Outputs
This section describes how outputs are handled by GEOS
The outputs are defined in a <Outputs>
XML block.
There are three available formats to output the results of a simulation: SILO, VTK, and Time History output into simple dataset HDF5 files which are consumable by post-processing scripts..
Defining an output
SILO Output
The SILO output is defined through the <Silo>
XML node (subnode of <Outputs> XML block
) as shown here:
<Outputs>
<Silo name="siloOutput"/>
</Outputs>
The parameter options are listed in the following table:
XML Element: Silo
Name |
Type |
Default |
Description |
---|---|---|---|
childDirectory |
string |
Child directory path |
|
fieldNames |
groupNameRef_array |
{} |
Names of the fields to output. If this attribute is specified, GEOSX outputs all (and only) the fields specified by the user, regardless of their plotLevel |
logLevel |
integer |
0 |
Sets the level of information to write in the standard output (the console typically).
Level 0 outputs no specific information for this solver. Higher levels require more outputs.
1
- Output timing information
|
name |
groupName |
required |
A name is required for any non-unique nodes |
onlyPlotSpecifiedFieldNames |
integer |
0 |
If this flag is equal to 1, then we only plot the fields listed in fieldNames. Otherwise, we plot all the fields with the required plotLevel, plus the fields listed in fieldNames |
parallelThreads |
integer |
1 |
Number of plot files. |
plotFileRoot |
string |
plot |
(no description available) |
plotLevel |
integer |
1 |
(no description available) |
writeCellElementMesh |
integer |
1 |
(no description available) |
writeEdgeMesh |
integer |
0 |
(no description available) |
writeFEMFaces |
integer |
0 |
(no description available) |
writeFaceElementMesh |
integer |
1 |
(no description available) |
VTK Output
The VTK output is defined through the <VTK>
XML node (subnode of <Outputs> XML block
) as shown here:
<Outputs>
<VTK name="vtkOutput"/>
</Outputs>
The parameter options are listed in the following table:
XML Element: VTK
Name |
Type |
Default |
Description |
---|---|---|---|
childDirectory |
string |
Child directory path |
|
fieldNames |
groupNameRef_array |
{} |
Names of the fields to output. If this attribute is specified, GEOS outputs all the fields specified by the user, regardless of their plotLevel |
format |
geos_vtk_VTKOutputMode |
binary |
Output data format. Valid options: |
levelNames |
string_array |
{} |
Names of mesh levels to output. |
logLevel |
integer |
0 |
Log level |
name |
groupName |
required |
A name is required for any non-unique nodes |
numberOfTargetProcesses |
integer |
1 |
Number of output aggregate files to be written. |
onlyPlotSpecifiedFieldNames |
integer |
0 |
If this flag is equal to 1, then we only plot the fields listed in fieldNames. Otherwise, we plot all the fields with the required plotLevel, plus the fields listed in fieldNames |
outputRegionType |
geos_vtk_VTKRegionTypes |
all |
Output region types. Valid options: |
parallelThreads |
integer |
1 |
Number of plot files. |
plotFileRoot |
string |
VTK |
Name of the root file for this output. |
plotLevel |
integer |
1 |
Level detail plot. Only fields with lower of equal plot level will be output. |
writeFEMFaces |
integer |
0 |
(no description available) |
writeFaceElementsAs3D |
integer |
0 |
Should the face elements be written as 3d volumes or not. |
writeGhostCells |
integer |
0 |
Should the vtk files contain the ghost cells or not. |
TimeHistory Output
The TimeHistory output is defined through the <TimeHistory>
XML node (subnode of <Outputs> XML block
) as shown here:
<Outputs>
<TimeHistory name="timeHistoryOutput" sources="{/Tasks/collectionTask}" filename="timeHistory" />
</Outputs>
The parameter options are listed in the following table:
XML Element: TimeHistory
Name |
Type |
Default |
Description |
---|---|---|---|
childDirectory |
string |
Child directory path |
|
filename |
string |
TimeHistory |
The filename to which to write time history output. |
format |
string |
hdf |
The output file format for time history output. |
logLevel |
integer |
0 |
Log level |
name |
groupName |
required |
A name is required for any non-unique nodes |
parallelThreads |
integer |
1 |
Number of plot files. |
sources |
groupNameRef_array |
required |
A list of collectors from which to collect and output time history information. |
In order to properly collect and output time history information the following steps must be accomplished:
Specify one or more collection tasks using the Tasks Manager.
Specify a TimeHistory Output using the collection task(s) as source(s).
Specify an event in the Event Management to trigger the collection task(s).
Specify an event in the Event Management to trigger the output.
Note: Currently if the collection and output events are triggered at the same simulation time, the one specified first will also trigger first. Thus in order to output time history for the current time in this case, always specify the time history collection events prior to the time history output events.
Triggering the outputs
The outputs can be triggered using the Event Management.
It is recommended to use a <PeriodicEvent>
to output results with a defined frequency:
<PeriodicEvent name="outputs"
timeFrequency="5000.0"
targetExactTimestep="1"
target="/Outputs/siloOutput" />
The keyword target
has to match with the name of the <Silo>
, <VTK>
, or <TimeHistory>
node.
Visualisation of the outputs
We suggest the use of VisIT, Paraview, and MatPlotLib to visualize the outputs.
Visualizing Silo outputs with VisIT
If the <Silo>
XML node was defined, GEOS writes the results in a folder called siloFiles
.
In VisIT :
File > Open file…
On the right panel, browse to the
siloFiles
folder.On the left panel, select the file(s) you want to visualize. Usually, one file is written according the frequency defined in the
timeFrequency
keyword of the Event that has triggered the output.To load fields, use the “Add” button and browse to the fields you want to plot.
To plot fields, use the “Draw” button.
Please consult the VisIT documentation for further explanations on its usage.
Visualizing VTK outputs with VisIT
If the <VTK>
XML node was defined, GEOS writes the results in a folder named after the plotFileRoot
attribute (default = vtkOutputs
).
For problems with multiple active regions (e.g. Hydraulic Fracturing), additional work may be required to ensure that vtk files can be read by VisIt.
Options include:
Using a VisIt macro / python script to convert default multi-region vtk files (see
GEOS/src/coreComponents/python/visitMacros/visitVTKConversion.py
).Using the
outputRegionType
attribute to output separate sets of files per region. For example:
<Problem>
<Events>
<!-- Use nested events to trigger both vtk outputs -->
<PeriodicEvent
name="outputs"
timeFrequency="2.0"
targetExactTimestep="0">
<PeriodicEvent
name="outputs_cell"
target="/Outputs/vtkOutput_cell"/>
<PeriodicEvent
name="outputs_surface"
target="/Outputs/vtkOutput_surface"/>
</PeriodicEvent>
</Events>
<Outputs>
<VTK
name="vtkOutput_cell"
outputRegionType="cell"
plotFileRoot="vtk_cell"/>
<VTK
name="vtkOutput_surface"
outputRegionType="surface"
plotFileRoot="vtk_surface"/>
</Outputs>
</Problem>
In VisIt, the prepared files can be visualized as follows:
Click the Open icon (or select File/Open from the top menu).
Enter the vtk output folder in the left-hand panel (these will be separate if you use option 2 above).
Select the desired
*.vtm
group in the right-hand panel (by double-clicking or selecting OK).(Repeat for any additional datasets/regions.)
In the main window, select the desired dataset from the Active Sources dropdown menu.
Click on the Add icon, and select a parameter to visualize from the mesh, psuedocolor, or vector plot options
At some point you may be prompted to create a Database Correlation. If you select Yes, then VisIt will create a new time slider, which can be used to change the time state while keeping the various aspects of the simulation synchronized.
Finally, click the Draw button and use the time slider to visualize the output.
Please consult the VisIT documentation for further explanations on its usage.
Visualizing VTK outputs with Paraview
If the <VTK>
XML node was defined, GEOS writes a folder and a .pvd
file named after the string defined
in name
keyword.
The .pvd
file contains references to the .pvtu
files. One .pvtu
file is output according the frequency defined in the timeFrequency
keyword of the Event that has triggered the output.
One .pvtu
contains references to .vtu
files. There is as much .vtu
file as there were MPI processes
used for the computation.
All these files can be opened with paraview. To have the whole results for every output time steps, you can
open the .pvd
file.
Visualizing TimeHistory outputs with MatPlotLib
If the <TimeHistory>
XML node was defined, GEOS writes a file named after the string defined
in the filename
keyword and formatted as specified by the string defined in the format
keyword (only HDF5 is currently supported).
The TimeHistory file contains the collected time history information from each specified time history collector. This information includes datasets for the time itself, any metadata sets describing index association with specified collection sets, and the time history information itself.
It is recommended to use MatPlotLib and format-specific accessors (like H5PY for HDF5) to access and easily plot the time history datat.