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

an evaluator returning the values of a function as TFEL's tensorial objects More...

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

Inheritance diagram for mgis::function::TensorView< FunctionType, TensorType >:
mgis::PreconditionsChecker< TensorView< FunctionType, TensorType > >

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 TensorView (ConstructorArgumentType)
 constructor, checking the preconditions
template<bool doPreconditionsCheck>
constexpr TensorView (const PreconditionsCheck< doPreconditionsCheck > &, ConstructorArgumentType)
 constructor
constexpr bool check (AbstractErrorHandler &) const
 perform consistency checks
constexpr const Space & 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, TensorConcept TensorType>
struct mgis::function::TensorView< FunctionType, TensorType >

an evaluator returning the values of a function as TFEL's tensorial objects

The view is built from a function whose number of components must be equal to the number of components of TensorType. Its call operators return the values of the function at a given integration point, mapped on the memory of the function using tfel::math::map:

  • a read-only tensor, for the constant call operators,
  • a mutable tensor, which may be modified, for the non 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
TensorTypetype of the tensorial objects returned by the view, which must match the TensorConcept concept

Member Typedef Documentation

◆ ConstructorArgumentType

template<FunctionConcept FunctionType, TensorConcept TensorType>
using mgis::function::TensorView< FunctionType, TensorType >::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

◆ TensorView() [1/2]

template<FunctionConcept FunctionType, TensorConcept TensorType>
mgis::function::TensorView< FunctionType, TensorType >::TensorView ( ConstructorArgumentType values)
constexpr

constructor, checking the preconditions

Parameters
[in]valuesfunction used to build the view

◆ TensorView() [2/2]

template<FunctionConcept FunctionType, TensorConcept TensorType>
template<bool doPreconditionsCheck>
mgis::function::TensorView< FunctionType, TensorType >::TensorView ( 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, TensorConcept TensorType>
bool mgis::function::TensorView< FunctionType, TensorType >::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 the number of components of the tensorial type

◆ checkPreconditions()

template<FunctionConcept FunctionType, TensorConcept TensorType>
bool mgis::function::TensorView< FunctionType, TensorType >::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 the number of components of the tensorial type

◆ getNumberOfComponents()

template<FunctionConcept FunctionType, TensorConcept TensorType>
size_type mgis::function::TensorView< FunctionType, TensorType >::getNumberOfComponents ( ) const
nodiscardconstexpr
Returns
the number of components of the values returned by the view, which is the number of components of the tensorial type

◆ getSpace()

template<FunctionConcept FunctionType, TensorConcept TensorType>
const TensorView< FunctionType, TensorType >::Space & mgis::function::TensorView< FunctionType, TensorType >::getSpace ( ) const
nodiscardconstexpr

return the underlying space

Returns
the space on which the underlying function is defined

◆ operator()() [1/8]

template<FunctionConcept FunctionType, TensorConcept TensorType>
requires ((internals::FunctionResultQuery<FunctionType>::b3) && (isFunctionResultTypeMappable<FunctionType>))
auto mgis::function::TensorView< FunctionType, TensorType >::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 values of the function at the given integration point as a mutable tensor, 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, TensorConcept TensorType>
requires ((internals::FunctionResultQuery<FunctionType>::b3) && (isFunctionConstResultTypeMappable<FunctionType>))
auto mgis::function::TensorView< FunctionType, TensorType >::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 of the function at the given integration point as a read-only tensor
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, TensorConcept TensorType>
requires ((internals::FunctionResultQuery<FunctionType>::b4) && (isFunctionResultTypeMappable<FunctionType>))
auto mgis::function::TensorView< FunctionType, TensorType >::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 values of the function at the given integration point as a mutable tensor, 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, TensorConcept TensorType>
requires ((internals::FunctionResultQuery<FunctionType>::b4) && (isFunctionConstResultTypeMappable<FunctionType>))
auto mgis::function::TensorView< FunctionType, TensorType >::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 of the function at the given integration point as a read-only tensor
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, TensorConcept TensorType>
requires ((internals::FunctionResultQuery<FunctionType>::b1) && (isFunctionResultTypeMappable<FunctionType>))
auto mgis::function::TensorView< FunctionType, TensorType >::operator() ( const element_index< Space > & i)
constexpr

call operator returning mutable values

Parameters
[in]iintegration point index
Returns
the values of the function at the given integration point as a mutable tensor, 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, TensorConcept TensorType>
requires ((internals::FunctionResultQuery<FunctionType>::b1) && (isFunctionConstResultTypeMappable<FunctionType>))
auto mgis::function::TensorView< FunctionType, TensorType >::operator() ( const element_index< Space > & i) const
nodiscardconstexpr

call operator

Parameters
[in]iintegration point index
Returns
the values of the function at the given integration point as a read-only tensor
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, TensorConcept TensorType>
requires ((internals::FunctionResultQuery<FunctionType>::b2) && (isFunctionResultTypeMappable<FunctionType>))
auto mgis::function::TensorView< FunctionType, TensorType >::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 values of the function at the given integration point as a mutable tensor, 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, TensorConcept TensorType>
requires ((internals::FunctionResultQuery<FunctionType>::b2) && (isFunctionConstResultTypeMappable<FunctionType>))
auto mgis::function::TensorView< FunctionType, TensorType >::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 of the function at the given integration point as a read-only tensor
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: