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

Thomas Witkowski's avatar
Thomas Witkowski committed
52
    /// Destructor.
53
    ~FiniteElemSpace();
54
55
    
    FiniteElemSpace& operator=(const FiniteElemSpace& feSpace);
56

Thomas Witkowski's avatar
Thomas Witkowski committed
57
    /// Returns \ref name.
58
59
    inline std::string getName() const 
    { 
60
      return name;
61
    }
62

Thomas Witkowski's avatar
Thomas Witkowski committed
63
    /// Returns \ref admin.
64
65
    inline DOFAdmin* getAdmin() const 
    { 
66
      return admin;
67
    }
68

Thomas Witkowski's avatar
Thomas Witkowski committed
69
    /// Set a new DOF admin.
70
71
    inline void setAdmin(DOFAdmin* a) 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
72
73
74
75
      admin = a;
    }

    /// Returns \ref basFcts
76
77
    inline const BasisFunction* getBasisFcts() const 
    { 
78
      return basFcts;
79
    }
80

Thomas Witkowski's avatar
Thomas Witkowski committed
81
    /// Returns \ref mesh
82
83
    inline Mesh* getMesh() const 
    { 
84
      return mesh; 
85
    }
86

87
88
    int calcMemoryUsage();

89
    static void clear();
90
91
92
93
94
95
  
  protected:
    /** \brief
     * Constructs a FiniteElemSpace with name name_ and the given DOFAdmin,
     * BasisFunction and Mesh.
     */
96
    FiniteElemSpace(DOFAdmin* admin,
97
98
		    const BasisFunction* basisFcts, 
		    Mesh* mesh,
Thomas Witkowski's avatar
Thomas Witkowski committed
99
		    std::string name = "");
100
101

  protected:
102
    /// Name of this FiniteElemSpace.
103
    const std::string name;
104

105
    /// DOFAdmin corresponding to this FiniteElemSpace.
106
107
    DOFAdmin* admin;

108
    /// Set of BasisFunction of this FiniteElemSpace.
109
110
    const BasisFunction* basFcts;

111
    /// The Mesh this FiniteElemSpace belongs to.
112
    Mesh* mesh;
113

114
    ///
115
    static std::vector<FiniteElemSpace*> feSpaces;
116
117
118
119
120
  };

}

#endif  // !_FINITEELEMSPACE_H_