Chi-Tech
|
Mesh generation can be classified into 4 basic levels difficulty.
The grid is an instance of the chi_mesh::MeshContinuum class. It has 3 members of primary interest namely:
We will explain the different elements of a mesh in more detail in sections below but as a quick primer we can say that mesh entities are loaded into chi_mesh::MeshHandler.
You can get the current mesh-handler using:
The computational grid is contained in a chi_mesh::MeshContinuum object which you can obtain with:
If there is no existing grid then one can be created as detailed in
Meshes and mesh operations are all handled under the umbrella of a chi_mesh::MeshHandler. Mesh handlers are loaded onto the global variable chi_meshhandler_stack
and the "current" handler is tracked by another global variable, chi_current_mesh_handler
. If any mesh operation is performed it should push newly created objects to a stack in a handler. The figure below shows a generalized architecture.
Even though we already showed how to obtain the handler, the "current" handler can always be obtained with:
Each mesh-handler is outfitted with one surface mesher and one volume mesher, both initially undefined. The surface meshing step can be thought of a preprocessing step. For those who are used to STAR-CCM+, this step is analogous to the remeshing of a CAD surface into a format more conducive to volume meshing.
There are various types of surface meshers:
Similarly there are also various types of volume meshers:
Surface meshers and volume meshers are assigned to a handler as:
To execute the surface meshers simply do:
A chi_mesh::MeshContinuum object is the business-end of meshes. The execution of a volume mesher ultimately results in the creation of a grid. To obtain a reference to a grid simply execute:
This command will retrieve the latest grid from the latest region within the current mesh handler.
Cells in Chi-Tech are the basic building blocks for mesh-based scientific computing. Some of the mesh types are shown in Figure 2 below and are defined by the enumeration they hold as defined by chi_mesh::CellType. The cell types supported right now are:
Cells live in the local_cells
member of a grid, which is of object type chi_mesh::MeshContinuum::LocalCells, under the auspices of either native_cells
or foreign_cells
. Local cells are guaranteed to be fully defined (i.e. not ghost cells) whilst non-local cells are most likely to be ghost-cells. The fastest way to access a cell is by means of its local id
The local_cells
object also facilitates an iterator.
and also a range based iterator
Alternatively, a more expensive way to access a cell is by means of its global index via the grid's cells
member. This member is a utility object that will search the native_cells
and foreign_cells
for the cell with the associated global id
Because of the search operation it is not recommended to repeatedly access cells by their global ids.