8#include <kernel/trafo/standard/evaluator.hpp> 
    9#include <kernel/geometry/atlas/chart.hpp> 
   10#include <kernel/cubature/scalar/gauss_legendre_driver.hpp> 
   11#include <kernel/cubature/scalar/newton_cotes_closed_driver.hpp> 
   12#include <kernel/cubature/scalar/newton_cotes_open_driver.hpp> 
   13#include <kernel/cubature/scalar/gauss_lobatto_driver.hpp> 
   25        typename Shape_ = 
typename EvalPolicy_::ShapeType>
 
   37          static inline void points(T_ v[])
 
   39            static const T_ s = T_(2) / T_(n_);
 
   40            for(
int i(0); i <= n_; ++i)
 
   41              v[i] *= (T_(i)*s - T_(1));
 
   46          static inline void val(T_ v[], 
const T_ x)
 
   48            static const T_ s = T_(2) / T_(n_);
 
   50            for(
int j(0); j <= n_; ++j)
 
   53              for(
int i(0); i <= n_; ++i)
 
   54                v[j] *= (i != j ? (T_(1) + x - T_(i)*s) / (T_(j)*s - T_(i)*s) : T_(1));
 
   60          static inline void d1(T_ v[], 
const T_ x)
 
   62            static const T_ s = T_(2) / T_(n_);
 
   64            for(
int j(0); j <= n_; ++j)
 
   67              for(
int k(0); k <= n_; ++k)
 
   72                for(
int i(0); i <= n_; ++i)
 
   73                  t *= ((i != k) && (i != j) ? (T_(1) + x - T_(i)*s) / (T_(j)*s - T_(i)*s) : T_(1));
 
   74                v[j] += t / (T_(j)*s - T_(k)*s);
 
   81          static inline void d2(T_ v[], 
const T_ x)
 
   83            static const T_ s = T_(2) / T_(n_);
 
   85            for(
int j(0); j <= n_; ++j)
 
   88              for(
int k(0); k <= n_; ++k)
 
   93                for(
int i(0); i <= n_; ++i)
 
   95                  if((i == k) || (i == j))
 
   98                  for(
int l(0); l <= n_; ++l)
 
   99                    r *= ((l != k) && (l != j) && (l != i) ? (T_(1) + x - T_(l)*s) / (T_(j)*s - T_(l)*s) : T_(1));
 
  100                  t += r / (T_(j)*s - T_(i)*s);
 
  102                v[j] += t / (T_(j)*s - T_(k)*s);
 
  112          template<
typename T_>
 
  113          static inline void points(T_ v[])
 
  120          template<
typename T_>
 
  121          static inline void val(T_ v[], 
const T_ x)
 
  123            v[0] = T_(0.5) * (T_(1) - x);
 
  124            v[1] = T_(0.5) * (T_(1) + x);
 
  128          template<
typename T_>
 
  129          static inline void d1(T_ v[], 
const T_)
 
  136          template<
typename T_>
 
  137          static inline void d2(T_ v[], 
const T_)
 
  148          template<
typename T_>
 
  149          static inline void points(T_ v[])
 
  157          template<
typename T_>
 
  158          static inline void val(T_ v[], 
const T_ x)
 
  160            v[0] = T_(0.5) * x * (x - T_(1));
 
  161            v[1] = (T_(1) - x) * (T_(1) + x);
 
  162            v[2] = T_(0.5) * x * (x + T_(1));
 
  166          template<
typename T_>
 
  167          static inline void d1(T_ v[], 
const T_ x)
 
  175          template<
typename T_>
 
  176          static inline void d2(T_ v[], 
const T_)
 
  188          template<
typename T_>
 
  189          static inline void points(T_ v[])
 
  198          template<
typename T_>
 
  199          static inline void val(T_ v[], 
const T_ x)
 
  201            v[0] = T_(0.0625) * (-T_(1) + x*( T_(1) + T_(9)*x*(T_(1) - x)));
 
  202            v[1] = T_(0.5625) * (T_(1) + x*(-T_(3) + x*(-T_(1) + T_(3)*x)));
 
  203            v[2] = T_(0.5625) * (T_(1) + x*( T_(3) + x*(-T_(1) - T_(3)*x)));
 
  204            v[3] = T_(0.0625) * (-T_(1) + x*(-T_(1) + T_(9)*x*(T_(1) + x)));
 
  208          template<
typename T_>
 
  209          static inline void d1(T_ v[], 
const T_ x)
 
  211            v[0] = T_(0.0625) * ( T_(1) + x*(T_(18) - T_(27)*x));
 
  212            v[1] = T_(0.0625) * (-T_(27) + x*(-T_(18) + T_(81)*x));
 
  213            v[2] = T_(0.0625) * ( T_(27) + x*(-T_(18) - T_(81)*x));
 
  214            v[3] = T_(0.0625) * (-T_(1) + x*(T_(18) + T_(27)*x));
 
  218          template<
