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

an evaluator applying a binary operation to the values returned by two evaluators, without storing this operation More...

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

Inheritance diagram for mgis::function::BinaryOperationModifier2< CallableType, FirstEvaluatorType, SecondEvaluatorType >:
mgis::function::BinaryOperationEvaluatorBase< BinaryOperationModifier2< CallableType, FirstEvaluatorType, SecondEvaluatorType >, FirstEvaluatorType, SecondEvaluatorType > mgis::function::internals::BinaryOperationModifierBase< CallableType, FirstEvaluatorType, SecondEvaluatorType >

Public Member Functions

MGIS_HOST_DEVICE constexpr auto apply (const evaluator_result< FirstEvaluatorType > &, const evaluator_result< SecondEvaluatorType > &) const
 apply the modifier
Public Member Functions inherited from mgis::function::BinaryOperationEvaluatorBase< BinaryOperationModifier2< CallableType, FirstEvaluatorType, SecondEvaluatorType >, FirstEvaluatorType, SecondEvaluatorType >
constexpr BinaryOperationEvaluatorBase (const FirstEvaluatorType &, const SecondEvaluatorType &)
 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

Additional Inherited Members

Public Types inherited from mgis::function::BinaryOperationEvaluatorBase< BinaryOperationModifier2< CallableType, FirstEvaluatorType, SecondEvaluatorType >, FirstEvaluatorType, SecondEvaluatorType >
using Space
 type of the space on which the two evaluators are defined
Static Public Member Functions inherited from mgis::function::internals::BinaryOperationModifierBase< CallableType, FirstEvaluatorType, SecondEvaluatorType >
static MGIS_HOST_DEVICE constexpr size_type getNumberOfComponents () MGIS_NOEXCEPT
 return the number of components
Static Public Attributes inherited from mgis::function::BinaryOperationEvaluatorBase< BinaryOperationModifier2< CallableType, FirstEvaluatorType, SecondEvaluatorType >, FirstEvaluatorType, SecondEvaluatorType >
static constexpr auto isElementEvaluator
 true if both evaluators match the ElementEvaluatorConcept
static constexpr auto isQuadratureEvaluator
 true if both evaluators match the QuadratureEvaluatorConcept
Protected Attributes inherited from mgis::function::BinaryOperationEvaluatorBase< BinaryOperationModifier2< CallableType, FirstEvaluatorType, SecondEvaluatorType >, FirstEvaluatorType, SecondEvaluatorType >
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 CallableType, EvaluatorConcept FirstEvaluatorType, EvaluatorConcept SecondEvaluatorType>
requires (BinaryOperationModifier2Requirements<CallableType, FirstEvaluatorType, SecondEvaluatorType>)
struct mgis::function::BinaryOperationModifier2< CallableType, FirstEvaluatorType, SecondEvaluatorType >

an evaluator applying a binary operation to the values returned by two evaluators, without storing this operation

This class behaves as BinaryOperationModifier except that the callable object is not stored in the instance: it must be trivially default constructible and a default constructed object is created each time the values are computed. Such a modifier is thus as light as the two underlying evaluators, which allows constexpr modifiers such as add or inner_product to be defined:

const auto e3 = add(e1, e2);
const auto e4 = e1 | add(e2);

The constructor inherited from BinaryOperationEvaluatorBase only takes the two evaluators as arguments.

Template Parameters
CallableTypetype of the binary operation, which must be trivially default constructible and callable with the values returned by the two evaluators
FirstEvaluatorTypetype of the evaluator used to compute the first argument of the operation
SecondEvaluatorTypetype of the evaluator used to compute the second argument of the operation

Member Function Documentation

◆ apply()

template<typename CallableType, EvaluatorConcept FirstEvaluatorType, EvaluatorConcept SecondEvaluatorType>
requires (BinaryOperationModifier2Requirements<CallableType, FirstEvaluatorType, SecondEvaluatorType>)
MGIS_HOST_DEVICE constexpr auto mgis::function::BinaryOperationModifier2< CallableType, FirstEvaluatorType, SecondEvaluatorType >::apply ( const evaluator_result< FirstEvaluatorType > & v1,
const evaluator_result< SecondEvaluatorType > & v2 ) const
constexpr

apply the modifier

Parameters
[in]v1value computed by the evaluator of the first argument of the operation at a given integration point
[in]v2value computed by the evaluator of the second argument of the operation at the same integration point
Returns
values computed by calling a default constructed object of type CallableType with the values v1 and v2 computed by the evaluators of the first and second argument of the operation at a given integration point
Note
this function is called by the call operators inherited from BinaryOperationEvaluatorBase

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