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

a view returning the values of a function as quantities More...

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

Inheritance diagram for mgis::function::QuantityView< FunctionType, UnitType >:
mgis::PreconditionsChecker< QuantityView< FunctionType, UnitType > >

Public Types

using Space = function_space<FunctionType>
 type of the space on which the underlying function is defined
using ConstructorArgumentType
 a simple alias used to workaround what seems to be a bug in gcc 16.x: the underlying function is passed to the constructors by value if it is a lightweight view and by reference otherwise

Public Member Functions

constexpr QuantityView (ConstructorArgumentType)
 constructor, checking the preconditions
template<bool doPreconditionsCheck>
constexpr QuantityView (const PreconditionsCheck< doPreconditionsCheck > &, ConstructorArgumentType)
 constructor
constexpr bool check (AbstractErrorHandler &) const
 perform consistency checks
constexpr decltype(auto) getSpace () const
 return the underlying space
constexpr size_type getNumberOfComponents () const MGIS_NOEXCEPT
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
constexpr auto operator() (const element_index< Space > &)
 call operator returning mutable values
constexpr auto operator() (const element_workspace< Space > &, const element_index< Space > &)
 call operator returning mutable values
constexpr auto operator() (const cell_index< Space > &, const quadrature_point_index< Space > &)
 call operator returning mutable values
constexpr auto operator() (const cell_workspace< Space > &, const cell_index< Space > &, const quadrature_point_index< Space > &)
 call operator returning mutable values

Static Public Member Functions

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

Detailed Description

template<FunctionConcept FunctionType, ::tfel::math::unit::UnitConcept UnitType>
struct mgis::function::QuantityView< FunctionType, UnitType >

a view returning the values of a function as quantities

A quantity is a scalar value associated with a physical unit. The view is built from a function with exactly one component. Its call operators return the value of the function at a given integration point:

  • a mutable quantity (a qt_ref object of TFEL/Math), referencing the value of the function, for the non constant call operators,
  • a read-only quantity (a const_qt_ref object of TFEL/Math), referencing the value of the function, for the constant call operators.

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

Template Parameters
FunctionTypetype of the underlying function
UnitTypeunit of the quantities returned by the view

Member Typedef Documentation

◆ ConstructorArgumentType

template<FunctionConcept FunctionType, ::tfel::math::unit::UnitConcept UnitType>
using mgis::function::QuantityView< FunctionType, UnitType >::ConstructorArgumentType
Initial value:
std::conditional_t<LightweightViewConcept<FunctionType>,
FunctionType,
FunctionType&>

a simple alias used to workaround what seems to be a bug in gcc 16.x: the underlying function is passed to the constructors by value if it is a lightweight view and by reference otherwise

Constructor & Destructor Documentation

◆ QuantityView() [1/2]

template<FunctionConcept FunctionType, ::tfel::math::unit::UnitConcept UnitType>
mgis::function::QuantityView< FunctionType, UnitType >::QuantityView ( ConstructorArgumentType values)
constexpr

constructor, checking the preconditions

Parameters
[in]valuesfunction used to build the view

◆ QuantityView() [2/2]

template<FunctionConcept FunctionType, ::tfel::math::unit::UnitConcept UnitType>
template<bool doPreconditionsCheck>
mgis::function::QuantityView< FunctionType, UnitType >::QuantityView ( const PreconditionsCheck< doPreconditionsCheck > & pcheck,
ConstructorArgumentType values )
constexpr

constructor

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

Member Function Documentation

◆ check()

template<FunctionConcept FunctionType, ::tfel::math::unit::UnitConcept UnitType>
bool mgis::function::QuantityView< FunctionType, UnitType >::check ( AbstractErrorHandler & eh) const
nodiscardconstexpr

perform consistency checks

Parameters
[in]eherror handler used to report the errors
Returns
true if the number of components of the underlying function is equal to one

◆ checkPreconditions()

template<FunctionConcept FunctionType, ::tfel::math::unit::UnitConcept UnitType>
bool mgis::function::QuantityView< FunctionType, UnitType >::checkPreconditions ( AbstractErrorHandler & eh,
const FunctionType & values )
staticconstexpr

method checking that the preconditions of the constructor are met

Parameters
[in]eherror handler used to report the errors
[in]valuesfunction used to build the view
Returns
true if the number of components of the function is equal to one

◆ getNumberOfComponents()

template<FunctionConcept FunctionType, ::tfel::math::unit::UnitConcept UnitType>
size_type mgis::function::QuantityView< FunctionType, UnitType >::getNumberOfComponents ( ) const
nodiscardconstexpr
Returns
the number of components of the values returned by the view, which is one

◆ getSpace()

