3#ifndef DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI1_CUBE3D_LOCALBASIS_HH
4#define DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI1_CUBE3D_LOCALBASIS_HH
13#include "../../common/localbasis.hh"
27 template<
class D,
class R>
39 for (
size_t i=0; i<6; i++)
50 for (
size_t i=0; i<6; i++)
51 sign_[i] = s[i] ? -1.0 : 1.0;
67 std::vector<typename Traits::RangeType>& out)
const
71 out[0][0] = sign_[0] * (in[0] - 1.0);
74 out[1][0] = sign_[1] * in[0];
78 out[2][1] = sign_[2] * (in[1] - 1.0);
81 out[3][1] = sign_[3] * in[1];
85 out[4][2] = sign_[4] * (in[2] - 1.0);
88 out[5][2] = sign_[5] * in[2];
89 out[6][0] = 6.0 * in[0] * in[1] - 3 * in[0]-6 * in[1] + 3.0;
90 out[6][1] = -3.0 * in[1] * in[1] + 3 * in[1];
92 out[7][0] = -6.0 * in[0] * in[1] + 3 * in[0];
93 out[7][1] = 3.0 * in[1] * in[1] - 3 * in[1];
95 out[8][0] = 3.0 * in[0] * in[0] - 3 * in[0];
96 out[8][1] = -6.0 * in[0] * in[1] + 3 * in[1]+6 * in[0]-3.0;
98 out[9][0] = -3.0 * in[0] * in[0] + 3 * in[0];
99 out[9][1] = 6.0 * in[0] * in[1] - 3 * in[1];
101 out[10][0] = -3.0 * in[0] * in[0] + 3 * in[0];
103 out[10][2] = 6.0 * in[0] * in[2]-6 * in[0]-3 * in[2] + 3.0;
104 out[11][0] = 3.0 * in[0] * in[0]-3 * in[0];
106 out[11][2] = -6.0 * in[0] * in[2] + 3 * in[2];
107 out[12][0] = -6.0 * in[0] * in[2]+6 * in[2] + 3 * in[0]-3.0;
109 out[12][2] = 3.0 * in[2] * in[2]-3 * in[2];
110 out[13][0] = -3 * in[0]+6 * in[0] * in[2];
112 out[13][2] = -3.0 * in[2] * in[2] + 3 * in[2];
114 out[14][1] = 6.0 * in[1] * in[2]-3 * in[1]-6 * in[2] + 3.0;
115 out[14][2] = -3 * in[2] * in[2] + 3 * in[2];
117 out[15][1] = -6.0 * in[1] * in[2] + 3 * in[1];
118 out[15][2] = 3.0 * in[2] * in[2]-3 * in[2];
120 out[16][1] = 3.0 * in[1] * in[1]-3 * in[1];
121 out[16][2] = -6.0 * in[1] * in[2] + 3 * in[2]+6 * in[1]-3.0;
123 out[17][1] = -3.0 * in[1] * in[1] + 3 * in[1];
124 out[17][2] = 6.0 * in[1] * in[2] - 3.0 * in[2];
134 std::vector<typename Traits::JacobianType>& out)
const
138 out[0][0] = { sign_[0], 0, 0};
139 out[0][1] = { 0, 0, 0};
140 out[0][2] = { 0, 0, 0};
142 out[1][0] = { sign_[1], 0, 0};
143 out[1][1] = { 0, 0, 0};
144 out[1][2] = { 0, 0, 0};
146 out[2][0] = { 0, 0, 0};
147 out[2][1] = { 0, sign_[2], 0};
148 out[2][2] = { 0, 0, 0};
150 out[3][0] = { 0, 0, 0};
151 out[3][1] = { 0, sign_[3], 0};
152 out[3][2] = { 0, 0, 0};
154 out[4][0] = { 0, 0, 0};
155 out[4][1] = { 0, 0, 0};
156 out[4][2] = { 0, 0, sign_[4]};
158 out[5][0] = { 0, 0, 0};
159 out[5][1] = { 0, 0, 0};
160 out[5][2] = { 0, 0, sign_[5]};
162 out[6][0] = { 6*in[1]-3, 6*in[0]-6, 0};
163 out[6][1] = { 0, -6*in[1]+3, 0};
164 out[6][2] = { 0, 0, 0};
166 out[7][0] = {-6*in[1]+3, -6*in[0], 0};
167 out[7][1] = { 0, 6*in[1]-3, 0};
168 out[7][2] = { 0, 0, 0};
170 out[8][0] = { 6*in[0]-3, 0, 0};
171 out[8][1] = {-6*in[1]+6, -6*in[0]+3, 0};
172 out[8][2] = { 0, 0, 0};
174 out[9][0] = {-6*in[0]+3, 0, 0};
175 out[9][1] = { 6*in[1], 6*in[0]-3, 0};
176 out[9][2] = { 0, 0, 0};
178 out[10][0] = {-6*in[0]+3, 0, 0};
179 out[10][1] = { 0, 0, 0};
180 out[10][2] = { 6*in[2]-6, 0, 6*in[0]-3};
182 out[11][0] = { 6*in[0]-3, 0, 0};
183 out[11][1] = { 0, 0, 0};
184 out[11][2] = { -6*in[2], 0, -6*in[0]+3};
186 out[12][0] = {-6*in[2]+3, 0, -6*in[0]+6};
187 out[12][1] = { 0, 0, 0};
188 out[12][2] = { 0, 0, 6*in[2]-3};
190 out[13][0] = { 6*in[2]-3, 0, 6*in[0]};
191 out[13][1] = { 0, 0, 0};
192 out[13][2] = { 0, 0, -6*in[2]+3};
194 out[14][0] = { 0, 0, 0};
195 out[14][1] = { 0, 6*in[2]-3, 6*in[1]-6};
196 out[14][2] = { 0, 0, -6*in[2]+3};
198 out[15][0] = { 0, 0, 0};
199 out[15][1] = { 0, -6*in[2]+3, -6*in[1]};
200 out[15][2] = { 0, 0, 6*in[2]-3};
202 out[16][0] = { 0, 0, 0};
203 out[16][1] = { 0, 6*in[1]-3, 0};
204 out[16][2] = { 0, -6*in[2]+6, -6*in[1]+3};
206 out[17][0] = { 0, 0, 0};
207 out[17][1] = { 0, -6*in[1]+3, 0};
208 out[17][2] = { 0, 6*in[2], 6*in[1]-3};
214 std::vector<typename Traits::RangeType>& out)
const
217 if (totalOrder == 0) {
219 }
else if (totalOrder == 1) {
221 auto const direction = std::distance(
order.begin(), std::find(
order.begin(),
order.end(), 1));
225 out[0] = { sign_[0], 0, 0};
226 out[1] = { sign_[1], 0, 0};
231 out[6] = { 6*in[1]-3, 0, 0};
232 out[7] = {-6*in[1]+3, 0, 0};
233 out[8] = { 6*in[0]-3, -6*in[1]+6, 0};
234 out[9] = {-6*in[0]+3, 6*in[1], 0};
235 out[10] = {-6*in[0]+3, 0, 6*in[2]-6};
236 out[11] = { 6*in[0]-3, 0, -6*in[2]};
237 out[12] = {-6*in[2]+3, 0, 0};
238 out[13] = { 6*in[2]-3, 0, 0};
239 out[14] = { 0, 0, 0};
240 out[15] = { 0, 0, 0};
241 out[16] = { 0, 0, 0};
242 out[17] = { 0, 0, 0};
247 out[2] = { 0, sign_[2], 0};
248 out[3] = { 0, sign_[3], 0};
251 out[6] = { 6*in[0]-6, -6*in[1]+3, 0};
252 out[7] = { -6*in[0], 6*in[1]-3, 0};
253 out[8] = { 0, -6*in[0]+3, 0};
254 out[9] = { 0, 6*in[0]-3, 0};
255 out[10] = { 0, 0, 0};
256 out[11] = { 0, 0, 0};
257 out[12] = { 0, 0, 0};
258 out[13] = { 0, 0, 0};
259 out[14] = { 0, 6*in[2]-3, 0};
260 out[15] = { 0, -6*in[2]+3, 0};
261 out[16] = { 0, 6*in[1]-3, -6*in[2]+6};
262 out[17] = { 0, -6*in[1]+3, 6*in[2]};
269 out[4] = { 0, 0, sign_[4]};
270 out[5] = { 0, 0, sign_[5]};
275 out[10] = { 0, 0, 6*in[0]-3};
276 out[11] = { 0, 0, -6*in[0]+3};
277 out[12] = {-6*in[0]+6, 0, 6*in[2]-3};
278 out[13] = { 6*in[0], 0, -6*in[2]+3};
279 out[14] = { 0, 6*in[1]-6, -6*in[2]+3};
280 out[15] = { 0, -6*in[1], 6*in[2]-3};
281 out[16] = { 0, 0, -6*in[1]+3};
282 out[17] = { 0, 0, 6*in[1]-3};
299 std::array<R,6> sign_;
First order Brezzi-Douglas-Marini shape functions on the reference hexahedron.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:29
void evaluateJacobian(const typename Traits::DomainType &in, std::vector< typename Traits::JacobianType > &out) const
Evaluate Jacobian of all shape functions.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:133
void evaluateFunction(const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:66
void partial(const std::array< unsigned int, 3 > &order, const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate partial derivatives of all shape functions.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:212
BDM1Cube3DLocalBasis(std::bitset< 6 > s)
Make set number s, where 0 <= s < 64.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:48
unsigned int order() const
Polynomial order of the shape functions.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:293
BDM1Cube3DLocalBasis()
Standard constructor.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:37
unsigned int size() const
number of shape functions
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:55
A dense n x m matrix.
Definition: fmatrix.hh:69
Default exception for dummy implementations.
Definition: exceptions.hh:261
Default exception class for range errors.
Definition: exceptions.hh:252
Implements a matrix constructed from a given type representing a field and compile-time given number ...
#define DUNE_THROW(E, m)
Definition: exceptions.hh:216
constexpr T accumulate(Range &&range, T value, F &&f)
Accumulate values.
Definition: hybridutilities.hh:289
Dune namespace.
Definition: alignedallocator.hh:11
Type traits for LocalBasisVirtualInterface.
Definition: localbasis.hh:32
D DomainType
domain type
Definition: localbasis.hh:43