Cubit Mesh#

Geometry#

We construct the geometry following the same general procedure that we used with Gmsh. We first create points, then connect the points into curves, and finally connect the curves into surfaces. Fig. 89 shows the geometry and variables names of the vertices and curves.

Geometry created in Cubit for generating the mesh.

Fig. 89 Geometry created in Cubit for generating the finite-element mesh. The names of the verties and curves match the ones we use in the Cubit journal files.#

Meshing using Journal Scripts#

We use Cubit journal files mesh_tri.jou and mesh_quad.jou to generate triangular and quadrilateral meshes, respectively. Both of these journal files make use of the geometry.jou, gradient.jou, and createbc.jou files for creating the geometry, setting the discretization size, and tagging boundary conditions, faults, and materials, respectively. We use the Cubit graphical user interface to play the Journal files.

We create a brick, extracting a midsurface from it, and then splitting the remaining surface with an extended fault and a splay surface. We then assign names to the surfaces, curves, and important vertices that we use when we specify the mesh sizing information and defining blocks and nodesets.

Warning

In this example we do not use IDless journaling in Cubit. The ids of some of the geometric entities might be depend on which version of Cubit you are using. The differences are most likely to occur when we split curves. For example, the section of the curve labeled c_topo might be labeled c_topo@A in your version with similar permutations for other curve sections.

Once you have run the mesh_tri.jou journal file to construct the geometry and generate the mesh, you will have a Exodus-II file (mesh_tri.exo). These are NetCDF files, and they can be loaded into ParaView. This can be done by either running ParaView and loading the file, or using the script provided in the viz directory. For example, if ParaView is in your path, you can run the following command:

Listing 129 Start paraview and run the viz/plot_mesh.py Python script to view the mesh with triangular cells.#
paraview --script=viz/plot_mesh.py
Finite-element mesh with triangular cells generated by Cubit.

Fig. 90 Finite-element mesh with triangular cells generated by Cubit.#