Form the sequence of element additions and deletions

GetAddDelSequence is a function defined in birth_death_w.c.

Synopsis:

void GetAddDelSequence(const char *inFileName, int *numDims, int *numSteps, int **theOps, ElemSlab_t **theSlabs)

Formal Arguments:

  • inFileName: [IN] name of input file or NULL if no input file specified
  • numDims: [OUT] the number of spatial and topological dimensions of the mesh
  • numSteps: [OUT] the number of addition/deletion steps
  • theOps: [OUT] array of length numSteps indicating the operation (add=+1,delete=-1)
  • theSlabs: [OUT] array of element slabs, one for each step

Description: This function constructs the sequence of element additions or deletions. It either reads input from a file to construct the sequence or, if no file is specified, generates some default data.

The format of the file is described below…

1
2
3
4
5
6
7
 ndims=<n>
 step +|- +|-<K0>,+|-<K1>,...,+|-<Kn-1>
 step +|- +|-<K0>,+|-<K1>,...,+|-<Kn-1>
 step +|- +|-<K0>,+|-<K1>,...,+|-<Kn-1>
 .
 .
 .

For example, the file

1
2
3
4
5
 ndims=2
 step + +2,+3
 step + +2,+0
 step - +0,-1
 step - -1,+0

creates several steps in the life of a 2 dimensional mesh of quads illustrated in “use case 4-1.gif”. .. figure:: use_case_4-1.gif The mesh depicted in “use case 4-1.gif” is, in fact, the default sequence if no input file is specified.

The “ndims=2” line specifies the fact that the mesh will be 2D. In turn, this means that every “step” line in the file will be a 2-tuple of integers. The only valid values for ndims are 1, 2 and 3. Each step line specifies elements to add or delete. A plus (‘+’) sign immediately after “step” indicates an addition while a minus sign (‘-‘) indicates a deletion. The signs on the entries of the tuples indicate which end of the corresponding axis at which the addition or deletion will occur. The first step line is always an addition. For example, in the above steps, the first step line creates a mesh 2 elements wide extending in the positive ‘x’ direction by three elements high extending in the positive ‘y’ direction from the origin. A +0 or -0 entry means the addition or deletion does not involve elements along this axis.

See Also: