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

an evaluator returning the values of a function view as a fixed size span or a scalar More...

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

Inheritance diagram for mgis::function::FixedSizeModifier< EvaluatorType, N >:
mgis::PreconditionsChecker< FixedSizeModifier< EvaluatorType, N > >

Public Types

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

Public Member Functions

constexpr FixedSizeModifier (const EvaluatorType &)
 constructor, checking the preconditions
template<bool doPreconditionsCheck>
requires (N > 0)
constexpr FixedSizeModifier (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, size_type N>
requires (N > 0)
struct mgis::function::FixedSizeModifier< EvaluatorType, N >

an evaluator returning the values of a function view as a fixed size span or a scalar

The modifier is built from an evaluator with exactly N components. Its call operators return the values computed by the evaluator at a given integration point:

  • a scalar if N is equal to 1,
  • a std::span<const real, N> if N is greater than 1 and the values returned by the evaluator are stored in contiguous memory,
  • a std::array<real, N> otherwise, in which case the values are copied.

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

Template Parameters
EvaluatorTypetype of the underlying evaluator
Nnumber of components of the values returned by the modifier, which must be strictly positive

Constructor & Destructor Documentation

◆ FixedSizeModifier() [1/2]

template<EvaluatorConcept EvaluatorType, size_type N>
requires (N > 0)
mgis::function::FixedSizeModifier< EvaluatorType, N >::FixedSizeModifier ( const EvaluatorType & e)
constexpr

constructor, checking the preconditions

Parameters
[in]valuesevaluator used to build the modifier

◆ FixedSizeModifier() [2/2]

template<EvaluatorConcept EvaluatorType, size_type N>
requires (N > 0)
template<bool doPreconditionsCheck>
requires (N > 0)
mgis::function::FixedSizeModifier< EvaluatorType, N >::FixedSizeModifier ( 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, size_type N>
requires (N > 0)
bool mgis::function::FixedSizeModifier< EvaluatorType, N >::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 N

◆ checkPreconditions()

template<EvaluatorConcept EvaluatorType, size_type N>
requires (N > 0)
bool mgis::function::FixedSizeModifier< EvaluatorType, N >::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]eevaluator used to build the modifier
Returns
true if the number of components of the evaluator is equal to N

◆ getNumberOfComponents()

template<EvaluatorConcept EvaluatorType, size_type N>
requires (N > 0)
size_type mgis::function::FixedSizeModifier< EvaluatorType, N >::getNumberOfComponents ( ) const
nodiscardconstexpr
Returns
the number of components of the values returned by the modifier, which is N

◆ getSpace()

template<EvaluatorConcept EvaluatorType, size_type N>
requires (N > 0)
decltype(auto) constexpr mgis::function::FixedSizeModifier< EvaluatorType, N >::getSpace ( ) const
nodiscardconstexpr

return the underlying space

Returns
the space on which the underlying evaluator is defined

◆ operator()() [1/4]

template<EvaluatorConcept EvaluatorType, size_type N>
requires ((internals::EvaluatorResultQuery<EvaluatorType>::b3) && (isEvaluatorResultTypeMappable<EvaluatorType>))
auto mgis::function::FixedSizeModifier< EvaluatorType, N >::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 values computed by the evaluator at the given integration point: a scalar if N is equal to 1, fixed size read-only values otherwise
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, size_type N>
requires ((internals::EvaluatorResultQuery<EvaluatorType>::b4) && (isEvaluatorResultTypeMappable<EvaluatorType>))
auto mgis::function::FixedSizeModifier< EvaluatorType, N >::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 values computed by the evaluator at the given integration point: a scalar if N is equal to 1, fixed size read-only values otherwise
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, size_type N>
requires ((internals::EvaluatorResultQuery<EvaluatorType>::b1) && (isEvaluatorResultTypeMappable<EvaluatorType>))
auto mgis::function::FixedSizeModifier< EvaluatorType, N >::operator() ( const element_index< Space > & i) const
nodiscardconstexpr

call operator

Parameters
[in]iintegration point index
Returns
the values computed by the evaluator at the given integration point: a scalar if N is equal to 1, fixed size read-only values otherwise
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, size_type N>
requires ((internals::EvaluatorResultQuery<EvaluatorType>::b2) && (isEvaluatorResultTypeMappable<EvaluatorType>))
auto mgis::function::FixedSizeModifier< EvaluatorType, N >::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 values computed by the evaluator at the given integration point: a scalar if N is equal to 1, fixed size read-only values otherwise
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: