We use a refinement algorithm due to Bänsch, who has developed a corresponding algorithm in 3D, too. A similar approach by Rivara is restricted to the 2D case.
In this algorithm the refining / coarsening a triangulation means to reverse previously executed refinements. Therefore it is necessary to store additional information for each triangle. To accomplish this we enlarge the FE2D data structure by the structure REFINE2D (see 6.3.3). This structure includes the flag to refine or to coarse with possible values 0, G_REFINE or G_COARSE, the refine edge and the level of refining. In the macro triangulation, where no triangle is refined, edge is the local number of the edge to refine (in general the longest edge) in each triangle and level is zero. In the situations that can be coarsened all triangles must have the same refinement level. Using this additional information in the REFINE2D structure a unique coarsening is possible.
In this context it is important to mention, that . Before refining the triangulation the first time, it is also possible to set the refine edge. In general the initialization is done by using "set-rfc-field-send" which allocates the memory for the REFINE2D structure and sets the refine edge on the longest one.
"refine-global-send" bisects all triangles (including the in general necessary correction) in the triangulation according to their refinement edge. If no refine structure is set, "set-rfc-field-send" is executed at first.
"refine-local" bisects all with G_REFINE in the refine flag marked triangles according to their refinement edge and makes the necessary corrections. The refine flag in the REFINE2D structure is not initialized after the local refining and can be used again or must be reset to 0 before starting "refine-local" again.
"coarsen-global-send" coarsens all refined triangles if possible. In most cases "coarsen-global-send" must be used several times to reverse all previously executed refinements.
"coarsen-local" coarsens all with G_COARSE in the refine flag marked triangles if they are the result of a previously executed refinement. The refine flag in the REFINE2D structure is not initialized after the local coarsening and can be used again or must be reset to 0 before starting "coarsen-local" again.
If boundary segments are refined which belong to a boundary curve stored in the structure BND_FUNCTION, "fit-bndfunctions-send" (see 6.3.3.4) is executed automatically.
To handle the data on the triangulation there are four functions, which may be defined by setting the corresponding function pointer in the ADAPT2D structure. They are executed during the refining and coarsening:
Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.