Geometry and Mesh (fedoo.mesh)
Mesh classes
|
Fedoo Mesh object. |
|
Fedoo mesh made of several ordered submeshes sharing one node table. |
Mesh manipulation functions
|
Make the spatial stack of two mesh objects which have the same element shape. |
|
Build a volume or surface mesh from the extrusion of a surface or wire mesh. |
|
Create a solid by thickening a surface mesh along nodal normals. |
|
Build a mesh of the surface from a given 2D or 3D mesh. |
|
Extract edges from a given 2D or 3D mesh. |
|
Attempt to change the type of element of a mesh. |
|
Change the type of element of a mesh from 'quad4' to 'tri3'. |
Import and export meshes
Use fedoo.Mesh.read() to import mesh geometry and connectivity:
VTK and other PyVista formats
VTK formats are read through PyVista: legacy .vtk meshes, XML
unstructured grids (.vtu) and XML polygonal surfaces (.vtp).
The imported geometry must contain cell types supported by Fedoo.
import fedoo as fd
mesh = fd.Mesh.read("model.vtu", name="Domain")
# Legacy VTK meshes and polygonal surfaces:
# mesh = fd.Mesh.read("model.vtk")
# mesh = fd.Mesh.read("surface.vtp")
fedoo.Mesh.from_pyvista() also accepts existing PyVista
UnstructuredGrid and PolyData objects, including mixed cell types.
It imports geometry and Fedoo’s _nset_/_eset_ field-data conventions,
but not ordinary point/cell result arrays. Element sets are not imported
through the PyVista path for mixed meshes.
Abaqus import
Use fedoo.Mesh.read() to import the mesh from an Abaqus deck:
mesh = fd.Mesh.read("model.inp", name="Domain")
Abaqus .inp files use meshlane, with meshio as a fallback. Install the
recommended reader with pip install "fedoo[io]". Supported first- and
second-order element types are converted to Fedoo elements. *NSET and
*ELSET definitions become mesh.node_sets and mesh.element_sets.
Several element types produce a fedoo.MultiMesh, with element
sets stored on the corresponding submeshes. Unsupported cell types are
skipped with a warning; isolated vertex cells are ignored.
Importing an Abaqus deck does not create its materials, loads or analysis steps; define those in Fedoo after importing the mesh.
Importing with meshlane or meshio
To explicitly use meshlane for another supported format, such as Gmsh,
pass its mesh object to fedoo.Mesh.from_meshio():
import meshlane
mesh = fd.Mesh.from_meshio(meshlane.read("model.msh"))
fedoo.Mesh.from_meshio() accepts both meshlane and meshio objects
and preserves their point/cell sets. Multiple supported cell types return
a fedoo.MultiMesh.
Exporting mesh geometry
Export mesh geometry
with fedoo.Mesh.save(), for example mesh.save("model.vtk").
Use fedoo.read_data() for saved simulation results, including FDH5,
rather than fedoo.Mesh.read().
Legacy readers
The following legacy readers handle specific ASCII VTK/Gmsh formats.
Prefer fedoo.Mesh.read() or fedoo.Mesh.from_meshio()
for new workflows.
|
Import a mesh from a file. |
|
Import a mesh from a msh file (gmsh format). |
|
Import a mesh from a legacy ASCII VTK file. |
Mesh Creation Functions
|
Create a rectangular Mesh |
|
Create the mesh of a box |
|
Create a surface mesh of a disk or an ellipse |
|
Create a mesh of a 2D plate with a hole |
|
Create a surface mesh of an hollow disk or an ellipse |
|
Create the mesh of a I. |
|
Create the Mesh of a straight line with corrdinates in 1D. |
|
Create the Mesh of a straight line |
|
Create the mesh of a curved line based on cylindrical coordinates |
|
Create the mesh of a cicle. |
|
Create a mesh as a regular grid in cylindrical coordinate |
|
Generate cylindrical local frames (er, etheta, ez) at each node. |
|
Create a 2D structured grid from 4 edges. |
|
Add regularly espaced nodes to an existing mesh between to existing nodes. |