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

class describing a uniform evaluator, i.e. an evaluator which returns the same value at each integration point of a space More...

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

Public Types

using ValueType
 type of the value passed to construct the uniform evaluator, which is a scalar value if N is equal to one, a constant std::span of N values otherwise

Public Member Functions

constexpr UniformEvaluator (const Space &, const ValueType &) MGIS_NOEXCEPT
 constructor
constexpr UniformEvaluator (UniformEvaluator &&) noexcept
 move constructor
constexpr UniformEvaluator (const UniformEvaluator &) MGIS_NOEXCEPT
 copy constructor
constexpr const Space & getSpace () const MGIS_NOEXCEPT
constexpr ValueType operator() (const element_index< Space > &) const MGIS_NOEXCEPT
 call operator, which returns the uniform value associated with an integration point
constexpr ValueType operator() (const element_workspace< Space > &, const element_index< Space > &) const MGIS_NOEXCEPT
 call operator, which returns the uniform value associated with an integration point
constexpr ValueType operator() (const cell_index< Space > &, const quadrature_point_index< Space > &) const MGIS_NOEXCEPT
 call operator, which returns the uniform value associated with an integration point
constexpr ValueType operator() (const cell_workspace< Space > &, const cell_index< Space > &, const quadrature_point_index< Space > &) const MGIS_NOEXCEPT
 call operator, which returns the uniform value associated with an integration point
constexpr ~UniformEvaluator () noexcept
 destructor

Static Protected Member Functions

static constexpr real buildValues (const real) MGIS_NOEXCEPT
 a uniform evaluator has at least one component
static constexpr std::array< real, N > buildValues (const std::span< const real > &) MGIS_NOEXCEPT
 builds the array stored by the evaluator from the values given to the constructor

Protected Attributes

const Space space
 underlying discretization space
const std::conditional_t< N==1, real, std::array< real, N > > values
 uniform value, a scalar if N is equal to one, an array otherwise

Detailed Description

template<SpaceConcept Space, std::size_t N>
struct mgis::function::UniformEvaluator< Space, N >

class describing a uniform evaluator, i.e. an evaluator which returns the same value at each integration point of a space

The value is copied when the evaluator is built, so the object it is built from may be destroyed afterwards.

Template Parameters
Spacetype of the space on which the evaluator is defined
Nnumber of components of the returned values, which must be greater than zero

Member Typedef Documentation

◆ ValueType

template<SpaceConcept Space, std::size_t N>
using mgis::function::UniformEvaluator< Space, N >::ValueType
Initial value:
std::conditional_t<N == 1, real, std::span<const real, N>>

type of the value passed to construct the uniform evaluator, which is a scalar value if N is equal to one, a constant std::span of N values otherwise

Constructor & Destructor Documentation

◆ UniformEvaluator()

template<SpaceConcept Space, std::size_t N>
mgis::function::UniformEvaluator< Space, N >::UniformEvaluator ( const Space & s,
const ValueType & v )
constexpr

constructor

Parameters
[in]sspace on which the evaluator is defined
[in]vuniform value, which is copied in the evaluator

Member Function Documentation

◆ buildValues() [1/2]

template<SpaceConcept Space, std::size_t N>
real mgis::function::UniformEvaluator< Space, N >::buildValues ( const real v)
staticnodiscardconstexprprotected

a uniform evaluator has at least one component

builds the value stored by the evaluator from the scalar value given to the constructor

Parameters
[in]vscalar value
Returns
the scalar value itself
Note
this overload is used when N is equal to one

◆ buildValues() [2/2]

template<SpaceConcept Space, std::size_t N>
std::array< real, N > mgis::function::UniformEvaluator< Space, N >::buildValues ( const std::span< const real > & v)
staticnodiscardconstexprprotected

builds the array stored by the evaluator from the values given to the constructor

Parameters
[in]vvalues, which must contain at least N values
Returns
an array holding the first N values of v
Note
this overload is used when N is greater than one

◆ getSpace()

template<SpaceConcept Space, std::size_t N>
const Space & mgis::function::UniformEvaluator< Space, N >::getSpace ( ) const
nodiscardconstexpr
Returns
the space on which the evaluator is defined

◆ operator()() [1/4]

template<SpaceConcept Space, std::size_t N>
requires (QuadratureSpaceConcept<Space>)
UniformEvaluator< Space, N >::ValueType mgis::function::UniformEvaluator< Space, N >::operator() ( const cell_index< Space > & ,
const quadrature_point_index< Space > &  ) const
nodiscardconstexpr

call operator, which returns the uniform value associated with an integration point

Parameters
[in]eindex of the cell, which is unused since the value is the same everywhere
[in]iindex of the quadrature point, which is unused since the value is the same everywhere
Returns
the uniform value
Note
this overload is available when the space matches the QuadratureSpaceConcept concept

◆ operator()() [2/4]

template<SpaceConcept Space, std::size_t N>
requires (QuadratureSpaceConcept<Space> && hasCellWorkspace<Space>)
UniformEvaluator< Space, N >::ValueType mgis::function::UniformEvaluator< Space, N >::operator() ( const cell_workspace< Space > & ,
const cell_index< Space > & ,
const quadrature_point_index< Space > &  ) const
nodiscardconstexpr

call operator, which returns the uniform value associated with an integration point

Parameters
[in]wkworkspace associated with the cell, which is unused
[in]eindex of the cell, which is unused since the value is the same everywhere
[in]iindex of the quadrature point, which is unused since the value is the same everywhere
Returns
the uniform value
Note
this overload is available when the space matches the QuadratureSpaceConcept concept and exposes a cell workspace

◆ operator()() [3/4]

template<SpaceConcept Space, std::size_t N>
requires (ElementSpaceConcept<Space>)
UniformEvaluator< Space, N >::ValueType mgis::function::UniformEvaluator< Space, N >::operator() ( const element_index< Space > & ) const
nodiscardconstexpr

call operator, which returns the uniform value associated with an integration point

Parameters
[in]iindex of the integration point, which is unused since the value is the same everywhere
Returns
the uniform value
Note
this overload is available when the space matches the ElementSpaceConcept concept

◆ operator()() [4/4]

template<SpaceConcept Space, std::size_t N>
requires (ElementSpaceConcept<Space> && hasElementWorkspace<Space>)
UniformEvaluator< Space, N >::ValueType mgis::function::UniformEvaluator< Space, N >::operator() ( const element_workspace< Space > & ,
const element_index< Space > &  ) const
nodiscardconstexpr

call operator, which returns the uniform value associated with an integration point

Parameters
[in]wkworkspace associated with the element, which is unused
[in]iindex of the integration point, which is unused since the value is the same everywhere
Returns
the uniform value
Note
this overload is available when the space matches the ElementSpaceConcept concept and exposes an element workspace

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