Declare a set

saf_declare_set is a function defined in set.c.

Synopsis:

SAF_Set * saf_declare_set(SAF_ParMode pmode, SAF_Db *db, const char *name, int max_topo_dim, SAF_SilRole role, SAF_ExtendMode extmode, SAF_Set *set)

Formal Arguments:

  • pmode: The parallel mode.
  • db: The database handle in which to create the set.
  • name: The name of the set being declared.
  • max_topo_dim: The topological dimension of the set. If the set will contain sets of different topological dimensions then this must be the maximum topological dimension of any set in the subset inclusion lattice rooted below set.
  • role: The role of the set. Possible values are SAF__SPACE for a spatial set, SAF__TIME for a time-base set, SAF__PARAM for a parameter space set, or SAF__USERD for a user-defined role.
  • extmode: Indicates whether or not the base-space represented by the set is extendible. Possible values are SAF__EXTENDIBLE_TRUE or SAF__EXTENDIBLE_FALSE
  • set: [OUT] Optional memory for link to the newly declared set.

Description: Every set has a maximum topological dimension indicating how the infinity of points that are the set are organized. Are they organized along some curve (1D), surface (2D), volume (3D), etc.? More formally, the maximum topological dimension of a set indicates the maximum rank of local coordinate systems over all neighborhoods of the infinite point set.

Note that a maximum topological dimension of 0 does not mean that the set contains a single point or no points. It means that the set contains only a finite number of points. That is the set is not an infinite point set but a finite one.

Preconditions:

  • pmode must be valid. (low-cost)
  • DATABASE must be a valid handle. (low-cost)
  • name cannot be NULL. (low-cost)
  • name must not begin with a leading ‘@’. (low-cost)
  • max_topo_dim must be positive. (low-cost)
  • role must be SAF__TIME, SAF__SPACE, or SAF__PARAM. (low-cost)
  • If role is SAF__TIME then max_topo_dim must be 1. (low-cost)
  • extmode must be either SAF__EXTENDIBLE_TRUE or SAF__EXTENDIBLE_FALSE. (low-cost)

Return Value: Returns a pointer to a set link on success; null on failure. The set argument is the successful return value, or if set is null, a new set link is allocated for the return.

Issues: Eventually roles specific to the creation of algebraic types and cell types will be added.

I think we can eliminate the role argument here and instead deduce it from the SAF__Quantity associated with the default coordinates for the set. For example, if the default coordinates represent a length quantity, then the role must be SAF__SPACE. If they represent a time quantity, then the role must be SAF__TIME.

See Also:

  • Sets: Introduction for current chapter