Dune Core Modules (2.9.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
5#ifndef DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI1_CUBE3D_LOCALINTERPOLATION_HH
6#define DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI1_CUBE3D_LOCALINTERPOLATION_HH
7
8#include <vector>
9
11
12namespace Dune
13{
14
24 template<class LB>
26 {
27
28 public:
31 {
32 sign0 = sign1 = sign2 = sign3 = sign4 = sign5 = 1.0;
33 }
34
41 {
42 sign0 = sign1 = sign2 = sign3 = sign4 = sign5 = 1.0;
43 if (s & 1)
44 {
45 sign0 = -1.0;
46 }
47 if (s & 2)
48 {
49 sign1 = -1.0;
50 }
51 if (s & 4)
52 {
53 sign2 = -1.0;
54 }
55 if (s & 8)
56 {
57 sign3 = -1.0;
58 }
59 if (s & 16)
60 {
61 sign4 = -1.0;
62 }
63 if (s & 32)
64 {
65 sign5 = -1.0;
66 }
67
68 n0[0] = -1.0;
69 n0[1] = 0.0;
70 n0[2] = 0.0;
71 n1[0] = 1.0;
72 n1[1] = 0.0;
73 n1[2] = 0.0;
74 n2[0] = 0.0;
75 n2[1] = -1.0;
76 n2[2] = 0.0;
77 n3[0] = 0.0;
78 n3[1] = 1.0;
79 n3[2] = 0.0;
80 n4[0] = 0.0;
81 n4[1] = 0.0;
82 n4[2] = -1.0;
83 n5[0] = 0.0;
84 n5[1] = 0.0;
85 n5[2] = 1.0;
86 }
87
96 template<typename F, typename C>
97 void interpolate(const F& f, std::vector<C>& out) const
98 {
99 // f gives v*outer normal at a point on the edge!
100 typedef typename LB::Traits::RangeFieldType Scalar;
101 //typedef typename LB::Traits::DomainFieldType Vector;
102
103 DUNE_THROW( NotImplemented, "Interpolation for BDM1Cube3D finite elements is not implemented." );
104
105 out.resize(18);
106 fill(out.begin(), out.end(), 0.0);
107
108 const int qOrder = 4;
110
111 for (typename QuadratureRule<Scalar,1>::const_iterator it = rule.begin();
112 it != rule.end(); ++it)
113 {
114 // TODO: write interpolation
115 }
116 }
117
118 private:
119 typename LB::Traits::RangeFieldType sign0, sign1, sign2, sign3, sign4, sign5;
120 typename LB::Traits::DomainType n0, n1, n2, n3, n4, n5;
121 };
122} // end namespace Dune
123#endif // DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI1_CUBE3D_LOCALINTERPOLATION_HH
First order Brezzi-Douglas-Marini shape functions on the reference hexahedron.
Definition: brezzidouglasmarini1cube3dlocalinterpolation.hh:26
BDM1Cube3DLocalInterpolation()
Standard constructor.
Definition: brezzidouglasmarini1cube3dlocalinterpolation.hh:30
void interpolate(const F &f, std::vector< C > &out) const
Interpolate a given function with shape functions.
Definition: brezzidouglasmarini1cube3dlocalinterpolation.hh:97
BDM1Cube3DLocalInterpolation(unsigned int s)
Make set number s, where 0 <= s < 64.
Definition: brezzidouglasmarini1cube3dlocalinterpolation.hh:40
Default exception for dummy implementations.
Definition: exceptions.hh:263
Abstract base class for quadrature rules.
Definition: quadraturerules.hh:154
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:266
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
constexpr GeometryType cube(unsigned int dim)
Returns a GeometryType representing a hypercube of dimension dim.
Definition: type.hh:472
typename Overloads::ScalarType< std::decay_t< V > >::type Scalar
Element type of some SIMD type.
Definition: interface.hh:235
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)