NEMoSys  0.63.0
A modular, extensible resource with robust automated mesh generation, mesh quality analysis, adaptive mesh refinement, and data transfer between arbitrary meshes.
NucMesh

NucMesh allows users to define and manipulate objects to be meshed. The module was originally developed for complex-pattern geometries composed from arrays of simple-shaped objects. The module allows users to prescribe the mesh per shapes (or groups of shape). Note that only two- dimensional meshes, and three-dimensional meshes generated by extruding a two-dimensional mesh are currently supported. It is particularly well suited for situations involving patterns made up of simple concentric geometric shapes.

The user guide provides several tutorials covering the capabilities of NucMesh, including complete input files.

NucMesh JSON Template

{
    "Program Type": "NucMesh Generation",
    "Mesh File Options": {
        "Output Mesh File": "output_mesh",
    },
    "NucMesh Options": {
        "Saved Objects": [
            {
                "Name": 
                "Type":
                ...
            }
        ],
        "Shapes": [
            {
                "Type":
                ...
            }
        ],
        "Extrude": []
    }
}

The "Output Mesh File" gives the resultant mesh name. The file extension used will indicate to NucMesh which format should be used to create the mesh. Supported format types are VTK's unstructured grid (.vtu/.vtk), Omega_h mesh (.osh), and Exodus II (.exo/.e).

Shapes

Shapes are the primitive objects that make up the geometries in NucMesh. There are two primitive classes of shapes: Circles And Polys and Circles. Both represent a set of concentric circles and/or polygons. Each “ring” of a concentric shape can have distinct mesh types and region names.

Circles And Polys

The Circles And Polys shape represents a set of concentric circles and/or regular polygons, where the polygons must each have the same number of sides. They are specified by the value of Type being Circles And Polys, and require specifying a Number of Sides integer, a Rings array, and, optionally, a Center. Each ring represents a set of concentric shapes, with geometric faces created by cutting shapes with smaller radii from ones with larger radii. The number of concentric shapes in one Circles And Polys is unbounded.

  • Number of Sides: Gives the number of sides for any polygons that will be specified. It is not possible to nest polygons with differing numbers of sides.
  • Center: Specifies the center of the shape with three ( [x, y, z] ) or five ( [x, y, z, R, \(\theta\)] ) parameters. If five parameters are specified, the [x, y, z] values are assumed to be the coordinates of the rotation center. Optional; if not specified, the local center [0, 0, 0] will be used.
  • Rings: Provides an array that contains the shape types and their associated parameters. Required for "Circles" and "Circles and Polys".
    • Shape Type: Specifies whether the shape is "Circle" or "Poly". Required.
    • Radius: Gives the radius of the shape. For polygons, this is the radius of the circumscribing circle. Required.
    • Mesh: Specifies the mesh parameters. Required.
      • Type: Specifies the mesh type for the shape: "T" for triangular, "S" for structured, and "Q" for quadrilateral. The "S" type should not be used in the innermost shape. Required.
      • Number of Elems: For "S" type meshes, a non-zero integer pair [r, c] must be specified to define the number of elements in the radial and circumferential directions of the shape. Required for "S" type meshes. Contiguous "S" type concentric shapes must have the same number of circumferential elements. Note that the number provided is for half the shape.
    • Rotation: Gives the number of degrees the shape should rotate. By default, polygons are oriented so that the lowest edge is parallel to the x-axis. Optional.
    • Material: Specifies the material name as a string. This adds the mesh elements within the ring to a material zone; all material zones with the same name are treated as one material. Optional.
    • Sideset: Specifies the sideset name as a string. Outer edges of a ring can be assigned to a sideset; all mesh edges created from curves assigned the same name are treated as one sideset. Optional.
circlesInPoly.png
Circles And Polys objects for polygons with 3, 4, and 6 sides.

Circles

The Circles shape, effectively a special case of the Circles And Polys shape type, represents a set of concentric circles. The are specified by the value of Type being Circles, and requires specifying a Rings array, and, optionally, a Center.

  • Center: Specifies the center of the circle with three ( [x, y, z] ) or five ( [x, y, z, R, \(\theta\)] ) parameters. If five parameters are specified, the [x, y, z] values are assumed to be the coordinates of the rotation center. Optional; if not specified, the local center [0, 0, 0] will be used.
  • Rings: Provides an array that contains the circle parameters. Note that circles should be listed in order of increasing size. Required
    • Radius: Gives the radius of the circle. Required.
    • Mesh: Specifies the mesh parameters. Required.
      • Type: Specifies the mesh type for the circle: "T" for triangular, "S" for structured, and "Q" for quadrilateral. The "S" type should not be used in the innermost circle. Required.
      • Number of Elems: For "S" type meshes, a non-zero integer pair [r, c] must be specified to define the number of elements in the radial and circumferential directions of the circle. Required for "S" type meshes. Contiguous "S" type concentric circles must have the same number of circumferential elements. Note that the number provided is for half the circle–for 10 circumferential elements, set the second integer to 5.
    • Material: Specifies the material name as a string. This adds the mesh elements within the ring to a material zone; all material zones with the same name are treated as one material. Optional.
    • Sideset: Specifies the sideset name as a string. Outer edges of a ring can be assigned to a sideset; all mesh edges created from curves assigned the same name are treated as one sideset. Optional.
concentricCircle.png
Concentric circle mesh with structured quads in the red, green, and blue regions. The red region has 32 circumferential elements while the green and blue regions have 16.

Arrays

