Chi-Tech
Volume Meshers

Functions

void chi_lua::chiVolumeMesherSetupOrthogonalBoundaries ()
 
void chi_lua::chiVolumeMesherCreate (int Type, varying OtherArgs)
 
void chi_lua::chiVolumeMesherSetProperty (int PropertyIndex, varying PropertyValue)
 
void chi_lua::chiVolumeMesherSetKBAPartitioningPxPyPz (int Px, int Py, int Pz)
 
void chi_lua::chiVolumeMesherSetKBACutsX ()
 
void chi_lua::chiVolumeMesherSetKBACutsY ()
 
void chi_lua::chiVolumeMesherSetKBACutsZ ()
 
void chi_lua::chiVolumeMesherSetMatIDToAll (int material_id)
 
void chi_lua::chiVolumeMesherExecute ()
 

Detailed Description

General Concepts

A volume mesher generates cells (chi_mesh::Cell) which can be either 2D polygons (chi_mesh::CellPolygon) or 3D polyhedrons (chi_mesh::CellPolyhedron). All cell objects are pushed into a vector located in a chi_mesh::MeshContinuum after creation. Right now only a single continuum can be operated on and this is normally by means of attaching a region to a solver.

Right now 2D meshes can be partitioned but the full 2D cell geometry exists on each processor. This is mostly because of the way the extruder works. This means that for a 2D problem a continuum will have ALL of the cells (as fully defined cells), in every process, in the member vector "cells" of the continuum. The same can not be said for 3D extruded meshes where each process has all the nodes but if cells are not local then only placeholders are uploaded. Placeholders are basically the base class chi_mesh::Cell and contains only the cell's partition_id and its centroid. The concept that these placeholders are uploaded allows a sweeping order to figure out dependencies. A similar strategy would have to be devised for using third-party meshes.

Global mesh references are maintained in chi_mesh::MeshContinuum::cells. This contains the actual mesh object. Local indices are stored in chi_mesh::MeshContinuum::local_cell_glob_indices and are the global indices of local cells. Conversely the local indices, given a global index, are stored in chi_mesh::MeshContinuum::glob_cell_local_indices.

Extruder Mesher

Function Documentation

◆ chiVolumeMesherCreate()

void chi_lua::chiVolumeMesherCreate ( int  Type,
varying  OtherArgs 
)

Creates a new volume mesher.

Parameters
Typeint Volume Remesher type.
OtherArgsvarying Additional arguments depending on Type.

Remesher types:
VOLUMEMESHER_EXTRUDER = Creates an extruded mesh from a 2D template mesh. Requires two additional arguments. TemplateType and handle. See below.
VOLUMEMESHER_UNPARTITIONED = Create the mesh from the latest UnpartitionedMesh. Requires a single additional argument, handle, which is a handle to a valid unpartitioned mesh.

_

Extruder parameters

When the mesher type is specified to be VOLUMEMESHER_EXTRUDER then two additional arguments are required. TemplateType and handle.

  • TemplateType can for now only be ExtruderTemplateType.UNPARTITIONED_MESH.
  • handle is a handle to the template mesh. When TemplateType is set to ExtruderTemplateType.UNPARTITIONED_MESH then the handle must point to a valid unpartitioned mesh.
Author
Jan

Definition at line 1646 of file lua_functions.c.

◆ chiVolumeMesherExecute()

void chi_lua::chiVolumeMesherExecute ( )

Executes the volume meshing pipeline.

Author
Jan

Definition at line 1848 of file lua_functions.c.

◆ chiVolumeMesherSetKBACutsX()

void chi_lua::chiVolumeMesherSetKBACutsX ( )

Sets the x-cuts for KBA type partitioning with a lua array.

Definition at line 1784 of file lua_functions.c.

◆ chiVolumeMesherSetKBACutsY()

void chi_lua::chiVolumeMesherSetKBACutsY ( )

Sets the y-cuts for KBA type partitioning with a lua array.

Definition at line 1788 of file lua_functions.c.

◆ chiVolumeMesherSetKBACutsZ()

void chi_lua::chiVolumeMesherSetKBACutsZ ( )

Sets the z-cuts for KBA type partitioning with a lua array.

Definition at line 1792 of file lua_functions.c.

◆ chiVolumeMesherSetKBAPartitioningPxPyPz()

void chi_lua::chiVolumeMesherSetKBAPartitioningPxPyPz ( int  Px,
int  Py,
int  Pz 
)

Sets the Px, Py and Pz partititioning parameters for a KBA-type partitioning. This also fixes the process count required to a total of Px*Py*Pz.

Parameters
Pxint Number partitions in x.
Pyint Number partitions in y.
Pzint Number partitions in z.

Definition at line 1780 of file lua_functions.c.

◆ chiVolumeMesherSetMatIDToAll()

void chi_lua::chiVolumeMesherSetMatIDToAll ( int  material_id)

Sets all cell-material id's to the supplied value.

Parameters
material_idint The id.

Usage Examples:

test/framework/tutorials/tutorial_93_raytracing.lua
test/framework/tutorials/fv_test2.lua
test/framework/tutorials/pwlc_test1.lua
test/framework/tutorials/pwlc_test2.lua
test/framework/tutorials/tutorial_91a_pwld.lua
test/framework/tutorials/fv_test1.lua
test/framework/tutorials/tutorial_06_wdd.lua
test/modules/CFEM_Diffusion/cDiffusion_2D_3a_analytical_coef.lua
test/modules/CFEM_Diffusion/cDiffusion_2D_3b_analytical_coef2.lua
test/modules/CFEM_Diffusion/cDiffusion_2D_1a_linear.lua
test/modules/DFEM_Diffusion/dDiffusion_2D_3a_analytical_coef.lua
test/modules/DFEM_Diffusion/dDiffusion_2D_3b_analytical_coef2.lua
test/modules/DFEM_Diffusion/dDiffusion_2D_3c_L2_error_MMS.lua
test/modules/DFEM_Diffusion/dDiffusion_2D_1a_linear.lua
test/modules/Diffusion/Diffusion1D_IP.lua
test/modules/Diffusion/Diffusion1D.lua
test/modules/Diffusion/Diffusion1D_KBA.lua
test/modules/LinearBoltzmannSolvers/DSA/acceleration_diffusion_CFEM.lua
test/modules/LinearBoltzmannSolvers/DSA/acceleration_diffusion_DFEM.lua
test/modules/LinearBoltzmannSolvers/MGDiffusion_KEigen/KEigenvalueMIP1D_1G.lua
test/modules/LinearBoltzmannSolvers/MGDiffusion_KEigen/utils/QBlock_mesh.lua
test/modules/LinearBoltzmannSolvers/Transport_SteadyCBC/Transport1D_1.lua
test/modules/LinearBoltzmannSolvers/Transport_Transient/TransientTransport1D_1.lua
test/modules/LinearBoltzmannSolvers/Transport_Transient/TransientTransport1D_3.lua
test/modules/LinearBoltzmannSolvers/Transport_Transient/TransientTransport2D_3.lua
test/modules/LinearBoltzmannSolvers/Transport_Transient/TransientTransport2D_2.lua
test/modules/LinearBoltzmannSolvers/Transport_Transient/TransientTransport1D_2.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport2D_3Poly_quad_mod.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport2D_5PolyA_AniHeteroBndry.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport2D_4b_DSA_ortho.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport2D_4a_DSA_ortho.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport3D_6ASplitMesh.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport3D_3a_DSA_ortho.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport3D_6BSplitMesh.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport1D_1.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport1D_3a_DSA_ortho.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport1D_4_DSA_ortho_inf.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport2D_2Unstructured.lua
test/modules/LinearBoltzmannSolvers/Transport_Keigen/KEigenvalueTransport1D_1G_CBC.lua
test/modules/LinearBoltzmannSolvers/Transport_Keigen/KEigenvalueTransport1D_1G.lua
test/modules/LinearBoltzmannSolvers/Transport_Keigen/utils/QBlock_mesh.lua
test/modules/LinearBoltzmannSolvers/MGDiffusion_Steady/MIPDiffusion3D_3a_DSA_ortho.lua
test/modules/LinearBoltzmannSolvers/MGDiffusion_Steady/MIPDiffusion3D_1b_Ortho.lua

