Cell classes#

This document summarizes the classes denoted to store and handle data about polygonal cells in 1, 2 or 3 dimensions.

class sigmaepsilon.mesh.cells.H27(*args, db: CellData[MeshDataLike, PointDataLike] | None = None, pointdata: PointDataLike | None = None, container: MeshDataLike | None = None, **kwargs)[source]#

27-node isoparametric triquadratic hexahedron.

top
7---14---6
|    |   |
15--25--13
|    |   |
4---12---5

middle
19--23--18
|    |   |
20--26--21
|    |   |
16--22--17

bottom
3---10---2
|    |   |
11--24---9
|    |   |
0----8---1
class Geometry[source]#
classmethod master_center() ndarray[source]#

Returns the local coordinates of the center of the cell.

Return type:

numpy.ndarray

classmethod master_coordinates() ndarray[source]#

Returns local coordinates of the cell.

Return type:

numpy.ndarray

classmethod polybase() Tuple[List][source]#

Retruns the polynomial base of the master element.

Returns:

  • list – A list of SymPy symbols.

  • list – A list of monomials.

class sigmaepsilon.mesh.cells.H8(*args, db: CellData[MeshDataLike, PointDataLike] | None = None, pointdata: PointDataLike | None = None, container: MeshDataLike | None = None, **kwargs)[source]#

8-node hexahedron.

top
7--6
|  |
4--5

bottom
3--2
|  |
0--1
class Geometry[source]#
classmethod master_center() ndarray[source]#

Returns the local coordinates of the center of the cell.

Return type:

numpy.ndarray

classmethod master_coordinates() ndarray[source]#

Returns local coordinates of the cell.

Return type:

numpy.ndarray

classmethod polybase() Tuple[List][source]#

Retruns the polynomial base of the master element.

Returns:

  • list – A list of SymPy symbols.

  • list – A list of monomials.

classmethod tetmap() ndarray[source]#

Returns a mapper to transform topology and other data to a collection of tetrahedral simplices.

sigmaepsilon.mesh.cells.Hex#

alias of H8

class sigmaepsilon.mesh.cells.L2(*args, db: CellData[MeshDataLike, PointDataLike] | None = None, pointdata: PointDataLike | None = None, container: MeshDataLike | None = None, **kwargs)[source]#

2-Node line element.

class Geometry[source]#
class sigmaepsilon.mesh.cells.L3(*args, db: CellData[MeshDataLike, PointDataLike] | None = None, pointdata: PointDataLike | None = None, container: MeshDataLike | None = None, **kwargs)[source]#

3-Node line element.

class Geometry[source]#
sigmaepsilon.mesh.cells.Line#

alias of L2

class sigmaepsilon.mesh.cells.Q4(*args, db: CellData[MeshDataLike, PointDataLike] | None = None, pointdata: PointDataLike | None = None, container: MeshDataLike | None = None, **kwargs)[source]#

Polygon class for 4-noded bilinear quadrilaterals.

class Geometry[source]#
classmethod master_center() ndarray[source]#

Returns the local coordinates of the center of the cell.

Return type:

numpy.ndarray

classmethod master_coordinates() ndarray[source]#

Returns local coordinates of the cell.

Return type:

numpy.ndarray

classmethod polybase() Tuple[List][source]#

Retruns the polynomial base of the master element.

Returns:

  • list – A list of SymPy symbols.

  • list – A list of monomials.

classmethod trimap() ndarray[source]#

Returns a mapper to transform topology and other data to a collection of triangular simplices.

to_triangles() ndarray[source]#

Returns the topology as a collection of T3 triangles, represented as a 2d NumPy integer array, where the first axis runs along the triangles, and the second along the nodes.

Only for 2d cells.

class sigmaepsilon.mesh.cells.Q8(*args, db: CellData[MeshDataLike, PointDataLike] | None = None, pointdata: PointDataLike | None = None, container: MeshDataLike | None = None, **kwargs)[source]#

Polygon class for 8-noded quadratic quadrilaterals.

class Geometry[source]#
classmethod master_center() ndarray[source]#

Returns the local coordinates of the center of the cell.

Return type:

numpy.ndarray

classmethod master_coordinates() ndarray[source]#

