FiniteElemSpace.h 3.48 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
// ============================================================================
// ==                                                                        ==
// == 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>
31
#include "AMDiS_fwd.h"
32
33
34
35
36
37
38
39
40
41
42
43

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
   */
  class FiniteElemSpace
  {
  public:
49
    /// Create an empty fe space.
50
51
    FiniteElemSpace();

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

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

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

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

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

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

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

88
89
    int calcMemoryUsage();

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

  protected:
103
    /// Name of this FiniteElemSpace.
104
    const std::string name;
105

106
    /// DOFAdmin corresponding to this FiniteElemSpace.
107
108
    DOFAdmin* admin;

109
    /// Set of BasisFunction of this FiniteElemSpace.
110
111
    const BasisFunction* basFcts;

112
    /// The Mesh this FiniteElemSpace belongs to.
113
    Mesh* mesh;
114

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

}

#endif  // !_FINITEELEMSPACE_H_