3 #ifndef DUNE_RANNACHER_TUREK_2D_LOCALBASIS_HH 4 #define DUNE_RANNACHER_TUREK_2D_LOCALBASIS_HH 9 #include <dune/common/fvector.hh> 10 #include <dune/common/fmatrix.hh> 17 template<
class D,
class R >
21 R, 1, FieldVector< R, 1 >,
32 std::vector< typename Traits::RangeType > &out )
const 36 out[0] = .75 - 2*in[0] + in[1] + qbase;
37 out[1] = -.25 + in[1] + qbase;
38 out[2] = .75 + in[0] - 2*in[1] - qbase;
39 out[3] = -.25 + in[0] - qbase;
44 std::vector< typename Traits::JacobianType > &out )
const 51 out[0][0][0] = -2 + 2*in[0]; out[0][0][1] = 1 - 2*in[1];
52 out[1][0][0] = 2*in[0]; out[1][0][1] = 1 - 2*in[1];
53 out[2][0][0] = 1 - 2*in[0]; out[2][0][1] = -2 + 2*in[1];
54 out[3][0][0] = 1 - 2*in[0]; out[3][0][1] = 2*in[1];
60 std::vector<typename Traits::RangeType>& out)
const 62 auto totalOrder = std::accumulate(
order.begin(),
order.end(), 0);
63 if (totalOrder == 0) {
65 }
else if (totalOrder == 1) {
66 auto const direction = std::distance(
order.begin(), std::find(
order.begin(),
order.end(), 1));
71 out[0] = -2 + 2*in[0];
79 out[2] = -2 + 2*in[1];
83 DUNE_THROW(RangeError,
"Component out of range.");
85 }
else if (totalOrder == 2) {
86 auto const direction = std::distance(
order.begin(), std::find(
order.begin(),
order.end(), 2));
99 out[0] = out[1] = out[2] = out[3] = 0;
103 out[0] = out[1] = out[2] = out[3] = 0;
117 #endif // #ifndef DUNE_RANNACHER_TUREK_2D_LOCALBASIS_HH unsigned int order() const
polynomial order of the shape functions
Definition: rannacherturek2dlocalbasis.hh:108
unsigned int size() const
number of shape functions
Definition: rannacherturek2dlocalbasis.hh:25
Definition: brezzidouglasmarini1cube2dlocalbasis.hh:15
D DomainType
domain type
Definition: localbasis.hh:49
void evaluateJacobian(const typename Traits::DomainType &in, std::vector< typename Traits::JacobianType > &out) const
evaluate jacobian of all shape functions
Definition: rannacherturek2dlocalbasis.hh:43
Definition: rannacherturek2dlocalbasis.hh:18
void evaluateFunction(const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
evaluate all shape functions
Definition: rannacherturek2dlocalbasis.hh:31
DF DomainFieldType
Export type for domain field.
Definition: localbasis.hh:40
LocalBasisTraits< D, 2, FieldVector< D, 2 >, R, 1, FieldVector< R, 1 >, FieldMatrix< R, 1, 2 > > Traits
Definition: rannacherturek2dlocalbasis.hh:22
Type traits for LocalBasisVirtualInterface.
Definition: localbasis.hh:37
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: rannacherturek2dlocalbasis.hh:58