Skip to content

mesh

gripyth.meshing.mesh

Mesh class.

CLASS DESCRIPTION
Geometry

Describes the geometry of the physical objects being modeled.

Mesh

Describes the mesh discretization of the geometry.

Geometry dataclass

Describes the geometry of the physical objects being modeled.

At this point, the implementation is restricted to 2d rectangular shapes. This may be generalized in the future.

ATTRIBUTE DESCRIPTION
B

width/breadth of the plate

TYPE: float

L

length of the plate

TYPE: float

t

out-of-plane thickness of the plate

TYPE: float

B instance-attribute

B: float

width/breadth of the plate

L instance-attribute

L: float

length of the plate

t instance-attribute

t: float

out-of-plane thickness of the plate

Mesh dataclass

Describes the mesh discretization of the geometry.

METHOD DESCRIPTION
__init__

Create a new mesh from nodes and elements.

ATTRIBUTE DESCRIPTION
dim

dimension of the mesh geometry

TYPE: int

elem_sets

named sets of element indices

TYPE: dict[str, NDArray[int32]]

element_materials

material type associated with each element

TYPE: NDArray[int32]

elements

connectivity matrix of the elements: maps element index to its nodes

TYPE: NDArray[int32]

n_elements

total number of mesh elements

TYPE: int

n_nodes

total number of mesh nodes

TYPE: int

n_voigt

size of tensors in Voigt notation

TYPE: int

node_sets

named sets of node indices

TYPE: dict[str, NDArray[int32]]

nodes

node coordinates: array of [x, y, …] for each node index

TYPE: NDArray[float64]

nodes_per_elem

number of nodes per element

TYPE: int

dim property

dim: int

dimension of the mesh geometry

elem_sets instance-attribute

elem_sets: dict[str, NDArray[int32]] = elem_sets or {}

named sets of element indices

element_materials instance-attribute

element_materials: NDArray[int32] = (
    element_materials or zeros(len(elements), dtype=int32)
)

material type associated with each element

elements instance-attribute

elements: NDArray[int32] = elements

connectivity matrix of the elements: maps element index to its nodes

n_elements property

n_elements: int

total number of mesh elements

n_nodes property

n_nodes: int

total number of mesh nodes

n_voigt property

n_voigt: int

size of tensors in Voigt notation

node_sets instance-attribute

node_sets: dict[str, NDArray[int32]] = node_sets or {}

named sets of node indices

nodes instance-attribute

nodes: NDArray[float64] = nodes

node coordinates: array of [x, y, …] for each node index

nodes_per_elem property

nodes_per_elem: int

number of nodes per element

__init__

__init__(
    nodes: NDArray[float64],
    elements: NDArray[int32],
    node_sets: dict[str, NDArray[int32]] | None = None,
    elem_sets: dict[str, NDArray[int32]] | None = None,
    element_materials: NDArray[int32] | None = None,
)

Create a new mesh from nodes and elements.