Download User Manual Version 2.0 - P-arch

Transcript
adjacent to a node).
Starting from VVER we built the array VSID(2,NSID) which contain for every side
of the mesh indices of its ending points (NSID is the number of sides in the grid). To
make an ecient search of an edge, given the indices of the ending points, sides in VSID
are specied in such a way that VSID(1,i)<VSID(2,i), and VSID(1,i),i=1,NV is ordered in increasing order. A simple hash table can be realized using a vector of pointers
(PVSID(NV)) to VSID, that contains for every vertex the pointer to the rst side to which
this vertex belong. Search of a side s of given ending point v1 and v2 can be made ordering index v1 and v2 in such a way that v1 < v2 and search of v2 is started from the
position VSID(2,PVSID(v1)). Disposing of VSID and PVSID, SEL(3,NEL) which contains
for every triangle indices of its three sides, can be easily calculated. Lastly, EEL(3,NEL)
which gives for every element indices of adjacent elements, is calculated.
With these structure at our disposal, the renement procedure does not present great
diculties because as already mentioned new nodes are added to the queue of the array
coordinates XV and indices of new triangles to the queue of the VEL array.
The procedure of de-renement is a little more complicated because, generally, when
vertices and triangles are eliminated, holes are created in the structures which describe
the triangulation. To avoid such a problem we have adopted a de-renement procedure
that, every time it is executed, re-builds the mesh, starting from the background mesh,
excluding those elements marked to be de-rened. In this way the same structures and
procedures used for the renement can be used also in the de-renement part of the code.
In order to be able to re-build the mesh one has to know exactly its \history", that
is for every element which does not belong to the background mesh one has to know of
which element it is son, and eventually of which element it is the father. Data structures
more suitable to store such information is tree. In our code this structure, called HISTORY,
is a vector of integers where the beginning of every renement step is labeled by a zero.
Renement operations are listed sequentially in HISTORY storing indices of the elements
created. The end of the re-renement step, that is eventually the beginning of another,
is labeled by a zero. Since a given element can be divided either in a standard way (four
elements) or in a green way (two elements), these last case is distinguished storing indices
of the new elements with negative sign (etype). The major drawback of this procedure is
that when re-building the mesh, dierent indices, in the old and new mesh, can be given
to the same triangle.
To avoid this problem we conceived a procedure of identication of the elements that
on the basis of an integer permits us to locate the position and the relatives with the other
elements. In fact, since the background grid is never modied, all the NELI elements of
the initial grid can be indexed in a unique way. At the end of the rst step of renement,
since a single triangle can generate only four, two or zero new triangles, the mesh can
have at maximum 4NELI elements. It is possible then to identify in a unique way every
triangle created (rst level triangles) dividing a triangle of the background grid (zero level
triangles) assigning to it a number between NELI+1 and 5NELI. Similar considerations
64