Chi-Tech
Mesh Tutorial 7: A 3D Extruded Mesh

The idea behind extruded meshes is that the 3D complex geometrical features can be reasonably well projected into a 2D plane. This 2D geometry is then meshed (it is expected that this 2D mesh is unstructured).

Then, the 2D meshes is extruded and appropriate material IDs/boundary IDs in 3D are provided to complete the 3D mesh.

Thus, in order to obtain a 3D extruded mesh, you need

  1. A 2D mesh
  2. Extrusion data

The 2D mesh

Currently, Chi-Tech can read in VTU and OBJ files. In the case of VTU files, you may provide an additional field such as 2D material IDs (i.e., material IDs that correspond to the 2D geometry).

You may create your 2D mesh with our favorite mesh generator. To convert that mesh into an object readable by Chi-Tech, you want need to use mesh converters (in Python, there is meshio but there are other possibilities).

mesh2d_file = "your_mesh.obj"
Handle chiMeshHandlerCreate()
Handle chiUnpartitionedMeshFromWavefrontOBJ(char file_name)

or

mesh2d_file = "your_mesh.vtu"
umesh = chiUnpartitionedMeshFromVTU(mesh2d_file, "attribute")
Handle chiUnpartitionedMeshFromVTU(char file_name, char field)

The extrusion process

chiSurfaceMesherCreate(SURFACEMESHER_PREDEFINED)
chiVolumeMesherCreate(VOLUMEMESHER_UNPARTITIONED, umesh)
chiVolumeMesherCreate(VOLUMEMESHER_EXTRUDER,
ExtruderTemplateType.UNPARTITIONED_MESH,
umesh);
nbr_planes_in_layer = 10
height=0.1
chiVolumeMesherSetProperty(EXTRUSION_LAYER,height,nbr_planes_in_layer,"Charlie");
chiVolumeMesherSetProperty(EXTRUSION_LAYER,height,nbr_planes_in_layer,"Chuck");
chiVolumeMesherSetProperty(EXTRUSION_LAYER,height,nbr_planes_in_layer,"Bob");
chiVolumeMesherSetProperty(EXTRUSION_LAYER,height,nbr_planes_in_layer,"SarahConner");
chiMeshHandlerExportMeshToVTK("export_mesh_without_IDs")
void chiMeshHandlerExportMeshToVTK(char FileName)
void chiSurfaceMesherCreate(int SurfaceMesherType)
void chiSurfaceMesherExecute()
void chiVolumeMesherSetProperty(int PropertyIndex, varying PropertyValue)
void chiVolumeMesherSetKBAPartitioningPxPyPz(int Px, int Py, int Pz)
void chiVolumeMesherCreate(int Type, varying OtherArgs)
void chiVolumeMesherExecute()

Completing the 3D mesh

To complete the 3D mesh, we need to provide material IDs and boundary IDs. We use the concept of a logical volume (LV). For each material zone, we will assign a material ID for cells (identified by their centroids) that are included in the LV.

We have several ways of defining a Logical Volume, LV:

  1. Using pre-defined volumes, such as RPP (rectangular paralleliped)and RCC (right circular cylinder),
  2. Using a surface mesh read in as an<tt>.obj file,
  3. Using lua functions to describe the surface mesh of the LV.

This should be repeated as many times as necessary to assign all 3D material IDs.

LV of pre-defined type

-- Logical Volumes
my_LV = chiLogicalVolumeCreate(RCC, 0, 0, 0.1, 0, 0, 0.2, 0.4)
chiMeshHandlerExportMeshToVTK("export_mesh_with_IDs")
Handle chiLogicalVolumeCreate(int TypeIndex, varying Values)

LV defined as read-in surfaces

chiSurfaceMeshImportFromOBJFile(surf_LV, "LV_file.obj", false)
my_LV = chiLogicalVolumeCreate(SURFACE, surf_LV)
chiMeshHandlerExportMeshToVTK("export_mesh_with_IDs")
Handle chiSurfaceMeshCreate()
success chiSurfaceMeshImportFromOBJFile(int SurfaceHandle, string FileName, bool polyflag, table3 transform)

LV using a Lua function

where the Lua function was previously defined, e.g.,

aaa