ogstools.meshes.subdomains module#
- ogstools.meshes.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- Return type:
- Returns:
A dict mapping the meshes to top, bottom, left and right.
- ogstools.meshes.subdomains.extract_surfaces(mesh, angle)[source]#
Extract the 2D surfaces of a 3D mesh.
- Parameters:
mesh (
UnstructuredGrid) – 3D mesh to be split apart.angle (
float) – Tolerated angle (in degrees) between given normal and element normal.
- Return type:
- Returns:
A list of meshes, as the result of splitting the mesh at its edges.
- ogstools.meshes.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.
- Return type:
- Returns:
A list of meshes, as the result of splitting the mesh at its corners.
- ogstools.meshes.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.- Return type:
- Returns:
A list of meshes, as the result of splitting the mesh at its corners.
- ogstools.meshes.subdomains.extract_boundaries(mesh, threshold_angle=15.0)[source]#
Extract boundaries of a 2D or 3D mesh.
- Parameters:
mesh (
UnstructuredGrid) – The domain meshthreshold_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.
- Return type:
- Returns:
A dictionary of top, bottom, left and right sections of the boundary mesh.
- ogstools.meshes.subdomains.identify_subdomains(mesh, subdomains)[source]#
Add bulk_node_ids and bulk_element_ids mapping to the subdomains.
- Parameters:
mesh (
UnstructuredGrid) – The domain meshsubdomains (
list[UnstructuredGrid]) – List of subdomain meshes.
- Return type: