Meshing with Zapdos

When generating a mesh for a Zapdos input file, the user has several options used regularly by Zapdos developers:

As CUBIT usage is well-documented elsewhere (and isn't open source software), only the first two options will be covered here.

MOOSE MeshGenerator

The MOOSE MeshGenerator system is designed to build flexible and arbitrary meshes in stages. See an example of a MeshGenerator mesh block below:

[Mesh<<<{"href": "../syntax/Mesh/index.html"}>>>]
  [./gmg]
    type = GeneratedMeshGenerator<<<{"description": "Create a line, square, or cube mesh with uniformly spaced or biased elements.", "href": "../source/meshgenerators/GeneratedMeshGenerator.html"}>>>
    dim<<<{"description": "The dimension of the mesh to be generated"}>>> = 3
    xmax<<<{"description": "Upper X Coordinate of the generated mesh"}>>> = 3
    ymax<<<{"description": "Upper Y Coordinate of the generated mesh"}>>> = 3
    zmax<<<{"description": "Upper Z Coordinate of the generated mesh"}>>> = 3
    nx<<<{"description": "Number of elements in the X direction"}>>> = 3
    ny<<<{"description": "Number of elements in the Y direction"}>>> = 3
    nz<<<{"description": "Number of elements in the Z direction"}>>> = 3
  []

  [./central_block]
    type = SubdomainBoundingBoxGenerator<<<{"description": "Changes the subdomain ID of elements either (XOR) inside or outside the specified box to the specified ID.", "href": "../source/meshgenerators/SubdomainBoundingBoxGenerator.html"}>>>
    input<<<{"description": "The mesh we want to modify"}>>> = gmg
    block_id<<<{"description": "Subdomain id to set for inside/outside the bounding box"}>>> = 2
    bottom_left<<<{"description": "The bottom left point (in x,y,z with spaces in-between)."}>>> = '1 1 1'
    top_right<<<{"description": "The bottom left point (in x,y,z with spaces in-between)."}>>> = '2 2 2'
  []

  [./central_boundary]
    type = SideSetsBetweenSubdomainsGenerator<<<{"description": "MeshGenerator that creates a sideset composed of the nodes located between two or more subdomains.", "href": "../source/meshgenerators/SideSetsBetweenSubdomainsGenerator.html"}>>>
    input<<<{"description": "The mesh we want to modify"}>>> = central_block
    primary_block<<<{"description": "The primary set of blocks for which to draw a sideset between"}>>> = 2
    paired_block<<<{"description": "The paired set of blocks for which to draw a sideset between"}>>> = 0
    new_boundary<<<{"description": "The list of boundary names to create on the supplied subdomain"}>>> = 7
  []
[]
(moose/test/tests/meshgenerators/sidesets_between_subdomains_generator/sideset_between_subdomains.i)

This block first creates a 3D cube in gmg using GeneratedMeshGenerator, then feeds that resulting mesh into central_block using the input parameter. SubdomainBoundingBoxGenerator creates rectangular subdomains defined by their bottom leftmost point and their top rightmost point and allows the user to define a block_id identifier for the block (in this case, 2). This output is sent to central_boundary, which uses SideSetsBetweenSubdomainsGenerator to define an interface between the default block created by gmg (block 0), and the new block created by central_block (block 2). The new interface boundary is given it's own ID, 7.

The MeshGenerator system generates a mesh "online", meaning at the beginning of a Zapdos/MOOSE simulation. An "offline" mesh is one that is generated elsewhere using a tool (or the --mesh-only flag when running a Zapdos input file on the command line) and imported into Zapdos using FileMeshGenerator.

Gmsh

Gmsh is an open source 3D finite element mesh generator. Many of the existing input files in the Zapdos test/tests directory require a mesh file of the format fileName.msh. An example of this is shown below:

[Mesh<<<{"href": "../syntax/Mesh/index.html"}>>>]
  [file]
    type = FileMeshGenerator<<<{"description": "Read a mesh from a file.", "href": "../source/meshgenerators/FileMeshGenerator.html"}>>>
    file<<<{"description": "The filename to read."}>>> = 'Lymberopoulos.msh'
  []
[]
(test/tests/Lymberopoulos_rf_discharge/Lymberopoulos_with_argon_metastables.i)

In order to create the requisite .msh file, you must run first download and install Gmsh on your computer. On the command line (first make sure that gmsh is in your system PATH), run the command gmsh -d fileName.geo where d is the dimensionality (1, 2, or 3) of the mesh and fileName.geo is the source file for the mesh. gmsh can be downloaded here. Examples of .msh and .geo files can also be found in the test/tests subdirectories.