releso.mesh.Mesh

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

Bases: BaseModel

Abstract class used to read in the mesh file and load it.

__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.

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.

adapt_export_path(environment_id: str)

If placeholder in export path insert environment_id into it.

Parameters:

environment_id (str) – Environment ID

dimensions: ConstrainedIntValue

Number of dimensions of the mesh.

export: MeshExporter | None

Path to the default export location of the mesh during environment operations. (So that the solver can use it.)

get_export_path() Path | None

Direct return of object variable.

Returns:

Path to the default export location of the mesh during environment operations. (So that the solver can use it.)

Return type:

str

abstract 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

path: str | Path | None

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