10#include <kernel/space/node_functional_base.hpp> 
   11#include <kernel/cubature/dynamic_factory.hpp> 
   17    namespace CroRavRanTur
 
   48        static constexpr int max_assigned_dofs = 1;
 
   50        template<
typename Function_>
 
   57        typedef typename Space_::TrafoType TrafoType;
 
   58        typedef typename Space_::ShapeType ShapeType;
 
   59        typedef typename Shape::FaceTraits<ShapeType, ShapeType::dimension-1>::ShapeType FacetType;
 
   61        typedef typename TrafoEvalType::EvalTraits TrafoEvalTraits;
 
   62        typedef typename TrafoEvalTraits::DataType 
DataType;
 
   63        typedef typename TrafoEvalTraits::DomainPointType DomainPointType;
 
   65        static constexpr int image_dim = TrafoEvalTraits::image_dim;
 
   67        typedef typename TrafoEvalType::template ConfigTraits<TrafoTags::img_point>::EvalDataType TrafoEvalData;
 
   69        TrafoEvalType _trafo_eval;
 
   70        DomainPointType _barycentre;
 
   75          _trafo_eval(space.get_trafo())
 
   78          for(
int i(0); i < ShapeType::dimension-1; ++i)
 
   79            _barycentre[i] = DataType_(1) / DataType_(shape_dim_);
 
   85          _trafo_eval.prepare(cell_index);
 
   96          return max_assigned_dofs;
 
   99        template<
typename NodeData_, 
typename Function_>
 
  100        void operator()(NodeData_& node_data, 
const Function_& function)
 const 
  102          static_assert(std::is_base_of<Analytic::Function, Function_>::value, 
"invalid function object");
 
  105          typedef Analytic::EvalTraits<DataType_, Function_> FuncEvalTraits;
 
  108          typename Function_::template Evaluator<FuncEvalTraits> func_eval(function);
 
  111          TrafoEvalData trafo_data;
 
  112          _trafo_eval(trafo_data, _barycentre);
 
  115          node_data[0] = func_eval.value(trafo_data.img_point);
 
  133        static constexpr int max_assigned_dofs = 1;
 
  135        template<
typename Function_>
 
  142        typedef typename Space_::TrafoType TrafoType;
 
  143        typedef typename Space_::ShapeType ShapeType;
 
  144        typedef typename Shape::FaceTraits<ShapeType, ShapeType::dimension-1>::ShapeType FacetType;
 
  146        typedef typename TrafoEvalType::EvalTraits TrafoEvalTraits;
 
  147        typedef typename TrafoEvalTraits::DataType 
DataType;
 
  148        typedef typename TrafoEvalTraits::DomainPointType DomainPointType;
 
  150        static constexpr int image_dim = TrafoEvalTraits::image_dim;
 
  154#if defined(FEAT_COMPILER_PGI) || (defined(FEAT_COMPILER_INTEL) && FEAT_COMPILER_INTEL >= 1800 && FEAT_COMPILER_INTEL < 1900) 
  156        typedef typename TrafoEvalType::template ConfigTraits<trafo_tags>::EvalDataType 
TrafoEvalData;
 
  158        typedef typename TrafoEvalType::template ConfigTraits<TrafoTags::img_point | TrafoTags::jac_det>::EvalDataType 
TrafoEvalData;
 
  163        TrafoEvalType _trafo_eval;
 
  169          _trafo_eval(space.get_trafo()),
 
  170          _cub_rule(Cubature::ctor_factory, Cubature::DynamicFactory(
"gauss-legendre:2"))
 
  177          _trafo_eval.prepare(cell_index);
 
  182          _trafo_eval.finish();
 
  188          return max_assigned_dofs;
 
  191        template<
typename NodeData_, 
typename Function_>
 
  192        void operator()(NodeData_& node_data, 
const Function_& function)
 const 
  194          static_assert(std::is_base_of<Analytic::Function, Function_>::value, 
"invalid function object");
 
  197          typedef Analytic::EvalTraits<DataType_, Function_> FuncEvalTraits;
 
  200          typename Function_::template Evaluator<FuncEvalTraits> func_eval(function);
 
  202          typename FuncEvalTraits::ValueType 
value(DataType_(0));
 
  203          DataType_ mean(DataType_(0));
 
  204          TrafoEvalData trafo_data;
 
  207          for(
int i(0); i < _cub_rule.get_num_points(); ++i)
 
  209            _trafo_eval(trafo_data, _cub_rule.get_point(i));
 
  210            value += (_cub_rule.get_weight(i) * trafo_data.jac_det) * func_eval.value(trafo_data.img_point);
 
  211            mean += _cub_rule.get_weight(i) * trafo_data.jac_det;
 
  215          node_data[0] = (DataType_(1) / mean) * 
value;
 
Cubature Rule class template.
Crouzeix-Raviart / Rannacher-Turek Element Evaluator class template declaration.
TrafoEvalType::template ConfigTraits< TrafoTags::img_point|TrafoTags::jac_det >::EvalDataType TrafoEvalData
Node-functional base class template.
void finish()
Releases the node-functional from the current cell.
DataType_ DataType
data type
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.
@ value
specifies whether the space should supply basis function values
std::uint64_t Index
Index data type.
TrafoTags
Trafo configuration tags enum.
@ img_point
specifies whether the trafo should supply image point coordinates
@ jac_det
specifies whether the trafo should supply jacobian determinants
Face traits tag struct template.