5#ifndef DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS0_PYRAMID_LOCALBASIS_HH
6#define DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS0_PYRAMID_LOCALBASIS_HH
11#include <dune/common/fmatrix.hh>
13#include "../../common/localbasis.hh"
26 template<
class D,
class R>
41 for (
size_t i=0; i<
size(); i++)
42 sign[i] = s[i] ? -1.0 : 1.0;
58 std::vector<typename Traits::RangeType>& out)
const
61 for (std::size_t i=0; i<out.size(); i++)
62 out[i] = {0.0,0.0,0.0};
64 out[0][0] = 1.5*in[0];
65 out[0][1] = 1.5*in[1];
68 out[1][0] = -2.0 + 3.0*in[0];
70 out[2][0] = 3.0*in[0];
72 out[3][1] = -2.0 + 3.0*in[1];
74 out[4][1] = 3.0*in[1];
76 for (std::size_t i=0; i<out.size(); i++)
88 std::vector<typename Traits::JacobianType>& out)
const
92 for(
int i=0; i<
size(); i++)
93 for(
int j=0; j<3; j++)
94 out[i][j] = {0.0, 0.0, 0.0};
96 out[0][0][0] = sign[0]*(1.5);
97 out[0][1][1] = sign[0]*(1.5);
99 out[1][0][0] = sign[1]*(3.0);
101 out[2][0][0] = sign[2]*(3.0);
103 out[3][1][1] = sign[3]*(3.0);
105 out[4][1][1] = sign[4]*(3.0);
111 std::vector<typename Traits::RangeType>& out)
const
113 auto totalOrder = std::accumulate(
order.begin(),
order.end(), 0);
114 if (totalOrder == 0) {
117 DUNE_THROW(NotImplemented,
"Desired derivative order is not implemented");
128 std::array<R,5> sign;
Definition bdfmcube.hh:18
Type traits for LocalBasisVirtualInterface.
Definition common/localbasis.hh:35
D DomainType
domain type
Definition common/localbasis.hh:43
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 &in, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions.
Definition raviartthomas0pyramidlocalbasis.hh:57
void evaluateJacobian(const typename Traits::DomainType &in, std::vector< typename Traits::JacobianType > &out) const
Evaluate Jacobian of all shape functions.
Definition raviartthomas0pyramidlocalbasis.hh:87
LocalBasisTraits< D, 3, Dune::FieldVector< D, 3 >, R, 3, Dune::FieldVector< R, 3 >, Dune::FieldMatrix< R, 3, 3 > > Traits
Definition raviartthomas0pyramidlocalbasis.hh:32
unsigned int order() const
Polynomial order of the shape functions.
Definition raviartthomas0pyramidlocalbasis.hh:122
unsigned int size() const
number of shape functions
Definition raviartthomas0pyramidlocalbasis.hh:46
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:109