ogstools.feflowlib package#
- ogstools.feflowlib.combine_material_properties(mesh, properties_list)[source]#
Combine multiple material properties. The combined properties are returned as list of values in a dictionary.
- Parameters:
mesh (pyvista.UnstructuredGrid) – mesh
properties_list (list) – list of properties to be combined
- Returns:
material_properties
- Return type:
collections.defaultdict
- ogstools.feflowlib.convert_geometry_mesh(doc)[source]#
Get the geometric construction of the mesh.
- Parameters:
doc (ifm.FeflowDoc) – The FEFLOW data.
- Returns:
mesh
- Return type:
pyvista.UnstructuredGrid
- ogstools.feflowlib.convert_properties_mesh(doc)[source]#
Get the mesh with point and cell properties.
- Parameters:
doc (ifm.FeflowDoc) – The FEFLOW data.
- Returns:
mesh
- Return type:
pyvista.UnstructuredGrid
- ogstools.feflowlib.deactivate_cells(mesh)[source]#
Multiplies the MaterialID of all cells that are inactive in FEFLOW by -1. Therefore, the input mesh is modified. :param mesh: mesh :type mesh: pyvista.UnstructuredGrid :return: 0 for no cells have been deactivated and 1 for cells have been deactivated :rytpe: int
- Parameters:
mesh (UnstructuredGrid) –
- ogstools.feflowlib.extract_cell_boundary_conditions(bulk_mesh_path, mesh)[source]#
Returns the cell boundary conditions of the mesh. It works by iterating all cell data and looking for data arrays that include the strings “P_SOUF” or “P_IOFLOW”. +++WARNING+++: This function still in a experimental state since it is not clear how exactly this function will be used in the future. TODO: Allow a generic definition of the normal vector for the filter condition.
- Parameters:
bulk_mesh_path (Path) – name of the mesh
mesh (pyvista.UnstructuredGrid) – mesh
- Returns:
path with name of mesh, topsurface mesh with cell boundary conditions
- Return type:
tuple
- ogstools.feflowlib.extract_point_boundary_conditions(out_mesh_path, mesh)[source]#
Returns the point boundary conditions of the mesh. It works by iterating all point data and looking for data arrays that include the string “_BC”. Depending on what follows, it defines the boundary condition type.
- Parameters:
out_mesh_path (Path) – path of the output mesh
mesh (pyvista.UnstructuredGrid) – mesh
- Returns:
dict_of_point_boundary_conditions
- Return type:
dict
- ogstools.feflowlib.get_specific_surface(surface_mesh, filter_condition)[source]#
Return only cells that match the filter condition for the normals of the input-surface mesh. A standard use case could be to extract the cells that have a normal in a particular direction, e.g. upward in the z-direction. The filter condition would then be: lambda normals: normals[:, 2] > 0.
- Parameters:
surface_mesh (pyvista.PolyData) – The surface mesh.
filter_condition (Callable [[list], [list]]) – A condition to set up the filter for the normals.
- Returns:
specific_cells
- Return type:
pyvista.UnstructuredGird
- class ogstools.feflowlib.helpFormat[source]#
Bases:
ArgumentDefaultsHelpFormatter
,RawTextHelpFormatter
A helper class for passing the correct format for the CLI arguments.
- ogstools.feflowlib.liquid_flow(saving_path, model=None)[source]#
A template for steady state diffusion process to be simulated in ogs.
- Parameters:
saving_path (str) – path of ogs simulation results
model (ogs6py.ogs.OGS) – ogs model, which shall be used with the template
- ogstools.feflowlib.points_and_cells(doc)[source]#
Get points and cells in a pyvista compatible format.
- Parameters:
doc (ifm.FeflowDoc) – The FEFLOW data.
- Returns:
pts, cells, celltypes (points, cells, celltypes)
- Return type:
tuple(numpy.ndarray, list, list)
- ogstools.feflowlib.setup_prj_file(bulk_mesh_path, mesh, material_properties, process, model=None)[source]#
Sets up a prj-file for ogs simulations using ogs6py.
- Parameters:
bulk_mesh_path (Path) – path of bulk mesh
mesh (pyvista.UnstructuredGrid) – mesh
material_properties (dict) – material properties
process (str) – the process to be prepared
model (ogs6py.OGS) – model to setup prj-file
- Returns:
model
- Return type:
ogs6py.OGS
- ogstools.feflowlib.steady_state_diffusion(saving_path, model=None)[source]#
A template for steady state diffusion process to be simulated in ogs.
- Parameters:
saving_path (str) – path of ogs simulation results
model (ogs6py.ogs.OGS) – ogs model, which shall be used with the template
- ogstools.feflowlib.update_geometry(mesh, doc)[source]#
Update the geometric construction of the mesh with point and cell data.
- Parameters:
mesh (pyvista.UnstructuredGrid) – The mesh to be updated.
doc (ifm.FeflowDoc) – The FEFLOW data.
- Returns:
mesh
- Return type:
pyvista.UnstructuredGrid
- ogstools.feflowlib.write_mesh_of_combined_properties(mesh, property_list, new_property, material_id, saving_path)[source]#
Writes a separate mesh-file with a specific material that has inhomogeneous property values within the material group. It can also be used to write multiple properties into a “new property” data array. For example, write a data array for a tensor defined by data arrays representing values of different spatial directions. Nevertheless it can still be be used to write the inhomogeneous values of a single property into a separate mesh-file.
- Parameters:
mesh (pyvista.UnstructuredGrid) – mesh
property_list (list) – list of properties
new_property (str) – name of the combined properties
material (int) – material with inhomogeneous properties
saving_path (Path) – path to save the mesh
material_id (int) –
- Returns:
filename
- Return type:
str
- ogstools.feflowlib.write_point_boundary_conditions(out_mesh_path, mesh)[source]#
Writes the point boundary conditions that are returned from ‘extract_point_boundary_conditions()’
- Parameters:
out_mesh_path (Path) – path for writing
mesh (pyvista.UnstructuredGrid) – mesh
Submodules#
- ogstools.feflowlib.templates module
- ogstools.feflowlib.tools module
helpFormat
get_specific_surface()
assign_bulk_ids()
extract_point_boundary_conditions()
write_point_boundary_conditions()
extract_cell_boundary_conditions()
get_material_properties()
combine_material_properties()
write_mesh_of_combined_properties()
materials_in_steady_state_diffusion()
materials_in_liquid_flow()
setup_prj_file()
deactivate_cells()