github.com
support links |
Generating a Meshby Carlos Remuzzi, BEng Biomedical Engineering, Freelance Developer, London UK How vmtkMeshGenerator worksThe mesh generator for vmtk works by performing two fundamental steps, Surface Remeshing and Volume Meshing. Surface remeshingSurface remeshing is performed under the assumption that the surface requires improvement before being used for CFD. In the surface remeshing step, the surface triangle edges are resized according to two alternative methods decided by the user:
Volume meshingAfter the surface has been remeshed the volume is filled with a combination of tetrahedral and prismatic elements. This task relies on algorithms based on Tetgen. The parameter -volumeelementfactor is used to control the size of the tetrahedral mesh and it represents a proportionality constant between the local surface edge length and the element volume. There's is another option involved in Volume meshing, it's the Boundary Layer. By activating it we can heighten the density of the mesh near the wall. We can adda a boundary layer by using the -boundarylayer option . The thickness of this layer can be specified through the -thicknessfactor parameter.
Figure 1: A generic uncapped surface. We will refer to it as foo.vtp Using vmtkMeshGeneratorHere you can find some examples on how to use vmtkmeshgenerator. All of the meshes displayed below have been generated from the surface in Figure 1, referred as foo.vtp. Generating a uniform element meshIt is advisable to adopt this method on branches with uniform dimensions.
Where
Generating a radius-adaptive element mesh
Adding a boundary layerAdding a boundary layer means increasing the element density close to the wall. This is advisable, for example, when dealing with hemodynamics because the solution near the wall is rather important as it's related to the wall shear stress. To add a layer simply add -
Converting mesh elements to quadratic
Scaling the meshMedical images are often in mm. Typically you want your computations and results to be either in cgs or SI systems, which means scaling the model in cm (1e-1) or in m (1e-3). Let's scale our mesh in cm and store it in the usual vtu format.
Inspecting the mesh entities
Figure 11: vmtkmeshboundaryinspector Tetrahedralizing the meshIf you added a boundary layer to your mesh you will have prismatic elements in it. Those elements are not always recognized by solvers. In those cases you'll simply need to tetrahedralize your mesh.
Linearizing the meshThis allows you to linearize your mesh preserving its elements.
Exporting the mesh for your solver
Dolfin :
libMesh :
lifeV :
|