MGIS 3.1.0
Loading...
Searching...
No Matches
mgis::function::BinaryOperationEvaluatorBase< Child, FirstEvaluatorType, SecondEvaluatorType > Struct Template Reference

a base class to construct an evaluator by applying a binary operation on the results of two evaluators More...

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

Public Types

using Space = evaluator_space<FirstEvaluatorType>
 type of the space on which the two evaluators are defined

Public Member Functions

constexpr BinaryOperationEvaluatorBase (const FirstEvaluatorType &, const SecondEvaluatorType &)
 constructor
constexpr BinaryOperationEvaluatorBase (const BinaryOperationEvaluatorBase &)
 copy constructor
constexpr BinaryOperationEvaluatorBase (BinaryOperationEvaluatorBase &&)
 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
constexpr auto operator() (const element_workspace< Space > &, const element_index< Space > &) const
 call operator
constexpr auto operator() (const cell_index< Space >, const quadrature_point_index< Space >) const
 call operator
constexpr auto operator() (const cell_workspace< Space > &, const cell_index< Space >, const quadrature_point_index< Space >) const
 call operator

Static Public Attributes

static constexpr auto isElementEvaluator
 true if both evaluators match the ElementEvaluatorConcept
static constexpr auto isQuadratureEvaluator
 true if both evaluators match the QuadratureEvaluatorConcept

Protected Attributes

FirstEvaluatorType first_evaluator
 evaluator of the first argument of the binary operation
SecondEvaluatorType second_evaluator
 evaluator of the second argument of the binary operation

Detailed Description

template<typename Child, EvaluatorConcept FirstEvaluatorType, EvaluatorConcept SecondEvaluatorType>
requires (BinaryOperationEvaluatorBaseRequirement<FirstEvaluatorType, SecondEvaluatorType>)
struct mgis::function::BinaryOperationEvaluatorBase< Child, FirstEvaluatorType, SecondEvaluatorType >

a base class to construct an evaluator by applying a binary operation on the results of two evaluators

This class is meant to be used with the curiously recurring template pattern: the child class gives the binary operation through an apply member function taking the values returned by the two evaluators and returning the values of the resulting evaluator.

The call operators of this class forward the values computed by the two evaluators to the apply member function of the child class: only the call operators which match the way both evaluators can be called are available.

Template Parameters
Childtype of the class deriving from this base class
FirstEvaluatorTypeevaluator used to compute the first argument of the binary operation
SecondEvaluatorTypeevaluator used to compute the second argument of the binary operation
Note
both evaluators must satisfy the requirements stated by BinaryOperationEvaluatorBaseRequirement

Constructor & Destructor Documentation

◆ BinaryOperationEvaluatorBase() [1/3]

template<typename Child, EvaluatorConcept FirstEvaluatorType, EvaluatorConcept SecondEvaluatorType>
requires (BinaryOperationEvaluatorBaseRequirement<FirstEvaluatorType, SecondEvaluatorType>)
mgis::function::BinaryOperationEvaluatorBase< Child, FirstEvaluatorType, SecondEvaluatorType >::BinaryOperationEvaluatorBase ( const FirstEvaluatorType & e1,
const SecondEvaluatorType & e2 )
constexpr

constructor

constructor, storing a copy of each of the two evaluators

Parameters
[in]e1evaluator used to compute the first argument of the binary operation, a copy of it is stored in the object
[in]e2evaluator used to compute the second argument of the binary operation, a copy of it is stored in the object

◆ BinaryOperationEvaluatorBase() [2/3]

template<typename Child, EvaluatorConcept FirstEvaluatorType, EvaluatorConcept SecondEvaluatorType>
requires (BinaryOperationEvaluatorBaseRequirement<FirstEvaluatorType, SecondEvaluatorType>)
mgis::function::BinaryOperationEvaluatorBase< Child, FirstEvaluatorType, SecondEvaluatorType >::BinaryOperationEvaluatorBase ( const BinaryOperationEvaluatorBase< Child, FirstEvaluatorType, SecondEvaluatorType > & )
constexprdefault

copy constructor

default copy constructor

◆ BinaryOperationEvaluatorBase() [3/3]

