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

Thomas Witkowski's avatar
Thomas Witkowski committed
54
55
    static void destroyFeSpaces();

56
57
58
59
60
61
62
63
#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
64
    /// Destructor.
65
    ~FiniteElemSpace();
66
67
    
    FiniteElemSpace& operator=(const FiniteElemSpace& feSpace);
68

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

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

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

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

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

99
100
    int calcMemoryUsage();

101
    static void clear();
102
103
104
105
106

    /// 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);
107
108
  
  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
109
110
    /// 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_