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
36
37

namespace AMDiS {

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

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

52
53
54
55
56
57
58
59
#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
60
    /// Destructor.
61
    ~FiniteElemSpace();
62
63
    
    FiniteElemSpace& operator=(const FiniteElemSpace& feSpace);
64

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

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

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

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

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

95
96
    int calcMemoryUsage();

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

  protected:
110
    /// Name of this FiniteElemSpace.
111
    const std::string name;
112

113
    /// DOFAdmin corresponding to this FiniteElemSpace.
114
115
    DOFAdmin* admin;

116
    /// Set of BasisFunction of this FiniteElemSpace.
117
118
    const BasisFunction* basFcts;

119
    /// The Mesh this FiniteElemSpace belongs to.
120
    Mesh* mesh;
121

122
    ///
123
    static std::vector<FiniteElemSpace*> feSpaces;
124
125
126
127
128
  };

}

#endif  // !_FINITEELEMSPACE_H_