Definition at line 1842 of file lua_functions.c.

◆ chiVolumeMesherSetProperty()

void chi_lua::chiVolumeMesherSetProperty ( int  PropertyIndex,
varying  PropertyValue 
)

Sets a volume mesher property.

Parameters
PropertyIndexint Index of the property to change. See below
PropertyValuevarying Value of the property.

_

PropertyIndex:

FORCE_POLYGONS = PropertyValue:[bool] Forces the 2D Meshing to use polygon cells even if the underlying surface mesh is triangles. Expects a boolean value.
MESH_GLOBAL = PropertyValue:[bool] Generate/Read the full mesh at each location. Expects a boolean value [Default=true].
PARTITION_TYPE = PartitionType. See below.
EXTRUSION_LAYER = PropertyValue:[double,(int),(char)] Adds a layer to the extruder volume mesher if it exists. Expects 1 required parameter, the layer height, followed by 2 optional parameters: number of subdivisions (defaults to 1), and layer id (char)(defaults to nothing). Only supported if partition-type is KBA_STYLE_XY or KBA_STYLE_XYZ.
CUTS_X = Adds a cut at the given x-value. Only supported if partition-type is KBA_STYLE_XY or KBA_STYLE_XYZ.
CUTS_Y = Adds a cut at the given y-value. Only supported if partition-type is KBA_STYLE_XY or KBA_STYLE_XYZ.
CUTS_Z = Adds a cut at the given z-value. Only supported if partition-type is KBA_STYLE_XY or KBA_STYLE_XYZ.
PARTITION_X = PropertyValue:[int] Number of partitions in X. Only supported if partition-type is KBA_STYLE_XY or KBA_STYLE_XYZ.
PARTITION_Y = PropertyValue:[int] Number of partitions in Y. Only supported if partition-type is KBA_STYLE_XY or KBA_STYLE_XYZ.
PARTITION_Z = PropertyValue:[int] Number of partitions in Z. Only supported if partition-type is KBA_STYLE_XY or KBA_STYLE_XYZ.
MATID_FROMLOGICAL = LogicalVolumeHandle:[int],Mat_id:[int], Sense:[bool](Optional, default:true) Sets the material id of cells that meet the sense requirement for the given logical volume.
BNDRYID_FROMLOGICAL = LogicalVolumeHandle:[int],Bndry_name:[string], Sense:[bool](Optional, default:true) Sets the cell boundary id to the specified value for cells that meet the sense requirement for the given logical volume.
MATID_FROM_LUA_FUNCTION = LuaFunctionName:[string]. For each cell, will call a lua function that can change the material id. The lua function must have 4 parameters, the cell's centroid x,y,z values (doubles) and the current cell-material id (int). The function must return a material id. BNDRYID_FROM_LUA_FUNCTION = LuaFunctionName:[string]. For each boundary face, will call a lua function that can change the boundary id. The lua function must have 7 parameters, the face's centroid x,y,z values (doubles), the face's normal x,y,z values (double), and the current face-boundary id (int). The function must return a boundary id.

_

PartitionType

Can be any of the following:

  • KBA_STYLE_XYZ
  • PARMETIS

Usage Examples:

