7 \subsection figure1 Figure 1: EntitySequences For One SequenceData
8 \image html figures/figure1.jpg
9
10 \ref dg-figures "List of Figures"
11
12The <I>SequenceData</I> class manages as set of arrays of per-entity values. Each
13<I>SequenceData</I> has a start and end handle denoting the block of entities for which
14the arrays contain data. The arrays managed by a <I>SequenceData</I> instance are
15divided into three groups:
16
17- Type-specific data (connectivity, coordinates, etc.): zero or more arrays.
18- Adjacency data: zero or one array.
19- Dense tag data: zero or more arrays.
20.
21
22The abstract <I>EntitySequence</I> class is a non-strict subset of a <I>SequenceData</I>.
23It contains a pointer to a <I>SequenceData</I> and the start and end handles to indicate
24the subset of the referenced <I>SequenceData</I>. The <I>EntitySequence</I> class is
25used to represent the regions of valid (or allocated) handles in a <I>SequenceData</I>.
26A <I>SequenceData</I> is expected to be referenced by one or more <I>EntitySequence</I>
27instances.
28
29Initial <I>EntitySequence</I> and <I>SequenceData</I> pairs are typically created in one
30of two configurations. When reading from a file, a <I>SequenceData</I> will be created
31to represent all of a single type of entity contained in a file. As all entries in the <I>SequenceData</I> correspond to valid handles (entities read from the file) a single
32<I>EntitySequence</I> instance corresponding to the entire <I>SequenceData</I> is initially
33created. The second configuration arises when allocating a single entity. If no
34entities have been allocated yet, a new <I>SequenceData</I> must be created to store
35the entity data. It is created with a constant size (e.g. 4k entities). The new
36<I>EntitySequence</I> corresponds to only the first entity in the <I>SequenceData</I>: the
37one allocated entity. As subsequent entities are allocated, the <I>EntitySequence</I>
38is extended to cover more of the corresponding <I>SequenceData</I>.
39
40Concrete subclasses of the <I>EntitySequence</I> class are responsible for representing
41specific types of entities using the array storage provided by the
42<I>SequenceData</I> class. They also handle allocating <I>SequenceData</I> instances with
43appropriate arrays for storing a particular type of entity. Each concrete subclass
44typically provides two constructors corresponding to the two initial allocation
45configurations described in the previous paragraph. <I>EntitySequence</I> implementations
46also provide a split method, which is a type of factory method. It
47modifies the called sequence and creates a new sequence such that the range of
48entities represented by the original sequence is split.
49
50The <I>VertexSequence</I> class provides an <I>EntitySequence</I> for storing vertex
51data. It references a SequenceData containing three arrays of doubles
52for storing the blocked vertex coordinate data. The <I>ElementSequence</I> class
53extends the <I>EntitySequence</I> interface with element-specific functionality. The
54<I>UnstructuredElemSeq</I> class is the concrete implementation of <I>ElementSequence</I>
55used to represent unstructured elements, polygons, and polyhedra. <I>MeshSetSequence</I>
56is the <I>EntitySequence</I> used for storing entity sets.
57
58Each <I>EntitySequence</I> implementation also provides an implementation of
59the values per entity method. This value is used to determine if an existing
60<I>SequenceData</I> that has available entities is suitable for storing a particular
61entity. For example, <I>UnstructuredElemSeq</I> returns the number of nodes per element
62from values per entity. When allocating a new element with a specific
63number of nodes, this value is used to determine if that element may be stored
64in a specific <I>SequenceData</I>. For vertices, this value is always zero. This could
65be changed to the number of coordinates per vertex, allowing representation of
66mixed-dimension data. However, API changes would be required to utilize such
67a feature. Sequences for which the corresponding data cannot be used to store
68new entities (e.g. structured mesh discussed in a later section) will return -1 or