|
MGIS 3.1.0
|
function defined on a space, whose values are stored in an external memory region. More...
#include </home/runner/work/MFrontGenericInterfaceSupport/MFrontGenericInterfaceSupport/include/MGIS/Function/Function.hxx>
Public Types | |
| using | ExternalData |
| type of the view to the external data used by the view, which is a mutable span if is_mutable is true, a constant span otherwise | |
| using | ValuesView |
| type of the value returned by the call operator, which is a reference to a scalar value if the number of components is equal to one at compile time, a mutable std::span otherwise | |
| using | ConstValuesView |
| type of the value returned by the call operator of a constant view, i.e. a constant version of ValuesView | |
Public Member Functions | |
| constexpr | FunctionView (const Space &, ExternalData, const size_type) |
| constructor when the number of components is known at compile time and the stride is only known at run time | |
| template<bool doPreconditionsCheck> requires ((layout.data_size != dynamic_extent) && (layout.data_stride == dynamic_extent)) | |
| constexpr | FunctionView (const PreconditionsCheck< doPreconditionsCheck > &, const Space &, ExternalData, const size_type) |
| constructor when the number of components is known at compile time and the stride is only known at run time | |
| constexpr | FunctionView (const Space &, ExternalData, const size_type, const size_type) |
| constructor when both the number of components and the stride are only known at run time | |
| template<bool doPreconditionsCheck> requires ((layout.data_size == dynamic_extent) && (layout.data_stride == dynamic_extent)) | |
| constexpr | FunctionView (const PreconditionsCheck< doPreconditionsCheck > &, const Space &, ExternalData, const size_type, const size_type) |
| constructor when both the number of components and the stride are only known at run time | |
| constexpr | FunctionView (const Space &, ExternalData, const size_type) |
| constructor when both the number of components and the stride are only known at run time, the stride being taken equal to the number of components | |
| template<bool doPreconditionsCheck> requires ((layout.data_size == dynamic_extent) && (layout.data_stride == dynamic_extent)) | |
| constexpr | FunctionView (const PreconditionsCheck< doPreconditionsCheck > &, const Space &, ExternalData, const size_type) |
| constructor when both the number of components and the stride are only known at run time, the stride being taken equal to the number of components | |
| constexpr | FunctionView (const Space &, ExternalData, const size_type) |
| constructor when the number of components is only known at run time and the stride is known at compile time | |
| template<bool doPreconditionsCheck> requires ((layout.data_size == dynamic_extent) && (layout.data_stride != dynamic_extent)) | |
| constexpr | FunctionView (const PreconditionsCheck< doPreconditionsCheck > &, const Space &, ExternalData, const size_type) |
| constructor when the number of components is only known at run time and the stride is known at compile time | |
| constexpr | FunctionView (const Space &, ExternalData) |
| constructor when both the number of components and the stride are known at compile time | |
| template<bool doPreconditionsCheck> requires ((layout.data_size != dynamic_extent) && (layout.data_stride != dynamic_extent)) | |
| constexpr | FunctionView (const PreconditionsCheck< doPreconditionsCheck > &, const Space &, ExternalData) |
| constructor when both the number of components and the stride are known at compile time | |
| constexpr | FunctionView (const Space &, ExternalData, const FunctionDataLayout< layout > &) |
| constructor when both the number of components and the stride are only known at run time and are given by a data layout object | |
| template<bool doPreconditionsCheck> requires ((layout.data_size == dynamic_extent) && (layout.data_stride == dynamic_extent)) | |
| constexpr | FunctionView (const PreconditionsCheck< doPreconditionsCheck > &, const Space &, ExternalData, const FunctionDataLayout< layout > &) |
| constructor when both the number of components and the stride are only known at run time and are given by a data layout object | |
| constexpr | FunctionView (const Space &, ExternalData, const FunctionDataLayout< layout > &) |
| constructor when the number of components is known at compile time and the stride is only known at run time and given by a data layout object | |
| template<bool doPreconditionsCheck> requires ((layout.data_size != dynamic_extent) && (layout.data_stride == dynamic_extent)) | |
| constexpr | FunctionView (const PreconditionsCheck< doPreconditionsCheck > &, const Space &, ExternalData, const FunctionDataLayout< layout > &) |
| constructor when the number of components is known at compile time and the stride is only known at run time and given by a data layout object | |
| constexpr | FunctionView (const Space &, ExternalData, const FunctionDataLayout< layout > &) |
| constructor when the number of components is only known at run time and given by a data layout object, the stride being known at compile time | |
| template<bool doPreconditionsCheck> requires ((layout.data_size == dynamic_extent) && (layout.data_stride != dynamic_extent)) | |
| constexpr | FunctionView (const PreconditionsCheck< doPreconditionsCheck > &, const Space &, ExternalData, const FunctionDataLayout< layout > &) |
| constructor when the number of components is only known at run time and given by a data layout object, the stride being known at compile time | |
| constexpr | FunctionView (FunctionView &&)=default |
| move constructor | |
| constexpr | FunctionView (const FunctionView &)=default |
| copy constructor | |
| constexpr const Space & | getSpace () const MGIS_NOEXCEPT |
| constexpr real * | data (mgis::attributes::UnsafeAttribute, const size_type) |
| return a pointer to the values associated with an integration point, given its offset | |
| constexpr real * | data (mgis::attributes::UnsafeAttribute, const size_type, const size_type) |
| return a pointer to the values associated with an integration point, given the index of its cell and its own index | |
| constexpr const real * | data (mgis::attributes::UnsafeAttribute, const size_type) const |
| return a pointer to the constant values associated with an integration point, given its offset | |
| constexpr const real * | data (mgis::attributes::UnsafeAttribute, const size_type, const size_type) const |
| return a pointer to the constant values associated with an integration point, given the index of its cell and its own index | |
| constexpr ValuesView | operator() (const size_type) |
| return the values associated with an integration point, given its offset | |
| constexpr ValuesView | operator() (const size_type, const size_type) |
| return the values associated with an integration point, given the index of its cell and its own index | |
| constexpr ConstValuesView | operator() (const size_type) const |
| return the constant values associated with an integration point, given its offset | |
| constexpr ConstValuesView | operator() (const size_type, const size_type) const |
| return the constant values associated with an integration point, given the index of its cell and its own index | |
| constexpr bool | checkCompatibility (const FunctionView &) const |
| check if the given view can be used in place of the current one | |
| constexpr std::span< real > | data () |
| constexpr std::span< const real > | data () const |
| constexpr | ~FunctionView ()=default |
| destructor | |
| Public Member Functions inherited from mgis::function::FunctionDataLayout< FunctionDataLayoutDescription{} > | |
| FunctionDataLayout ()=default | |
| default constructor | |
| FunctionDataLayout & | operator= (FunctionDataLayout &&)=default |
| move assignment operator | |
| ~FunctionDataLayout ()=default | |
| destructor | |
| Public Member Functions inherited from mgis::function::FunctionDataSize< layout.data_size > | |
| constexpr bool | isScalar () const MGIS_NOEXCEPT |
| constexpr size_type | getNumberOfComponents () const MGIS_NOEXCEPT |
| Public Member Functions inherited from mgis::function::FunctionDataStride< layout.data_stride > | |
| constexpr size_type | getDataStride () const MGIS_NOEXCEPT |
Static Public Member Functions | |
| static constexpr bool | checkPreconditions (AbstractErrorHandler &, const Space &, ExternalData) |
| check that the preconditions to build the view are met when the number of components and the stride are known at compile time | |
| static constexpr bool | checkPreconditions (AbstractErrorHandler &, const Space &, ExternalData, const size_type) |
| check that the preconditions to build the view are met when the number of components is only known at run time and the stride is known at compile time | |
| static constexpr bool | checkPreconditions (AbstractErrorHandler &, const Space &, ExternalData, const size_type) |
| check that the preconditions to build the view are met when the number of components is known at compile time and the stride is only known at run time | |
| static constexpr bool | checkPreconditions (AbstractErrorHandler &, const Space &, ExternalData, const size_type) |
| check that the preconditions to build the view are met when both the number of components and the stride are only known at run time, the stride being taken equal to the number of components | |
| static constexpr bool | checkPreconditions (AbstractErrorHandler &, const Space &, ExternalData, const size_type, const size_type) |
| check that the preconditions to build the view are met when both the number of components and the stride are only known at run time | |
| static constexpr bool | checkPreconditions (AbstractErrorHandler &, const Space &, ExternalData, const FunctionDataLayout< layout > &) |
| check that the preconditions to build the view are met when both the number of components and the stride are only known at run time and are given by a data layout object | |
Static Public Attributes | |
| static constexpr bool | allowScalarAccessor |
| true if the view can be seen as a scalar valued function, i.e. if the number of components is equal to one or is only known at run time | |
Protected Attributes | |
| const Space | space |
| underlying discretization space | |
| ExternalData | values |
| view to the values stored in the external memory region | |
Additional Inherited Members | |
| Protected Member Functions inherited from mgis::function::FunctionDataLayout< FunctionDataLayoutDescription{} > | |
| constexpr size_type | getDataOffset (const size_type) const MGIS_NOEXCEPT |
| the data offset of an integration point is its offset multiplied by the stride, which is taken from the template parameter when it is known at compile time, from the FunctionDataStride base class otherwise | |
function defined on a space, whose values are stored in an external memory region.
The FunctionView defines a function using an external memory region.
This memory region may contain more data than the one associated with the function as illustrated by the following figure:
|------------------------------------------------------------—| <- Raw data -> |------------------------------------—| <- Data of the first element --> |------------—| | <-function data-> ^ ^ | | data_size | data_stride
The size of all the data (including the one not related to the function) associated with one element of the space is called the data_stride in the FunctionView class.
The size of the data hold by the function per element of the space, i.e. the number of components of the function is given by data_size.
The values of the view can be accessed either with the offset of an integration point, if the space matches the LinearElementSpaceConcept concept, or with the index of a cell and the index of a quadrature point, if the space matches the LinearQuadratureSpaceConcept concept.
A FunctionView is a lightweight view: it can be copied at a negligible cost, as stated by the specialisation of LightweightViewTraits, and it matches the EvaluatorConcept concept: it can be used as an evaluator, which returns constant values.
| Space | type of the discretization space on which the function is defined, which must match the LinearFunctionalSpaceConcept concept |
| layout | data layout description, stating the number of components of the function and the distance between the values of two successive integration points, both of them being known at compile time or only at run time |
| is_mutable | if true, the view allows modifying the values stored in the external memory region, otherwise those values are constant |
| using mgis::function::FunctionView< Space, layout, is_mutable >::ConstValuesView |
type of the value returned by the call operator of a constant view, i.e. a constant version of ValuesView
| using mgis::function::FunctionView< Space, layout, is_mutable >::ExternalData |
type of the view to the external data used by the view, which is a mutable span if is_mutable is true, a constant span otherwise
| using mgis::function::FunctionView< Space, layout, is_mutable >::ValuesView |
type of the value returned by the call operator, which is a reference to a scalar value if the number of components is equal to one at compile time, a mutable std::span otherwise
|
constexpr |
constructor when the number of components is known at compile time and the stride is only known at run time
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | dstride | stride of the data |
|
constexpr |
constructor when the number of components is known at compile time and the stride is only known at run time
the run-time stride is stored in the FunctionDataStride base class; the preconditions are checked by the PreconditionsChecker base class when doPreconditionsCheck is true
| doPreconditionsCheck | if true, the preconditions are checked, otherwise they are skipped |
| [in] | pcheck | tag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check) |
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | dstride | stride of the data |
|
constexpr |
constructor when both the number of components and the stride are only known at run time
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | dsize | number of components of the function |
| [in] | dstride | stride of the data |
|
constexpr |
constructor when both the number of components and the stride are only known at run time
the number of components and the stride, which are only known at run time, are stored in the FunctionDataSize and FunctionDataStride base classes; the preconditions are checked by the PreconditionsChecker base class when doPreconditionsCheck is true
| doPreconditionsCheck | if true, the preconditions are checked, otherwise they are skipped |
| [in] | pcheck | tag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check) |
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | dsize | number of components of the function |
| [in] | dstride | stride of the data |
|
constexpr |
constructor when both the number of components and the stride are only known at run time, the stride being taken equal to the number of components
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | dsize | number of components of the function |
|
constexpr |
constructor when both the number of components and the stride are only known at run time, the stride being taken equal to the number of components
| doPreconditionsCheck | if true, the preconditions are checked, otherwise they are skipped |
| [in] | pcheck | tag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check) |
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | dsize | number of components of the function |
|
constexpr |
constructor when the number of components is only known at run time and the stride is known at compile time
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | dsize | number of components of the function |
|
constexpr |
constructor when the number of components is only known at run time and the stride is known at compile time
| doPreconditionsCheck | if true, the preconditions are checked, otherwise they are skipped |
| [in] | pcheck | tag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check) |
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | dsize | number of components of the function |
|
constexpr |
constructor when both the number of components and the stride are known at compile time
| [in] | s | quadrature space |
| [in] | v | values |
|
constexpr |
constructor when both the number of components and the stride are known at compile time
| doPreconditionsCheck | if true, the preconditions are checked, otherwise they are skipped |
| [in] | pcheck | tag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check) |
| [in] | s | quadrature space |
| [in] | v | values |
|
constexpr |
constructor when both the number of components and the stride are only known at run time and are given by a data layout object
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | l | data layout |
|
constexpr |
constructor when both the number of components and the stride are only known at run time and are given by a data layout object
| doPreconditionsCheck | if true, the preconditions are checked, otherwise they are skipped |
| [in] | pcheck | tag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check) |
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | l | data layout |
|
constexpr |
constructor when the number of components is known at compile time and the stride is only known at run time and given by a data layout object
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | l | data layout |
|
constexpr |
constructor when the number of components is known at compile time and the stride is only known at run time and given by a data layout object
| doPreconditionsCheck | if true, the preconditions are checked, otherwise they are skipped |
| [in] | pcheck | tag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check) |
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | l | data layout |
|
constexpr |
constructor when the number of components is only known at run time and given by a data layout object, the stride being known at compile time
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | l | data layout |
|
constexpr |
constructor when the number of components is only known at run time and given by a data layout object, the stride being known at compile time
| doPreconditionsCheck | if true, the preconditions are checked, otherwise they are skipped |
| [in] | pcheck | tag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check) |
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | l | data layout |
|
nodiscardconstexpr |
check if the given view can be used in place of the current one
| [in] | v | view to compare with the current view |
|
staticnodiscardconstexpr |
check that the preconditions to build the view are met when the number of components and the stride are known at compile time
when the number of components and the stride are known at compile time, the only condition is that the external data contains at least layout.data_stride * (space_size - 1) + layout.data_size values; a space of size zero is accepted without any check
| [in] | eh | error handler used to report the detected errors |
| [in] | s | quadrature space |
| [in] | v | values |
|
staticnodiscardconstexpr |
check that the preconditions to build the view are met when both the number of components and the stride are only known at run time and are given by a data layout object
| [in] | eh | error handler used to report the detected errors |
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | l | data layout, which gives the number of components and the stride of the function |
|
staticnodiscardconstexpr |
check that the preconditions to build the view are met when both the number of components and the stride are only known at run time, the stride being taken equal to the number of components
| [in] | eh | error handler used to report the detected errors |
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | dsize | number of components of the function |
|
staticnodiscardconstexpr |
check that the preconditions to build the view are met when the number of components is known at compile time and the stride is only known at run time
| [in] | eh | error handler used to report the detected errors |
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | dstride | stride of the data |
|
staticnodiscardconstexpr |
check that the preconditions to build the view are met when the number of components is only known at run time and the stride is known at compile time
when only the stride is known at run time, it must be greater than zero and not smaller than the compile-time number of components, and the external data must contain at least dstride * (space_size - 1) + layout.data_size values
when only the number of components is known at run time, it must be greater than zero and not greater than the compile-time stride, and the external data must contain at least layout.data_stride * (space_size - 1) + dsize values
| [in] | eh | error handler used to report the detected errors |
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | dsize | number of components of the function |
|
staticnodiscardconstexpr |
check that the preconditions to build the view are met when both the number of components and the stride are only known at run time
when both the number of components and the stride are only known at run time, both must be greater than zero, the number of components must not be greater than the stride and the external data must contain at least dstride * (space_size - 1) + dsize values
| [in] | eh | error handler used to report the detected errors |
| [in] | s | quadrature space |
| [in] | v | values |
| [in] | dsize | number of components of the function |
| [in] | dstride | stride of the data |
|
nodiscardconstexpr |
|
nodiscardconstexpr |
|
nodiscardconstexpr |
return a pointer to the values associated with an integration point, given its offset
| [in] | t | tag stating that no bound checking is performed (mgis::unsafe), the offset must be strictly smaller than the size of the space |
| [in] | o | offset associated with the integration point |
|
nodiscardconstexpr |
return a pointer to the constant values associated with an integration point, given its offset
| [in] | t | tag stating that no bound checking is performed (mgis::unsafe), the offset must be strictly smaller than the size of the space |
| [in] | o | offset associated with the integration point |
|
nodiscardconstexpr |
return a pointer to the values associated with an integration point, given the index of its cell and its own index
| [in] | t | tag stating that no bound checking is performed (mgis::unsafe), the indices must be valid |
| [in] | e | cell index |
| [in] | i | quadrature point index |
|
nodiscardconstexpr |
return a pointer to the constant values associated with an integration point, given the index of its cell and its own index
| [in] | t | tag stating that no bound checking is performed (mgis::unsafe), the indices must be valid |
| [in] | e | cell index |
| [in] | i | quadrature point index |
|
nodiscardconstexpr |
|
nodiscardconstexpr |
return the values associated with an integration point, given its offset
| [in] | o | offset associated with the integration point |
|
nodiscardconstexpr |
return the constant values associated with an integration point, given its offset
| [in] | o | offset associated with the integration point |
|
nodiscardconstexpr |
return the values associated with an integration point, given the index of its cell and its own index
| [in] | e | cell index |
| [in] | i | quadrature point index |
|
nodiscardconstexpr |
return the constant values associated with an integration point, given the index of its cell and its own index
| [in] | e | cell index |
| [in] | i | quadrature point index |
|
staticconstexpr |
true if the view can be seen as a scalar valued function, i.e. if the number of components is equal to one or is only known at run time