3#ifndef DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI1_CUBE2D_LOCALBASIS_HH
4#define DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI1_CUBE2D_LOCALBASIS_HH
13#include "../../common/localbasis.hh"
26 template<
class D,
class R>
37 for (
size_t i=0; i<4; i++)
48 for (
size_t i=0; i<4; i++)
49 sign_[i] = s[i] ? -1.0 : 1.0;
65 std::vector<typename Traits::RangeType>& out)
const
69 out[0][0] = sign_[0]*(in[0] - 1.0);
71 out[1][0] = 6.0*in[0]*in[1] - 3.0*in[0]-6*in[1] + 3.0;
72 out[1][1] = -3.0*in[1]*in[1] + 3.0*in[1];
73 out[2][0] = sign_[1]*(in[0]);
75 out[3][0] = -6.0*in[0]*in[1] + 3.0*in[0];
76 out[3][1] = 3.0*in[1]*in[1] - 3.0*in[1];
78 out[4][1] = sign_[2]*(in[1] - 1.0);
79 out[5][0] = 3.0*in[0]*in[0] - 3.0*in[0];
80 out[5][1] = -6.0*in[0]*in[1] + 6.0*in[0] + 3.0*in[1] - 3.0;
82 out[6][1] = sign_[3]*(in[1]);
83 out[7][0] = -3.0*in[0]*in[0] + 3.0*in[0];
84 out[7][1] = 6.0*in[0]*in[1] - 3.0*in[1];
94 std::vector<typename Traits::JacobianType>& out)
const
98 out[0][0][0] = sign_[0];
103 out[1][0][0] = 6.0*in[1] - 3.0;
104 out[1][0][1] = 6.0*in[0] - 6.0;
106 out[1][1][1] = -6.0*in[1] + 3.0;
108 out[2][0][0] = sign_[1];
113 out[3][0][0] = -6.0*in[1] + 3.0;
114 out[3][0][1] = -6.0*in[0];
116 out[3][1][1] = 6.0*in[1] - 3.0;
121 out[4][1][1] = sign_[2];
123 out[5][0][0] = 6.0*in[0] - 3.0;
125 out[5][1][0] = -6.0*in[1] + 6.0;
126 out[5][1][1] = -6.0*in[0] + 3.0;
131 out[6][1][1] = sign_[3];
133 out[7][0][0] = -6.0*in[0] + 3.0;
135 out[7][1][0] = 6.0*in[1];
136 out[7][1][1] = 6.0*in[0] - 3.0;
142 std::vector<typename Traits::RangeType>& out)
const
145 if (totalOrder == 0) {
147 }
else if (totalOrder == 1) {
149 auto const direction = std::distance(
order.begin(), std::find(
order.begin(),
order.end(), 1));
153 out[0][0] = sign_[0];
156 out[1][0] = 6.0*in[1] - 3.0;
159 out[2][0] = sign_[1];
162 out[3][0] = -6.0*in[1] + 3.0;
168 out[5][0] = 6.0*in[0] - 3.0;
169 out[5][1] = -6.0*in[1] + 6.0;
174 out[7][0] = -6.0*in[0] + 3.0;
175 out[7][1] = 6.0*in[1];
181 out[1][0] = 6.0*in[0] - 6.0;
182 out[1][1] = -6.0*in[1] + 3.0;
187 out[3][0] = -6.0*in[0];
188 out[3][1] = 6.0*in[1] - 3.0;
191 out[4][1] = sign_[2];
194 out[5][1] = -6.0*in[0] + 3.0;
197 out[6][1] = sign_[3];
200 out[7][1] = 6.0*in[0] - 3.0;
217 std::array<R,4> sign_;
First order Brezzi-Douglas-Marini shape functions on the reference quadrilateral.
Definition: brezzidouglasmarini1cube2dlocalbasis.hh:28
void evaluateJacobian(const typename Traits::DomainType &in, std::vector< typename Traits::JacobianType > &out) const
Evaluate Jacobian of all shape functions.
Definition: brezzidouglasmarini1cube2dlocalbasis.hh:93
void partial(const std::array< unsigned int, 2 > &order, const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate partial derivatives of all shape functions.
Definition: brezzidouglasmarini1cube2dlocalbasis.hh:140
BDM1Cube2DLocalBasis()
Standard constructor.
Definition: brezzidouglasmarini1cube2dlocalbasis.hh:35
unsigned int size() const
number of shape functions
Definition: brezzidouglasmarini1cube2dlocalbasis.hh:53
BDM1Cube2DLocalBasis(std::bitset< 4 > s)
Make set number s, where 0 <= s < 16.
Definition: brezzidouglasmarini1cube2dlocalbasis.hh:46
unsigned int order() const
Polynomial order of the shape functions.
Definition: brezzidouglasmarini1cube2dlocalbasis.hh:211
void evaluateFunction(const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions.
Definition: brezzidouglasmarini1cube2dlocalbasis.hh:64
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