FiniteElemSpace.h 3.26 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

    /// Returns for a set of FE spaces that FE space having basis functions with
    /// the highest degree.
    static const FiniteElemSpace* 
    getHighest(vector<const FiniteElemSpace*>& feSpaces);
105
106
107
108
109
110
  
  protected:
    /** \brief
     * Constructs a FiniteElemSpace with name name_ and the given DOFAdmin,
     * BasisFunction and Mesh.
     */
111
    FiniteElemSpace(DOFAdmin* admin,
112
113
		    const BasisFunction* basisFcts, 
		    Mesh* mesh,
114
		    string name = "");
115
116

  protected:
117
    /// Name of this FiniteElemSpace.
118
    const string name;
119

120
    /// DOFAdmin corresponding to this FiniteElemSpace.
121
122
    DOFAdmin* admin;

123
    /// Set of BasisFunction of this FiniteElemSpace.
124
125
    const BasisFunction* basFcts;

126
    /// The Mesh this FiniteElemSpace belongs to.
127
    Mesh* mesh;
128

129
    ///
130
    static vector<FiniteElemSpace*> feSpaces;
131
132
133
134
135
  };

}

#endif  // !_FINITEELEMSPACE_H_