Array objects are used to repeat shapes spatially with specific patterns. There are three array types:

  • Rectangular: specifies a number of objects in the x and y directions and the pitch in each direction.
  • Polar: specifies a number of objects set a certain distance from a given center.
  • Hexagonal: specifies a number of objects in a hexagonal shape

Each array type has a Shapes entry, which takes a list (a JSON array) of shapes (the same values as allowed in the NucMesh Options Shapes entry) as well as a Pattern entry, which defines how the shapes are arranged by referring to the zero-indexed entries in the array's Shapes list. Each array type also has an optional center. Array shape types are not aware of the center of their subshapes and simply perform translations defined by the pattern, then translate the entire array by the values given in Center.

Note
When arrays are used with polygons, care must be taken when defining the space between polygons. For such objects, the space will be assigned between the centers of the circles that would circumscribe those polygons.

Rectangular Arrays

The "Rectangular Array" makes a grid of shapes. It requires specifying a Grid Distance, the distance between adjacent shapes in the grid, a Shapes list, and a Pattern.

  • Center: Specifies the center of the array with three ( [x, y, z] ) or five ( [x, y, z, R, \(\theta\)] ) parameters. If five parameters are specified, the [x, y, z] values are assumed to be the coordinates of the rotation center. Optional; if not specified, the local center [0, 0, 0] will be used.
  • Grid Distance: Gives the [x and y] distances between centers of objects in the grid. Required.
  • Pattern: Describes the array's pattern, as an array of arrays, using the shapes listed. Shapes are indicated by their position in the "Shapes" list, starting from 0. Required.
  • Shapes: Lists the shapes that will be used in the array For empty spaces, use the keyword null. Shapes may be specified here, or saved objects may be used. Required.

Polar Arrays

Polar Arrays allow the user to create a polar (circular) arrangement of shapes. Polar arrays require specifying a Radius, a Start Angle, an End Angle, a Shapes list, and a Pattern. Optionally, a Polar Array can also specify Rotate with Array, which specifies whether subshapes should be rotated as well as translated and has a default value of false, and a Center.

  • Center: Specifies the center of the array with three ( [x, y, z] ) or five ( [x, y, z, R, \(\theta\)] ) parameters. If five parameters are specified, the [x, y, z] values are assumed to be the coordinates of the rotation center. Optional; if not specified, the local center [0, 0, 0] will be used.
  • Radius: Sets radius from the center of the array. Required.
  • Start Angle: Sets the angle (in degrees, measured counterclockwise from the positive x-axis) at which the array should start. Required.
  • End Angle: Sets the angle (in degrees, measured counterclockwise from the positive x-axis) at which the array should end. For a full circle, this can be set to the same value as the Start Angle.Note that this will not place an object at the end angle; see the note below. Required.
  • Rotate with Array: If true, orientation of shapes will rotate according to their angular position. Optional.
  • Pattern: Describes the array's pattern as an array. Shapes are indicated by their position in the "Shapes" list, starting from 0. Required.
  • Shapes: The shapes or group of shapes to be used in the array. For empty spaces, use the keyword null. Shapes may be specified here, or saved objects may be used. Required.
Note
Polar arrays are designed with full circles in mind. Objects within an array will be \(\frac{end\ angle - start\ angle}{number\ of\ shapes}\) degrees apart. This is done so that if a complete circle is specified, there is no overlap between the first and final objects. However, if only a partial arc is to be specified, the user should determine the end angle carefully so that objects are placed as expected. For example, if a user wants three circle objects at 0, 45, and 90 degrees, then the appropriate end angle can be calculated as \((degrees\ apart)(number\ of\ shapes) + start\ angle = (45)(3)+0 = 135\).
polarArray5.png
Polar array with two concentric rings of eight Circle objects.
polarArrayRotate.png
Arrays showing the two options for Rotate with Array; false on the left, true on the right.

Hexagonal Arrays

Hexagonal arrays are used to construct a hexagonal pattern of shapes. Hexagonal arrays require specifying a Grid Distance, a Shapes list, and a Pattern. Optionally, a Hexagonal Array can also specify a Center.

  • Center: Specifies the center of the array with three ( [x, y, z] ) or five ( [x, y, z, R, \(\theta\)] ) parameters. If five parameters are specified, the [x, y, z] values are assumed to be the coordinates of the rotation center. Optional; if not specified, the local center [0, 0, 0] will be used.
  • Grid Distance: Gives the distance between centers of objects in the grid. Required. Note that this distance is a single value, as opposed to the [x, y] grid distance used in rectangular arrays.
  • Pattern: Describes the array's pattern as an array of arrays. Shapes are indicated by their position in the "Shapes" list, starting from 0. Required.
  • Shapes: The shapes or group of shapes to be used in the array. For empty spaces, use the keyword null. Shapes may be specified here, or saved objects may be used. Required.

Saved Objects

NucMesh allows the user to name and save frequently used objects by including them in the "Saved Objects" section with an additional parameters, "Name". Saved/aliased objects can be re-used by their name.

Each entry in the Saved Objects list is a shape, with the same specification as the NucMesh Options Shapes list and the additional requirement of a string-valued Name. Other shapes (whether in the Shapes list, as a subshape in some array shape, or even subsequent shapes in the Saved Objects list) can then refer to the shape by using the Saved Object key, with the value being the string given by Name. Note also that, when using a saved object, shape parameters can be overridden (with the exception of the Shapes list of a saved array object).

Extrusion

The 2D geometry and mesh which is created by the Shapes section can be extruded along the z-axis. The optional Extrude section of NucMesh Options takes a list of numbers that describe the heights of each mesh layer. Material zones and sidesets will also be extruded. Additionally, sidesets named Top and Bottom will be created, representing the new and original mesh faces, respectively.