ogstools.meshlib.boundary module#

class ogstools.meshlib.boundary.Boundary[source]#

Bases: ABC

Abstract base class representing a boundary within a mesh.

A boundary refers to the set of edges or faces that defines the delineation between the interior region and exterior regions of a mesh. In a 2D mesh, it is formed by a closed collection of line segments (1D). In a 3D mesh, it is formed by a closed collection of faces (2D).

abstract dim()[source]#

Get the dimension of the boundary.

Returns:

int: The dimension of the boundary. For example, the dimension of a boundary of a cube (3D) is 2.

Return type:

int

class ogstools.meshlib.boundary.Layer[source]#

Bases: Boundary

Layer(top: ogstools.meshlib.boundary_subset.Surface, bottom: ogstools.meshlib.boundary_subset.Surface, material_id: int = 0, num_subdivisions: int = 0)

top: Surface#
bottom: Surface#
material_id: int = 0#
num_subdivisions: int = 0#

Class representing a geological layer with top and bottom surfaces.

A geological layer is a distinct unit of rock or sediment that has unique properties and characteristics, associated by the material_id. It is often bounded by two surfaces: the top surface and the bottom surface. These surfaces delineate the spatial extent of the layer in the GIS system.

create_raster(resolution)[source]#

Create raster representations for the layer.

For each surface, including intermediate surfaces (num_of_subdivisions > 0), this method generates .asc files.

Args:

resolution (float): The resolution for raster creation.

Returns:

list[Path]: A list of filenames to .asc raster files.

Return type:

list[Path]

dim()[source]#

Get the dimension of the boundary.

Returns:

int: The dimension of the boundary. For example, the dimension of a boundary of a cube (3D) is 2.

Return type:

int

__init__(top, bottom, material_id=0, num_subdivisions=0)#
class ogstools.meshlib.boundary.LocationFrame[source]#

Bases: object

LocationFrame(xmin: float, xmax: float, ymin: float, ymax: float)

xmin: float#
xmax: float#
ymin: float#
ymax: float#
as_gml(filename)[source]#

Generate GML representation of the location frame.

Args:

filename (Path): The filename to save the GML representation to.

Returns:

None

__init__(xmin, xmax, ymin, ymax)#
class ogstools.meshlib.boundary.Raster[source]#

Bases: object

Class representing a raster representation of a location frame.

This class provides methods to create and save a raster representation based on a specified location frame and resolution.

frame: LocationFrame#
resolution: float#
__init__(frame, resolution)#
as_vtu(outfilevtu)[source]#

Create and save a raster representation as a VTK unstructured grid.

Args:

outfilevtu (Path): The path to save the VTK unstructured grid representation.

Returns:

Path: The path to the saved VTK unstructured grid representation.

Return type:

Path