Dune Core Modules (2.6.0)

brezzidouglasmarini1cube3dlocalinterpolation.hh
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI1_CUBE3D_LOCALINTERPOLATION_HH
4 #define DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI1_CUBE3D_LOCALINTERPOLATION_HH
5 
6 #include <vector>
7 
9 
10 namespace Dune
11 {
12 
22  template<class LB>
24  {
25 
26  public:
29  {
30  sign0 = sign1 = sign2 = sign3 = sign4 = sign5 = 1.0;
31  }
32 
39  {
40  sign0 = sign1 = sign2 = sign3 = sign4 = sign5 = 1.0;
41  if (s & 1)
42  {
43  sign0 = -1.0;
44  }
45  if (s & 2)
46  {
47  sign1 = -1.0;
48  }
49  if (s & 4)
50  {
51  sign2 = -1.0;
52  }
53  if (s & 8)
54  {
55  sign3 = -1.0;
56  }
57  if (s & 16)
58  {
59  sign4 = -1.0;
60  }
61  if (s & 32)
62  {
63  sign5 = -1.0;
64  }
65 
66  n0[0] = -1.0;
67  n0[1] = 0.0;
68  n0[2] = 0.0;
69  n1[0] = 1.0;
70  n1[1] = 0.0;
71  n1[2] = 0.0;
72  n2[0] = 0.0;
73  n2[1] = -1.0;
74  n2[2] = 0.0;
75  n3[0] = 0.0;
76  n3[1] = 1.0;
77  n3[2] = 0.0;
78  n4[0] = 0.0;
79  n4[1] = 0.0;
80  n4[2] = -1.0;
81  n5[0] = 0.0;
82  n5[1] = 0.0;
83  n5[2] = 1.0;
84  }
85 
94  template<typename F, typename C>
95  void interpolate(const F& f, std::vector<C>& out) const
96  {
97  // f gives v*outer normal at a point on the edge!
98  typedef typename LB::Traits::RangeFieldType Scalar;
99  //typedef typename LB::Traits::DomainFieldType Vector;
100  typename F::Traits::RangeType y;
101 
102  DUNE_THROW( NotImplemented, "Interpolation for BDM1Cube3D finite elements is not implemented." );
103 
104  out.resize(18);
105  fill(out.begin(), out.end(), 0.0);
106 
107  const int qOrder = 4;
109 
110  for (typename QuadratureRule<Scalar,1>::const_iterator it = rule.begin();
111  it != rule.end(); ++it)
112  {
113  // TODO: write interpolation
114  }
115  }
116 
117  private:
118  typename LB::Traits::RangeFieldType sign0, sign1, sign2, sign3, sign4, sign5;
119  typename LB::Traits::DomainType n0, n1, n2, n3, n4, n5;
120  };
121 } // end namespace Dune
122 #endif // DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI1_CUBE3D_LOCALINTERPOLATION_HH
First order Brezzi-Douglas-Marini shape functions on the reference hexahedron.
Definition: brezzidouglasmarini1cube3dlocalinterpolation.hh:24
BDM1Cube3DLocalInterpolation()
Standard constructor.
Definition: brezzidouglasmarini1cube3dlocalinterpolation.hh:28
void interpolate(const F &f, std::vector< C > &out) const
Interpolate a given function with shape functions.
Definition: brezzidouglasmarini1cube3dlocalinterpolation.hh:95
BDM1Cube3DLocalInterpolation(unsigned int s)
Make set number s, where 0 <= s < 64.
Definition: brezzidouglasmarini1cube3dlocalinterpolation.hh:38
Default exception for dummy implementations.
Definition: exceptions.hh:261
Abstract base class for quadrature rules.
Definition: quadraturerules.hh:97
static const QuadratureRule & rule(const GeometryType &t, int p, QuadratureType::Enum qt=QuadratureType::GaussLegendre)
select the appropriate QuadratureRule for GeometryType t and order p
Definition: quadraturerules.hh:225
#define DUNE_THROW(E, m)
Definition: exceptions.hh:216
constexpr GeometryType cube(unsigned int dim)
Returns a GeometryType representing a hypercube of dimension dim.
Definition: type.hh:705
Dune namespace.
Definition: alignedallocator.hh:10
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 4, 22:30, 2024)