5#ifndef DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI1_CUBE3D_LOCALBASIS_HH 
    6#define DUNE_LOCALFUNCTIONS_BREZZIDOUGLASMARINI1_CUBE3D_LOCALBASIS_HH 
   15#include "../../common/localbasis.hh" 
   29  template<
class D, 
class R>
 
   41      for (
size_t i=0; i<6; i++)
 
   52      for (
size_t i=0; i<6; i++)
 
   53        sign_[i] = s[i] ? -1.0 : 1.0;
 
   69                                 std::vector<typename Traits::RangeType>& out)
 const 
   73      out[0][0]  = sign_[0] * (in[0] - 1.0);
 
   76      out[1][0]  = sign_[1] * in[0];
 
   80      out[2][1]  = sign_[2] * (in[1] - 1.0);
 
   83      out[3][1]  = sign_[3] * in[1];
 
   87      out[4][2]  = sign_[4] * (in[2] - 1.0);
 
   90      out[5][2]  = sign_[5] * in[2];
 
   91      out[6][0]  =  6.0 * in[0] * in[1] - 3 * in[0]-6 * in[1] + 3.0;
 
   92      out[6][1]  = -3.0 * in[1] * in[1] + 3 * in[1];
 
   94      out[7][0]  = -6.0 * in[0] * in[1] + 3 * in[0];
 
   95      out[7][1]  =  3.0 * in[1] * in[1] - 3 * in[1];
 
   97      out[8][0]  =  3.0 * in[0] * in[0] - 3 * in[0];
 
   98      out[8][1]  = -6.0 * in[0] * in[1] + 3 * in[1]+6 * in[0]-3.0;
 
  100      out[9][0]  = -3.0 * in[0] * in[0] + 3 * in[0];
 
  101      out[9][1]  =  6.0 * in[0] * in[1] - 3 * in[1];
 
  103      out[10][0] = -3.0 * in[0] * in[0] + 3 * in[0];
 
  105      out[10][2] =  6.0 * in[0] * in[2]-6 * in[0]-3 * in[2] + 3.0;
 
  106      out[11][0] =  3.0 * in[0] * in[0]-3 * in[0];
 
  108      out[11][2] = -6.0 * in[0] * in[2] + 3 * in[2];
 
  109      out[12][0] = -6.0 * in[0] * in[2]+6 * in[2] + 3 * in[0]-3.0;
 
  111      out[12][2] =  3.0 * in[2] * in[2]-3 * in[2];
 
  112      out[13][0] = -3 * in[0]+6 * in[0] * in[2];
 
  114      out[13][2] = -3.0 * in[2] * in[2] + 3 * in[2];
 
  116      out[14][1] =  6.0 * in[1] * in[2]-3 * in[1]-6 * in[2] + 3.0;
 
  117      out[14][2] = -3 * in[2] * in[2] + 3 * in[2];
 
  119      out[15][1] = -6.0 * in[1] * in[2] + 3 * in[1];
 
  120      out[15][2] =  3.0 * in[2] * in[2]-3 * in[2];
 
  122      out[16][1] =  3.0 * in[1] * in[1]-3 * in[1];
 
  123      out[16][2] = -6.0 * in[1] * in[2] + 3 * in[2]+6 * in[1]-3.0;
 
  125      out[17][1] = -3.0 * in[1] * in[1] + 3 * in[1];
 
  126      out[17][2] =  6.0 * in[1] * in[2] - 3.0 * in[2];
 
  136                                 std::vector<typename Traits::JacobianType>& out)
 const 
  140      out[0][0]  = {  sign_[0],          0,          0};
 
  141      out[0][1]  = {         0,          0,          0};
 
  142      out[0][2]  = {         0,          0,          0};
 
  144      out[1][0]  = {  sign_[1],          0,          0};
 
  145      out[1][1]  = {         0,          0,          0};
 
  146      out[1][2]  = {         0,          0,          0};
 
  148      out[2][0]  = {         0,          0,          0};
 
  149      out[2][1]  = {         0,   sign_[2],          0};
 
  150      out[2][2]  = {         0,          0,          0};
 
  152      out[3][0]  = {         0,          0,          0};
 
  153      out[3][1]  = {         0,   sign_[3],          0};
 
  154      out[3][2]  = {         0,          0,          0};
 
  156      out[4][0]  = {         0,          0,          0};
 
  157      out[4][1]  = {         0,          0,          0};
 
  158      out[4][2]  = {         0,          0,   sign_[4]};
 
  160      out[5][0]  = {         0,          0,          0};
 
  161      out[5][1]  = {         0,          0,          0};
 
  162      out[5][2]  = {         0,          0,   sign_[5]};
 
  164      out[6][0]  = { 6*in[1]-3,  6*in[0]-6,          0};
 
  165      out[6][1]  = {         0, -6*in[1]+3,          0};
 
  166      out[6][2]  = {         0,          0,          0};
 
  168      out[7][0]  = {-6*in[1]+3,   -6*in[0],          0};
 
  169      out[7][1]  = {         0,  6*in[1]-3,          0};
 
  170      out[7][2]  = {         0,          0,          0};
 
  172      out[8][0]  = { 6*in[0]-3,          0,          0};
 
  173      out[8][1]  = {-6*in[1]+6, -6*in[0]+3,          0};
 
  174      out[8][2]  = {         0,          0,          0};
 
  176      out[9][0]  = {-6*in[0]+3,          0,          0};
 
  177      out[9][1]  = {   6*in[1],  6*in[0]-3,          0};
 
  178      out[9][2]  = {         0,          0,          0};
 
  180      out[10][0] = {-6*in[0]+3,          0,          0};
 
  181      out[10][1] = {         0,          0,          0};
 
  182      out[10][2] = { 6*in[2]-6,          0,  6*in[0]-3};
 
  184      out[11][0] = { 6*in[0]-3,          0,          0};
 
  185      out[11][1] = {         0,          0,          0};
 
  186      out[11][2] = {  -6*in[2],          0, -6*in[0]+3};
 
  188      out[12][0] = {-6*in[2]+3,          0, -6*in[0]+6};
 
  189      out[12][1] = {         0,          0,          0};
 
  190      out[12][2] = {         0,          0,  6*in[2]-3};
 
  192      out[13][0] = { 6*in[2]-3,          0,    6*in[0]};
 
  193      out[13][1] = {         0,          0,          0};
 
  194      out[13][2] = {         0,          0, -6*in[2]+3};
 
  196      out[14][0] = {         0,          0,          0};
 
  197      out[14][1] = {         0,  6*in[2]-3,  6*in[1]-6};
 
  198      out[14][2] = {         0,          0, -6*in[2]+3};
 
  200      out[15][0] = {         0,          0,          0};
 
  201      out[15][1] = {         0, -6*in[2]+3,   -6*in[1]};
 
  202      out[15][2] = {         0,          0,  6*in[2]-3};
 
  204      out[16][0] = {         0,          0,          0};
 
  205      out[16][1] = {         0,  6*in[1]-3,          0};
 
  206      out[16][2] = {         0, -6*in[2]+6, -6*in[1]+3};
 
  208      out[17][0] = {         0,          0,          0};
 
  209      out[17][1] = {         0, -6*in[1]+3,          0};
 
  210      out[17][2] = {         0,    6*in[2],  6*in[1]-3};
 
  216                  std::vector<typename Traits::RangeType>& out) 
