ogstools.meshlib.subdomains module#

ogstools.meshlib.subdomains.get_dim(mesh)[source]#
Return type:

int

ogstools.meshlib.subdomains.named_boundaries(subdomains)[source]#

Name 1D meshes according to their position (top, bottom, left, right)

Parameters:

subdomains (list[UnstructuredGrid]) – List of meshes to name

Returns:

A dict mapping the meshes to top, bottom, left and right.

Return type:

dict[str, UnstructuredGrid]

ogstools.meshlib.subdomains.split_by_threshold_angle(mesh, threshold_angle)[source]#

Split a continuous 1D boundary by a threshold angle

Parameters:
  • mesh (UnstructuredGrid) – 1D mesh to be split apart.

  • threshold_angle (float) – Represents the angle (in degrees) between neighbouring elements which - if exceeded - determines the corners of the mesh.

Returns:

A list of meshes, as the result of splitting the mesh at its corners.

Return type:

list[UnstructuredGrid]

ogstools.meshlib.subdomains.split_by_vertical_lateral_edges(mesh)[source]#

Split a continuous 1D boundary by assumption of vertical lateral edges

Only works properly if you have 2 perfectly vertical boundaries: one at the very left and one at the very right of the model.

Parameters:

mesh (UnstructuredGrid) – 1D mesh to be split apart.

Returns:

A list of meshes, as the result of splitting the mesh at its corners.

Return type:

list[UnstructuredGrid]

ogstools.meshlib.subdomains.extract_boundaries(mesh, threshold_angle=15.0)[source]#

Extract 1D boundaries of a 2D mesh.

Parameters:
  • mesh (UnstructuredGrid) – The 2D domain

  • threshold_angle (float | None) – If None, the boundary will be split by the assumption of vertical lateral boundaries. Otherwise it represents the angle (in degrees) between neighbouring elements which - if exceeded - determines the corners of the boundary mesh.

Returns:

A dictionary of top, bottom, left and right sections of the boundary mesh.

Return type:

dict[str, UnstructuredGrid]

ogstools.meshlib.subdomains.remove_data(mesh, datanames)[source]#
ogstools.meshlib.subdomains.identify_subdomains(mesh, subdomains)[source]#

Add bulk_node_ids and bulk_element_ids mapping to the subdomains.

Parameters:
  • mesh (UnstructuredGrid) – The domain mesh

  • subdomains (list[UnstructuredGrid]) – List of subdomain meshes.