template<typename Child, EvaluatorConcept FirstEvaluatorType, EvaluatorConcept SecondEvaluatorType>
requires (BinaryOperationEvaluatorBaseRequirement<FirstEvaluatorType, SecondEvaluatorType>)
mgis::function::BinaryOperationEvaluatorBase< Child, FirstEvaluatorType, SecondEvaluatorType >::BinaryOperationEvaluatorBase ( BinaryOperationEvaluatorBase< Child, FirstEvaluatorType, SecondEvaluatorType > && )
constexprdefault

move constructor

default move constructor

Member Function Documentation

◆ check()

template<typename Child, EvaluatorConcept FirstEvaluatorType, EvaluatorConcept SecondEvaluatorType>
requires (BinaryOperationEvaluatorBaseRequirement<FirstEvaluatorType, SecondEvaluatorType>)
bool mgis::function::BinaryOperationEvaluatorBase< Child, FirstEvaluatorType, SecondEvaluatorType >::check ( AbstractErrorHandler & ctx) const
nodiscardconstexpr

perform consistency checks

implementation of the check member function

Parameters
[in]ctxerror handler used to report the errors
Returns
true if the values computed by the two evaluators are valid, the errors being reported using the error handler ctx

The spaces of the two evaluators are compared first, then the values computed by each evaluator are checked. The first failing check stops the process and registers the associated error message in the error handler.

◆ getSpace()

template<typename Child, EvaluatorConcept FirstEvaluatorType, EvaluatorConcept SecondEvaluatorType>
requires (BinaryOperationEvaluatorBaseRequirement<FirstEvaluatorType, SecondEvaluatorType>)
decltype(auto) constexpr mgis::function::BinaryOperationEvaluatorBase< Child, FirstEvaluatorType, SecondEvaluatorType >::getSpace ( ) const
nodiscardconstexpr

return the underlying space

Returns
the space on which the two evaluators are defined

◆ operator()() [1/4]

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

call operator

Parameters
[in]ecell index
[in]iquadrature point index of the cell of index e
Returns
values computed by the apply member function of the child class from the values returned by the two evaluators at the quadrature point i of the cell e
Note
only available if both evaluators can be called with a cell index and a quadrature point index

◆ operator()() [2/4]

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

call operator

Parameters
[in]wkworkspace of the cell of index e
[in]ecell index
[in]iquadrature point index of the cell of index e
Returns
values computed by the apply member function of the child class from the values returned by the two evaluators at the quadrature point i of the cell e, whose workspace is wk
Note
only available if both evaluators can be called with a cell workspace, a cell index and a quadrature point index

◆ operator()() [3/4]

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

call operator

Parameters
[in]iindex of the element on which the values are computed
Returns
values computed by the apply member function of the child class from the values returned by the two evaluators at the integration point i, which is the index of the element on which the values are computed
Note
only available if both evaluators can be called with an element index

◆ operator()() [4/4]

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

call operator

Parameters
[in]wkworkspace of the element on which the values are computed
[in]iindex of the integration point of this element
Returns
values computed by the apply member function of the child class from the values returned by the two evaluators at the integration point i of the element whose workspace is wk
Note
only available if both evaluators can be called with an element workspace and an element index

Member Data Documentation

◆ isElementEvaluator

template<typename Child, EvaluatorConcept FirstEvaluatorType, EvaluatorConcept SecondEvaluatorType>
auto mgis::function::BinaryOperationEvaluatorBase< Child, FirstEvaluatorType, SecondEvaluatorType >::isElementEvaluator
staticconstexpr
Initial value:
=
concept defining evaluators working on an element space
Definition EvaluatorConcept.hxx:337

true if both evaluators match the ElementEvaluatorConcept

◆ isQuadratureEvaluator

template<typename Child, EvaluatorConcept FirstEvaluatorType, EvaluatorConcept SecondEvaluatorType>
auto mgis::function::BinaryOperationEvaluatorBase< Child, FirstEvaluatorType, SecondEvaluatorType >::isQuadratureEvaluator
staticconstexpr
Initial value:
=
concept defining evaluators working on a quadrature space
Definition EvaluatorConcept.hxx:347

true if both evaluators match the QuadratureEvaluatorConcept


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