Skip to content

Mesh¤

tatva.mesh.Mesh ¤

A class used to represent a Mesh for finite element method (FEM) simulations.

Attributes:

  • nodes

    The coordinates of the mesh nodes.

  • elements

    The connectivity of the mesh elements.

Methods:

  • unit_square

    Generate a unit square mesh with n_x and n_y nodes in the x and y directions.

  • rectangle

    Generate a rectangular mesh with specified x and y ranges and number of nodes.

coords class-attribute ¤

coords = _tuplegetter(0, 'Alias for field number 0')

Alias for field number 0

elements class-attribute ¤

elements = _tuplegetter(1, 'Alias for field number 1')

Alias for field number 1

unit_square classmethod ¤

unit_square(n_x: int, n_y: int, *, type: ElementType | Literal['triangle', 'quad'] = <ElementType.TRIANGLE: 'triangle'>, dim: Literal[2, 3] = 2) -> Mesh

Generate a unit square mesh with n_x and n_y nodes in the x and y directions.

rectangle classmethod ¤

rectangle(x: tuple[float, float], y: tuple[float, float], n_x: int, n_y: int, *, type: ElementType | Literal['triangle', 'quad'] = <ElementType.TRIANGLE: 'triangle'>, dim: Literal[2, 3] = 2) -> Mesh

Generate a rectangular mesh with specified x and y ranges and number of nodes.