shapeFunction2d.hh

Go to the documentation of this file.
1 
6 #ifndef shapeFunction2d_hh
7 #define shapeFunction2d_hh
8 
9 #include "basics/typedefs.hh"
10 #include "basics/exceptions.hh"
11 #include "space/tmatrix.hh"
12 
13 namespace hp2D {
14 
15  // forward declarations
16  template<class F>
17  class Quad;
18 
19  using concepts::Real;
20 
21  // ******************************************************* ShapeFunction2D **
22 
28  template<typename F>
30  public:
33 
35  uint n(uint i) const {
38  return n_[i]; }
40  void n(uint i, uint value) {
42  n_[i] = value;
43  }
44 
46  uint nq(uint i) const {
49  return nq_[i]; }
51  void nq(uint i, uint value) {
53  nq_[i] = value;
54  }
55 
57  const Real* values(uint i) const {
60  return values_[i]; }
62  void values(uint i, const Real* value) {
64  values_[i] = value;
65  }
66 
68  const Real* abscissas(uint i) const {
71  return abscissas_[i]; }
73  void abscissas(uint i, const Real* value) {
75  abscissas_[i] = value;
76  }
77 
79  const Real* weights(uint i) const {
82  return weights_[i]; }
84  void weights(uint i, const Real* value) {
86  weights_[i] = value;
87  }
89  const concepts::TMatrixBase<F>* T() const { return T_; }
91  void T(const concepts::TMatrixBase<F>* T) { T_ = T; }
96  { usedIdx_ = usedIdx; }
97  private:
98  int n_[2], nq_[2];
99  const F* values_[2];
100  const Real* abscissas_[2], * weights_[2];
103  };
104 
105  // *************************************************** makeShapeFunction2D **
106 
107  template<class F>
110 
111 } // namespace hp2D
112 
113 #endif // shapeFunction2d_hh
const concepts::TColumnTensor< bool, 2 > * usedIdx() const
Returns the used indices (local degrees of freedom)
void T(const concepts::TMatrixBase< F > *T)
Sets the T matrix.
const Real * weights(uint i) const
Returns the weights of the quadrature rule.
const concepts::TMatrixBase< F > * T() const
Returns the T matrix.
uint n(uint i) const
Returns number of shape functions.
void weights(uint i, const Real *value)
Sets the weights of the quadrature rule.
void nq(uint i, uint value)
Sets the number of quadratur points.
const concepts::TMatrixBase< F > * T_
#define conceptsAssert(cond, exc)
Assert that a certain condition is fulfilled.
Definition: exceptions.hh:394
2D hp-FEM for H1-conforming elements.
Collecting the data of a 2D shape function in one class.
uint nq(uint i) const
Returns number of quadratur points.
void abscissas(uint i, const Real *value)
Sets the abscissas of the quadrature rule and the shape functions.
const Real * abscissas_[2]
Exception class for assertions.
Definition: exceptions.hh:258
ShapeFunction2D< F > makeShapeFunction2D(const Quad< F > &quad)
ShapeFunction2D(const ShapeFunction2D< F > &s)
void values(uint i, const Real *value)
Sets the values of the shape functions.
An abstract class for a T matrix.
Definition: element.hh:37
void n(uint i, uint value)
Sets the number of shape functions.
A 2D FEM element: a quad.
Definition: bf_advection.hh:44
const Real * abscissas(uint i) const
Returns the abscissas of the quadrature rule and the shape functions.
void usedIdx(const concepts::TColumnTensor< bool, 2 > *usedIdx)
Sets the used indices (ldof)
const Real * values(uint i) const
Returns the values of the shape functions.
const Real * weights_[2]
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
const concepts::TColumnTensor< bool, 2 > * usedIdx_
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich