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

an evaluator returning the values computed by an evaluator as quantities More...

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

Inheritance diagram for mgis::function::QuantityModifier< EvaluatorType, UnitType >:
mgis::PreconditionsChecker< QuantityModifier< EvaluatorType, UnitType > >

Public Types

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

Public Member Functions

constexpr QuantityModifier (const EvaluatorType &)
 constructor, checking the preconditions
template<bool doPreconditionsCheck>
constexpr QuantityModifier (const PreconditionsCheck< doPreconditionsCheck > &, const EvaluatorType &)
 constructor
constexpr bool check (AbstractErrorHandler &) const
 perform consistency checks
constexpr decltype(auto) getSpace () const
 return the underlying space
constexpr size_type getNumberOfComponents () const
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 Member Functions

static constexpr bool checkPreconditions (AbstractErrorHandler &, const EvaluatorType &)
 method checking that the preconditions of the constructor are met

Detailed Description

template<EvaluatorConcept EvaluatorType, ::tfel::math::unit::UnitConcept UnitType>
struct mgis::function::QuantityModifier< EvaluatorType, UnitType >

an evaluator returning the values computed by an evaluator as quantities

A quantity is a scalar value associated with a physical unit. The modifier is built from an evaluator with exactly one component. Its call operators return the value computed by the evaluator at a given integration point:

  • a read-only quantity (a const_qt_ref object of TFEL/Math) referencing the value computed by the evaluator when this value is stored in memory owned by another object,
  • a quantity owning its value (a qt object of TFEL/Math), in which case the value computed by the evaluator is copied.

Only the call operators which match the way the underlying evaluator can be called are available.

Template Parameters
EvaluatorTypetype of the underlying evaluator
UnitTypeunit of the quantities returned by the modifier

Constructor & Destructor Documentation

◆ QuantityModifier() [1/2]

template<EvaluatorConcept EvaluatorType, ::tfel::math::unit::UnitConcept UnitType>
mgis::function::QuantityModifier< EvaluatorType, UnitType >::QuantityModifier ( const EvaluatorType & e)
constexpr

constructor, checking the preconditions

Parameters
[in]valuesevaluator used to build the modifier

◆ QuantityModifier() [2/2]

template<EvaluatorConcept EvaluatorType, ::tfel::math::unit::UnitConcept UnitType>
template<bool doPreconditionsCheck>
mgis::function::QuantityModifier< EvaluatorType, UnitType >::QuantityModifier ( const PreconditionsCheck< doPreconditionsCheck > & pcheck,
const EvaluatorType & e )
constexpr

constructor

Template Parameters
doPreconditionsCheckboolean stating if the preconditions must be checked
Parameters
[in]pcheckobject stating if preconditions must be checked
[in]valuesevaluator used to build the modifier

Member Function Documentation

◆ check()

template<EvaluatorConcept EvaluatorType, ::tfel::math::unit::UnitConcept UnitType>
bool mgis::function::QuantityModifier< EvaluatorType, UnitType >::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 and if its number of components is equal to one

◆ checkPreconditions()

template<EvaluatorConcept EvaluatorType, ::tfel::math::unit::UnitConcept UnitType>
bool mgis::function::QuantityModifier< EvaluatorType, UnitType >::checkPreconditions ( AbstractErrorHandler & eh,
const EvaluatorType & values )
staticconstexpr

method checking that the preconditions of the constructor are met

Parameters
[in]eherror handler used to report the errors
[in]valuesevaluator used to build the modifier
Returns
true if the number of components of the evaluator is equal to one

◆ getNumberOfComponents()

template<EvaluatorConcept EvaluatorType, ::tfel::math::unit::UnitConcept UnitType>
size_type mgis::function::QuantityModifier< EvaluatorType, UnitType >::getNumberOfComponents ( ) const
nodiscardconstexpr
Returns
the number of components of the values returned by the modifier, which is one

◆ getSpace()

template<EvaluatorConcept EvaluatorType, ::tfel::math::unit::UnitConcept UnitType>
decltype(auto) constexpr mgis::function::QuantityModifier< EvaluatorType, UnitType >::getSpace ( ) const
nodiscardconstexpr

return the underlying space

Returns
the space on which the underlying evaluator is defined

◆ operator()() [1/4]

template<EvaluatorConcept EvaluatorType, ::tfel::math::unit::UnitConcept UnitType>
requires ((internals::EvaluatorResultQuery<EvaluatorType>::b3) && (isEvaluatorResultTypeMappable<EvaluatorType>))
auto mgis::function::QuantityModifier< EvaluatorType, UnitType >::operator() ( const cell_index< Space > & e,
const quadrature_point_index< Space > & i ) const
nodiscardconstexpr

call operator

Parameters
[in]ecell index
[in]iquadrature point index
Returns
the value computed by the evaluator at the given integration point as a quantity
Note
only available if the underlying evaluator can be called with a cell index and a quadrature point index and if the values it returns can be mapped to memory

◆ operator()() [2/4]

template<EvaluatorConcept EvaluatorType, ::tfel::math::unit::UnitConcept UnitType>
requires ((internals::EvaluatorResultQuery<EvaluatorType>::b4) && (isEvaluatorResultTypeMappable<EvaluatorType>))
auto mgis::function::QuantityModifier< EvaluatorType, UnitType >::operator() ( const cell_workspace< Space > & wk,
const cell_index< Space > & e,
const quadrature_point_index< Space > & i ) const
nodiscardconstexpr

call operator

Parameters
[in]wkcell workspace
[in]ecell index
[in]iquadrature point index
Returns
the value computed by the evaluator at the given integration point as a quantity
Note
only available if the underlying evaluator can be called with a cell workspace, a cell index and a quadrature point index and if the values it returns can be mapped to memory

◆ operator()() [3/4]

template<EvaluatorConcept EvaluatorType, ::tfel::math::unit::UnitConcept UnitType>
requires ((internals::EvaluatorResultQuery<EvaluatorType>::b1) && (isEvaluatorResultTypeMappable<EvaluatorType>))
auto mgis::function::QuantityModifier< EvaluatorType, UnitType >::operator() ( const element_index< Space > & i) const
nodiscardconstexpr

call operator

Parameters
[in]iintegration point index
Returns
the value computed by the evaluator at the given integration point as a quantity
Note
only available if the underlying evaluator can be called with an element index and if the values it returns can be mapped to memory

◆ operator()() [4/4]

template<EvaluatorConcept EvaluatorType, ::tfel::math::unit::UnitConcept UnitType>
requires ((internals::EvaluatorResultQuery<EvaluatorType>::b2) && (isEvaluatorResultTypeMappable<EvaluatorType>))
auto mgis::function::QuantityModifier< EvaluatorType, UnitType >::operator() ( const element_workspace< Space > & wk,
const element_index< Space > & i ) const
nodiscardconstexpr

call operator

Parameters
[in]wkelement workspace
[in]iintegration point index
Returns
the value computed by the evaluator at the given integration point as a quantity
Note
only available if the underlying evaluator can be called with an element workspace and an element index and if the values it returns can be mapped to memory

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