Chi-Tech
Mesh Generators

Modules

 chi_mesh.ExtruderMeshGenerator
 
 chi_mesh.FromFileMeshGenerator
 
 chi_mesh.MeshGenerator
 
 chi_mesh.OrthogonalMeshGenerator
 

Detailed Description

We split a MeshGenerator's execution into a phase that generates an unpartitioned mesh and a phase that then converts this mesh into partitioned chi_mesh::MeshContinuum (with both steps customizable). The phase that creates the MeshContinuum object can be hooked up to a partitioner that can also be designed to be pluggable.

Example A

nodes = {-1.0,-0.75,-0.5,-0.25,0.0,0.25,0.5,0.75,1.0}
meshgen1 = chi_mesh.OrthogonalMeshGenerator.Create({ node_sets = {nodes,nodes} })
virtual void Execute()
void chiMeshHandlerExportMeshToVTK(char FileName)

In this example we created a set of nodes (monotonically increasing in value) for use with the chi_mesh.OrthogonalMeshGenerator. We supplied the same set twice meaning the generator will build a 2D mesh.

We did not specify a partitioner and therefore the generator will use the chi.PETScGraphPartitioner with type="parmetis" by default. Using 8 processes, we can see the mesh and it's partitioning below.

Example B

meshgen1 = chi_mesh.FromFileMeshGenerator.Create({ filename="TriangleMesh2x2.obj" })

In this example we created a mesh by reading it from a file, using the chi_mesh.FromFileMeshGenerator. The types of file-types we can support is ever growing. At the time of writing this we support the following formats:

Using 8 processes, we can see the mesh and it's partitioning below.

Example C

({
inputs =
{
chi_mesh.FromFileMeshGenerator.Create({ filename=TriangleMesh2x2.obj" }),
},
layers = {{z=1.1, n=2}, -- First layer - 2 sub-layers
{z=2.1, n=3}}, -- Second layer - 3 sub-layers
})
chi_mesh.MeshGenerator.Execute(meshgen1)
chiMeshHandlerExportMeshToVTK("ZMeshTest")

In this example we use an chi_mesh.ExtruderMeshGenerator with another mesh generator as an input to create an extruded mesh. Using 8 processes, we can see the mesh and it's partitioning below.

Using different Partitioners

ChiTech now has a set of Graph Partitioners (i.e. based off GraphPartitioner) that support different forms of partitioning, for example we have:

An example of changing the partitioning to PETSc's "average" option is shown below:

({
inputs =
{
({
filename="resources/TestMeshes/TriangleMesh2x2.obj"
}),
},
layers = {{z=1.1, n=2}, {z=2.1, n=3}},
partitioner = chi.PETScGraphPartitioner.Create({type="average"})
})

Another example using the KBAGraphPartitioner is shown below

({
inputs =
{
({
filename="resources/TestMeshes/TriangleMesh2x2.obj"
}),
},
layers = {{z=1.1, n=2}, {z=2.1, n=3}},
partitioner = chi.KBAGraphPartitioner.Create
({
nx = 2, ny=2, nz=2,
xcuts = {0.0}, ycuts = {0.0}, zcuts = {1.1}
})
})