Returns local coordinates of the cell.

Return type:

numpy.ndarray

classmethod polybase() Tuple[List][source]#

Retruns the polynomial base of the master element.

Returns:

  • list – A list of SymPy symbols.

  • list – A list of monomials.

shape_function_derivative_evaluator() ndarray#

Returns the first orderderivatives of the shape functions, evaluated at multiple points, according to ‘pcoords’.

— (nP, nNE, 2)

classmethod trimap() ndarray[source]#

Returns a mapper to transform topology and other data to a collection of triangular simplices.

to_triangles() ndarray[source]#

Returns the topology as a collection of T3 triangles, represented as a 2d NumPy integer array, where the first axis runs along the triangles, and the second along the nodes.

Only for 2d cells.

class sigmaepsilon.mesh.cells.Q9(*args, db: CellData[MeshDataLike, PointDataLike] | None = None, pointdata: PointDataLike | None = None, container: MeshDataLike | None = None, **kwargs)[source]#

Polygon class for 9-noded biquadratic quadrilaterals.

class Geometry[source]#
classmethod master_center() ndarray[source]#

Returns the local coordinates of the center of the cell.

Return type:

numpy.ndarray

classmethod master_coordinates() ndarray[source]#

Returns local coordinates of the cell.

Return type:

numpy.ndarray

classmethod polybase() Tuple[List][source]#

Retruns the polynomial base of the master element.

Returns:

  • list – A list of SymPy symbols.

  • list – A list of monomials.

shape_function_derivative_evaluator()#

Returns the first orderderivatives of the shape functions, evaluated at multiple points, according to ‘pcoords’.

— (nP, nNE, 2)

classmethod trimap() ndarray[source]#

Returns a mapper to transform topology and other data to a collection of triangular simplices.

to_triangles() ndarray[source]#

Returns the topology as a collection of T3 triangles, represented as a 2d NumPy integer array, where the first axis runs along the triangles, and the second along the nodes.

Only for 2d cells.

sigmaepsilon.mesh.cells.Quad#

alias of Q4

sigmaepsilon.mesh.cells.QuadraticLine#

alias of L3

class sigmaepsilon.mesh.cells.T3(*args, db: CellData[MeshDataLike, PointDataLike] | None = None, pointdata: PointDataLike | None = None, container: MeshDataLike | None = None, **kwargs)[source]#

A class to handle 3-noded triangles.

Example

>>> from sigmaepsilon.mesh import TriMesh, CartesianFrame, PointData, triangulate
>>> from sigmaepsilon.mesh.cells import T3 as CellData
>>> A = CartesianFrame(dim=3)
>>> coords, topo = triangulate(size=(800, 600), shape=(10, 10))
>>> pd = PointData(coords=coords, frame=A)
>>> cd = CellData(topo=topo)
>>> trimesh = TriMesh(pd, cd)
>>> trimesh.area()
480000.0
class Geometry[source]#
classmethod master_center() ndarray[source]#

Returns the center of the master cell relative to the origo of the master cell.

Return type:

numpy.ndarray

classmethod master_coordinates() ndarray[source]#

Returns local coordinates of the master cell relative to the origo of the master cell.

Return type:

numpy.ndarray

classmethod polybase() Tuple[List][source]#

Retruns the polynomial base of the master element.

Returns:

  • list – A list of SymPy symbols.

  • list – A list of monomials.

classmethod trimap() ndarray[source]#

Returns a mapping used to transform the topology to triangles. This is only implemented here for standardization.

areas(*_, **__) ndarray[source]#

Returns the areas of the cells as an 1d NumPy array.

to_triangles() ndarray[source]#

Returns the topology as triangles.

class sigmaepsilon.mesh.cells.T6(*args, db: CellData[MeshDataLike, PointDataLike] | None = None, pointdata: PointDataLike | None = None, container: MeshDataLike | None = None, **kwargs)[source]#

A class to handle 6-noded triangles.

Example