typename T_>
 
  219          static inline void d2(T_ v[], 
const T_ x)
 
  221            v[0] = T_(1.125) * (T_(1) - T_(3)*x);
 
  222            v[1] = T_(1.125) * (-T_(1) + T_(9)*x);
 
  223            v[2] = T_(1.125) * (-T_(1) - T_(9)*x);
 
  224            v[3] = T_(1.125) * (T_(1) + T_(3)*x);
 
  289        typename EvalPolicy_,
 
  291      class Evaluator<Trafo_, EvalPolicy_, degree_, Shape::Vertex > :
 
  292        public EvaluatorBase<Trafo_, Evaluator<Trafo_, EvalPolicy_, degree_, Shape::Vertex >, EvalPolicy_>
 
  325        static constexpr int domain_dim = EvalPolicy::domain_dim;
 
  327        static constexpr int image_dim = EvalPolicy::image_dim;
 
  357          BaseClass::prepare(cell_index);
 
  360          const MeshType& mesh = this->_trafo.get_mesh();
 
  363          typedef typename MeshType::VertexSetType VertexSetType;
 
  364          const VertexSetType& vertex_set = mesh.get_vertex_set();
 
  367          typedef typename VertexSetType::VertexType VertexType;
 
  368          const VertexType& vtx = vertex_set[cell_index];
 
  371          for(
int i(0); i < image_dim; ++i)
 
  388          for(
int i(0); i < image_dim; ++i)
 
  404        typename EvalPolicy_,
 
  406      class Evaluator<Trafo_, EvalPolicy_, degree_, Shape::Hypercube<1> > :
 
  407        public EvaluatorBase<Trafo_, Evaluator<Trafo_, EvalPolicy_, degree_, Shape::Hypercube<1> >, EvalPolicy_>
 
  442        static constexpr int domain_dim = EvalPolicy::domain_dim;
 
  444        static constexpr int image_dim = EvalPolicy::image_dim;
 
  468          _charts(trafo.get_charts_vector(1))
 
  481          BaseClass::prepare(cell_index);
 
  484          const MeshType& mesh = this->_trafo.get_mesh();
 
  487          typedef typename MeshType::VertexSetType VertexSetType;
 
  488          const VertexSetType& vertex_set = mesh.get_vertex_set();
 
  491          typedef typename MeshType::template IndexSet<domain_dim, 0>::Type IndexSetType;
 
  492          const IndexSetType& index_set = mesh.template get_index_set<domain_dim, 0>();
 
  495          static constexpr int n = degree_;
 
  498          _iso_coeff[0] = vertex_set[index_set(cell_index, 0)];
 
  499          _iso_coeff[n] = vertex_set[index_set(cell_index, 1)];
 
  504          for(
int i(1); i < n; ++i)
 
  505            _iso_coeff[i].set_convex(
DataType(i) / 
DataType(n), _iso_coeff[0], _iso_coeff[n]);
 
  509          const ChartType* chart = _charts.at(cell_index);
 
  513            for(
int i(1); i < degree_; ++i)
 
  515              _iso_coeff[i] = chart->project(_iso_coeff[i]);
 
  532          Intern::Basis<degree_>::val(v, 
dom_point[0]);
 
  535          for(
int k(0); k <= degree_; ++k)
 
  552          Intern::Basis<degree_>::d1(v, 
dom_point[0]);
 
  555          for(
int k(0); k < image_dim; ++k)
 
  557            for(
int i(0); i <= degree_; ++i)
 
  558              jac_mat(k,0) += v[i] * _iso_coeff[i][k];
 
  575          Intern::Basis<degree_>::d2(v, 
dom_point[0]);
 
  578          for(
int i(0); i < image_dim; ++i)
 
  580            for(
int k(0); k <= degree_; ++k)
 
  581              hess_ten(i,0,0) += v[k] * _iso_coeff[k][i];
 
  602          const DataType a2 = (_iso_coeff[degree_] - _iso_coeff[0]).norm_euclid_sqr();
 
  611          const DataType b2 = (_iso_coeff[1] - 
DataType(0.5) * (_iso_coeff[2] + _iso_coeff[0])).norm_euclid_sqr();
 
  636          static const DataType G = 
DataType(FEAT_F128C(0.77459666924148337703585307995647992216658434105));
 
  671          XABORTM(
"cell width computation not available for isoparametric trafo");
 
  685        typename EvalPolicy_,
 
  687      class Evaluator<Trafo_, EvalPolicy_, degree_, Shape::Hypercube<2> > :
 
  688        public EvaluatorBase<Trafo_, Evaluator<Trafo_, EvalPolicy_, degree_, Shape::Hypercube<2> >, EvalPolicy_>
 
  724        static constexpr int domain_dim = EvalPolicy::domain_dim;
 
  726        static constexpr int image_dim = EvalPolicy::image_dim;
 
  738        const std::vector<const ChartType*>& _charts_2;
 
  751          _charts_1(trafo.get_charts_vector(1)),
 
  752          _charts_2(trafo.get_charts_vector(2))
 
  765          BaseClass::prepare(cell_index);
 
  768          const MeshType& mesh = this->_trafo.get_mesh();
 
  771          typedef typename MeshType::VertexSetType VertexSetType;
 
  772          const VertexSetType& vertex_set = mesh.get_vertex_set();
 
  775          typedef typename MeshType::template IndexSet<2, 0>::Type IndexSetType;
 
  776          const IndexSetType& index_set = mesh.template get_index_set<2, 0>();
 
  779          typedef typename MeshType::template IndexSet<2, 1>::Type EdgeIndexSetType;
 
  780          const EdgeIndexSetType& edges_at_quad = mesh.template get_index_set<2, 1>();
 
  783          static constexpr int n = degree_;
 
  786          _iso_coeff[0][0].
