Creating a Local Mesh to Represent the Remote Mesh
Use the SMACseCreateMesh function to create a local mesh object (see
Creating a Mesh Object). This mesh
object is used to hold the remote mesh; do not assign any node or element collection
to it. The mesh name used by the client importing the remote mesh can be different
from the remote mesh name; the association between the meshes is done through the
Co-Simulation Configuration
file. You must set the <mapOn> element to
“NOMAP” on the
<connection> element (see <connection> Element).
Use the SMACseRegisterMesh function to register the mesh object (see
Registering the Mesh Object). Then,
define the incoming and outgoing fields (see Creating a Field Type).
Once you register the interface model (see Registering the Interface Model), you can retrieve the remote mesh's node and element topology.
Example
The following example illustrates how to create a local mesh to represent a remote mesh and how to assign incoming and outgoing fields to the local mesh:
// Create local mesh object
SMACseMesh* mesh = SMACseCreateMesh("myMeshName");
// Do NOT define any element and node collections
// Register Mesh
SMACseRegisterMesh( mesh );
// You can now define fields on the mesh
SMACseCreateFieldDefinition( "displacement", SMACseFieldPos_atNode,
SMACseFieldAlgType_Vector3d, SMACseFieldDataType_Double );
SMACseCreateFieldDefinition( "force", SMACseFieldPos_atNode,
SMACseFieldAlgType_Vector3d, SMACseFieldDataType_Double );
// Register Incoming and Outgoing Fields
SMACseRegisterOutgoingField( "force", "myMeshName");
SMACseRegisterIncomingField( "displacement", "myMeshName");
// Register the interface model
SMACseRegisterInterface();