FiniteElemSpace.h 3.36 KB
Newer Older
1
2
3
4
5
6
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
7
// ==  TU Dresden                                                            ==
8
// ==                                                                        ==
9
10
11
// ==  Institut fr Wissenschaftliches Rechnen                               ==
// ==  Zellescher Weg 12-14                                                  ==
// ==  01069 Dresden                                                         ==
12
13
14
15
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
16
// ==  https://gforge.zih.tu-dresden.de/projects/amdis/                      ==
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// ==                                                                        ==
// ============================================================================

/** \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

namespace AMDiS {

  /** \ingroup FEMSpace
   * \brief
37
   * A FiniteElemSpace is a triple of a DOFAdmin and a set of BasisFunction on a mesh.
38
39
40
41
   */
  class FiniteElemSpace
  {
  public:
42
    /// Create an empty fe space.
43
44
    FiniteElemSpace();

45
    ///
46
    static FiniteElemSpace *provideFeSpace(DOFAdmin *admin,
47
					   const BasisFunction *basFcts,
48
					   Mesh *mesh,
49
					   std::string name = "");
50

Thomas Witkowski's avatar
Thomas Witkowski committed
51
    /// Destructor.
52
    ~FiniteElemSpace();
53
54
    
    FiniteElemSpace& operator=(const FiniteElemSpace& feSpace);
55

Thomas Witkowski's avatar
Thomas Witkowski committed
56
    /// Returns \ref name.
57
58
    inline std::string getName() const 
    { 
59
      return name;
60
    }
61

Thomas Witkowski's avatar
Thomas Witkowski committed
62
    /// Returns \ref admin.
63
64
    inline DOFAdmin* getAdmin() const 
    { 
65
      return admin;
66
    }
67

Thomas Witkowski's avatar
Thomas Witkowski committed
68
    /// Set a new DOF admin.
69
70
    inline void setAdmin(DOFAdmin* a) 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
71
72
73
74
      admin = a;
    }

    /// Returns \ref basFcts
75
76
    inline const BasisFunction* getBasisFcts() const 
    { 
77
      return basFcts;
78
    }
79

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

86
87
    int calcMemoryUsage();

88
    static void clear();
89
90
91
92
93
94
  
  protected:
    /** \brief
     * Constructs a FiniteElemSpace with name name_ and the given DOFAdmin,
     * BasisFunction and Mesh.
     */
95
    FiniteElemSpace(DOFAdmin* admin,
96
97
		    const BasisFunction* basisFcts, 
		    Mesh* mesh,
Thomas Witkowski's avatar
Thomas Witkowski committed
98
		    std::string name = "");
99
100

  protected:
101
    /// Name of this FiniteElemSpace.
102
    const std::string name;
103

104
    /// DOFAdmin corresponding to this FiniteElemSpace.
105
106
    DOFAdmin* admin;

107
    /// Set of BasisFunction of this FiniteElemSpace.
108
109
    const BasisFunction* basFcts;

110
    /// The Mesh this FiniteElemSpace belongs to.
111
    Mesh* mesh;
112

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

}

#endif  // !_FINITEELEMSPACE_H_