dune-localfunctions
2.11
Toggle main menu visibility
Loading...
Searching...
No Matches
dune
localfunctions
brezzidouglasmarini
brezzidouglasmarini1cube3d
brezzidouglasmarini1cube3dlocalinterpolation.hh
Go to the documentation of this file.
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 © 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
10
#include <dune/geometry/quadraturerules.hh>
11
12
namespace
Dune
13
{
14
24
template
<
class
LB>
25
class
BDM1Cube3DLocalInterpolation
26
{
27
28
public
:
30
BDM1Cube3DLocalInterpolation
()
31
{
32
sign0 = sign1 = sign2 = sign3 = sign4 = sign5 = 1.0;
33
}
34
40
BDM1Cube3DLocalInterpolation
(
unsigned
int
s)
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
std::fill(out.begin(), out.end(), 0.0);
107
108
const
int
qOrder = 4;
109
const
QuadratureRule<Scalar,1>& rule = QuadratureRules<Scalar,1>::rule(GeometryTypes::cube(1), qOrder);
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
Dune
Definition
bdfmcube.hh:18
Dune::BDM1Cube3DLocalInterpolation::BDM1Cube3DLocalInterpolation
BDM1Cube3DLocalInterpolation()
Standard constructor.
Definition
brezzidouglasmarini1cube3dlocalinterpolation.hh:30
Dune::BDM1Cube3DLocalInterpolation::interpolate
void interpolate(const F &f, std::vector< C > &out) const
Interpolate a given function with shape functions.
Definition
brezzidouglasmarini1cube3dlocalinterpolation.hh:97
Dune::BDM1Cube3DLocalInterpolation::BDM1Cube3DLocalInterpolation
BDM1Cube3DLocalInterpolation(unsigned int s)
Make set number s, where 0 <= s < 64.
Definition
brezzidouglasmarini1cube3dlocalinterpolation.hh:40
Generated by
1.17.0