Services for Results Provider

The required services for results provider are designed for performance and to facilitate the development of a results provider.

This page discusses:

The SIMULIA Co-Simulation Services API is defined in SIMULIA Co-Simulation Services API. In addition, you need the add-on services defined by the SMACseApiResultsProvider.h header file. These add-on services reduce the data transfer and simplify the coding effort for the SIMULIA Co-Simulation Services API.

Data Model

The results provider uses the concept of frames. A frame contains field data at a specific time. Frames do not have to be uniformly distributed in time; however, the frames should be ordered in ascending order of time. Different fields can be stored at different frequencies; therefore, the number of frames can vary between field types. As the downstream application progresses in time, the results provider transfers and maps the field data on demand when the analysis time exceeds the previous transferred frames.

putFramePtsForField and putFieldFnWithTime are callback functions that you must provide. The functions are written in terms of your data model, but they are called by theSIMULIA Co-Simulation Services. You must register these callback functions.

Registering the Callback Services

Use the SMACseRegisterSequentialCallback function to register the callback functions putFramePtsForField and putFieldFnWithTime.

The SMACseRegisterSequentialCallback function takes the following arguments:

iUserPutFieldFunctionWithTime
Function pointer to putFieldFnWithTime.
iUserPutFramePointForField
Function pointer to putFramePointForField.

Querying Required Fields

Use the SMACseQueryRequiredFields function to obtain a list of fields required from the results provider. This optional utility helps you retrieve essential information from the specification file without having to parse XML.

The SMACseQueryRequiredFields function takes the following argument:

iSpecFile
File name of the specification file.

The specification file name is defined as a command line argument of the results provider.

The SMACseQueryRequiredFields function returns a constant character string of a comma separated list of fields. The fields are defined by the field type and region name separated with a period. Multiple fields are separated by commas. For example, displacement.Region A, force.Region A, temperature.Region B. You must parse this string and register the regions and fields (see Defining the Interface Model).

Results Provider Control API

Use the SMACseProvideResults function to notify the SIMULIA Co-Simulation Services Director that the results provider is ready to provide field data. The SIMULIA Co-Simulation Services Director then calls putFramePtsForField and putFieldFnWithTime to retrieve required information as the consumer application progresses in time. There is no time advancement in the reader process; therefore, the time-based APIs are meaningless.

The SMACseProvideResults function takes no arguments.

Results Provider Data Services

The SIMULIA Co-Simulation Services call the putFramePointsForField and putFieldFnWithTime callback functions to retrieve data from your results provider. These services are called by the SIMULIA Co-Simulation Services when new information is required to advance the downstream simulation.

The putFramePointsForField function is called by the SIMULIA Co-Simulation Services to retrieve the frame number at the specified time for a particular field or to retrieve the frame number before and after the specified time for a particular field. The SIMULIA Co-Simulation Services send field data only when the before and after frame time points change. The putFramePointsForField function takes the following arguments:

iFieldType
Field type name to retrieve the frame time points.
iMeshName
Region name for which the frame points are retrieved.
iMaxNumberOfFrames
Maximum number of time frames.

The value returned is either 1 or 2.

iTime
Solution time to extract field data.
iUserData
Pointer to user data object.

The userData object is defined by SMACseConnect.

oNumberOfFrames
Number of frame time points the client has for the specified time.

Set this value either to 1 or 2.

oFrameTimePoints
Vector of frame time points.

The putFieldFnWithTime function is called by the SIMULIA Co-Simulation Services to retrieve the field at the requested time point. The putFieldFnWithTimefunction takes the following parameters:

iFieldType
Field type name to be retrieved.
iMeshName
Region name for the field to be retrieved.
iCollectionName
Collection name.

The collection name is either a node or element collection depending on the field position.

iNMembers
Number of members in the collection.
iMembers
List of member identifiers.
iTime
Solution time to extract the field.
iUserData
Pointer to user data object.

The userData object is defined by the SMACseConnect function.

oTargetBuffer
Target buffer to which to write field data.