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

an evaluator applying a unary operation to the values returned by another evaluator, without storing this operation More...

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

Inheritance diagram for mgis::function::UnaryOperation2< CallableType, EvaluatorType >:
mgis::function::EvaluatorModifierBase< UnaryOperation2< CallableType, EvaluatorType >, EvaluatorType > mgis::function::internals::UnaryOperationBase< CallableType, EvaluatorType >

Public Member Functions

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

Additional Inherited Members

Public Types inherited from mgis::function::EvaluatorModifierBase< UnaryOperation2< CallableType, EvaluatorType >, EvaluatorType >
using Space
 type of the space on which the underlying evaluator is defined
Static Public Member Functions inherited from mgis::function::internals::UnaryOperationBase< CallableType, EvaluatorType >
static constexpr size_type getNumberOfComponents () MGIS_NOEXCEPT
 return the number of components
Protected Attributes inherited from mgis::function::EvaluatorModifierBase< UnaryOperation2< CallableType, EvaluatorType >, EvaluatorType >
EvaluatorType evaluator
 underlying evaluator

Detailed Description

template<typename CallableType, EvaluatorConcept EvaluatorType>
requires ((std::is_trivially_default_constructible_v<CallableType>)&&( std::invocable<CallableType, evaluator_result<EvaluatorType>>))
struct mgis::function::UnaryOperation2< CallableType, EvaluatorType >

an evaluator applying a unary operation to the values returned by another evaluator, without storing this operation

This class behaves as UnaryOperation 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 underlying evaluator, which allows constexpr modifiers such as absolute_value or negate to be defined.

The constructor inherited from EvaluatorModifierBase only takes the underlying evaluator as an argument.

Template Parameters
CallableTypetype of the unary operation, which must be trivially default constructible and callable with the values returned by the evaluator
EvaluatorTypetype of the evaluator whose values are modified

Member Function Documentation

◆ apply()

template<typename CallableType, EvaluatorConcept EvaluatorType>
requires ((std::is_trivially_default_constructible_v<CallableType>)&&( std::invocable<CallableType, evaluator_result<EvaluatorType>>))
MGIS_HOST_DEVICE constexpr auto mgis::function::UnaryOperation2< CallableType, EvaluatorType >::apply ( const evaluator_result< EvaluatorType > & values) const
constexpr

apply the modifier

Parameters
[in]valuesvalues computed by the underlying evaluator at a given integration point
Returns
values computed by calling a default constructed object of type CallableType with the values computed by the underlying evaluator at a given integration point
Note
this function is called by the call operators inherited from EvaluatorModifierBase

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