FiniteElemSpace.h 3.06 KB
Newer Older
1
2
3
4
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
5
// ==  http://www.amdis-fem.org                                              ==
6
7
// ==                                                                        ==
// ============================================================================
8
9
10
11
12
13
14
15
16
17
18
19
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology 
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.


20
21
22
23
24
25
26
27
28
29
30
31

/** \file FiniteElemSpace.h */

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

#ifndef AMDIS_FINITEELEMSPACE_H
#define AMDIS_FINITEELEMSPACE_H

#include <string>
#include <vector>
32
#include "AMDiS_fwd.h"
33
34
35

namespace AMDiS {

36
37
  using namespace std;

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

48
    ///
49
    static FiniteElemSpace *provideFeSpace(DOFAdmin *admin,
50
					   const BasisFunction *basFcts,
51
					   Mesh *mesh,
52
					   string name = "");
53

54
55
56
57
58
59
60
61
#if DEBUG
    /// For debugging it may be useful to get some FE space for a given mesh at a 
    /// position in code where it is not possible to access the FE space directly. The
    /// function assumes that there is only one FE space defined for the mesh.

    static FiniteElemSpace *provideFeSpace(Mesh *mesh);
#endif

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

Thomas Witkowski's avatar
Thomas Witkowski committed
67
    /// Returns \ref name.
68
    inline string getName() const 
69
    { 
70
      return name;
71
    }
72

Thomas Witkowski's avatar
Thomas Witkowski committed
73
    /// Returns \ref admin.
74
75
    inline DOFAdmin* getAdmin() const 
    { 
76
      return admin;
77
    }
78

Thomas Witkowski's avatar
Thomas Witkowski committed
79
    /// Set a new DOF admin.
80
81
    inline void setAdmin(DOFAdmin* a) 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
82
83
84
85
      admin = a;
    }

    /// Returns \ref basFcts
86
87
    inline const BasisFunction* getBasisFcts() const 
    { 
88
      return basFcts;
89
    }
90

Thomas Witkowski's avatar
Thomas Witkowski committed
91
    /// Returns \ref mesh
92
93
    inline Mesh* getMesh() const 
    { 
94
      return mesh; 
95
    }
96

97
98
    int calcMemoryUsage();

99
    static void clear();
100
101
102
103
104
105
  
  protected:
    /** \brief
     * Constructs a FiniteElemSpace with name name_ and the given DOFAdmin,
     * BasisFunction and Mesh.
     */
106
    FiniteElemSpace(DOFAdmin* admin,
107
108
		    const BasisFunction* basisFcts, 
		    Mesh* mesh,
109
		    string name = "");
110
111

  protected:
112
    /// Name of this FiniteElemSpace.
113
    const string name;
114

115
    /// DOFAdmin corresponding to this FiniteElemSpace.
116
117
    DOFAdmin* admin;

118
    /// Set of BasisFunction of this FiniteElemSpace.
119
120
    const BasisFunction* basFcts;

121
    /// The Mesh this FiniteElemSpace belongs to.
122
    Mesh* mesh;
123

124
    ///
125
    static vector<FiniteElemSpace*> feSpaces;
126
127
128
129
130
  };

}

#endif  // !_FINITEELEMSPACE_H_