9#include <kernel/space/parametric_evaluator.hpp> 
   15    namespace BognerFoxSchmit
 
   33          return T_(0.5) + T_(0.25) * x * (x*x - T_(3));
 
   39          return T_(0.5) - T_(0.25) * x * (x*x - T_(3));
 
   45          return T_(0.25) * (x + T_(1)) * Math::sqr(x - T_(1));
 
   51          return T_(0.25) * (x - T_(1)) * Math::sqr(x + T_(1));
 
   58          return +T_(0.75) * (x*x - T_(1));
 
   64          return -T_(0.75) * (x*x - T_(1));
 
   70          return T_(0.25) * (T_(3)*x + T_(1)) * (x - T_(1));
 
   76          return T_(0.25) * (T_(3)*x - T_(1)) * (x + T_(1));
 
   95          return T_(0.5) * (T_(3)*x - T_(1));
 
  101          return T_(0.5) * (T_(3)*x + T_(1));
 
  113        typename TrafoEvaluator_,
 
  114        typename SpaceEvalTraits_,
 
  115        typename Shape_ = 
typename Space_::ShapeType>
 
  125        typename TrafoEvaluator_,
 
  126        typename SpaceEvalTraits_>
 
  127      class Evaluator<Space_, TrafoEvaluator_, SpaceEvalTraits_, Shape::Hypercube<1> > :
 
  133            Shape::Hypercube<1> >,
 
  158        typedef typename SpaceEvalTraits::DataType 
DataType;
 
  199          CoeffEvalData coeff_data;
 
  203          _coeff = coeff_data.jac_mat(0,0);
 
  215        template<
typename EvalData_>
 
  221          data.phi[0].ref_value = Intern::p1(
DataType(point[0]));
 
  223          data.phi[1].ref_value = _coeff * Intern::q1(
DataType(point[0]));
 
  225          data.phi[2].ref_value = Intern::p2(
DataType(point[0]));
 
  227          data.phi[3].ref_value = _coeff * Intern::q2(
DataType(point[0]));
 
  239        template<
typename EvalData_>
 
  245          data.phi[0].ref_grad[0] = Intern::dp1(
DataType(point[0]));
 
  247          data.phi[1].ref_grad[0] = _coeff * Intern::dq1(
DataType(point[0]));
 
  249          data.phi[2].ref_grad[0] = Intern::dp2(
DataType(point[0]));
 
  251          data.phi[3].ref_grad[0] = _coeff * Intern::dq2(
DataType(point[0]));
 
  263        template<
typename EvalData_>
 
  269          data.phi[0].ref_hess[0][0] = Intern::ddp1(
DataType(point[0]));
 
  271          data.phi[1].ref_hess[0][0] = _coeff * Intern::ddq1(
DataType(point[0]));
 
  273          data.phi[2].ref_hess[0][0] = Intern::ddp2(
DataType(point[0]));
 
  275          data.phi[3].ref_hess[0][0] = _coeff * Intern::ddq2(
DataType(point[0]));
 
  286        typename TrafoEvaluator_,
 
  287        typename SpaceEvalTraits_>
 
  288      class Evaluator<Space_, TrafoEvaluator_, SpaceEvalTraits_, Shape::Hypercube<2> > :
 
  294            Shape::Hypercube<2> >,
 
  319        typedef typename SpaceEvalTraits::DataType 
DataType;
 
  339          return _coeff_fod[i](0,0) * rx + _coeff_fod[i](0,1) * ry;
 
  356          return _coeff_fod[i](1,0) * rx + _coeff_fod[i](1,1) * ry;
 
  394          CoeffEvalData coeff_data;
 
  397          for(
int i(0); i < 4; ++i)
 
  407            _coeff_fod[i] = coeff_data.jac_mat;
 
  420        template<