convert(vertex_set[index_set(cell_index, 0)]);
 
  787          _iso_coeff[0][n].
convert(vertex_set[index_set(cell_index, 1)]);
 
  788          _iso_coeff[n][0].
convert(vertex_set[index_set(cell_index, 2)]);
 
  789          _iso_coeff[n][n].
convert(vertex_set[index_set(cell_index, 3)]);
 
  799          for(
int i(1); i < degree_; ++i)
 
  805            _iso_coeff[0][i].
set_convex(alpha, _iso_coeff[0][0], _iso_coeff[0][n]);
 
  807            _iso_coeff[n][i].
set_convex(alpha, _iso_coeff[n][0], _iso_coeff[n][n]);
 
  809            _iso_coeff[i][0].
set_convex(alpha, _iso_coeff[0][0], _iso_coeff[n][0]);
 
  811            _iso_coeff[i][n].
set_convex(alpha, _iso_coeff[0][n], _iso_coeff[n][n]);
 
  815          const int ox[4] = {1, 1, 0, n};
 
  816          const int oy[4] = {0, n, 1, 1};
 
  817          const int ix[4] = {1, 1, 0, 0};
 
  818          const int iy[4] = {0, 0, 1, 1};
 
  824          for(
int e = 0; e < 4; ++e)
 
  827            const Index edge_idx = edges_at_quad(cell_index, e);
 
  830            const ChartType* chart = _charts_1.at(edge_idx);
 
  841            for(
int k(1); k < degree_; ++k, y += iy[e], x += ix[e])
 
  844              point.convert(_iso_coeff[y][x]);
 
  845              point = chart->project(point);
 
  846              _iso_coeff[y][x].
convert(point);
 
  853          for(
int i(1); i < degree_; ++i)
 
  858            for(
int j(1); j < degree_; ++j)
 
  864              p_horz.
set_convex(alpha_h, _iso_coeff[i][0], _iso_coeff[i][n]);
 
  867              p_vert.
set_convex(alpha_v, _iso_coeff[0][j], _iso_coeff[n][j]);
 
  875          const ChartType* chart = _charts_2.at(cell_index);
 
  879            for(
int i(1); i < degree_; ++i)
 
  881              for(
int j(1); j < degree_; ++j)
 
  884                point.convert(_iso_coeff[i][j]);
 
  885                point = chart->project(point);
 
  886                _iso_coeff[i][j].
convert(point);
 
  903          DataType vx[degree_+1], vy[degree_+1];
 
  904          Intern::Basis<degree_>::val(vx, 
dom_point[0]);
 
  905          Intern::Basis<degree_>::val(vy, 
dom_point[1]);
 
  908          for(
int i(0); i <= degree_; ++i)
 
  910            for(
int j(0); j <= degree_; ++j)
 
  911              img_point.axpy(vy[i]*vx[j], _iso_coeff[i][j]);
 
  926          DataType vx[degree_+1], vy[degree_+1];
 
  927          DataType dx[degree_+1], dy[degree_+1];
 
  929          Intern::Basis<degree_>::val(vx, 
dom_point[0]);
 
  930          Intern::Basis<degree_>::val(vy, 
dom_point[1]);
 
  931          Intern::Basis<degree_>::d1(dx, 
dom_point[0]);
 
  932          Intern::Basis<degree_>::d1(dy, 
dom_point[1]);
 
  935          for(
int k(0); k < image_dim; ++k)
 
  937            for(
int i(0); i <= degree_; ++i)
 
  939              for(
int j(0); j <= degree_; ++j)
 
  941                jac_mat(k,0) += vy[i] * dx[j] * _iso_coeff[i][j][k];
 
  942                jac_mat(k,1) += dy[i] * vx[j] * _iso_coeff[i][j][k];
 
  959          DataType vx[degree_+1], vy[degree_+1];
 
  960          DataType dx[degree_+1], dy[degree_+1];
 
  961          DataType qx[degree_+1], qy[degree_+1];
 
  963          Intern::Basis<degree_>::val(vx, 
dom_point[0]);
 
  964          Intern::Basis<degree_>::val(vy, 
dom_point[1]);
 
  965          Intern::Basis<degree_>::d1(dx, 
dom_point[0]);
 
  966          Intern::Basis<degree_>::d1(dy, 
dom_point[1]);
 
  967          Intern::Basis<degree_>::d2(qx, 
dom_point[0]);
 
  968          Intern::Basis<degree_>::d2(qy, 
dom_point[1]);
 
  971          for(
int k(0); k < image_dim; ++k)
 
  973            for(
int i(0); i <= degree_; ++i)
 
  975              for(
int j(0); j <= degree_; ++j)
 
  977                hess_ten(k,0,0) += vy[i] * qx[j] * _iso_coeff[i][j][k];
 
  978                hess_ten(k,0,1) += dy[i] * dx[j] * _iso_coeff[i][j][k];
 
  979                hess_ten(k,1,1) += qy[i] * vx[j] * _iso_coeff[i][j][k];
 
  995          static const DataType G = 
DataType(FEAT_F128C(0.57735026918962576450914878050195745564760175127));
 
 1002          for(
int i(0); i < 2; ++i)
 
 1005            for(
int j(0); j < 2; ++j)
 
 1037          calc_jac_mat(
jac_mat, cub_pt);
 
 1041          ref_ray.set_mat_vec_mult(
jac_inv, ray);
 
 1044          return DataType(2) / ref_ray.norm_euclid();
 
 1057        typename EvalPolicy_,
 
 1059      class Evaluator<Trafo_, EvalPolicy_, degree_, Shape::Hypercube<3> > :
 
 1060        public EvaluatorBase<Trafo_, Evaluator<Trafo_, EvalPolicy_, degree_, Shape::Hypercube<3> >, EvalPolicy_>
 
 1096        static constexpr int domain_dim = EvalPolicy::domain_dim;
 
 1098        static constexpr int image_dim = EvalPolicy::image_dim;
 
 1110        const std::vector<const ChartType*>& _charts_2;
 
 1111        const std::vector<const ChartType*>& _charts_3;
 
 1118        template<
typename T_, 
typename C_>
 
 1119        static void _c1(C_& q, T_ x, 
const C_& u1, 
const C_& u2)
 
 1121          for(
int i(0); i < C_::n; ++i)
 
 1122            q[i] = u1[i] + x * (u2[i] - u1[i]);
 
 1126        template<
typename T_, 
typename C_>
 
 1127        static void _c2(C_& q, T_ x, 
const C_& u1, 
const C_& u2, T_ y, 
const C_& v1, 
const C_& v2)
 
 1129          for(
int i(0); i < C_::n; ++i)
 
 1130            q[i] = T_(0.5) * (u1[i] + v1[i] + x * (u2[i] - u1[i]) + y * (v2[i] - v1[i]));
 
 1134        template<
typename T_, 
typename C_>
 
 1135        static void _c3(C_& q, T_ x, 
const C_& u1, 
const C_& u2, T_ y, 
const C_& v1, 
const C_& v2, T_ z, 
const C_& w1, 
const C_& w2)
 
 1137          for(
int i(0); i < C_::n; ++i)
 
 1138            q[i] = (u1[i] + v1[i] + w1[i] + x * (u2[i] - u1[i]) + y * (v2[i] - v1[i]) + z * (w2[i] - w1[i])) / T_(3);
 
 1150          _charts_1(trafo.get_charts_vector(1)),
 
 1151          _charts_2(trafo.get_charts_vector(2)),
 
 1152          _charts_3(trafo.get_charts_vector(3))
 
 1165          BaseClass::prepare(cell_index);
 
 1168          const MeshType& mesh = this->_trafo.get_mesh();
 
 1171          typedef typename MeshType::VertexSetType VertexSetType;
 
 1172          const VertexSetType& vertex_set = mesh.get_vertex_set();
 
 1175          typedef typename MeshType::template IndexSet<3, 0>::Type IndexSetType;
 
 1176          const IndexSetType& index_set = mesh.template get_index_set<3, 0>();
 
 1179          typedef typename MeshType::template IndexSet<3, 1>::Type EdgeIndexSetType;
 
 1180          const EdgeIndexSetType& edges_at_hexa = mesh.template get_index_set<3, 1>();
 
 1183          typedef typename MeshType::template IndexSet<3, 2>::Type QuadIndexSetType;
 
 1184          const QuadIndexSetType& quads_at_hexa = mesh.template get_index_set<3, 2>();
 
 1187          static constexpr int n = degree_;
 
 1190          _iso_coeff[0][0][0].
convert(vertex_set[index_set(cell_index, 0)]);
 
 1191          _iso_coeff[0][0][n].
convert(vertex_set[index_set(cell_index, 1)]);
 
 1192          _iso_coeff[0][n][0].
convert(vertex_set[index_set(cell_index, 2)]);
 
 1193          _iso_coeff[0][n][n].
convert(vertex_set[index_set(cell_index, 3)]);
 
 1194          _iso_coeff[n][0][0].
convert(vertex_set[index_set(cell_index, 4)]);
 
 1195          _iso_coeff[n][0][n].
convert(vertex_set[index_set(cell_index, 5)]);
 
 1196          _iso_coeff[n][n][0].
convert(vertex_set[index_set(cell_index, 6)]);
 
 1197          _iso_coeff[n][n][n].
convert(vertex_set[index_set(cell_index, 7)]);
 
 1208          for(
int i(1); i < degree_; ++i)
 
 1214            _c1(_iso_coeff[0][0][i], alpha, _iso_coeff[0][0][0], _iso_coeff[0][0][n]);
 
 1216            _c1(_iso_coeff[0][n][i], alpha, _iso_coeff[0][n][0], _iso_coeff[0][n][n]);
 
 1218            _c1(_iso_coeff[n][0][i], alpha, _iso_coeff[n][0][0], _iso_coeff[n][0][n]);
 
 1220            _c1(_iso_coeff[n][n][i], alpha, _iso_coeff[n][n][0], _iso_coeff[n][n][n]);
 
 1224            _c1(_iso_coeff[0][i][0], alpha, _iso_coeff[0][0][0], _iso_coeff[0][n][0]);
 
 1226            _c1(_iso_coeff[0][i][n], alpha, _iso_coeff[0][0][n], _iso_coeff[0][n][n]);
 
 1228            _c1(_iso_coeff[n][i][0], alpha, _iso_coeff[n][0][0], _iso_coeff[n][n][0]);
 
 1230            _c1(_iso_coeff[n][i][n], alpha, _iso_coeff[n][0][n], _iso_coeff[n][n][n]);
 
 1234            _c1(_iso_coeff[i][0][0], alpha, _iso_coeff[0][0][0], _iso_coeff[n][0][0]);
 
 1236            _c1(_iso_coeff[i][0][n], alpha, _iso_coeff[0][0][n], _iso_coeff[n][0][n]);
 
 1238            _c1(_iso_coeff[i][n][0], alpha, _iso_coeff[0][n][0], _iso_coeff[n][n][0]);
 
 1240            _c1(_iso_coeff[i][n][n], alpha, _iso_coeff[0][n][n], _iso_coeff[n][n][n]);
 
 1244          const int eox[12] = {1, 1, 1, 1, 0, n, 0, n, 0, n, 0, n};
 
 1245          const int eoy[12] = {0, n, 0, n, 1, 1, 1, 1, 0, 0, n, n};
 
 1246          const int eoz[12] = {0, 0, n, n, 0, 0, n, n, 1, 1, 1, 1};
 
 1247          const int eix[12] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0};
 
 1248          const int eiy[12] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0};
 
 1249          const int eiz[12] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1};
 
 1255          for(
int e = 0; e < 12; ++e)
 
 1258            const Index edge_idx = edges_at_hexa(cell_index, e);
 
 1261            const ChartType* chart = _charts_1.at(edge_idx);
 
 1264            if(chart == 
nullptr)
 
 1273            for(
int i(1); i < degree_; ++i, z += eiz[e], y += eiy[e], x += eix[e])
 
 1276              point.convert(_iso_coeff[z][y][x]);
 
 1277              point = chart->project(point);
 
 1278              _iso_coeff[z][y][x].
convert(point);
 
 1283          for(
int i(1); i < degree_; ++i)
 
 1287            for(
int j(1); j < degree_; ++j)
 
 1292              _c2(_iso_coeff[0][i][j],
 
 1293                alpha_i, _iso_coeff[0][0][j], _iso_coeff[0][n][j],
 
 1294                alpha_j, _iso_coeff[0][i][0], _iso_coeff[0][i][n]);
 
 1295              _c2(_iso_coeff[n][i][j],
 
 1296                alpha_i, _iso_coeff[n][0][j], _iso_coeff[n][n][j],
 
 1297                alpha_j, _iso_coeff[n][i][0], _iso_coeff[n][i][n]);
 
 1300              _c2(_iso_coeff[i][0][j],
 
 1301                alpha_i, _iso_coeff[0][0][j], _iso_coeff[n][0][j],
 
 1302                alpha_j, _iso_coeff[i][0][0], _iso_coeff[i][0][n]);
 
 1303              _c2(_iso_coeff[i][n][j],
 
 1304                alpha_i, _iso_coeff[0][n][j], _iso_coeff[n][n][j],
 
 1305                alpha_j, _iso_coeff[i][n][0], _iso_coeff[i][n][n]);
 
 1308              _c2(_iso_coeff[i][j][0],
 
 1309                alpha_i, _iso_coeff[0][j][0], _iso_coeff[n][j][0],
 
 1310                alpha_j, _iso_coeff[i][0][0], _iso_coeff[i][n][0]);
 
 1311              _c2(_iso_coeff[i][j][n],
 
 1312                alpha_i, _iso_coeff[0][j][n], _iso_coeff[n][j][n],
 
 1313                alpha_j, _iso_coeff[i][0][n], _iso_coeff[i][n][n]);
 
 1318          const int qox[6] = {1, 1, 1, 1, 0, n};
 
 1319          const int qoy[6] = {1, 1, 0, n, 1, 1};
 
 1320          const int qoz[6] = {0, n, 1, 1, 1, 1};
 
 1321          const int qix[6] = {0, 0, 0, 0, 0, 0};
 
 1322          const int qjx[6] = {1, 1, 1, 1, 0, 0};
 
 1323          const int qiy[6] = {1, 1, 0, 0, 0, 0};
 
 1324          const int qjy[6] = {0, 0, 0, 0, 1, 1};
 
 1325          const int qiz[6] = {0, 0, 1, 1, 1, 1};
 
 1326          const int qjz[6] = {0, 0, 0, 0, 0, 0};
 
 1329          for(
int q = 0; q < 6; ++q)
 
 1332            const Index quad_idx = quads_at_hexa(cell_index, q);
 
 1335            const ChartType* chart = _charts_2.at(quad_idx);
 
 1338            if(chart == 
nullptr)
 
 1347            for(
int i(1); i < degree_; ++i, z += qiz[q], y += qiy[q], x += qix[q])
 
 1349              for(
int j(1); j < degree_; ++j, z += qjz[q], y += qjy[q], x += qjx[q])
 
 1352                point.convert(_iso_coeff[z][y][x]);
 
 1353                point = chart->project(point);
 
 1354                _iso_coeff[z][y][x].
convert(point);
 
 1360          for(
int i(1); i < degree_; ++i)
 
 1363            for(
int j(1); j < degree_; ++j)
 
 1366              for(
int k(1); k < degree_; ++k)
 
 1369                _c3(_iso_coeff[i][j][k],
 
 1370                  alpha_i, _iso_coeff[0][j][k], _iso_coeff[n][j][k],
 
 1371                  alpha_j, _iso_coeff[i][0][k], _iso_coeff[i][n][k],
 
 1372                  alpha_k, _iso_coeff[i][j][0], _iso_coeff[i][j][n]);
 
 1378          const ChartType* chart = _charts_3.at(cell_index);
 
 1379          if(chart != 
nullptr)
 
 1382            for(
int i(1); i < degree_; ++i)
 
 1384              for(
int j(1); j < degree_; ++j)
 
 1386                for(
int k(1); k < degree_; ++k)
 
 1389                  point.convert(_iso_coeff[i][j][k]);
 
 1390                  point = chart->project(point);
 
 1391                  _iso_coeff[i][j][k].
convert(point);
 
 1409          DataType vx[degree_+1], vy[degree_+1], vz[degree_+1];
 
 1410          Intern::Basis<degree_>::val(vx, 
dom_point[0]);
 
 1411          Intern::Basis<degree_>::val(vy, 
dom_point[1]);
 
 1412          Intern::Basis<degree_>::val(vz, 
dom_point[2]);
 
 1415          for(
int i(0); i <= degree_; ++i)
 
 1417            for(
int j(0); j <= degree_; ++j)
 
 1419              for(
int k(0); k <= degree_; ++k)
 
 1421                img_point.axpy(vz[i]*vy[j]*vx[k], _iso_coeff[i][j][k]);
 
 1438          DataType vx[degree_+1], vy[degree_+1], vz[degree_+1];
 
 1439          DataType dx[degree_+1], dy[degree_+1], dz[degree_+1];
 
 1441          Intern::Basis<degree_>::val(vx, 
dom_point[0]);
 
 1442          Intern::Basis<degree_>::val(vy, 
dom_point[1]);
 
 1443          Intern::Basis<degree_>::val(vz, 
dom_point[2]);
 
 1444          Intern::Basis<degree_>::d1(dx, 
dom_point[0]);
 
 1445          Intern::Basis<degree_>::d1(dy, 
dom_point[1]);
 
 1446          Intern::Basis<degree_>::d1(dz, 
dom_point[2]);
 
 1449          for(
int l(0); l < image_dim; ++l)
 
 1451            for(
int i(0); i <= degree_; ++i)
 
 1453              for(
int j(0); j <= degree_; ++j)
 
 1455                for(
int k(0); k <= degree_; ++k)
 
 1457                  jac_mat(l,0) += vz[i] * vy[j] * dx[k] * _iso_coeff[i][j][k][l];
 
 1458                  jac_mat(l,1) += vz[i] * dy[j] * vx[k] * _iso_coeff[i][j][k][l];
 
 1459                  jac_mat(l,2) += dz[i] * vy[j] * vx[k] * _iso_coeff[i][j][k][l];
 
 1477          DataType vx[degree_+1], vy[degree_+1], vz[degree_+1];
 
 1478          DataType dx[degree_+1], dy[degree_+1], dz[degree_+1];
 
 1479          DataType qx[degree_+1], qy[degree_+1], qz[degree_+1];
 
 1481          Intern::Basis<degree_>::val(vx, 
dom_point[0]);
 
 1482          Intern::Basis<degree_>::val(vy, 
dom_point[1]);
 
 1483          Intern::Basis<degree_>::val(vz, 
dom_point[2]);
 
 1484          Intern::Basis<degree_>::d1(dx, 
dom_point[0]);
 
 1485          Intern::Basis<degree_>::d1(dy, 
dom_point[1]);
 
 1486          Intern::Basis<degree_>::d1(dz, 
dom_point[2]);
 
 1487          Intern::Basis<degree_>::d2(qx, 
dom_point[0]);
 
 1488          Intern::Basis<degree_>::d2(qy, 
dom_point[1]);
 
 1489          Intern::Basis<degree_>::d2(qz, 
dom_point[2]);
 
 1492          for(
int l(0); l < image_dim; ++l)
 
 1494            for(
int i(0); i <= degree_; ++i)
 
 1496              for(
int j(0); j <= degree_; ++j)
 
 1498                for(
int k(0); k <= degree_; ++k)
 
 1500                  hess_ten(l,0,0) += vz[i] * vy[j] * qx[k] * _iso_coeff[i][j][k][l];
 
 1501                  hess_ten(l,0,1) += vz[i] * dy[j] * dx[k] * _iso_coeff[i][j][k][l];
 
 1502                  hess_ten(l,0,2) += dz[i] * vy[j] * dx[k] * _iso_coeff[i][j][k][l];
 
 1503                  hess_ten(l,1,1) += vz[i] * qy[j] * vx[k] * _iso_coeff[i][j][k][l];
 
 1504                  hess_ten(l,1,2) += dz[i] * dy[j] * vx[k] * _iso_coeff[i][j][k][l];
 
 1505                  hess_ten(l,2,2) += qz[i] * vy[j] * vx[k] * _iso_coeff[i][j][k][l];
 
 1524          const DataType cx = 
DataType(FEAT_F128C(0.57735026918962576450914878050195745564760175127));
 
 1531          for(
int i(0); i < 8; ++i)
 
 1534            for(
int j(0); j < 3; ++j)
 
 1535              cub_pt[j] = 
DataType((((i >> j) & 1) << 1) - 1) * cx;
 
 1538            calc_jac_mat(
jac_mat, cub_pt);
 
 1567          calc_jac_mat(
jac_mat, cub_pt);
 
 1571          ref_ray.set_mat_vec_mult(
jac_inv, ray);
 
 1574          return DataType(2) / ref_ray.norm_euclid();
 
#define XABORTM(msg)
Abortion macro definition with custom message.
VertexSetType::VertexType WorldPoint
Type of a single vertex.
Tiny Vector class template.
CUDA_HOST_DEVICE Vector & set_convex(DataType alpha, const Vector< T_, n_, sna_ > &a, const Vector< T_, n_, snb_ > &b)
Sets this vector to the convex combination of two other vectors.
CUDA_HOST_DEVICE void convert(const Vector< Tx_, n_, sx_ > &x)
conversion operator
Trafo Evaluator CRTP base-class template.
Shape::Hypercube< 3 > ShapeType
shape type
EvalPolicy::HessianTensorType HessianTensorType
hessian tensor type
EvalPolicy_ EvalPolicy
trafo evaluation traits
EvalPolicy::JacobianInverseType JacobianInverseType
jacobian inverse matrix type
EvalPolicy::HessianInverseType HessianInverseType
hessian inverse tensor type
Evaluator(const TrafoType &trafo)
Constructor.
EvalPolicy::DomainPointType DomainPointType
domain point type
void calc_hess_ten(HessianTensorType &hess_ten, const DomainPointType &dom_point) const
Computes the hessian tensor for a given domain point.
EvalPolicy::JacobianDeterminantType JacobianDeterminantType
jacobian determinant type
TrafoType::MeshType MeshType
type of the underlying mesh
Geometry::Atlas::ChartBase< MeshType > ChartType
type of the chart
DataType volume() const
Computes and returns the volume of the current cell.
EvalPolicy::ImagePointType ImagePointType
image point type
void calc_jac_mat(JacobianMatrixType &jac_mat, const DomainPointType &dom_point) const
Calculates the jacobian matrix for a given point.
EvalPolicy::DataType DataType
evaluation data type
void prepare(Index cell_index)
Prepares the evaluator for a given cell.
DataType width_directed(const ImagePointType &ray) const
Computes and returns the directed mesh width.
Trafo_ TrafoType
trafo type using this evaluator
void map_point(ImagePointType &img_point, const DomainPointType &dom_point) const
Maps a point from the reference cell to the selected cell.
const std::vector< const ChartType * > & _charts_1
the chart pointer arrays
EvaluatorBase< Trafo_, Evaluator, EvalPolicy_ > BaseClass
base-class typedef
EvalPolicy::JacobianMatrixType JacobianMatrixType
jacobian matrix type
EvalPolicy::HessianInverseType HessianInverseType
hessian inverse tensor type
Trafo_ TrafoType
trafo type using this evaluator
EvalPolicy::JacobianInverseType JacobianInverseType
jacobian inverse matrix type
TrafoType::MeshType MeshType
type of the underlying mesh
const std::vector< const ChartType * > & _charts_1
the chart pointer arrays
EvalPolicy::DomainPointType DomainPointType
domain point type
void prepare(Index cell_index)
Prepares the evaluator for a given cell.
void calc_jac_mat(JacobianMatrixType &jac_mat, const DomainPointType &dom_point) const
Calculates the jacobian matrix for a given point.
DataType width_directed(const ImagePointType &ray) const
Computes and returns the directed mesh width.
EvalPolicy::DataType DataType
evaluation data type
EvalPolicy_ EvalPolicy
trafo evaluation traits
EvaluatorBase< Trafo_, Evaluator, EvalPolicy_ > BaseClass
base-class typedef
Shape::Hypercube< 2 > ShapeType
shape type
void calc_hess_ten(HessianTensorType &hess_ten, const DomainPointType &dom_point) const
Computes the hessian tensor for a given domain point.
EvalPolicy::ImagePointType ImagePointType
image point type
Geometry::Atlas::ChartBase< MeshType > ChartType
type of the chart
EvalPolicy::HessianTensorType HessianTensorType
hessian tensor type
EvalPolicy::JacobianDeterminantType JacobianDeterminantType
jacobian determinant type
EvalPolicy::JacobianMatrixType JacobianMatrixType
jacobian matrix type
DataType volume() const
Computes and returns the volume of the current cell.
void map_point(ImagePointType &img_point, const DomainPointType &dom_point) const
Maps a point from the reference cell to the selected cell.
Evaluator(const TrafoType &trafo)
Constructor.
EvaluatorBase< Trafo_, Evaluator, EvalPolicy_ > BaseClass
base-class typedef
EvalPolicy::JacobianDeterminantType JacobianDeterminantType
jacobian determinant type
EvalPolicy_ EvalPolicy
trafo evaluation traits
EvalPolicy::HessianTensorType HessianTensorType
hessian tensor type
EvalPolicy::ImagePointType ImagePointType
image point type
EvalPolicy::JacobianInverseType JacobianInverseType
jacobian inverse matrix type
void map_point(ImagePointType &img_point, const DomainPointType &dom_point) const
Maps a point from the reference cell to the selected cell.
EvalPolicy::HessianInverseType HessianInverseType
hessian inverse tensor type
EvalPolicy::DomainPointType DomainPointType
domain point type
Trafo_ TrafoType
trafo type using this evaluator
EvalPolicy::JacobianMatrixType JacobianMatrixType
jacobian matrix type
void prepare(Index cell_index)
Prepares the evaluator for a given cell.
Shape::Vertex ShapeType
shape type
EvalPolicy::DataType DataType
evaluation data type
Evaluator(const TrafoType &trafo)
Constructor.
TrafoType::MeshType MeshType
type of the underlying mesh
Shape::Hypercube< 1 > ShapeType
shape type
EvalPolicy::JacobianMatrixType JacobianMatrixType
jacobian matrix type
void map_point(ImagePointType &img_point, const DomainPointType &dom_point) const
Maps a point from the reference cell to the selected cell.
void prepare(Index cell_index)
Prepares the evaluator for a given cell.
EvalPolicy_ EvalPolicy
trafo evaluation traits
EvalPolicy::DomainPointType DomainPointType
domain point type
void calc_jac_mat(JacobianMatrixType &jac_mat, const DomainPointType &dom_point) const
Calculates the jacobian matrix for a given point.
DataType volume() const
Computes and returns the volume of the current cell.
DataType width_directed(const ImagePointType &) const
Computes and returns the directed mesh width.
Evaluator(const TrafoType &trafo)
Constructor.
EvalPolicy::DataType DataType
evaluation data type
DataType volume_g3() const
Approximates the edge length using a 3-point Gauss quadrature rule.
EvalPolicy::HessianTensorType HessianTensorType
hessian tensor type
Trafo_ TrafoType
trafo type using this evaluator
EvalPolicy::HessianInverseType HessianInverseType
hessian inverse tensor type
TrafoType::MeshType MeshType
type of the underlying mesh
EvaluatorBase< Trafo_, Evaluator, EvalPolicy_ > BaseClass
base-class typedef
EvalPolicy::JacobianDeterminantType JacobianDeterminantType
jacobian determinant type
EvalPolicy::JacobianInverseType JacobianInverseType
jacobian inverse matrix type
EvalPolicy::ImagePointType ImagePointType
image point type
Geometry::Atlas::ChartBase< MeshType > ChartType
type of the chart
void calc_hess_ten(HessianTensorType &hess_ten, const DomainPointType &dom_point) const
Computes the hessian tensor for a given domain point.
const std::vector< const ChartType * > & _charts
the chart pointer array
T_ sqrt(T_ x)
Returns the square-root of a value.
T_ log(T_ x)
Returns the natural logarithm of a value.
std::uint64_t Index
Index data type.
TrafoTags
Trafo configuration tags enum.
@ img_point
specifies whether the trafo should supply image point coordinates
@ hess_inv
specifies whether the trafo should supply inverse hessian tensors
@ dom_point
specifies whether the trafo should supply domain point coordinates
@ hess_ten
specifies whether the trafo should supply hessian tensors
@ jac_inv
specifies whether the trafo should supply inverse jacobian matrices
@ jac_mat
specifies whether the trafo should supply jacobian matrices
@ jac_det
specifies whether the trafo should supply jacobian determinants
Hypercube shape tag struct template.