Class WriteMesh

class tools.outmesh.WriteMesh[source]

Class for writing model outputs. The outputs are written as hdf5 files for each mesh partition.

Note

The model outputs are all located in an output folder (dir key in the inputfile documentation) and consist of a time series file named gospl.xdmf and 2 other folders (h5 and xmf).

The XDMF file is the main entry point for visualising the output and should be sufficient for most users. This file can easely be opened within Paraview.

Initialise

__init__()

Initialise model outputs parameters.

Public Methods

readData()

When a simulation restarts, variables from previous HDF5 output files are read and assigned to the restarting run.

visModel()

Main function to write model outputs on disk.

Private Methods

_createOutputDir()

Create a directory to store outputs.

_forcePaleo()

Forcing the model based on backward simulation results.

_outputMesh()

Saves mesh local information stored in the DMPlex to HDF5 file.

_outputStrat()

Saves mesh local stratigraphic information stored in the DMPlex as HDF5 file.

_save_DMPlex_XMF()

Saves mesh local information stored in the HDF5 to XmF file.

_save_XDMF()

This function writes the XDmF file which is calling the XmF files above.

_upliftBF(alpha, step)

Reads locally the backward model elevation at any given step and compute elevation difference between backward and forward models.

Public functions

WriteMesh.readData()[source]

When a simulation restarts, variables from previous HDF5 output files are read and assigned to the restarting run.

The following variables are used:

  • surface elevation elev.

  • cumulative erosion & deposition values erodep.

  • flow accumulation flowAcc before pit filling.

  • river sediment load sedLoad.

  • fine sediment load sedLoadf when dual lithologies are accounted for.

  • weathered sediment load sedLoadw when dual lithologies are accounted for.

  • carbonate sediment load sedLoadc when carbonate module is turned on.

WriteMesh.visModel()[source]

Main function to write model outputs on disk.

Private functions

WriteMesh._createOutputDir()[source]

Create a directory to store outputs. By default the folder will be called output. If a folder name is specified in the YAML input file, this name will be used.

Note

The input option makedir gives the ability to delete any existing output folder with the same name (if set to False) or to create a new folder with the given dir name plus a number at the end (e.g. outputDir_XX if set to True with XX the run number). It prevents overwriting on top of previous runs.

WriteMesh._forcePaleo()[source]

Forcing the model based on backward simulation results. This function computes difference between backward model elevation and current one.

Note

The backward elevation is often computed based on paleo-elevation maps at specific time interval. During the pre-processing phase a series of backward elevations are then created based on these paleo-elevation maps. These backward elevations are then used to force the forward model over time. This is done by computing the differences at any given time step between the obtained forward elevations and the predicted backward ones. These differences are then used to define an uplift map that matches the differences modulated by an imposed factor (alpha). Once the uplift map has been computed the model is then rerun from the previous time step to the current one.

WriteMesh._outputMesh()[source]

Saves mesh local information stored in the DMPlex to HDF5 file. If the file already exists, it will be overwritten. Mesh characteristics are recorded for each partition. The following variables will be available:

  • surface elevation elev.

  • cumulative erosion & deposition values erodep.

  • flow accumulation flowAcc before pit filling.

  • river sediment load sedLoad.

  • fine sediment load sedLoadf when dual lithologies are accounted for.

  • carbonate sediment load sedLoadc when carbonate module is turned on.

  • uplift subsidence values if vertical tectonic forcing is considered uplift.

  • horizontal displacement values when considered hdisp.

  • precipitation maps based on forcing conditions rain.

WriteMesh._outputStrat()[source]

Saves mesh local stratigraphic information stored in the DMPlex as HDF5 file. The following variables will be recorded:

  • elevation at time of deposition, considered to be to the current elevation for the top stratigraphic layer stratZ.

  • thickness of each stratigrapic layer stratH accounting for both erosion & deposition events.

  • proportion of fine sediment stratF contains in each stratigraphic layer.

  • proportion of weathered sediment stratW contains in each stratigraphic layer.

  • porosity of coarse sediment phiS in each stratigraphic layer computed at center of each layer.

  • porosity of fine sediment phiF in each stratigraphic layer computed at center of each layer.

  • porosity of weathered sediment phiW in each stratigraphic layer computed at center of each layer.

  • proportion of carbonate sediment stratC contains in each stratigraphic layer if the carbonate module is turned on.

  • porosity of carbonate sediment phiC in each stratigraphic layer computed at center of each layer when the carbonate module is turned on.

Important

It is worth mentioning that the stratigraphic architecture is only outputed as HDF5 files and does not record the XMF and XDMF files. A set of post-processing scripts are then required to extract the informations and visualise the stratigraphic records of any specific simulations.

WriteMesh._save_DMPlex_XMF()[source]

Saves mesh local information stored in the HDF5 to XmF file. The XMF files are XML schema explaining how to read gospl data files.

The XmF file is written by a single processor (rank 0) and contains each partition HDF5 files in blocks. The variables described for the HDF5 file (function _outputMesh above) are all accessible from this file.

WriteMesh._save_XDMF()[source]

This function writes the XDmF file which is calling the XmF files above. The XDmF file represents the time series of the model outputs and can be directly loaded and visualised with Paraview.

Note

For a brief overview of the approach used to record gospl outputs, user can read this visit documentation

WriteMesh._upliftBF(alpha, step)[source]

Reads locally the backward model elevation at any given step and compute elevation difference between backward and forward models.

Parameters
  • alpha – fitting coefficient for backward uplift differences

  • step – backward model time step to use