typename EvalData_>
 
  425          const DataType x(point[0]), y(point[1]);
 
  429          data.phi[ 0].ref_value = Intern::p1(x) * Intern::p1(y);
 
  430          d0 = Intern::q1(x) * Intern::p1(y);
 
  431          d1 = Intern::p1(x) * Intern::q1(y);
 
  432          data.phi[ 1].ref_value = _trans_dx(0, d0, d1);
 
  433          data.phi[ 2].ref_value = _trans_dy(0, d0, d1);
 
  434          data.phi[ 3].ref_value = Intern::q1(x) * Intern::q1(y);
 
  437          data.phi[ 4].ref_value = Intern::p2(x) * Intern::p1(y);
 
  438          d0 = Intern::q2(x) * Intern::p1(y);
 
  439          d1 = Intern::p2(x) * Intern::q1(y);
 
  440          data.phi[ 5].ref_value = _trans_dx(1, d0, d1);
 
  441          data.phi[ 6].ref_value = _trans_dy(1, d0, d1);
 
  442          data.phi[ 7].ref_value = Intern::q2(x) * Intern::q1(y);
 
  445          data.phi[ 8].ref_value = Intern::p1(x) * Intern::p2(y);
 
  446          d0 = Intern::q1(x) * Intern::p2(y);
 
  447          d1 = Intern::p1(x) * Intern::q2(y);
 
  448          data.phi[ 9].ref_value = _trans_dx(2, d0, d1);
 
  449          data.phi[10].ref_value = _trans_dy(2, d0, d1);
 
  450          data.phi[11].ref_value = Intern::q1(x) * Intern::q2(y);
 
  453          data.phi[12].ref_value = Intern::p2(x) * Intern::p2(y);
 
  454          d0 = Intern::q2(x) * Intern::p2(y);
 
  455          d1 = Intern::p2(x) * Intern::q2(y);
 
  456          data.phi[13].ref_value = _trans_dx(3, d0, d1);
 
  457          data.phi[14].ref_value = _trans_dy(3, d0, d1);
 
  458          data.phi[15].ref_value = Intern::q2(x) * Intern::q2(y);
 
  470        template<
typename EvalData_>
 
  475          const DataType x(point[0]), y(point[1]);
 
  479          data.phi[ 0].ref_grad[0] = Intern::dp1(x) * Intern::p1(y);
 
  480          data.phi[ 0].ref_grad[1] = Intern::p1(x) * Intern::dp1(y);
 
  481          d0x = Intern::dq1(x) * Intern::p1(y);
 
  482          d0y = Intern::q1(x) * Intern::dp1(y);
 
  483          d1x = Intern::dp1(x) * Intern::q1(y);
 
  484          d1y = Intern::p1(x) * Intern::dq1(y);
 
  485          data.phi[ 1].ref_grad[0] = _trans_dx(0, d0x, d1x);
 
  486          data.phi[ 1].ref_grad[1] = _trans_dx(0, d0y, d1y);
 
  487          data.phi[ 2].ref_grad[0] = _trans_dy(0, d0x, d1x);
 
  488          data.phi[ 2].ref_grad[1] = _trans_dy(0, d0y, d1y);
 
  489          data.phi[ 3].ref_grad[0] = Intern::dq1(x) * Intern::q1(y);
 
  490          data.phi[ 3].ref_grad[1] = Intern::q1(x) * Intern::dq1(y);
 
  493          data.phi[ 4].ref_grad[0] = Intern::dp2(x) * Intern::p1(y);
 
  494          data.phi[ 4].ref_grad[1] = Intern::p2(x) * Intern::dp1(y);
 
  495          d0x = Intern::dq2(x) * Intern::p1(y);
 
  496          d0y = Intern::q2(x) * Intern::dp1(y);
 
  497          d1x = Intern::dp2(x) * Intern::q1(y);
 
  498          d1y = Intern::p2(x) * Intern::dq1(y);
 
  499          data.phi[ 5].ref_grad[0] = _trans_dx(1, d0x, d1x);
 
  500          data.phi[ 5].ref_grad[1] = _trans_dx(1, d0y, d1y);
 
  501          data.phi[ 6].ref_grad[0] = _trans_dy(1, d0x, d1x);
 
  502          data.phi[ 6].ref_grad[1] = _trans_dy(1, d0y, d1y);
 
  503          data.phi[ 7].ref_grad[0] = Intern::dq2(x) * Intern::q1(y);
 
  504          data.phi[ 7].ref_grad[1] = Intern::q2(x) * Intern::dq1(y);
 
  507          data.phi[ 8].ref_grad[0] = Intern::dp1(x) * Intern::p2(y);
 
  508          data.phi[ 8].ref_grad[1] = Intern::p1(x) * Intern::dp2(y);
 
  509          d0x = Intern::dq1(x) * Intern::p2(y);
 
  510          d0y = Intern::q1(x) * Intern::dp2(y);
 
  511          d1x = Intern::dp1(x) * Intern::q2(y);
 
  512          d1y = Intern::p1(x) * Intern::dq2(y);
 
  513          data.phi[ 9].ref_grad[0] = _trans_dx(2, d0x, d1x);
 
  514          data.phi[ 9].ref_grad[1] = _trans_dx(2, d0y, d1y);
 
  515          data.phi[10].ref_grad[0] = _trans_dy(2, d0x, d1x);
 
  516          data.phi[10].ref_grad[1] = _trans_dy(2, d0y, d1y);
 
  517          data.phi[11].ref_grad[0] = Intern::dq1(x) * Intern::q2(y);
 
  518          data.phi[11].ref_grad[1] = Intern::q1(x) * Intern::dq2(y);
 
  521          data.phi[12].ref_grad[0] = Intern::dp2(x) * Intern::p2(y);
 
  522          data.phi[12].ref_grad[1] = Intern::p2(x) * Intern::dp2(y);
 
  523          d0x = Intern::dq2(x) * Intern::p2(y);
 
  524          d0y = Intern::q2(x) * Intern::dp2(y);
 
  525          d1x = Intern::dp2(x) * Intern::q2(y);
 
  526          d1y = Intern::p2(x) * Intern::dq2(y);
 
  527          data.phi[13].ref_grad[0] = _trans_dx(3, d0x, d1x);
 
  528          data.phi[13].ref_grad[1] = _trans_dx(3, d0y, d1y);
 
  529          data.phi[14].ref_grad[0] = _trans_dy(3, d0x, d1x);
 
  530          data.phi[14].ref_grad[1] = _trans_dy(3, d0y, d1y);
 
  531          data.phi[15].ref_grad[0] = Intern::dq2(x) * Intern::q2(y);
 
  532          data.phi[15].ref_grad[1] = Intern::q2(x) * Intern::dq2(y);
 
  544        template<
