MGIS 3.1.0
Loading...
Searching...
No Matches
mgis::function::EvaluatorModifierBase< Child, EvaluatorType > Struct Template Reference

a base class to construct a new evaluator by applying a modifier to the values returned by an existing evaluator More...

#include </home/runner/work/MFrontGenericInterfaceSupport/MFrontGenericInterfaceSupport/include/MGIS/Function/EvaluatorModifierBase.hxx>

Public Types

using Space = evaluator_space<EvaluatorType>
 type of the space on which the underlying evaluator is defined

Public Member Functions

constexpr EvaluatorModifierBase (const EvaluatorType &)
 constructor
constexpr EvaluatorModifierBase (const EvaluatorModifierBase &)
 copy constructor
constexpr EvaluatorModifierBase (EvaluatorModifierBase &&)
 move constructor
constexpr decltype(auto) getSpace () const
 return the underlying space
constexpr bool check (AbstractErrorHandler &) const
 perform consistency checks
constexpr auto operator() (const element_index< Space > &) const
 call operator: the value computed by the underlying evaluator is passed to the apply member function of the derived class
constexpr auto operator() (const element_workspace< Space > &, const element_index< Space > &) const
 call operator: the value computed by the underlying evaluator is passed to the apply member function of the derived class
constexpr auto operator() (const cell_index< Space > &, const quadrature_point_index< Space > &) const
 call operator: the value computed by the underlying evaluator is passed to the apply member function of the derived class
constexpr auto operator() (const cell_workspace< Space > &, const cell_index< Space > &, const quadrature_point_index< Space > &) const
 call operator: the value computed by the underlying evaluator is passed to the apply member function of the derived class

Protected Attributes

EvaluatorType evaluator
 underlying evaluator

Detailed Description

template<typename Child, EvaluatorConcept EvaluatorType>
struct mgis::function::EvaluatorModifierBase< Child, EvaluatorType >

a base class to construct a new evaluator by applying a modifier to the values returned by an existing evaluator

This class implements the CRTP idiom: the call operators forward the values computed by the underlying evaluator to the apply member function of the derived class, which is responsible for modifying them. Only the call operators which match the way the underlying evaluator can be called are available.

Template Parameters
Childtype of the derived class, which must implement an apply member function accepting the values returned by the underlying evaluator
EvaluatorTypetype of the modified evaluator

Constructor & Destructor Documentation

◆ EvaluatorModifierBase()

template<typename Child, EvaluatorConcept EvaluatorType>
mgis::function::EvaluatorModifierBase< Child, EvaluatorType >::EvaluatorModifierBase ( const EvaluatorType & e)
constexpr

constructor

Parameters
[in]emodified evaluator

Member Function Documentation

◆ check()

template<typename Child, EvaluatorConcept EvaluatorType>
bool mgis::function::EvaluatorModifierBase< Child, EvaluatorType >::check ( AbstractErrorHandler & ctx) const
nodiscardconstexpr

perform consistency checks

Parameters
[in]ctxerror handler used to report the errors
Returns
true if the values computed by the underlying evaluator are valid

◆ getSpace()

template<typename Child, EvaluatorConcept EvaluatorType>
decltype(auto) constexpr mgis::function::EvaluatorModifierBase< Child, EvaluatorType >::getSpace ( ) const
nodiscardconstexpr

return the underlying space

Returns
the space on which the underlying evaluator is defined

◆ operator()() [1/4]

template<typename Child, EvaluatorConcept EvaluatorType>
requires (internals::EvaluatorResultQuery<EvaluatorType>::b3)
auto mgis::function::EvaluatorModifierBase< Child, EvaluatorType >::operator() ( const cell_index< Space > & e,
const quadrature_point_index< Space > & i ) const
nodiscardconstexpr

call operator: the value computed by the underlying evaluator is passed to the apply member function of the derived class

Parameters
[in]ecell index
[in]iquadrature point index
Returns
the modified value
Note
only available if the underlying evaluator can be called with a cell index and a quadrature point index

◆ operator()() [2/4]

template<typename Child, EvaluatorConcept EvaluatorType>
requires (internals::EvaluatorResultQuery<EvaluatorType>::b4)
auto mgis::function::EvaluatorModifierBase< Child, EvaluatorType >::operator() ( const cell_workspace< Space > & wk,
const cell_index< Space > & e,
const quadrature_point_index< Space > & i ) const
nodiscardconstexpr

call operator: the value computed by the underlying evaluator is passed to the apply member function of the derived class

Parameters
[in]wkcell workspace
[in]ecell index
[in]iquadrature point index
Returns
the modified value
Note
only available if the underlying evaluator can be called with a cell workspace, a cell index and a quadrature point index

◆ operator()() [3/4]

template<typename Child, EvaluatorConcept EvaluatorType>
requires (internals::EvaluatorResultQuery<EvaluatorType>::b1)
auto mgis::function::EvaluatorModifierBase< Child, EvaluatorType >::operator() ( const element_index< Space > & e) const
nodiscardconstexpr

call operator: the value computed by the underlying evaluator is passed to the apply member function of the derived class

Parameters
[in]eelement index, i.e. index of the integration point
Returns
the modified value
Note
only available if the underlying evaluator can be called with an element index

◆ operator()() [4/4]

template<typename Child, EvaluatorConcept EvaluatorType>
requires (internals::EvaluatorResultQuery<EvaluatorType>::b2)
auto mgis::function::EvaluatorModifierBase< Child, EvaluatorType >::operator() ( const element_workspace< Space > & wk,
const element_index< Space > & e ) const
nodiscardconstexpr

call operator: the value computed by the underlying evaluator is passed to the apply member function of the derived class

Parameters
[in]wkelement workspace
[in]eelement index, i.e. index of the integration point
Returns
the modified value
Note
only available if the underlying evaluator can be called with an element workspace and an element index

The documentation for this struct was generated from the following files: