Abstract data types and protocols#

class sigmaepsilon.mesh.typing.ABC_PolyCell[source]#

Helper class that provides a standard way to create an ABC using inheritance.

class sigmaepsilon.mesh.typing.CellDataProtocol(*args, **kwargs)[source]#

A generic protocol class for storing cell-related data in a mesh.

property container: PolyDataLike#

Returns the container object of the block.

property frames: ndarray#

Ought to return the reference frames of the cells.

property has_frames: bool#

Ought to return True if the cells are equipped with frames, False if they are not.

property id: ndarray#

Ought to return global ids of the cells.

property nodes: ndarray#

Ought to return the topology of the cells as a 2d NumPy integer array.

property pointdata: PointDataLike#

Returns the hosting pointdata.

class sigmaepsilon.mesh.typing.GeometryProtocol(*args, **kwargs)[source]#

Protocol for Geometry classes.

classmethod approximator(*args, **kwargs) Callable[source]#

Returns a callable object that can be used to approximate over nodal values of one or more cells.

classmethod master_center() ndarray[source]#

Returns the coordinates of the master element.

Return type:

numpy.ndarray

classmethod master_coordinates() ndarray[source]#

Returns the coordinates of the master element.

Return type:

numpy.ndarray

classmethod shape_function_derivatives(x: float | Iterable[float], *args, **kwargs) ndarray[source]#

Evaluates shape function derivatives wrt. the master element or the local coordinate frames of some cells. To control the behaviour, either ‘jac’ or ‘wrt’ can be provided.

classmethod shape_function_matrix(x: float | Iterable[float], *args, N: int | None = 1, **kwargs) ndarray[source]#

Evaluates the shape function matrix at the specified locations and an N number of nodal variables.

classmethod shape_function_values(x: float | Iterable[float], *args, **kwargs) ndarray[source]#

Evaluates the shape functions at the specified locations.

class sigmaepsilon.mesh.typing.PointDataProtocol(*args, **kwargs)[source]#

A protocol class for storing point-related data in a mesh.

property frame: ReferenceFrame#

Ought to return a frame of reference.

property id: ndarray#

Ought to return global ids of the points as an 1d integer array.

pull() ndarray[source]#

Collects data at the points from the cells meeting at thenodes and aggregates it

property x: ndarray#

Ought to return the coordinates of the associated pointcloud as a 2d float array, where the first axis runs along the points.

class sigmaepsilon.mesh.typing.PolyCellProtocol(*args, **kwargs)[source]#

A generic protocol class for polygonal cell containers.

coords() ndarray[source]#

Ought to return the coordiantes associated with the object.

property db: CellDataProtocol[PolyDataLike, PointDataLike]#

Returns the database of the block.

jacobian_matrix() ndarray[source]#

Ought to return meaninful measures for each cell.

loc_to_glob(x: Iterable | ndarray, ec: ndarray | None = None) ndarray[source]#

Maps local coordinates in the master domain to global cooridnates. The basis of the transformation is ‘ec’, which is the node coordinates array of the cells of shape (nE, nNE, nD), where ‘nE’, ‘nNE’ and ‘nD’ are the number of cells, nodes per cell and local spatial dimensions.

local_coordinates() ndarray[source]#

Ought to return the coordinates of the cells in their local coordinate systems.

measure() float[source]#

Ought to return a single measure for a collection of cells.

measures() ndarray[source]#

Ought to return meaninful measures for each cell.

normals() ndarray[source]#

Ought to return the normal vectors of the surface of the mesh.

to_simplices() Tuple[ndarray][source]#

Ought to return a triangular representation of the mesh.

topology() TopologyArray[source]#

Ought to return the topology associated with the object.

class sigmaepsilon.mesh.typing.PolyDataProtocol(*args, **kwargs)[source]#

A generic protocol class for polygonal mesh containers.

cellblocks(*args, **kwargs) Iterable[PolyDataLike][source]#

Ought to return PolyData blocks with attached CellData.

property celldata: PolyCellLike#

Ought to return the attached celldata.

coords(*args, **kwargs) ndarray[source]#

Ought to return the coordiantes associated with the object.

property frame: ReferenceFrame | CartesianFrame#

Ought to return the frame of the attached pointdata

nodal_distribution_factors(*args, **kwargs) ndarray | csr_matrix[source]#

Ought to return nodal distribution factors for every node of every cell in the block.

pointblocks(*args, **kwargs) Iterable[PolyDataLike][source]#

Ought to return PolyData blocks with attached PointData.

property pointdata: PointDataLike#

Ought to return the attached pointdata.

root(*args, **kwargs) PolyDataLike[source]#

Ought to return the top level container.

source(*args, **kwargs) PolyDataLike | None[source]#

Ought to return the object that holds onto point data.

topology(*args, **kwargs) ndarray | TopologyArray[source]#

Ought to return the topology associated with the object.