Chi-Tech
|
Consider an example of using a predeveloped mesh as shown in Figure 1 below.
The first step in this process is to create a chi_mesh::MeshHandler for all subsequent meshing operations. This will also serve as a global subspace for other meshing objects that will be added.
We next import a surface mesh (chi_mesh::SurfaceMesh) that will define our problem. Solvers will directly operate on predefined meshes.
The next step is to break up the boundaries of this mesh into edges that we can assign to boundaries. We first collect loops of edges, which are lists of connected edges. We then split these loops by angle into further loops. Finally we assign each fine-grained loop to a chi_mesh::LineMesh object that can be added to a chi_mesh::Boundary type.
Next we create a chi_mesh::Region object to which we are going to add boundaries. We can add a boundary for each chi_mesh::LineMesh and each chi_mesh::SurfaceMesh.
We now have everything we need to do a Predefined 2D mesh operation. To do this we create a chi_mesh::SurfaceMesher with the type SURFACEMESHER_PREDEFINED as well as a chi_mesh::VolumeMesher with the type VOLUMEMESHER_PREDEFINED2D.
The SURFACEMESHER_PREDEFINED is just a pass-through mesher, in contrast to the SURFACEMESHER_DELAUNAY* type which will re-mesh surfaces. The VOLUMEMESHER_PREDEFINED2D* similarly does not create new mesh elements but at least this instantiates the notion of nodes and cells.