const       
  219      if (totalOrder == 0) {
 
  221      } 
else if (totalOrder == 1) {
 
  223        auto const direction = std::distance(
order.begin(), std::find(
order.begin(), 
order.end(), 1));
 
  227          out[0]  = {  sign_[0],          0,          0};
 
  228          out[1]  = {  sign_[1],          0,          0};
 
  233          out[6]  = { 6*in[1]-3,          0,          0};
 
  234          out[7]  = {-6*in[1]+3,          0,          0};
 
  235          out[8]  = { 6*in[0]-3, -6*in[1]+6,          0};
 
  236          out[9]  = {-6*in[0]+3,    6*in[1],          0};
 
  237          out[10] = {-6*in[0]+3,          0,  6*in[2]-6};
 
  238          out[11] = { 6*in[0]-3,          0,   -6*in[2]};
 
  239          out[12] = {-6*in[2]+3,          0,          0};
 
  240          out[13] = { 6*in[2]-3,          0,          0};
 
  241          out[14] = {         0,          0,          0};
 
  242          out[15] = {         0,          0,          0};
 
  243          out[16] = {         0,          0,          0};
 
  244          out[17] = {         0,          0,          0};
 
  249          out[2]  = {         0,   sign_[2],          0};
 
  250          out[3]  = {         0,   sign_[3],          0};
 
  253          out[6]  = { 6*in[0]-6, -6*in[1]+3,          0};
 
  254          out[7]  = {  -6*in[0],  6*in[1]-3,          0};
 
  255          out[8]  = {         0, -6*in[0]+3,          0};
 
  256          out[9]  = {         0,  6*in[0]-3,          0};
 
  257          out[10] = {         0,          0,          0};
 
  258          out[11] = {         0,          0,          0};
 
  259          out[12] = {         0,          0,          0};
 
  260          out[13] = {         0,          0,          0};
 
  261          out[14] = {         0,  6*in[2]-3,          0};
 
  262          out[15] = {         0, -6*in[2]+3,          0};
 
  263          out[16] = {         0,  6*in[1]-3, -6*in[2]+6};
 
  264          out[17] = {         0, -6*in[1]+3,    6*in[2]};
 
  271          out[4]  = {         0,          0,   sign_[4]};
 
  272          out[5]  = {         0,          0,   sign_[5]};
 
  277          out[10] = {         0,          0,  6*in[0]-3};
 
  278          out[11] = {         0,          0, -6*in[0]+3};
 
  279          out[12] = {-6*in[0]+6,          0,  6*in[2]-3};
 
  280          out[13] = {   6*in[0],          0, -6*in[2]+3};
 
  281          out[14] = {         0,  6*in[1]-6, -6*in[2]+3};
 
  282          out[15] = {         0,   -6*in[1],  6*in[2]-3};
 
  283          out[16] = {         0,          0, -6*in[1]+3};
 
  284          out[17] = {         0,          0,  6*in[1]-3};
 
  301    std::array<R,6> sign_;
 
First order Brezzi-Douglas-Marini shape functions on the reference hexahedron.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:31
 
void evaluateJacobian(const typename Traits::DomainType &in, std::vector< typename Traits::JacobianType > &out) const
Evaluate Jacobian of all shape functions.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:135
 
void evaluateFunction(const typename Traits::DomainType &in, std::vector< typename Traits::RangeType > &out) const
Evaluate all shape functions.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:68
 
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:214
 
BDM1Cube3DLocalBasis(std::bitset< 6 > s)
Make set number s, where 0 <= s < 64.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:50
 
unsigned int order() const
Polynomial order of the shape functions.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:295
 
BDM1Cube3DLocalBasis()
Standard constructor.
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:39
 
unsigned int size() const
number of shape functions
Definition: brezzidouglasmarini1cube3dlocalbasis.hh:57
 
A dense n x m matrix.
Definition: fmatrix.hh:117
 
vector space out of a tensor product of fields.
Definition: fvector.hh:97
 
Default exception for dummy implementations.
Definition: exceptions.hh:357
 
Default exception class for range errors.
Definition: exceptions.hh:348
 
Implements a matrix constructed from a given type representing a field and compile-time given number ...
 
#define DUNE_THROW(E,...)
Definition: exceptions.hh:314
 
constexpr T accumulate(Range &&range, T value, F &&f)
Accumulate values.
Definition: hybridutilities.hh:280
 
Dune namespace.
Definition: alignedallocator.hh:13
 
Type traits for LocalBasisVirtualInterface.
Definition: localbasis.hh:35
 
D DomainType
domain type
Definition: localbasis.hh:43