typename EvalData_>
 
  549          const DataType x(point[0]), y(point[1]);
 
  550          DataType d0xx, d0xy, d0yy, d1xx, d1xy, d1yy;
 
  553          data.phi[ 0].ref_hess[0][0] = Intern::ddp1(x) * Intern::p1(y);
 
  554          data.phi[ 0].ref_hess[0][1] =
 
  555          data.phi[ 0].ref_hess[1][0] = Intern::dp1(x) * Intern::dp1(y);
 
  556          data.phi[ 0].ref_hess[1][1] = Intern::p1(x) * Intern::ddp1(y);
 
  557          d0xx = Intern::ddq1(x) * Intern::p1(y);
 
  558          d0xy = Intern::dq1(x) * Intern::dp1(y);
 
  559          d0yy = Intern::q1(x) * Intern::ddp1(y);
 
  560          d1xx = Intern::ddp1(x) * Intern::q1(y);
 
  561          d1xy = Intern::dp1(x) * Intern::dq1(y);
 
  562          d1yy = Intern::p1(x) * Intern::ddq1(y);
 
  563          data.phi[ 1].ref_hess[0][0] = _trans_dx(0, d0xx, d1xx);
 
  564          data.phi[ 1].ref_hess[0][1] =
 
  565          data.phi[ 1].ref_hess[1][0] = _trans_dx(0, d0xy, d1xy);
 
  566          data.phi[ 1].ref_hess[1][1] = _trans_dx(0, d0yy, d1yy);
 
  567          data.phi[ 2].ref_hess[0][0] = _trans_dy(0, d0xx, d1xx);
 
  568          data.phi[ 2].ref_hess[0][1] =
 
  569          data.phi[ 2].ref_hess[1][0] = _trans_dy(0, d0xy, d1xy);
 
  570          data.phi[ 2].ref_hess[1][1] = _trans_dy(0, d0yy, d1yy);
 
  571          data.phi[ 3].ref_hess[0][0] = Intern::ddq1(x) * Intern::q1(y);
 
  572          data.phi[ 3].ref_hess[0][1] =
 
  573          data.phi[ 3].ref_hess[1][0] = Intern::dq1(x) * Intern::dq1(y);
 
  574          data.phi[ 3].ref_hess[1][1] = Intern::q1(x) * Intern::ddq1(y);
 
  577          data.phi[ 4].ref_hess[0][0] = Intern::ddp2(x) * Intern::p1(y);
 
  578          data.phi[ 4].ref_hess[0][1] =
 
  579          data.phi[ 4].ref_hess[1][0] = Intern::dp2(x) * Intern::dp1(y);
 
  580          data.phi[ 4].ref_hess[1][1] = Intern::p2(x) * Intern::ddp1(y);
 
  581          d0xx = Intern::ddq2(x) * Intern::p1(y);
 
  582          d0xy = Intern::dq2(x) * Intern::dp1(y);
 
  583          d0yy = Intern::q2(x) * Intern::ddp1(y);
 
  584          d1xx = Intern::ddp2(x) * Intern::q1(y);
 
  585          d1xy = Intern::dp2(x) * Intern::dq1(y);
 
  586          d1yy = Intern::p2(x) * Intern::ddq1(y);
 
  587          data.phi[ 5].ref_hess[0][0] = _trans_dx(1, d0xx, d1xx);
 
  588          data.phi[ 5].ref_hess[0][1] =
 
  589          data.phi[ 5].ref_hess[1][0] = _trans_dx(1, d0xy, d1xy);
 
  590          data.phi[ 5].ref_hess[1][1] = _trans_dx(1, d0yy, d1yy);
 
  591          data.phi[ 6].ref_hess[0][0] = _trans_dy(1, d0xx, d1xx);
 
  592          data.phi[ 6].ref_hess[0][1] =
 
  593          data.phi[ 6].ref_hess[1][0] = _trans_dy(1, d0xy, d1xy);
 
  594          data.phi[ 6].ref_hess[1][1] = _trans_dy(1, d0yy, d1yy);
 
  595          data.phi[ 7].ref_hess[0][0] = Intern::ddq2(x) * Intern::q1(y);
 
  596          data.phi[ 7].ref_hess[0][1] =
 
  597          data.phi[ 7].ref_hess[1][0] = Intern::dq2(x) * Intern::dq1(y);
 
  598          data.phi[ 7].ref_hess[1][1] = Intern::q2(x) * Intern::ddq1(y);
 
  601          data.phi[ 8].ref_hess[0][0] = Intern::ddp1(x) * Intern::p2(y);
 
  602          data.phi[ 8].ref_hess[0][1] =
 
  603          data.phi[ 8].ref_hess[1][0] = Intern::dp1(x) * Intern::dp2(y);
 
  604          data.phi[ 8].ref_hess[1][1] = Intern::p1(x) * Intern::ddp2(y);
 
  605          d0xx = Intern::ddq1(x) * Intern::p2(y);
 
  606          d0xy = Intern::dq1(x) * Intern::dp2(y);
 
  607          d0yy = Intern::q1(x) * Intern::ddp2(y);
 
  608          d1xx = Intern::ddp1(x) * Intern::q2(y);
 
  609          d1xy = Intern::dp1(x) * Intern::dq2(y);
 
  610          d1yy = Intern::p1(x) * Intern::ddq2(y);
 
  611          data.phi[ 9].ref_hess[0][0] = _trans_dx(2, d0xx, d1xx);
 
  612          data.phi[ 9].ref_hess[0][1] =
 
  613          data.phi[ 9].ref_hess[1][0] = _trans_dx(2, d0xy, d1xy);
 
  614          data.phi[ 9].ref_hess[1][1] = _trans_dx(2, d0yy, d1yy);
 
  615          data.phi[10].ref_hess[0][0] = _trans_dy(2, d0xx, d1xx);
 
  616          data.phi[10].ref_hess[0][1] =
 
  617          data.phi[10].ref_hess[1][0] = _trans_dy(2, d0xy, d1xy);
 
  618          data.phi[10].ref_hess[1][1] = _trans_dy(2, d0yy, d1yy);
 
  619          data.phi[11].ref_hess[0][0] = Intern::ddq1(x) * Intern::q2(y);
 
  620          data.phi[11].ref_hess[0][1] =
 
  621          data.phi[11].ref_hess[1][0] = Intern::dq1(x) * Intern::dq2(y);
 
  622          data.phi[11].ref_hess[1][1] = Intern::q1(x) * Intern::ddq2(y);
 
  625          data.phi[12].ref_hess[0][0] = Intern::ddp2(x) * Intern::p2(y);
 
  626          data.phi[12].ref_hess[0][1] =
 
  627          data.phi[12].ref_hess[1][0] = Intern::dp2(x) * Intern::dp2(y);
 
  628          data.phi[12].ref_hess[1][1] = Intern::p2(x) * Intern::ddp2(y);
 
  629          d0xx = Intern::ddq2(x) * Intern::p2(y);
 
  630          d0xy = Intern::dq2(x) * Intern::dp2(y);
 
  631          d0yy = Intern::q2(x) * Intern::ddp2(y);
 
  632          d1xx = Intern::ddp2(x) * Intern::q2(y);
 
  633          d1xy = Intern::dp2(x) * Intern::dq2(y);
 
  634          d1yy = Intern::p2(x) * Intern::ddq2(y);
 
  635          data.phi[13].ref_hess[0][0] = _trans_dx(3, d0xx, d1xx);
 
  636          data.phi[13].ref_hess[0][1] =
 
  637          data.phi[13].ref_hess[1][0] = _trans_dx(3, d0xy, d1xy);
 
  638          data.phi[13].ref_hess[1][1] = _trans_dx(3, d0yy, d1yy);
 
  639          data.phi[14].ref_hess[0][0] = _trans_dy(3, d0xx, d1xx);
 
  640          data.phi[14].ref_hess[0][1] =
 
  641          data.phi[14].ref_hess[1][0] = _trans_dy(3, d0xy, d1xy);
 
  642          data.phi[14].ref_hess[1][1] = _trans_dy(3, d0yy, d1yy);
 
  643          data.phi[15].ref_hess[0][0] = Intern::ddq2(x) * Intern::q2(y);
 
  644          data.phi[15].ref_hess[0][1] =
 
  645          data.phi[15].ref_hess[1][0] = Intern::dq2(x) * Intern::dq2(y);
 
  646          data.phi[15].ref_hess[1][1] = Intern::q2(x) * Intern::ddq2(y);
 
TrafoEvaluator_ TrafoEvaluator
trafo evaluator type
void eval_ref_gradients(EvalData_ &data, const DomainPointType &point) const
Evaluates the basis function gradients on the reference cell.
void eval_ref_hessians(EvalData_ &data, const DomainPointType &point) const
Evaluates the basis function hessians on the reference cell.
void prepare(const TrafoEvaluator &trafo_eval)
Prepares the evaluator for a given cell.
SpaceEvalTraits_ SpaceEvalTraits
space evaluation traits
SpaceEvalTraits::EvalPolicy EvalPolicy
evaluation policy
Space_ SpaceType
space type
SpaceEvalTraits::DataType DataType
data type
Evaluator(const SpaceType &space)
Constructor.
ParametricEvaluator< Evaluator, TrafoEvaluator_, SpaceEvalTraits_, ref_caps > BaseClass
base-class typedef
DataType _coeff
first-order derivative transform coefficient
void eval_ref_values(EvalData_ &data, const DomainPointType &point) const
Evaluates the basis function values on the reference cell.
int get_num_local_dofs() const
Returns the number of local DOFs.
EvalPolicy::DomainPointType DomainPointType
domain point type
TrafoEvaluator_ TrafoEvaluator
trafo evaluator type
Space_ SpaceType
space type
SpaceEvalTraits_ SpaceEvalTraits
space evaluation traits
void eval_ref_hessians(EvalData_ &data, const DomainPointType &point) const
Evaluates the basis function hessians on the reference cell.
EvalPolicy::DomainPointType DomainPointType
domain point type
DataType _trans_dy(Index i, DataType rx, DataType ry) const
Transforms the Y-derivative basis function.
SpaceEvalTraits::EvalPolicy EvalPolicy
evaluation policy
void eval_ref_values(EvalData_ &data, const DomainPointType &point) const
Evaluates the basis function values on the reference cell.
void prepare(const TrafoEvaluator &trafo_eval)
Prepares the evaluator for a given cell.
ParametricEvaluator< Evaluator, TrafoEvaluator_, SpaceEvalTraits_, ref_caps > BaseClass
base-class typedef
int get_num_local_dofs() const
Returns the number of local DOFs.
Evaluator(const SpaceType &space)
Constructor.
DataType _trans_dx(Index i, DataType rx, DataType ry) const
Transforms the X-derivative basis function.
void eval_ref_gradients(EvalData_ &data, const DomainPointType &point) const
Evaluates the basis function gradients on the reference cell.
SpaceEvalTraits::DataType DataType
data type
Bogner-Fox-Schmit Element Evaluator class template declaration.
Finite-Element Parametric Evaluator CRTP base-class template.
Tiny Matrix class template.
static constexpr SpaceTags ref_caps
Bogner-Fox-Schmit Element Evaluator reference capabilities.
SpaceTags
Space configuration tags enum.
@ ref_value
specifies whether the space should supply reference basis function values
@ ref_hess
specifies whether the space should supply reference basis function hessians
@ ref_grad
specifies whether the space should supply reference basis function gradients
std::uint64_t Index
Index data type.
@ dom_point
specifies whether the trafo should supply domain point coordinates