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

an evaluator applying a binary operation to the values returned by two evaluators More...

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

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

Public Member Functions

MGIS_HOST_DEVICE constexpr BinaryOperationModifier (const CallableType &, const FirstEvaluatorType &, const SecondEvaluatorType &)
 constructor
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< BinaryOperationModifier< 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< BinaryOperationModifier< 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< BinaryOperationModifier< 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< BinaryOperationModifier< 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 (BinaryOperationModifierRequirements<CallableType, FirstEvaluatorType, SecondEvaluatorType>)
struct mgis::function::BinaryOperationModifier< CallableType, FirstEvaluatorType, SecondEvaluatorType >

an evaluator applying a binary operation to the values returned by two evaluators

Such an evaluator is usually built with the binary_operation function, which can either be applied to two evaluators at once or be partially applied to the second evaluator only, in which case a modifier is obtained and can be applied to the first evaluator using operator|:

const auto e3 = binary_operation(c, e1, e2);
const auto e4 = e1 | binary_operation(c, e2);
MGIS_HOST_DEVICE constexpr auto binary_operation(CallableType &&, SecondEvaluatorType &&)
partially apply a binary operation to the evaluator of its second argument
Definition BinaryOperation.ixx:231

The callable object is stored in the instance. The number of components of the returned values is the compile-time size of the type returned by the callable, which must thus be known at compile time. The two evaluators must be defined on the same space and must both be either element evaluators or quadrature evaluators, as stated by BinaryOperationEvaluatorBaseRequirement. Only the call operators which match the way both evaluators can be called are available.

Template Parameters
CallableTypetype of the binary operation, which must be copy 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

Constructor & Destructor Documentation

◆ BinaryOperationModifier()

template<typename CallableType, EvaluatorConcept FirstEvaluatorType, EvaluatorConcept SecondEvaluatorType>
requires (BinaryOperationModifierRequirements<CallableType, FirstEvaluatorType, SecondEvaluatorType>)
MGIS_HOST_DEVICE constexpr mgis::function::BinaryOperationModifier< CallableType, FirstEvaluatorType, SecondEvaluatorType >::BinaryOperationModifier ( const CallableType & c,
const FirstEvaluatorType & e1,
const SecondEvaluatorType & e2 )
constexpr

constructor

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

Member Function Documentation

◆ apply()

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

apply the modifier

calls the stored callable object with the given values

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 the stored callable object 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: