releso.mesh.MeshIOMesh

class releso.mesh.MeshIOMesh(*, save_location: Path, logger_name: str | None = None, path: str | Path | None = None, export: MeshExporter | None = None, dimensions: ConstrainedIntValue)

Bases: Mesh

Provides an interface to load meshio meshes.

Since gustaf currently only really supports .msh files, this also only supports files with this ending. If and when gustaf implements support for additional files types already supported by meshio. This will be updated.

__init__(**data: Any) None

Constructor for the ReLeSO basemodel object.

Methods

adapt_export_path(environment_id)

If placeholder in export path insert environment_id into it.

convert_to_pathlib_add_datetime(v)

Add timestamp to save_location, of applicable.

delete_dimension_if_possible(mesh)

Looks into the mesh and checks if the dimensionality can be reduced.

get_export_path()

Direct return of object variable.

get_logger()

Gets the currently defined environment logger.

get_mesh()

Calls the correct method to load the mesh for the gustaf library.

set_logger_name_recursively(logger_name)

Set the logger_name variable for all child elements.

Attributes

path

path to the mesh file (might be not used in case of mixd )

export

Path to the default export location of the mesh during environment operations.

dimensions

Number of dimensions of the mesh.

save_location

Definition of the save location of the logs and validation results.

logger_name

name of the logger.

delete_dimension_if_possible(mesh: gustaf.Volumes | gustaf.Faces)

Looks into the mesh and checks if the dimensionality can be reduced.

If the bounds of one or more dimensions are equal, the dimension is removed from the mesh.

Parameters:

mesh (GustafMeshTypes) – _description_

get_mesh() gustaf.Volumes | gustaf.Faces

Calls the correct method to load the mesh for the gustaf library.

Note

There is an error in a version of gustaf during the loading process . Please check with the maintainer of this package if you have trouble.

Returns:

Mesh in gustaf library format.

Return type:

gustaf.Mesh