test/framework/chi_mesh/LogicalVolume/lv_rcc_test1.lua
test/framework/chi_mesh/LogicalVolume/lv_boolean_test1.lua
test/modules/CFEM_Diffusion/cDiffusion_2D_3a_analytical_coef.lua
test/modules/CFEM_Diffusion/cDiffusion_2D_2b_RobinBCs.lua
test/modules/CFEM_Diffusion/cDiffusion_2D_3b_analytical_coef2.lua
test/modules/CFEM_Diffusion/cDiffusion_2D_2a_DirBCs.lua
test/modules/CFEM_Diffusion/cDiffusion_2D_1a_linear.lua
test/modules/DFEM_Diffusion/dDiffusion_2D_2a_DirBCs.lua
test/modules/DFEM_Diffusion/dDiffusion_2D_3a_analytical_coef.lua
test/modules/DFEM_Diffusion/dDiffusion_2D_3b_analytical_coef2.lua
test/modules/DFEM_Diffusion/dDiffusion_2D_2b_RobinBCs.lua
test/modules/DFEM_Diffusion/dDiffusion_2D_3c_L2_error_MMS.lua
test/modules/DFEM_Diffusion/dDiffusion_2D_1a_linear.lua
test/modules/Diffusion/Diffusion3D_1Poly_IP.lua
test/modules/Diffusion/Diffusion3D_2Ortho.lua
test/modules/Diffusion/Diffusion3D_3Unstructured_IP.lua
test/modules/Diffusion/Diffusion3D_1Poly.lua
test/modules/Diffusion/Diffusion2D_1Poly.lua
test/modules/Diffusion/Diffusion2D_1Poly_IP.lua
test/modules/Diffusion/Diffusion3D_4VTU.lua
test/modules/Diffusion/Diffusion2D_2Unstructured.lua
test/modules/Diffusion/Diffusion2D_2Unstructured_IP.lua
test/modules/Diffusion/Diffusion3D_3Unstructured.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady_Cyl/Transport2DCyl_1Monoenergetic.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady_Cyl/Transport2DCyl_2Multigroup.lua
test/modules/LinearBoltzmannSolvers/MGDiffusion_KEigen/utils/QBlock_mesh.lua
test/modules/LinearBoltzmannSolvers/Transport_SteadyCBC/Transport2D_1Poly.lua
test/modules/LinearBoltzmannSolvers/Transport_Adjoint/Adjoint2D_3c_response.lua
test/modules/LinearBoltzmannSolvers/Transport_Adjoint/Adjoint2D_1a_forward.lua
test/modules/LinearBoltzmannSolvers/Transport_Adjoint/Adjoint2D_2a_forward.lua
test/modules/LinearBoltzmannSolvers/Transport_Adjoint/Adjoint2D_2b_adjoint.lua
test/modules/LinearBoltzmannSolvers/Transport_Adjoint/Adjoint2D_1b_adjoint.lua
test/modules/LinearBoltzmannSolvers/Transport_Adjoint/Adjoint2D_2c_response.lua
test/modules/LinearBoltzmannSolvers/Transport_Adjoint/Adjoint2D_3a_forward.lua
test/modules/LinearBoltzmannSolvers/Transport_Adjoint/Adjoint2D_3b_adjoint.lua
test/modules/LinearBoltzmannSolvers/Transport_Adjoint/Adjoint2D_1c_response.lua
test/modules/LinearBoltzmannSolvers/Transport_Transient/TransientTransport1D_3.lua
test/modules/LinearBoltzmannSolvers/Transport_Transient/TransientTransport2D_3.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport2D_1Poly_Balance.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport2D_4b_DSA_ortho.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport2D_1Poly_BalanceMG.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport2D_1Poly.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport3D_1a_Extruder.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport2D_4a_DSA_ortho.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport3D_3a_DSA_ortho.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport3D_1Poly_qmom_part1.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport3D_2Unstructured.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport1D_3a_DSA_ortho.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport3D_1Poly_qmom_part2.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport3D_4Cycles1.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport3D_1b_Ortho.lua
test/modules/LinearBoltzmannSolvers/Transport_Steady/Transport3D_1Poly_parmetis.lua
test/modules/LinearBoltzmannSolvers/Transport_Keigen/utils/QBlock_mesh.lua
test/modules/LinearBoltzmannSolvers/MGDiffusion_Steady/MIPDiffusion3D_3a_DSA_ortho.lua

Author
Jan

Definition at line 1770 of file lua_functions.c.

◆ chiVolumeMesherSetupOrthogonalBoundaries()