Mesh#
Module containing mesh and relative objects.
- class volmdlr.mesh.ElementsGroup(elements, name: str)[source]#
Bases:
DessiaObject
Defines a group of elements.
- property elements_per_node#
Maps the elements of each node.
- exception volmdlr.mesh.FlatElementError[source]#
Bases:
Exception
An error in case an element is flat.
- class volmdlr.mesh.LinearElement(start: Point2D, end: Point2D, interior_normal: Vector2D, name: str = '')[source]#
Bases:
LineSegment2D
A class that defines a linear element.
- class volmdlr.mesh.Mesh(elements_groups: List[ElementsGroup])[source]#
Bases:
DessiaObject
Defines a mesh.
- copy()[source]#
Copy object.
- Parameters:
deep – If False, perform a shallow copy. If True, perform a deep copy.
memo – A dict that keep track of references.
- get_nodes_correction()[source]#
A getter method for nodes_correction private variable.
- Returns:
A dict of nodes_correction
- Return type:
dict
- property gmsh#
A property to get gmsh (a private variable).
- Returns:
A gmsh_parser data
- Return type:
- class volmdlr.mesh.Node2D(x: float, y: float, name: str = '')[source]#
Bases:
Point2D
A node is a Point2D with some hash capabilities for performance used for Mesh.
- class volmdlr.mesh.Node3D(x: float, y: float, z: float, name: str = '')[source]#
Bases:
Point3D
A node is a Point3D with some hash capabilities for performance used for Mesh.
- class volmdlr.mesh.QuadrilateralElement2D(points: List[Point2D])[source]#
Bases:
ClosedPolygon2D
Class to define a 2D quadrilateral element.
- class volmdlr.mesh.TetrahedralElement(points, name: str = '')[source]#
Bases:
DessiaObject
Class to define a 3D tetrahedral element.
- class volmdlr.mesh.TetrahedralElementQuadratic(points, name: str = '')[source]#
Bases:
DessiaObject
Class to define a 3D quadratic tetrahedral element.
- class volmdlr.mesh.TriangularElement(points: List[Point2D])[source]#
Bases:
Triangle
A mesh element defined with 3 nodes.
- axial_symmetry(line)[source]#
Applies axial symmetry to the triangular element with respect to a given line.
This method creates a mirror image of the triangular element across the specified line. Each point of the triangle is reflected on the other side of the line, resulting in a new triangular element that is a mirror image of the original.
- Parameters:
line – The line of symmetry.
- Returns:
A new TriangularElement instance that is the mirror image of the original.
- Return type:
- class volmdlr.mesh.TriangularElement2D(points, name: str = '')[source]#
Bases:
TriangularElement
,ClosedPolygon2D
Class to define a 2D triangular element.
- axial_symmetry(line)[source]#
Applies axial symmetry to the triangular element with respect to a given line.
This method creates a mirror image of the triangular element across the specified line. Each point of the triangle is reflected on the other side of the line, resulting in a new triangular element that is a mirror image of the original.
- Parameters:
line – The line of symmetry.
- Returns:
A new TriangularElement2D instance that is the mirror image of the original.
- Return type:
- plot(ax=None, edge_style: EdgeStyle = EdgeStyle(color='k', alpha=1, edge_ends=False, edge_direction=False, width=None, arrow=False, plot_points=False, dashed=True, linestyle='-', linewidth=1, equal_aspect=True), point_numbering=False, fill=False, fill_color='w')[source]#
Matplotlib plot for a closed polygon 2D.
- class volmdlr.mesh.TriangularElement3D(points)[source]#
Bases:
TriangularElement
,ClosedPolygon3D
Class to define a 3D triangular element.