Transferring Field Data from the Co-Simulation Services to the Client
Use the SMACseGetField function to retrieve an incoming field from
the SIMULIA Co-Simulation Services. The SMACseGetField function takes the following arguments:
iFieldName- Field type of the incoming field.
iRegionName- Region name that the field spans.
iCollectionName- Node or element collection name depending on whether it is a nodal- or
element-based field.
If the collection name is not specified for nodal fields, the field data for all nodes on the region is provided.
iNMembers- Number of members in
iMembers. This argument is reserved for future use.
iMembers- Member list. This argument is reserved for future use.
iTimeStamp- Time the field is to be retrieved. Field values are interpolated between
the previous coupling step and the target time.
The time should be between the previous target time and the current target time.
oAppBuffer- Address of the client’s memory buffer into which to copy field data.
iMaxSizeInBytes- Memory buffer size in bytes.
oMissingMembers- Byte array indicating missing members.
iFieldName, iRegionName, and
iCollectionName identify the subset of the field.
The client must
allocate
a memory buffer for oAppBuffer, such that the SIMULIA Co-Simulation Services can copy the field data to the client’s memory. The maximum size parameter,
iMaxSizeInBytes, ensures that the SIMULIA Co-Simulation Services does not overwrite your memory. The required memory is the product of the number
of members in the collection, the multiplicity of the field type, and the data type
size. For example, assume you have a nodal 3D vector field using double precision.
If there are 20 nodes in the collection, the buffer size needs to be 20 members × 3
values per member × 8 bytes for double precision.
Missing members are nodes or elements for which the mapper neighborhood search failed; therefore, field data cannot be mapped at these locations. Missing member treatment is intended for a small number of failures. Depending on the field type, there are various ways of providing a localized treatment. For example, when mapping displacements, you can choose to interpolate values from neighboring nodes; when mapping fluxes, you can assign a zero value at a local spot without sacrificing global conservation across the interface.
There are several methods of treating missing members:
- If
oMissingMembersis NULL and the Co-Simulation Configuration file does not specify how to treat missing members, an error is issued and the simulation is ended. - If
oMissingMembersis NULL and the Co-Simulation Configuration file specifies how to treat missing members, the appropriate treatment is applied. For more information, see Mapping Specification. - If an
oMissingMembersvector is provided, its entries are set to one to indicate the member is missing members. In this case, a warning is issued and the client is responsible for providing a field value for the missing member.
Example
The following example illustrates the SMACseGetField
function:
:
unsigned int buffSizeInBytes = nInterfaceDof*sizeof(double);
SMACseGetField( "force", "Mesh B", "", mesh_B.getNumNodes(), mesh_B.labels(), t+dT, f_b, buffSizeInBytes, NULL);
: