9#include <kernel/space/node_functional_base.hpp> 
   15    namespace Discontinuous
 
   20        template<
typename Shape_>
 
   24        struct Barycentre< Shape::Simplex<dim_> >
 
   27          static void make(T_& p)
 
   29            typedef typename T_::DataType DT;
 
   30            for(
int i(0); i < dim_; ++i)
 
   31              p[i] = DT(1) / DT(dim_+1);
 
   36        struct Barycentre< Shape::Hypercube<dim_> >
 
   39          static void make(T_& p)
 
   41            typedef typename T_::DataType DT;
 
   42            for(
int i(0); i < dim_; ++i)
 
   54        typename Shape_ = 
typename Space_::ShapeType>
 
   74        static constexpr int max_assigned_dofs = 1;
 
   76        template<
typename Function_>
 
   83        typedef typename Space_::TrafoType TrafoType;
 
   85        typedef typename TrafoEvalType::EvalTraits TrafoEvalTraits;
 
   86        typedef typename TrafoEvalTraits::DomainPointType DomainPointType;
 
   89        typedef typename TrafoEvalType::template ConfigTraits<TrafoTags::img_point>::EvalDataType TrafoEvalData;
 
   91        TrafoEvalType _trafo_eval;
 
   92        DomainPointType _dom_point;
 
   97          _trafo_eval(space.get_trafo())
 
  100          Intern::Barycentre<Shape_>::make(_dom_point);
 
  106          _trafo_eval.prepare(cell_index);
 
  111          _trafo_eval.finish();
 
  117          return max_assigned_dofs;
 
  120        template<
typename NodeData_, 
typename Function_>
 
  121        void operator()(NodeData_& node_data, 
const Function_& function)
 const 
  123          static_assert(std::is_base_of<Analytic::Function, Function_>::value, 
"invalid function object");
 
  124          static_assert(Function_::can_value, 
"function cannot compute values");
 
  127          typedef Analytic::EvalTraits<DataType_, Function_> FuncEvalTraits;
 
  130          typename Function_::template Evaluator<FuncEvalTraits> func_eval(function);
 
  133          TrafoEvalData trafo_data;
 
  134          _trafo_eval(trafo_data, _dom_point);
 
  137          node_data[0] = func_eval.value(trafo_data.img_point);
 
  150        static constexpr int max_assigned_dofs = shape_dim_+1;
 
  152        template<
typename Function_>
 
  159        typedef typename Space_::TrafoType TrafoType;
 
  162        typedef typename TrafoEvalType::EvalTraits TrafoEvalTraits;
 
  163        typedef typename TrafoEvalTraits::DomainPointType DomainPointType;
 
  166        typedef typename TrafoEvalType::template ConfigTraits<TrafoTags::img_point>::EvalDataType TrafoEvalData;
 
  168        TrafoEvalType _trafo_eval;
 
  173          _trafo_eval(space.get_trafo())
 
  180          _trafo_eval.prepare(cell_index);
 
  185          _trafo_eval.finish();
 
  191          return max_assigned_dofs;
 
  194        template<
typename NodeData_, 
typename Function_>
 
  195        void operator()(NodeData_& node_data, 
const Function_& function)
 const 
  197          static_assert(std::is_base_of<Analytic::Function, Function_>::value, 
"invalid function object");
 
  198          static_assert(Function_::can_value, 
"function cannot compute values");
 
  201          typedef Analytic::EvalTraits<DataType_, Function_> FuncEvalTraits;
 
  204          typename Function_::template Evaluator<FuncEvalTraits> func_eval(function);
 
  207          TrafoEvalData trafo_data;
 
  211          for(
int i(0); i < max_assigned_dofs; ++i)
 
  214            for(
int j(0); j < shape_dim_; ++j)
 
  216              dom_point[j] = DataType_(j+1 == i ? 1 : 0);
 
  223            node_data[i] = func_eval.value(trafo_data.img_point);
 
  237        static constexpr int max_assigned_dofs = shape_dim_+1;
 
  239        template<
typename Function_>
 
  246        typedef typename Space_::TrafoType TrafoType;
 
  249        typedef typename TrafoEvalType::EvalTraits TrafoEvalTraits;
 
  250        typedef typename TrafoEvalTraits::DomainPointType DomainPointType;
 
  253        typedef typename TrafoEvalType::template ConfigTraits<TrafoTags::img_point>::EvalDataType TrafoEvalData;
 
  255        TrafoEvalType _trafo_eval;
 
  260          _trafo_eval(space.get_trafo())
 
  267          _trafo_eval.prepare(cell_index);
 
  272          _trafo_eval.finish();
 
  278          return max_assigned_dofs;
 
  281        template<
typename NodeData_, 
typename Function_>
 
  282        void operator()(NodeData_& node_data, 
const Function_& function)
 const 
  284          static_assert(std::is_base_of<Analytic::Function, Function_>::value, 
"invalid function object");
 
  285          static_assert(Function_::can_value, 
"function cannot compute values");
 
  288          typedef Analytic::EvalTraits<DataType_, Function_> FuncEvalTraits;
 
  291          typename Function_::template Evaluator<FuncEvalTraits> func_eval(function);
 
  294          TrafoEvalData trafo_data;
 
  299          node_data[0] = func_eval.value(trafo_data.img_point);
 
  302          for(
int i(0); i < shape_dim_; ++i)
 
  307            const auto value_0 = func_eval.value(trafo_data.img_point);
 
  312            const auto value_1 = func_eval.value(trafo_data.img_point);
 
  315            node_data[i+1] = DataType_(0.5) * (value_0 - value_1);
 
Node-functional base class template.
void finish()
Releases the node-functional from the current cell.
void prepare(Index cell_index)
Prepares the node-functional for a given cell.
Null-Node-Functional class template.
int get_num_assigned_dofs() const
Returns the number of assigned dofs on the current cell.
NodeFunctionalBase< Space_, DataType_ > BaseClass
base-class typedef
void operator()(NodeData_ &node_data, const Function_ &function) const
Evaluation operator.
std::uint64_t Index
Index data type.
@ dom_point
specifies whether the trafo should supply domain point coordinates
Hypercube shape tag struct template.
Simplex shape tag struct template.