Creating and Registering Interface Regions
An interface region defines a physics domain being coupled. The domains are required to be co-located. For a two-way co-simulation, the source and target regions must have the same extent for proper spatial mapping. For one-way co-simulation or a sequential simulation, the source region can be larger than the target region.
You can couple domains as follows:
- through discrete locations,
- through a common interface surface adjoining two non-overlapping domains, and
- over the entire domain if the physics domain overlap.
At the API level, a mesh defines an interface region. A mesh has a reference name; it contains one or more node collections and zero or more element collections. Here, the term “element” refers to either a surface facet for a surface region or an element for a volume region. Element collections are used to group different element classes. Generally, a mesh has a single node collection and one or more element collections. It can have zero element collections when the interface region consists of discrete points only.
To define an interface region, you must do the following:
- create a mesh object;
- add one or more node collections;
- add element collections, if required; and
- register the mesh.
Creating a Mesh Object
Use the SMACseCreateMesh function to create a mesh object. The
SMACseCreateMesh function takes the following argument:
iReferenceName- Interface mesh reference name.
The name is case sensitive and must correspond to the region name specified in the Co-Simulation Configuration file.
SMACseCreateMesh returns an opaque handle to the mesh object.
The mesh object handle is used to add node and element collections and to
register the mesh object.
When you embed the SIMULIA Co-Simulation Services in parallel mode, call SMACseCreateMesh on any compute rank
that contains part of the interface region.
Adding Node Collections
A mesh typically has at least one node collection. However, you can define multiple node collections to provide further grouping (for example, grouping nodes per numerical domains present on a compute rank). Do not register any node collection when importing a remote mesh (see Importing a Remote Client's Mesh).
A node collection has a reference name and is associated with a spatial dimensionality. It also contains a list of node labels and coordinates. The node labels must be unique across all compute ranks.
Use the SMACseAddNodeCollection function to add a node
collection. The SMACseAddNodeCollection function takes the
following arguments:
iMesh- Mesh handle.
iCollectionRefName- Node collection reference name.
The reference name must be unique name within the region.
iRegionDim-
SMACseDim_2dfor a two-dimensional mesh,SMACseDim_3dfor a three-dimensional mesh, orSMACseDim_Axifor an axisymmetric mesh.
iNNodes- Number of nodes in the collection.
iLabels- Vector containing the node labels.
iCoordinates- Vector containing the nodal coordinates. The coordinates are listed consecutively for every node in the collection given the spatial dimensionality.
Node labels can start with zero and can be any unsigned integer value. You can provide the node labels in any order; they do not need to be defined consecutively. However, the node labels must be unique for the entire model. Nodal fields are exchanged in the order in which the nodes are defined in the collection.
When you embed the SIMULIA Co-Simulation Services in parallel mode, call SMACseAddNodeCollection if the
compute rank contains nodes belonging to the mesh. You should register only the
nodes belonging to the compute rank.
Adding Element Collections
A mesh consists of zero or more element collections. If no element collections are specified, the mesh definition consists purely of nodes without element topology information; this represents discrete points. For surface coupling, each surface facet is represented as an element. Do not register any element collections when importing a remote mesh (see Importing a Remote Client's Mesh).
An element collection has a reference name; it is associated with an element class and refers to a node collection. It also contains a list of element labels and connectivity data. The connectivity data is in terms of the node labels provided in the node collection. In most cases, multiple element collections might refer to a single node collection. The element labels must be unique across all compute ranks.
Use the SMACseAddElemCollection function to add an element
collection. The SMACseAddElemCollection function takes the
following arguments:
iMesh- Mesh handle.
iElemCollectionRefName- Element collection reference name.
iNodeCollectionRefName- Node collection reference name associated with the element collection.
iElemClass- String defining the element class/type defined in Table 1.
Table 1. Element class. String Description SMACseSurfTopo_Line22D Surface facet, 2-node line SMACseSurfTopo_Line32D Surface facet, 3-node quadratic line SMACseSurfTopo_Tri33D Surface facet, 3-node linear triangle SMACseSurfTopo_Tri63D Surface facet, 6-node quadratic triangle SMACseSurfTopo_Quad43D Surface facet, 4-node linear quadrilateral SMACseSurfTopo_Quad83D Surface facet, 8-node quadratic quadrilateral SMACseVolTopo_Tri32D Volume element, 3-node linear triangle SMACseVolTopo_Tri62D Volume element, 6-node quadratic triangle SMACseVolTopo_Quad42D Volume element, 4-node linear quadrilateral SMACseVolTopo_Quad82D Volume element, 8-node quadratic quadrilateral SMACseVolTopo_Tet43D Volume element, 4-node linear tetrahedron SMACseVolTopo_Tet103D Volume element, 10-node quadratic tetrahedron SMACseVolTopo_Pyr5 3D Volume element, 5-node pyramid SMACseVolTopo_Wedge63D Volume element, 6-node linear wedge SMACseVolTopo_Wedge153D Volume element, 15-node quadratic wedge SMACseVolTopo_Hex83D Volume element, 8-node linear hexahedron SMACseVolTopo_Hex203D Volume element, 20-node quadratic hexahedron iNElems- Number of elements in the collection.
iLabels- Vector containing the element labels.
The element labels must be unique across a compute domain.
iConnectivity- Vector containing the nodal connectivity data for each element in the collection.
Specify one element collection for each element class.
To provide further grouping to access field data, you can define multiple element collections for the same element class. The element class name identifies the number of nodes per element. Element connectivity data is specified by the node labels; it is provided as the connectivity data for the first element, followed by the second element, etc. For each element, the node labels are provided in the order illustrated in Figure 1, Figure 2, and Figure 3. For surface elements (facets) the connectivity defines the outward normal according to the right-hand rule convention. The outward normals of each subsystem model must point toward each other for the mapper to distinguish between the top and bottom faces of membrane and shell elements.



When you embed the SIMULIA Co-Simulation Services in parallel mode, each element is unique to a compute domain; therefore, each
element can exist only on one compute domain. Call the
SMACseAddElemCollection function if the interface region
contains elements on the compute rank.
Registering the Mesh Object
When all node and element collections are added to the mesh object, use the
SMACseRegisterMesh function to register the mesh. The
SMACseRegisterMesh function takes the following argument:
iRegion- The name of the region.
At this stage, you cannot modify the mesh object anymore. However, you can define and register additional interface regions.
When you embed the SIMULIA Co-Simulation Services in parallel mode, register the mesh on each compute domain that processes part of the interface.
Example
The following example illustrates how to create and register an interface region:
//
// Create a mesh object with name “Mesh A”
//
SMACseMesh* mesh = SMACseCreateMesh("Mesh A");
//
// Add a node collection with nodes numbered sequentially between 1 - 9.
// Node labels do not need to be defined in any particular order.
//
unsigned int numNodes = 9;
unsigned int labels[ ] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
double coords[ ] = { 0., 0., 0.,
1., 0., 0.,
2., 0., 0.,
2., 1., 0.,
0., 2., 0.,
1., 2., 0.,
2., 2., 0. };
SMACseAddNodeCollection( mesh, "myNodeCollection", SMACseDim_3d, numNodes, labels, coords);
//
// Add element collections with 2 quads and 4 triangles
// Element labels do not have to be defined in any particular order.
unsigned int elemLabels_1 [ ] = { 1, 5 };
unsigned int elemLabels_2 [ ] = { 3, 4, 10, 7 };
unsigned int connectivity_1[ ] = { 2, 5, 4, 1,
5, 8, 7, 4 };
unsigned int connectivity_2[ ] = { 2, 3, 5,
3, 6, 5,
5, 6, 8,
6, 9, 8 };
SMACseAddElemCollection( mesh, "MyQuads", "MyNodeCollection",
"SMACseSurfTopo_Quad4", 2, elemLabels_1, connectivity_1);
SMACseAddElemCollection( mesh, "MyTriangles", "MyNodeCollection",
"SMACseSurfTopo_Tri3", 4, elemLabels_2, connectivity_2);
//
// Register Mesh
//
SMACseRegisterMesh( mesh );