If the stratigraphic structure is turned on in the XmL input file, Badlands produces sedimentary layers Hdf5 files. The stratigraphic layers are defined on a regularly spaced grid and a layer is recorded at each layer time interval given by the user.
Here we build a vtk structured grid based on the stratal layers that could be visualise directly in Paraview/Visit.
In [ ]:
%matplotlib inline
import numpy as np
# Import badlands grid generation toolbox
import pybadlands_companion.stratalMesh as mesh
# display plots in SVG format
%config InlineBackend.figure_format = 'svg'
First we need to load one of the stratigraphic file. The files are located in the h5/ folder in the simulation main output folder and are named using the following convention:
sed.time
T.p
X.hdf5
with T the display time index and X the number of the partition (used in the parallel version). In cases where you ran your simulation in parallel you will also need to give the number of CPUs used (cpus).
To load a file you will need to give the folder name and the number of processors used in your simulation.
For more information regarding the function uncomment the following line.
In [ ]:
#help(mesh.stratalMesh.__init__)
In [ ]:
folder = '/workspace/volume/Examples/delta/output_0/h5/'
vtkMesh = mesh.stratalMesh(folder)
Then we need to load a particular output time interval (this is the T parameter in the hdf5 file name convention).
Note
This number is not always the number of sedimentary layers for this particular time step as you could have chosen in the input file to have more than 1 sedimentary layer recorded by output interval!
In [ ]:
#help(vtkMesh.loadStratigraphy)
In [ ]:
vtkMesh.loadStratigraphy(timestep=50)
In [ ]:
#help(vtkMesh.buildMesh)
In [ ]:
vtkMesh.buildMesh(outfolder='/workspace/volume/')
In [ ]: