10#include <kernel/shape.hpp>
11#include <kernel/trafo/standard/mapping.hpp>
12#include <kernel/geometry/conformal_mesh.hpp>
15#include <kernel/space/eval_data.hpp>
16#include <kernel/space/details.hpp>
17#include <kernel/space/lagrange2/element.hpp>
18#include <kernel/space/lagrange2/details.hpp>
22 namespace VoxelAssembly
24 template<
typename IndexType_>
28 typedef IndexType_ IndexType;
29 const IndexType* cell_to_dofs;
30 IndexType num_loc_dofs;
32 CUDA_HOST_DEVICE IndexType operator()(IndexType cell_index, IndexType vert_index)
const
34 return *(cell_to_dofs + cell_index*num_loc_dofs + vert_index);
37 CUDA_HOST_DEVICE
IndexSetWrapper(
const IndexType* _cell_t, IndexType numi)
39 cell_to_dofs(_cell_t),
47 template<
typename IndexType_>
51 typedef IndexType_ IndexType;
52 const IndexType* loc_cell_to_dofs;
54 CUDA_HOST_DEVICE IndexType operator()(IndexType DOXY(cell_index), IndexType vert_index)
const
56 return *(loc_cell_to_dofs + vert_index);
61 loc_cell_to_dofs(_cell_t)
68 template<
typename VertexType_>
72 typedef VertexType_ VertexType;
73 const VertexType* vert_array;
75 CUDA_HOST_DEVICE VertexType operator[](
Index index)
const
77 return vert_array[index];
90 template<
typename Shape_>
93 template<
typename Space_,
typename DT_,
typename IT_>
96 template<
typename Shape_,
typename DT_,
typename IT_>
100 typedef Shape_ ShapeType;
101 typedef IT_ IndexType;
104 static constexpr int dim = SpaceType::world_dim;
142 typedef DT_ DataType;
143 typedef DataType BasisValueType;
144 typedef DataType BasisReferenceValueType;
149 static constexpr int max_local_dofs = SpaceEvalHelp::get_num_local_dofs();
152 typedef typename EvalTraits::DataType DataType;
159 static constexpr int num_verts = TrafoEvalHelp::num_verts;
166 static constexpr bool reduced_data =
true;
171 SpaceEvalHelp::eval_ref_values(data, point);
176 template<
typename ThreadGroup_>
177 CUDA_DEVICE
static __forceinline__
void group_eval_ref_values(
const ThreadGroup_& tg, EvalData& data,
const DomainPointType& point)
179 SpaceEvalHelp::group_eval_ref_values(tg, data, point);
186 SpaceEvalHelp::eval_ref_gradients(data, point);
192 SpaceEvalHelp::eval_ref_hessians(data, point);
197 TrafoEvalHelp::set_coefficients(coeffs,
VertexSetWrapper(vertex_set), local_dofs, cell_index);
201 template<
typename ThreadGroup_>
202 CUDA_DEVICE
static inline void grouped_set_coefficients(
const ThreadGroup_& tg, DataType* coeffs,
const SharedIndexSetWrapper<IndexType>& local_dofs,
const VertexPointType* vertex_set, IndexType cell_index)
204 TrafoEvalHelp::grouped_set_coefficients(tg, coeffs, VertexSetWrapper(vertex_set), local_dofs, cell_index);
208 CUDA_HOST_DEVICE
static inline void map_point(
typename TrafoEvalHelp::ImagePointType&
img_point,
const typename TrafoEvalHelp::DomainPointType&
dom_point,
const Tiny::Matrix<DataType, dim, num_verts>& coeffs)
213 CUDA_HOST_DEVICE
static inline void calc_jac_mat(
typename TrafoEvalHelp::JacobianMatrixType&
jac_mat,
const typename TrafoEvalHelp::DomainPointType&
dom_point,
const Tiny::Matrix<DataType, dim, num_verts>& coeffs)
219 template<
typename ThreadGroup_>
220 CUDA_DEVICE
static inline void grouped_calc_jac_mat(
const ThreadGroup_& tg,
typename TrafoEvalHelp::JacobianMatrixType&
jac_mat,
const typename TrafoEvalHelp::DomainPointType&
dom_point,
const DataType* coeffs)
226 CUDA_HOST_DEVICE
static inline void calc_hess_ten(
typename TrafoEvalHelp::HessianTensorType&
hess_ten,
const typename TrafoEvalHelp::DomainPointType&
dom_point,
const Tiny::Matrix<DataType, dim, num_verts>& coeffs)
231 CUDA_HOST_DEVICE
static inline DataType volume(
const Tiny::Matrix<DataType, dim, num_verts>& coeffs)
233 return TrafoEvalHelp::volume(coeffs);
236 CUDA_HOST_DEVICE
static inline DataType width_directed(
const typename TrafoEvalHelp::ImagePointType& ray,
const Tiny::Matrix<DataType, dim, num_verts>& coeffs)
238 return TrafoEvalHelp::width_directed(ray, coeffs);
241 CUDA_HOST_DEVICE
static inline void trans_values(EvalData& data)
243 if constexpr(!reduced_data)
244 ParamEvalHelp::trans_values(data);
247 CUDA_HOST_DEVICE
static inline void trans_gradients(EvalData& data,
const typename TrafoEvalHelp::JacobianInverseType&
jac_inv)
250 ParamEvalHelp::trans_gradients(data,
jac_inv);
255 CUDA_HOST_DEVICE
static inline void trans_hessian(EvalData& data,
const typename TrafoEvalHelp::JacobianInverseType&
jac_inv,
const typename TrafoEvalHelp::HessianInverseType&
hess_inv)
Reduced Space evaluation data structure.
Standard Lagrange-2 Finite-Element space class template.
Tiny Matrix class template.
Tiny Tensor3 class template.
Tiny Vector class template.
SpaceTags
Space configuration tags enum.
std::uint64_t Index
Index data type.
@ 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
Evalautator helper class for standard trafo.
static CUDA_HOST_DEVICE void eval_ref_values(EvalData &data, const DomainPointType &point)
Ref value calculation.
Tiny::Tensor3< DT_, dim, dim, dim > HessianTensorType
hessian tensor type
Space::Lagrange2::EvalHelper< DomainPointType, DT_, ShapeType > SpaceEvalHelp
The space helper detail class.
Space::EvalDataReduced< EvalTraits, config > EvalData
The eval data wrapping the basis functions.
Tiny::Vector< DT_, dim > VertexPointType
The vertex point type.
Tiny::Matrix< DT_, dim, dim > JacobianInverseType
jacobian inverse matrix type
Tiny::Tensor3< DT_, dim, dim, dim > HessianInverseType
hessian inverse tensor type
DT_ JacobianDeterminantType
jacobian determinant type
Tiny::Vector< DT_, dim > ImagePointType
The image point type.
DT_ ValueType
The value type.
Tiny::Matrix< DT_, dim, dim > JacobianMatrixType
jacobian matrix type
Space::ParametricEvalHelper ParamEvalHelp
Parametric eval helper.
static CUDA_HOST_DEVICE void eval_ref_gradients(EvalData &data, const DomainPointType &point)
Ref value calculation.
static CUDA_HOST_DEVICE void eval_ref_hessians(EvalData &data, const DomainPointType &point)
ref value calculation
Trafo::Standard::EvalHelper< DataType, DomainPointType, ImagePointType, JacobianMatrixType, JacobianInverseType, JacobianDeterminantType, HessianTensorType, HessianInverseType, ShapeType, dim > TrafoEvalHelp
The trafo helper detail class.
Tiny::Vector< DT_, dim > DomainPointType
The domainpoint type.