|
FEAT 3
Finite Element Analysis Toolbox
|
This page gives an overview over the mesh-file related tools and scripts that can be found in the tools/mesh_tools directory.
There exist a few Python scripts that can be used to generate FEAT 3 mesh-files for some simple 2D and 3D domains. Please check the documentation of the scripts for details.
Creates a 2D quadrilateral mesh that discretizes a circle domain with 4*N+1 quadrilateral elements, which looks roughly like this:
.
./'|'\.
./' | '\.
./' ./'\ '\.
./' ./' '\. '\.
+----+ +----+
'\. '\. ./' ./'
'\. '\./' ./'
'\ | ./'
'\.|./'
'
Creates a 2D quadrilateral mesh that discretizes a rectangular domain with 4*N+1 quadrilateral elements, which (for N=2) looks roughly like this:
+-------------------+ |'\. ./'| | +-----------+ | | |'\. ./'| | | | +---+ | | | | | | | | | | +---+ | | | |./' '\.| | | +-----------+ | |./' '\.| +-------------------+
Creates a 2D quadrilateral mesh that discretizes a rectangular domain with M*N quadrilateral elements. This script offers a wide variety of element sizing choices that also allow for the generation of anisotropic meshes, e.g.:
+-----+--------------------+-----+ | | | | +-----+--------------------+-----+ | | | | | | | | +-----+--------------------+-----+ | | | | | | | | | | | | +-----+--------------------+-----+
Creates a 2D quadrilateral mesh that discretizes a ring domain with M*N quadrilateral elements.
Creates a 2D triangular mesh that discretizes a rectangular domain with 2*M*N quadrilateral elements. This script is the triangular version of the 2d_quad_rect.py script, which subdivides each quadrilateral into 2 triangles.
Creates a 3D hexahedral mesh that discretizes a cuboid domain with M*N*L hexahedral elements.
This tool can be used to create a 3D hexahedral mesh from a 2D quadrilateral mesh by extruding it in Z direction thus forming a "2.5D" mesh, which also includes an extrusion of the 2D charts that were used to parameterize the 2D input mesh. The 3D mesh can optionally also be rotated and translated by specifying an origin, an offset and a set of yaw-pitch-roll rotation angles given in revolutions
This tool accepts the following command line parameters:
--in <input-meshfiles...>--out <output-meshfile>--z-list <z_0> <z_1> ... <z_n>--z-range <z-min> <z-max> <n>--z-names <name-min> <name-max>--origin <x> <y>--offset <x> <y> <z>--angles <yaw> <pitch> <roll>The optional rigid body transformation consists of the origin vector v, the offset vector w as well as a 3D rotation matrix R, which is given by the yaw-pitch-roll angle triplet, which define the following transformation mapping:
\[ x \mapsto w + R \cdot(x - v)\]
Examples:
The following call creates a 3D unit cube mesh with 1 hexahedral element by extruding the 2D unit-square mesh:
mesh-extruder --in unit-square-quad.xml --out unit-cube-hexa.xml --z-range 0 1 1 --z-names bnd:f bnd:n
The following call creates a 3D cylinder domain with 3 slices in Z-direction from the 12-quad unit-circle mesh, with its center translated to (0,0,0) and rotated by 45 degrees (=1/8 revolution) around the X-axis:
mesh-extruder --in unit_circle_quad_12.xml --out cylinder_tilted.xml --z-list 0.0 0.1 0.9 1.0 --offset 0 0 -0.5 --angles 0.125 0 0
This tool can be used to create a FEAT mesh file from a set of vertex coordinate and vertices@element indices text files. This is especially helpful if one needs to create a FEAT mesh file from some other mesh file format and if no other tool chain exists that could make that conversion possible in a more convenient way.
This tool accepts the following command line parameters:
--out <output-meshfile>--shape <shape>--vtx <filenames...>--shape. Empty lines and lines beginning with the hash character '#' are ignored.--idx <filenames...>--shape. The indices are expected to be given in the correct order according to the FEAT 3 numbering, see meshfile_shape_numbering for details. Empty lines and lines beginning with the hash character '#' are ignored.--bnd--parts <name1> <formula1> [<name2> <formula2> ...]--parts option can only be used if FEAT is configured and linked against the 'fparser' third-party library. Also, it is highly recommended to enclose each formula in a pair of double-quotation marks to ensure your command line interpreter doesn't get confused by more complex formulae.The number of vertex coordinates files passed to the --vtx argument must always be equal to the number of element indices files passed to the --idx argument, since these always form a pair of vertices-elements relations.
This tools offers the possibility to join several meshes into a single meshes by specifying a set of multiple vertices-indices file pairs. In this case, the indices of the i-th index file correspond to the vertices given in the i-th vertex coordinate file.
Furthermore, this tool automatically removes duplicate vertices as well as orphan vertices, i.e. vertices which are not referenced by any element. Duplicate vertices usually appear when two or more meshes are joined together, whereas orphan vertices appear when one manually removes elements.
Examples:
The following call creates a 2D quadrilateral mesh from the vertices given in vertices.txt and the vertex@element indices given in elements.txt along with a single mesh-part named 'bnd' for the entire boundary:
mesh-indexer --out mesh.xml --shape h2 --vtx vertices.txt --idx elements.txt --bnd
The following call creates a 3D tetrahedral mesh that is obtained by joining the two meshes which are given by the vertices-elements pairs verts_a.txt + elems_a.txt and verts_b.txt + elems_b.txt, i.e. elems_a.txt contains indices of the vertices in verts_a.txt and elems_b.txt contains indices of the vertices verts_b.txt:
mesh-indexer --out mesh.xml --shape s3 --vtx verts_a.txt verts_b.txt --idx elems_a.txt elems_b.txt
This tool can be used to create a partitioning file for a given mesh file, which is then saved as a separate mesh file and which can be passed to MPI parallel applications in addition to the original mesh file to ensure that these applications picks one of the pre-computed partitionings instead of applying a partitioner at simulation time.
This tool allows you to specify the number of desired partitions/patches independently of the number of MPI processes that this tool is run with, however, not all MPI processes may be used to run the partitioner if the workload is too small to distribute over all MPI processes.
This tool allows you to specify the refinement level of the mesh that is to be partitioned, if the unrefined mesh stored in the mesh file that you want to partition is too coarse for the number of patches that you want to create. The chosen partitioning level is then also written to the output file and the PartiDomainControl will also refine the mesh to the required level if it chooses to select the corresponding partitioning.
By default, the partitioning is named 'auto', which tells the PartiDomainControl, which is used to read in the partition mesh file, that the corresponding partitioning can be chosen automatically if the number of MPI processes matches the number of patches in the partitioning. If you choose a different name for the partitioning, you will have to tell the PartiDomainControl explicitly that you want to use that particular partitioning by supplying its name to the '–part-extern-name' command line parameter of the PartDomainControl object. Unless you indent to try out different partitionings for the same number of patches, it is recommended to simply leave the partition name as 'auto'.
By default, this tool creates the dual graph for the partitioner based on the facet-adjacency of the elements, however, you can also specify that the dual graph is to be defined based on the vertex-adjacency of the elements. The former one usually results in nicer partitionings, but you might want to try out the vertex-based adjacency if the facet-based element adjacency does not yield satisfactory results for the mesh that you are trying to partition.
If you want to visualize the partitioning created by this tool, you can simply use the 'mesh2vtk' tool and supply both the input mesh file as well as the partitioning mesh file written by this tool as input mesh files and the mesh2vtk tool will write out the partitioning as a cell variable in the resulting VTK file. If you have created the partitioning on a refinement level greater than 0, you also have to tell the mesh2vtk tool to write out the refined mesh on at least the same level to visualize the partitioning because it is not available on lower refinement levels, of course.
This tool supports the following command line parameters:
--mesh <meshfile>--out <partition-file>--parts <n>--dual-by-verts--level <n>--name <name>--prio <priority>--no-2lvl--genetic <time-init> <time-mutate>--no-parmetis--no-zoltanThis tool performs some basic sanity checks on a given mesh file to identify orphaned entities and other invalid adjacency combinations. Please note that this tool is very basic and does not offer any sophisticated checks (yet), but it can still be useful if one has created or modified a mesh file manually or via some custom script or conversion tool.
This tool converts a mesh from the FEAT 3 mesh file format to a corresponding VTK format, which currently always corresponds the XML-based VTU file format for unstructured meshes. This tool can optionally also apply a rigid body transformation given by an origin-angles-offset tuple.
This tool accepts the following command line parameters:
--mesh <filenames...>--vtk <filename>--level <lvl_max> [<lvl_min>]--origin <x> [<y> [<z>]]--angles <angle> (2D only)--angles <yaw> <pitch> <roll> (3D only)--offset <x> [<y> [<z>]]--no-adapt--no-dist--no-proj--no-volume--hit-test <name1> <formula1> [<name2> <formula2> ...]--hit-test option can only be used if FEAT is configured and linked against the 'fparser' third-party library. Also, it is highly recommended to enclose each formula in a pair of double-quotation marks to ensure your command line interpreter doesn't get confused by more complex formulae.This tool converts a 2D triangular or quadrilateral mesh from the FEAT 3 mesh file format to an encapsulated post-script (EPS) file, so that it may be included as a vector graphic in e.g. a LaTeX document.
This tool accepts the following command line parameters:
--mesh <filenames...>--eps <filename>--level <lvl_max> [<lvl_min>]--box <width> <height>--stroke <width>--extra <offset>--no-adaptThis tool converts a 2D triangular or quadrilateral mesh from the FEAT 3 mesh file format to a scalable vector graphics (SVG) file, which can be either displayed directly in an internet browser or converted to another vector graphics format such as EPS or PDF via some vector graphics application like e.g. Inkscape.
This tool accepts the following command line parameters:
--mesh <filenames...>--svg <filename>--level <lvl_max> [<lvl_min>]--box <width> <height>--stroke <width>--extra <offset>--no-adaptThis tool converts a mesh from the FEAT 3 mesh file format to the legacy FEATFLOW 1/2 TRI mesh file format.
This tool accepts the following command line parameters:
--mesh <filenames...>--tri <filename>--level <lvl_max> [<lvl_min>]--knpr [<mesh-part-names...>]--knpr bnd:l "bnd:t bnd:b" bnd:rwill yield 3 nodal property groups: bnd:l -> 1, bnd:t -> 2, bnd:b -> 2, bnd:r -> 3, the rest -> 0
This tool converts a 3D hexahedral mesh from the legacy FEATFLOW 1/2 TRI mesh file format to the FEAT 3 mesh file format.
This tool has a fixed command line argument structure:
tri2mesh <prjfile> <meshfile> [<scale>]
where
<prjfile> is the mandatory filename of the input PRJ file <meshfile> is the mandatory filename of the output FEAT 3 mesh file <scale> is the optional scaling factor for the coordinates