GeMA
The GeMA main application
Meshes

In GeMA, the domain discretization is represented by Mesh objects. Since different simulation methods require different kinds of domain discretizations, the GeMA framework takes a hierarchical approach for defining meshes. The basic mesh type is just a collection of points, each tied to a spatial position and possibly associated with several user-specified data sets. On top of this definition comes a cell mesh, where a cell defines a partition of the global spatial domain and is represented in 1D by a segment, in 2D by an area and in 3D by a volume. Cells can also be associated with their own data sets. On another level, each cell can be tied to interpolation functions and integration rules and called an element, giving support to the Finite Element Method.

gemaMeshTypesReduced.png
Some mesh types

To support this diversity of types, real meshes are created by plugin objects. Consider an element mesh. Its inputs might include the set of node coordinates and the set of mesh triangles. A node mesh with points organized on a regular grid, on the other hand, just needs the number of grid columns and lines, along with their spacing to be definied, so each plugin comes with its particular set of required and optional fields, as described in each mesh plugin documentation.

The figure below summarizes the entity types that can be associated with cell / element meshes. Although other mesh types can be associated with a different set of entities, those are in general a subset of this one. The only entity common to all mesh types is the node. The entities are:

gemaMeshEntities.png
Cell / element mesh entities
  • Nodes: Nodes define the set of cell vertices. Their coordinate dimension is a mesh characteristic. For the framework, there is no limitation on node dimension: 1D, 2D and 3D are equally supported, provided that all nodes in a mesh have the same dimension (physics plugins, on the other hand, might limit their support to a fixed dimension set);
  • Ghost nodes: Some discretization techniques, like the XFEM method, require the ability to (dynamically) create additional element points where the solution field will be calculated (additional degrees of freedom, not tied to the element nodes). Those points are not part of the element geometry definition and are called ghost nodes in GeMA. Their existence adds support for sub-parametric elements;
  • Cells: Cells / elements are formed by an ordered set of nodes. Their number and organization should follow the schema provided by the cell / element type. The framework supports several types of 2D and 3D elements, both linear and quadratic. A mesh can contain cells with different types. See the documentation in the Element types page for a list of the available cells / elements and their node, edge and face orders;
  • Node sets: Node sets are named groups of nodes belonging to the mesh, and each mesh can contain several of them. Node sets can contain regular nodes, ghost nodes or both. They are particularly handy when imposing boundary conditions;
  • Cell groups: Mesh cells can be organized in groups, and each mesh can contain several of them. Groups can have heterogeneous elements and a cell can belong to multiple groups;
  • Borders: Mesh borders are formed by sets of cell edges in 2D or sets of cell faces in 3D. They are particularly handy when imposing boundary conditions. Each edge or face is identified by a tuple composed of the cell id and the index of the edge/face in the cell;
  • Integration rules: Integration rules are used to define the location and weight of integration points (also called Gauss points) associated with each mesh element type. There are two kinds of integration rules: element rules and border rules. The latter is used to specify integrating schemas for boundary conditions. A mesh can be associated with several integration rule sets.

Any number of user defined data sets can be associated with mesh nodes, cells and Gauss (integration) points. Those data sets can store scalar, vector or matrix values and can also support user functions that will be executed any time that a value is requested. Data sets can also support storing history data, i.e. store a limited (or unlimited) number of past states for each data. The figures below illustrate this concepts.

gemaAttributes.png
Mesh attributes
gemaAttributeHistory.png
Attribute history

Mesh nodes can be associated with state variables and node attributes. Mesh cells with cell attributes and property set lines. Element integration points can be associated with Gauss attributes. Although the syntax for associating data to nodes, cells and Gauss points is plugin dependent, the set of options defining a data set is unique and documented in the Data options page.

A simulation can contain several meshes, each created by the Mesh keyword. Data can be transfered between meshes with the set of methods provided by the mesh mapping process. Mesh data can be printed and saved to files with the set of methods provided by the io process.

Example

local meshNodes = {
-- X, Y
{ 0.0, 0.0},
{10.0, 0.0},
{20.0, 0.0},
{ 0.0, 10.0},
{10.0, 10.0},
{20.0, 10.0},
}
local meshQuad4Elements = {
{ 1, 2, 5, 4},
{ 2, 3, 6, 5},
}
local meshElements = {
{ cellType = 'quad4', cellList = meshQuad4Elements },
}
Mesh
{
-- General mesh attributes
id = 'meshName',
typeName = 'GemaMesh.elem',
description = 'Simple mesh with two quad elements',
-- Mesh dimensions
coordinateDim = 2,
-- State vars stored in this mesh (per node)
stateVars = {'u'},
-- Mesh node coordinates
nodeData = meshNodes,
-- Element data
cellData = meshElements,
}

Fields

Field (*) Description Type Required
id The mesh name. String Yes
typeName The name of the plugin that will be used to create this mesh. If the plugin exports several object types, the plugin name should be followed by a dot followed by the requested mesh object type. String Yes
Examples: typeName = "GemaMesh.elem", typeName = "RegularGridMesh"
description A description of the mesh purpose. String No

(*) Mesh objects are implemented by plugins, so the remaining set of attributes shown on the above example are particular to the plugin and their documentation can be found on the GemaMesh plugin documentation.