template<FunctionConcept FunctionType, ::tfel::math::unit::UnitConcept UnitType>
decltype(auto) constexpr mgis::function::QuantityView< FunctionType, UnitType >::getSpace ( ) const
nodiscardconstexpr

return the underlying space

Returns
the space on which the underlying function is defined

◆ operator()() [1/8]

template<FunctionConcept FunctionType, ::tfel::math::unit::UnitConcept UnitType>
requires ((internals::FunctionResultQuery<FunctionType>::b3) && (isFunctionResultTypeMappable<FunctionType>))
auto mgis::function::QuantityView< FunctionType, UnitType >::operator() ( const cell_index< Space > & e,
const quadrature_point_index< Space > & i )
nodiscardconstexpr

call operator returning mutable values

Parameters
[in]ecell index
[in]iquadrature point index
Returns
the value of the function at the given integration point as a mutable quantity, which may be modified
Note
only available if the underlying function can be called with a cell index and a quadrature point index and if the values it returns can be mapped to mutable memory

◆ operator()() [2/8]

template<FunctionConcept FunctionType, ::tfel::math::unit::UnitConcept UnitType>
requires ((internals::FunctionResultQuery<FunctionType>::b3) && (isFunctionConstResultTypeMappable<FunctionType>))
auto mgis::function::QuantityView< FunctionType, 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 of the function at the given integration point as a read-only quantity
Note
only available if the underlying function can be called with a cell index and a quadrature point index and if the values it returns can be mapped to memory

◆ operator()() [3/8]

template<FunctionConcept FunctionType, ::tfel::math::unit::UnitConcept UnitType>
requires ((internals::FunctionResultQuery<FunctionType>::b4) && (isFunctionResultTypeMappable<FunctionType>))
auto mgis::function::QuantityView< FunctionType, UnitType >::operator() ( const cell_workspace< Space > & wk,
const cell_index< Space > & e,
const quadrature_point_index< Space > & i )
nodiscardconstexpr

call operator returning mutable values

Parameters
[in]wkcell workspace
[in]ecell index
[in]iquadrature point index
Returns
the value of the function at the given integration point as a mutable quantity, which may be modified
Note
only available if the underlying function 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 mutable memory

◆ operator()() [4/8]

template<FunctionConcept FunctionType, ::tfel::math::unit::UnitConcept UnitType>
requires ((internals::FunctionResultQuery<FunctionType>::b4) && (isFunctionConstResultTypeMappable<FunctionType>))
auto mgis::function::QuantityView< FunctionType, 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 of the function at the given integration point as a read-only quantity
Note
only available if the underlying function 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()() [5/8]

template<FunctionConcept FunctionType, ::tfel::math::unit::UnitConcept UnitType>
requires ((internals::FunctionResultQuery<FunctionType>::b1) && (isFunctionResultTypeMappable<FunctionType>))
auto mgis::function::QuantityView< FunctionType, UnitType >::operator() ( const element_index< Space > & i)
nodiscardconstexpr

call operator returning mutable values

Parameters
[in]iintegration point index
Returns
the value of the function at the given integration point as a mutable quantity, which may be modified
Note
only available if the underlying function can be called with an element index and if the values it returns can be mapped to mutable memory

◆ operator()() [6/8]

template<FunctionConcept FunctionType, ::tfel::math::unit::UnitConcept UnitType>
requires ((internals::FunctionResultQuery<FunctionType>::b1) && (isFunctionConstResultTypeMappable<FunctionType>))
auto mgis::function::QuantityView< FunctionType, UnitType >::operator() ( const element_index< Space > & i) const
nodiscardconstexpr

call operator

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

◆ operator()() [7/8]

template<FunctionConcept FunctionType, ::tfel::math::unit::UnitConcept UnitType>
requires ((internals::FunctionResultQuery<FunctionType>::b2) && (isFunctionResultTypeMappable<FunctionType>))
auto mgis::function::QuantityView< FunctionType, UnitType >::operator() ( const element_workspace< Space > & wk,
const element_index< Space > & i )
nodiscardconstexpr

call operator returning mutable values

Parameters
[in]wkelement workspace
[in]iintegration point index
Returns
the value of the function at the given integration point as a mutable quantity, which may be modified
Note
only available if the underlying function can be called with an element workspace and an element index and if the values it returns can be mapped to mutable memory

◆ operator()() [8/8]

template<FunctionConcept FunctionType, ::tfel::math::unit::UnitConcept UnitType>
requires ((internals::FunctionResultQuery<FunctionType>::b2) && (isFunctionConstResultTypeMappable<FunctionType>))
auto mgis::function::QuantityView< FunctionType, 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 of the function at the given integration point as a read-only quantity
Note
only available if the underlying function 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: