CoarseningManager3d.h 3.75 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  crystal growth group                                                  ==
// ==                                                                        ==
// ==  Stiftung caesar                                                       ==
// ==  Ludwig-Erhard-Allee 2                                                 ==
// ==  53175 Bonn                                                            ==
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  http://www.caesar.de/cg/AMDiS                                         ==
// ==                                                                        ==
// ============================================================================

/** \file CoarseningManager3d.h */

#ifndef AMDIS_COARSENINGMANAGER_3D_H
#define AMDIS_COARSENINGMANAGER_3D_H

#include "CoarseningManager.h"
#include "MemoryManager.h"

namespace AMDiS {

  // ============================================================================
  // ===== class CoarseningManager3d ============================================
  // ============================================================================

  /** \ingroup Adaption 
   * \brief
   * Implements a CoarseningManager for 3-dimensional meshes.
   */
  class CoarseningManager3d : public CoarseningManager
  {
  public:
    MEMORY_MANAGED(CoarseningManager3d);

    /** \brief
     * Calls base class constructor and checks dimension of mesh. 
     */
46
    CoarseningManager3d() : CoarseningManager() {};
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90

    /** \brief
     * destructor
     */
    virtual ~CoarseningManager3d() {};

  protected:
    /** \brief
     * Implements CoarseningManager::coarsenFunction
     */
    int coarsenFunction(ElInfo *el_info);

    /** \brief
     * Coarsens a single Tetrahedron of the coarsening patch. DOFs
     * in the interior of the element are removed; DOFs for higher order
     * at the boundary or the coarsening patch still belong to 
     * the parent. Do not remove them form the mesh!!!                  
     */
    void coarsenTetrahedron(RCNeighbourList *coarsenList, int index);

    /** \brief
     * Gets the patch for coarsening starting on element    
     * el_info->el in direction of neighbour [3-dir]; returns 1 if a boundary
     * reached and 0 if we come back to the starting element.         
     * We complete the loop also in the case of a incompatible 
     * coarsening patch since then all marks of patch elements are reset by    
     * coarsenPatch() and this minimizes calls of traverseNeighbour();     
     * if we reach a boundary while looping around the edge we loop back to    
     * the starting element before we return                        
     */         
    bool getCoarsenPatch(ElInfo* el_info, DegreeOfFreedom *edge[2],
			 int dir, RCNeighbourList* coarsenList, int *n_neigh);

    /** \brief
     * First rebuild the DOFs on the parents then do restriction
     * of data (if possible) and finally coarsen the patch elements
     */
    void coarsenPatch(RCNeighbourList *coarsenList, int n_neigh, int bound);
    
  };

}

#endif // AMDIS_COARSENINGMANAGER_3D_H