ogs5py.reader

ogs5py subpackage providing reader for the ogs5 output.

Reader

readvtk([task_root, task_id, pcs, single_file]) A genearal reader for OGS vtk outputfiles.
readpvd([task_root, task_id, pcs, single_file]) Read a paraview pvd file.
readtec_point([task_root, task_id, pcs, …]) Collect TECPLOT point output from OGS5.
readtec_polyline([task_root, task_id, pcs, …]) Collect TECPLOT polyline output from OGS5.
VTK_ERR vtkStringOutputWindow - File Specific output window class

readvtk(task_root='.', task_id=None, pcs='ALL', single_file=None)[source]

A genearal reader for OGS vtk outputfiles.

give a dictionary containing their data

the Filename of the pvd is structured the following way: {task_id}[_{PCS}]xxxx.vtk thereby the “_{PCS}” is optional and just present if a PCS_TYPE is specified in the *.out file

Parameters:
  • task_root (string, optional) – string containing the path to the directory containing the ogs output Default : “.”
  • task_id (string, optional) – string containing the file name of the ogs task without extension Default : None
  • pcs (string or None, optional) –

    specify the PCS type that should be collected Possible values are:

    • None/”” (no PCS_TYPE specified in *.out)
    • ”NO_PCS”
    • ”GROUNDWATER_FLOW”
    • ”LIQUID_FLOW”
    • ”RICHARDS_FLOW”
    • ”AIR_FLOW”
    • ”MULTI_PHASE_FLOW”
    • ”PS_GLOBAL”
    • ”HEAT_TRANSPORT”
    • ”DEFORMATION”
    • ”MASS_TRANSPORT”
    • ”OVERLAND_FLOW”
    • ”FLUID_MOMENTUM”
    • ”RANDOM_WALK”

    You can get a list with all known PCS-types by setting PCS=”ALL” Default : None

  • single_file (string or None, optional) – If you want to read just a single file, you can set the path here. Default : None
Returns:

result – keys are the point names and the items are the data from the corresponding files if pcs=”ALL”, the output is a dictionary with the PCS-types as keys

Return type:

dict

readpvd(task_root='.', task_id=None, pcs='ALL', single_file=None)[source]

Read a paraview pvd file.

Convert all concerned files to a dictionary containing their data.

the Filename of the pvd is structured the following way: {task_id}[_{PCS}].pvd thereby the “_{PCS}” is optional and just present if a PCS_TYPE is specified in the *.out file

Parameters:
  • task_root (string, optional) – string containing the path to the directory containing the ogs output Default : “.”
  • task_id (string, optional) – string containing the file name of the ogs task without extension Default : None
  • pcs (string or None, optional) –

    specify the PCS type that should be collected Possible values are:

    • None/”” (no PCS_TYPE specified in *.out)
    • ”NO_PCS”
    • ”GROUNDWATER_FLOW”
    • ”LIQUID_FLOW”
    • ”RICHARDS_FLOW”
    • ”AIR_FLOW”
    • ”MULTI_PHASE_FLOW”
    • ”PS_GLOBAL”
    • ”HEAT_TRANSPORT”
    • ”DEFORMATION”
    • ”MASS_TRANSPORT”
    • ”OVERLAND_FLOW”
    • ”FLUID_MOMENTUM”
    • ”RANDOM_WALK”

    You can get a list with all known PCS-types by setting PCS=”ALL” Default : None

  • single_file (string or None, optional) – If you want to read just a single file, you can set the path here. Default : None
Returns:

result – keys are the point names and the items are the data from the corresponding files if pcs=”ALL”, the output is a dictionary with the PCS-types as keys

Return type:

dict

readtec_point(task_root='.', task_id=None, pcs='ALL', single_file=None)[source]

Collect TECPLOT point output from OGS5.

the Filenames are structured the following way: {task_id}_time_{NAME}[_{PCS+extra}].tec thereby the “_{PCS}” is optional and just present if a PCS_TYPE is specified in the *.out file the “extra” will not be recognized and will destroy the search-process

Parameters:
  • task_root (string, optional) – string containing the path to the directory containing the ogs output Default : “.”
  • task_id (string, optional) – string containing the file name of the ogs task without extension Default : None
  • pcs (string or None, optional) –

    specify the PCS type that should be collected Possible values are:

    • None/”” (no PCS_TYPE specified in *.out)
    • ”NO_PCS”
    • ”GROUNDWATER_FLOW”
    • ”LIQUID_FLOW”
    • ”RICHARDS_FLOW”
    • ”AIR_FLOW”
    • ”MULTI_PHASE_FLOW”
    • ”PS_GLOBAL”
    • ”HEAT_TRANSPORT”
    • ”DEFORMATION”
    • ”MASS_TRANSPORT”
    • ”OVERLAND_FLOW”
    • ”FLUID_MOMENTUM”
    • ”RANDOM_WALK”

    You can get a list with all known PCS-types by setting PCS=”ALL” Default : None

  • single_file (string or None, optional) – If you want to read just a single file, you can set the path here. Default : None
Returns:

result – keys are the point names and the items are the data from the corresponding files if pcs=”ALL”, the output is a dictionary with the PCS-types as keys

Return type:

dict

readtec_polyline(task_root='.', task_id=None, pcs='ALL', single_file=None, trim=True)[source]

Collect TECPLOT polyline output from OGS5.

the Filenames are structured the following way: {task_id}_ply_{NAME}_t{ply_id}[_{PCS}].tec thereby the “_{PCS}” is optional and just present if a PCS_TYPE is specified in the *.out file

Parameters:
  • task_root (string, optional) – string containing the path to the directory containing the ogs output Default : “.”
  • task_id (string, optional) – string containing the file name of the ogs task without extension Default : None
  • pcs (string or None, optional) –

    specify the PCS type that should be collected Possible values are:

    • None/”” (no PCS_TYPE specified in *.out)
    • ”NO_PCS”
    • ”GROUNDWATER_FLOW”
    • ”LIQUID_FLOW”
    • ”RICHARDS_FLOW”
    • ”AIR_FLOW”
    • ”MULTI_PHASE_FLOW”
    • ”PS_GLOBAL”
    • ”HEAT_TRANSPORT”
    • ”DEFORMATION”
    • ”MASS_TRANSPORT”
    • ”OVERLAND_FLOW”
    • ”FLUID_MOMENTUM”
    • ”RANDOM_WALK”

    You can get a list with all known PCS-types by setting pcs=”ALL” Default : None

  • single_file (string or None, optional) – If you want to read just a single file, you can set the path here. Default : None
  • trim (Bool, optional) – if the ply_ids are not continuous, there will be “None” values in the output list. If trim is “True” these values will be eliminated. If there is just one output for a polyline, the list will be eliminated and the output will be the single dict. Default : True
Returns:

result – keys are the Polyline names and the items are lists sorted by the ply_id (it is assumed, that the ply_ids are continuous, if not, the corresponding list entries are “None”) if pcs=”ALL”, the output is a dictionary with the PCS-types as keys

Return type:

dict