optimus.geometry.common

Common functionality for geometries.

Module Contents

Classes

Geometry

ImportedGeometry

class optimus.geometry.common.Geometry(grid, label='none')
number_of_vertices()

The number of vertices in the surface mesh of the geometry.

export_mesh(filename=None)

Export the mesh in GMSH format.

Parameters
filenamestr, None

The name of the file for export.

_correct_elements_group_bempp_grids()

To add mesh group to geometries created by bempp.

scale_grid(scaling_factor)

Scale the entire grid with a multiplicative factor.

Be aware that the geometry does not explicitly store a physical unit. It is the user’s responsibility to have consistent distance units in the mesh compared to the material parameters. This function serves to implicitly change the units of the mesh through a multiplicative scaling. The grid in the geometry is overwritten.

Parameters
scaling_factorfloat

The scaling factor for the grid.

class optimus.geometry.common.ImportedGeometry(bempp_grid, label, filename=None)

Bases: Geometry