Update the database to the current step

UpdateDatabase is a function defined in exampleutil.c.

Synopsis:

void UpdateDatabase(DbInfo_t *dbInfo, int stepNum, int numSteps, hbool_t do_multifile, int numFields, SAF_Field *theFields)

Formal Arguments:

  • dbInfo: [IN/OUT] database info object (currentFile member can be modified)
  • stepNum: [IN] the current step number in the sequence starting from zero
  • numSteps: [IN] total number of steps to be output (>=1)
  • do_multifile: [IN] boolean to indicate if each step will go to a different supplemental file
  • numFields: [IN] the number of fields on the mesh
  • theFields: [IN] array of length numFields of the field handles

Description: This function performs a number of tasks involved in updating the database to the current step in the sequence of additions and deletions.

Issues: We are forced to create a new state field each time this function is called. This can be viewed as either approrpriate or counter-intuitive depending on how the SAF client views its data. Certainly, since each step in the sequence of additions and deletions changes the mesh, the state output by the client is different on each step. This follows the strict definition of state currently supported by SAF’s states and suites API. However, if the list of fields that are output do not change and only their base-space varies with time, is the state output by the client, in the eyes of the client, really different? We could support this somewhat looser definition of state by instead of associating with each state the fields on the mesh instances, we used fields on the aggregate. However, this would require a minor alteration to our current interpretation of inhomogeneous fields. If interested, we can persue further.

Because the fields from each state are defined on a different base-space, we need to define a new suite for every step in the simulation. This will be corrected when SAF supports sub-setting on suites. Then, we’ll be able to define an inhomogenous field on the suite for its different pieces.

we always write to the 0’th index of this new suite

See Also: