FiniteElemSpace.h 3.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  crystal growth group                                                  ==
// ==                                                                        ==
// ==  Stiftung caesar                                                       ==
// ==  Ludwig-Erhard-Allee 2                                                 ==
// ==  53175 Bonn                                                            ==
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  http://www.caesar.de/cg/AMDiS                                         ==
// ==                                                                        ==
// ============================================================================

/** \file FiniteElemSpace.h */

/** \defgroup FEMSpace FEMSpace
 * @{ <img src="femspace.png"> @}
 */

#ifndef AMDIS_FINITEELEMSPACE_H
#define AMDIS_FINITEELEMSPACE_H

#include <string>
#include <vector>
#include "MemoryManager.h"

namespace AMDiS {

  class DOFAdmin;
  class BasisFunction;
  class Mesh;

  template<typename T> class DOFVector;
  template<typename T> class DimVec;

  /** \ingroup FEMSpace
   * \brief
44
   * A FiniteElemSpace is a triple of a DOFAdmin and a set of BasisFunction on a mesh.
45
46
47
48
49
50
   */
  class FiniteElemSpace
  {
  public:
    MEMORY_MANAGED(FiniteElemSpace);

51
    /// Create an empty fe space.
52
53
    FiniteElemSpace();

54
    ///
55
    static FiniteElemSpace *provideFESpace(DOFAdmin *admin,
56
					   const BasisFunction *basFcts,
57
					   Mesh *mesh,
58
					   const std::string& name_ = "");
59

Thomas Witkowski's avatar
Thomas Witkowski committed
60
    /// Destructor.
61
    ~FiniteElemSpace();
62
63
    
    FiniteElemSpace& operator=(const FiniteElemSpace& feSpace);
64

Thomas Witkowski's avatar
Thomas Witkowski committed
65
    /// Returns \ref name.
66
    inline std::string getName() const { 
67
      return name;
68
    }
69

Thomas Witkowski's avatar
Thomas Witkowski committed
70
    /// Returns \ref admin.
71
72
    inline DOFAdmin* getAdmin() const { 
      return admin;
73
    }
74

Thomas Witkowski's avatar
Thomas Witkowski committed
75
76
77
78
79
80
    /// Set a new DOF admin.
    inline void setAdmin(DOFAdmin* a) {
      admin = a;
    }

    /// Returns \ref basFcts
81
82
    inline const BasisFunction* getBasisFcts() const { 
      return basFcts;
83
    }
84

Thomas Witkowski's avatar
Thomas Witkowski committed
85
    /// Returns \ref mesh
86
87
    inline Mesh* getMesh() const { 
      return mesh; 
88
    }
89

90
91
    int calcMemoryUsage();

92
    static void clear();
93
94
95
96
97
98
99
100
101
  
  protected:
    /** \brief
     * Constructs a FiniteElemSpace with name name_ and the given DOFAdmin,
     * BasisFunction and Mesh.
     */
    FiniteElemSpace(DOFAdmin* admin_,
		    const BasisFunction* basisFcts, 
		    Mesh* mesh,
102
		    const std::string& name = "");
103
104

  protected:
105
    /// Name of this FiniteElemSpace.
106
    const std::string name;
107

108
    /// DOFAdmin corresponding to this FiniteElemSpace.
109
110
    DOFAdmin* admin;

111
    /// Set of BasisFunction of this FiniteElemSpace.
112
113
    const BasisFunction* basFcts;

114
    /// The Mesh this FiniteElemSpace belongs to.
115
    Mesh* mesh;
116

117
    ///
118
    static std::vector<FiniteElemSpace*> feSpaces;
119
120
121
122
123
  };

}

#endif  // !_FINITEELEMSPACE_H_