Declare a state group

saf_declare_state_group is a function defined in state.c.

Synopsis:

SAF_StateGrp * saf_declare_state_group(SAF_ParMode pmode, SAF_Db *db, const char *name, SAF_Suite *suite, SAF_Set *mesh_space, SAF_StateTmpl *stmpl, SAF_Quantity *quantity, SAF_Unit *unit, hid_t coord_data_type, SAF_StateGrp *state_grp)

Formal Arguments:

  • pmode: The parallel mode.
  • db: The database in which to declare the new state group.
  • name: The name of this state group.
  • suite: The suite that these states are associated with.
  • mesh_space: The set representing the computational mesh
  • stmpl: A state template that defines the pattern (via a list of field templates) of fields that can be stored in each state.
  • quantity: The quantity associated with the axis of the parametric space. For example, SAF__TIME_QUANTITY.
  • unit: The units associated with the axis of the parametric space.
  • coord_data_type: The data type of the coordinates of the parametric space.
  • state_grp: The returned handle for a state group.

Description: A state group contains all of the states associated with a suite. It contains:

1
2
3
4
5
6
7
8
 - a name
 - pointer to the suite that these states are attached to
 - array of sets that represent the computational meshes associated with each state
 - a coordinate field containing two components
     -- a scalar field whose values are the parametric values (e.g., time values) associated with each state
     -- a field whose values are IDs of the default coordinate fields (the independent variable) of the
        computational mesh associated with each state
 - a field containing IDs of all the fields (dependent variables) attached to the computational mesh at each state

Return Value: Returns a pointer to the new state group on success; null on failure. If the caller supplies a state_grp argument then that becomes the return value, otherwise a new state group link is allocated herein.

Issues: The new implementation of state group supercedes the current concept of a “state field”. A “state field”, as currently implemented, is just one component of a state group. Thus, we can delete all references to SAF__StateFld and add the new type SAF__StateGrp that contains:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 - the name of the state group
 - pointer to the SAF_Suite that the state group is attached to
 - array of pointers to the SAF_Sets that represent the computational meshes associated with each state
 - pointer to a SAF_Field coordinate field containing two components (this field may have to be an indirect field
   if we don't support composite fields with heterogeneous components):
     -- a scalar field whose values are the parametric values (e.g., time values) associated with each state
     -- an indirect field whose values are IDs of the default coordinate fields of the computational mesh
        associated with each state
 - pointer to an indirect SAF_Field containing IDs of all the fields (dependent variables) attached to the
   computational mesh at each state (this indirect field is what is currently a "state field")

See Also:

  • States: Introduction for current chapter