GlobalDOFNumbering.h 2.52 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
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  crystal growth group                                                  ==
// ==                                                                        ==
// ==  Stiftung caesar                                                       ==
// ==  Ludwig-Erhard-Allee 2                                                 ==
// ==  53175 Bonn                                                            ==
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  http://www.caesar.de/cg/AMDiS                                         ==
// ==                                                                        ==
// ============================================================================

/** \file GlobalDOFNumbering.h */

#ifndef AMDIS_GLOBALDOFNUMBERING_H
#define AMDIS_GLOBALDOFNUMBERING_H

#include <map>
#include <vector>
#include "Global.h"
28
#include "AMDiS_fwd.h"
29
30
31
32
33
34
35
36
37
38

namespace AMDiS {

  /** \ingroup Parallel
   * \brief 
   * Creates a global DOF numbering.
   */
  class GlobalDOFNumbering
  {
  public:
39
    /// Constructor
40
41
    GlobalDOFNumbering(std::vector<MeshStructure*> &meshCodes,
		       std::vector< std::vector<DegreeOfFreedom> > &dofCodes,
42
43
		       int dofsPerElement);

44
    /// Returns the local index of rank corresponding to global index.
45
46
    int getLocalIndex(int rank, int globalIndex);

47
    /// Returns the global index corresponing to local index of rank.
48
49
50
    int getGlobalIndex(int rank, int localIndex);

  protected:
51
52
    void handleRecursive(std::vector<MeshStructure*> &meshCodes,
			 std::vector< std::vector<DegreeOfFreedom>::iterator> &it);
53
54

  protected:
55
    std::vector< std::map<DegreeOfFreedom, DegreeOfFreedom> > localToGlobal_;
56

57
    std::vector< std::map<DegreeOfFreedom, DegreeOfFreedom> > globalToLocal_;
58
59
60
61
62
63
64
65
66

    int dofsPerElement_;

    DegreeOfFreedom globalIndexCounter_;
  };

}

#endif