>>> from sigmaepsilon.mesh import TriMesh, CartesianFrame, PointData, triangulate
>>> from sigmaepsilon.mesh.cells import T6 as CellData
>>> from sigmaepsilon.mesh.utils.topology.tr import T3_to_T6
>>> A = CartesianFrame(dim=3)
>>> coords, topo = triangulate(size=(800, 600), shape=(10, 10))
>>> coords, topo = T3_to_T6(coords, topo)
>>> pd = PointData(coords=coords, frame=A)
>>> cd = CellData(topo=topo)
>>> trimesh = TriMesh(pd, cd)
>>> trimesh.area()
480000.0
class Geometry[source]#
classmethod master_center() ndarray[source]#

Returns the local coordinates of the center of the cell.

Return type:

numpy.ndarray

classmethod master_coordinates() ndarray[source]#

Returns local coordinates of the cell.

Return type:

numpy.ndarray

classmethod polybase() Tuple[List][source]#

Retruns the polynomial base of the master element.

Returns:

  • list – A list of SymPy symbols.

  • list – A list of monomials.

classmethod trimap(subdivide: bool = True) ndarray[source]#

Returns a mapper to transform topology and other data to a collection of triangular simplices.

to_triangles() ndarray[source]#

Returns the topology as triangles.

class sigmaepsilon.mesh.cells.TET10(*args, db: CellData[MeshDataLike, PointDataLike] | None = None, pointdata: PointDataLike | None = None, container: MeshDataLike | None = None, **kwargs)[source]#

10-node isoparametric hexahedron.

class Geometry[source]#
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 polybase() Tuple[List][source]#

Retruns the polynomial base of the master element.

Returns:

  • list – A list of SymPy symbols.

  • list – A list of monomials.

classmethod tetmap(subdivide: bool = True) ndarray[source]#

Returns a mapper to transform topology and other data to a collection of tetrahedral simplices.

class sigmaepsilon.mesh.cells.TET4(*args, db: CellData[MeshDataLike, PointDataLike] | None = None, pointdata: PointDataLike | None = None, container: MeshDataLike | None = None, **kwargs)[source]#

4-node isoparametric hexahedron.

class Geometry[source]#
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 polybase() Tuple[List][source]#

Retruns the polynomial base of the master element.

Returns:

  • list – A list of SymPy symbols.

  • list – A list of monomials.

classmethod tetmap() ndarray[source]#

Returns a mapper to transform topology and other data to a collection of tetrahedral simplices.

to_tetrahedra(flatten: bool = True) ndarray[source]#

Returns the topology as a collection of TET4 tetrahedra, represented as a 2d NumPy integer array, where the first axis runs along the tetrahedra, and the second along the nodes.

Only for 3d cells.

Parameters:

flatten (bool, Optional) – If True, the topology is returned as a 2d array. If False, the length of the first axis equals the number of cells in the block, the length of the second axis equals the number of tetrahedra per cell.

volumes() ndarray[source]#

Returns the volumes of the cells in the database.

sigmaepsilon.mesh.cells.Tetra#

alias of TET4

sigmaepsilon.mesh.cells.Tri#

alias of T3

class sigmaepsilon.mesh.cells.W18(*args, db: CellData[MeshDataLike, PointDataLike] | None = None, pointdata: PointDataLike | None = None, container: MeshDataLike | None = None, **kwargs)[source]#

Polyhedra class for 18-noded biquadratic wedges.

class Geometry[source]#
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 polybase() Tuple[List][source]#

Retruns the polynomial base of the master element.

Returns:

  • list – A list of SymPy symbols.

  • list – A list of monomials.

classmethod tetmap() ndarray[source]#

Returns a mapper to transform topology and other data to a collection of tetrahedral simplices.

class sigmaepsilon.mesh.cells.W6(*args, db: CellData[MeshDataLike, PointDataLike] | None = None, pointdata: PointDataLike | None = None, container: MeshDataLike | None = None, **kwargs)[source]#

Polyhedra class for 6-noded trilinear wedges.

class Geometry[source]#
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 polybase() Tuple[List][source]#

Retruns the polynomial base of the master element.

Returns:

  • list – A list of SymPy symbols.

  • list – A list of monomials.

classmethod tetmap() ndarray[source]#

Returns a mapper to transform topology and other data to a collection of tetrahedral simplices.

sigmaepsilon.mesh.cells.Wedge#

alias of W6