FiniteElemSpace.h 3.16 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/******************************************************************************
 *
 * AMDiS - Adaptive multidimensional simulations
 *
 * Copyright (C) 2013 Dresden University of Technology. All Rights Reserved.
 * Web: https://fusionforge.zih.tu-dresden.de/projects/amdis
 *
 * Authors: 
 * Simon Vey, Thomas Witkowski, Andreas Naumann, Simon Praetorius, et al.
 *
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 *
 * 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
32
33

/** \file FiniteElemSpace.h */

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

#ifndef AMDIS_FINITEELEMSPACE_H
#define AMDIS_FINITEELEMSPACE_H

#include <string>
#include <vector>
34
#include "AMDiS_fwd.h"
35
36
37

namespace AMDiS {

38
39
  using namespace std;

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

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

Thomas Witkowski's avatar
Thomas Witkowski committed
56
57
    static void destroyFeSpaces();

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

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

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

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

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

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

101
102
    int calcMemoryUsage();

103
    static void clear();
104
105
106
107
108

    /// 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);
109
110
  
  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
111
112
    /// Constructs a FiniteElemSpace with name name_ and the given DOFAdmin,
    /// BasisFunction and Mesh.
113
    FiniteElemSpace(DOFAdmin* admin,
114
115
		    const BasisFunction* basisFcts, 
		    Mesh* mesh,
116
		    string name = "");
117
118

  protected:
119
    /// Name of this FiniteElemSpace.
120
    const string name;
121

122
    /// DOFAdmin corresponding to this FiniteElemSpace.
123
124
    DOFAdmin* admin;

125
    /// Set of BasisFunction of this FiniteElemSpace.
126
127
    const BasisFunction* basFcts;

128
    /// The Mesh this FiniteElemSpace belongs to.
129
    Mesh* mesh;
130

131
    ///
132
    static vector<FiniteElemSpace*> feSpaces;
133
134
135
136
137
  };

}

#endif  // !_FINITEELEMSPACE_H_