5#ifndef DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS0_PYRAMID_LOCALBASIS_HH
6#define DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS0_PYRAMID_LOCALBASIS_HH
13#include "../../common/localbasis.hh"
26 template<
class D,
class R>
45 offset_[0][0] = {0.0, 0.0, -1.0};
47 offset_[0][1] = {0.0, 0.0, -1.0};
50 offset_[1][0] = {-2.0, -2.0, 0.0};
52 offset_[1][1] = {0.0, 0.0, 0.0};
55 offset_[2][0] = {0.0, 0.0, 0.0};
57 offset_[2][1] = {0.0, 0.0, 0.0};
60 offset_[3][0] = {0.0, 0.0, 0.0};
62 offset_[3][1] = {-2.0, -2.0, 0.0};
65 offset_[4][0] = {0.0, 0.0, 0.0};
67 offset_[4][1] = {0.0, 0.0, 0.0};
76 for(std::size_t i=1; i<5; ++i)
77 for(std::size_t j=0; j<2; ++j)
79 offset_[i][j] /= std::sqrt(2.0);
80 factor_[i][j] /= std::sqrt(2.0);
86 offset_[5][0] = {0.0, -2.0, 0.0};
88 offset_[5][1] = {2.0, 0.0, 0.0};
91 for (
size_t i=0; i<5; i++)
92 sign_[i] = s[i] ? -1.0 : 1.0;
111 std::vector<typename Traits::RangeType>& out)
const
114 bool compositeElement = x[0] > x[1];
115 for (std::size_t i=0; i<
size(); i++)
118 out[i] *= factor_[i][compositeElement];
119 out[i] += offset_[i][compositeElement];
131 std::vector<typename Traits::JacobianType>& out)
const
134 bool compositeElement = x[0] > x[1];
135 for (std::size_t i=0; i<
size(); i++)
136 for(std::size_t j=0; j<3; j++)
137 for(std::size_t k=0; k<3; k++)
138 out[i][j][k] = (j==k) * factor_[i][compositeElement] * sign_[i];
144 std::vector<typename Traits::RangeType>& out)
const
147 if (totalOrder == 0) {
161 std::array<R,6> sign_;
162 std::array<std::array<typename Traits::RangeType, 2>, 6> offset_;
163 std::array<std::array<R, 2>, 6> factor_;
A dense n x m matrix.
Definition: fmatrix.hh:117
vector space out of a tensor product of fields.
Definition: fvector.hh:91
Default exception for dummy implementations.
Definition: exceptions.hh:263
First order Raviart-Thomas shape functions on the reference pyramid.
Definition: raviartthomas0pyramidlocalbasis.hh:28
RT0PyramidLocalBasis(std::bitset< 5 > s=0)
Make set number s, where 0 <= s < 32.
Definition: raviartthomas0pyramidlocalbasis.hh:39
void evaluateFunction(const typename Traits::DomainType &x, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions.
Definition: raviartthomas0pyramidlocalbasis.hh:110
unsigned int order() const
Polynomial order of the shape functions.
Definition: raviartthomas0pyramidlocalbasis.hh:155
unsigned int size() const
number of shape functions
Definition: raviartthomas0pyramidlocalbasis.hh:99
void evaluateJacobian(const typename Traits::DomainType &x, std::vector< typename Traits::JacobianType > &out) const
Evaluate Jacobian of all shape functions.
Definition: raviartthomas0pyramidlocalbasis.hh:130
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: raviartthomas0pyramidlocalbasis.hh:142
Implements a matrix constructed from a given type representing a field and compile-time given number ...
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
constexpr T accumulate(Range &&range, T value, F &&f)
Accumulate values.
Definition: hybridutilities.hh:279
Dune namespace.
Definition: alignedallocator.hh:13
Type traits for LocalBasisVirtualInterface.
Definition: localbasis.hh:35
D DomainType
domain type
Definition: localbasis.hh:43