MGIS 3.1.0
Loading...
Searching...
No Matches
mgis::function::FunctionView< Space, layout, is_mutable > Struct Template Reference

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>

Inheritance diagram for mgis::function::FunctionView< Space, layout, is_mutable >:
mgis::PreconditionsChecker< FunctionView< Space, FunctionDataLayoutDescription{}, true > > mgis::function::FunctionDataLayout< FunctionDataLayoutDescription{} > mgis::function::FunctionDataSize< layout.data_size > mgis::function::FunctionDataStride< layout.data_stride >

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

Detailed Description

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout = FunctionDataLayoutDescription{}, bool is_mutable = true>
struct mgis::function::FunctionView< Space, layout, is_mutable >

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.

Template Parameters
Spacetype of the discretization space on which the function is defined, which must match the LinearFunctionalSpaceConcept concept
layoutdata 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_mutableif true, the view allows modifying the values stored in the external memory region, otherwise those values are constant

Member Typedef Documentation

◆ ConstValuesView

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout = FunctionDataLayoutDescription{}, bool is_mutable = true>
using mgis::function::FunctionView< Space, layout, is_mutable >::ConstValuesView
Initial value:
std::conditional_t<
layout.data_size == dynamic_extent,
std::span<const real>,
std::conditional_t<layout.data_size == 1,
const real&,
std::span<const real, layout.data_size>>>
mgis_real real
alias to the numeric type used
Definition Config.hxx:140
constexpr size_type dynamic_extent
a constant whose role is similar to std::dynamic_extent
Definition Config.hxx:143

type of the value returned by the call operator of a constant view, i.e. a constant version of ValuesView

◆ ExternalData

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout = FunctionDataLayoutDescription{}, bool is_mutable = true>
using mgis::function::FunctionView< Space, layout, is_mutable >::ExternalData
Initial value:
std::conditional_t<is_mutable, std::span<real>, std::span<const real>>

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

◆ ValuesView

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout = FunctionDataLayoutDescription{}, bool is_mutable = true>
using mgis::function::FunctionView< Space, layout, is_mutable >::ValuesView
Initial value:
std::conditional_t<
layout.data_size == dynamic_extent,
std::span<real>,
std::conditional_t<layout.data_size == 1,
real&,
std::span<real, layout.data_size>>>

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

Constructor & Destructor Documentation

◆ FunctionView() [1/16]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires ((layout.data_size != dynamic_extent) && (layout.data_stride == dynamic_extent))
mgis::function::FunctionView< Space, layout, is_mutable >::FunctionView ( const Space & s,
FunctionView< Space, layout, is_mutable >::ExternalData v,
const size_type dsize )
constexpr

constructor when the number of components is known at compile time and the stride is only known at run time

Parameters
[in]squadrature space
[in]vvalues
[in]dstridestride of the data

◆ FunctionView() [2/16]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires ((layout.data_size != dynamic_extent) && (layout.data_stride == dynamic_extent))
template<bool doPreconditionsCheck>
requires ((layout.data_size != dynamic_extent) && (layout.data_stride == dynamic_extent))
mgis::function::FunctionView< Space, layout, is_mutable >::FunctionView ( const PreconditionsCheck< doPreconditionsCheck > & pcheck,
const Space & s,
FunctionView< Space, layout, is_mutable >::ExternalData v,
const size_type dsize )
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

Template Parameters
doPreconditionsCheckif true, the preconditions are checked, otherwise they are skipped
Parameters
[in]pchecktag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check)
[in]squadrature space
[in]vvalues
[in]dstridestride of the data

◆ FunctionView() [3/16]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires ((layout.data_size == dynamic_extent) && (layout.data_stride == dynamic_extent))
mgis::function::FunctionView< Space, layout, is_mutable >::FunctionView ( const Space & s,
FunctionView< Space, layout, is_mutable >::ExternalData v,
const size_type dsize,
const size_type dstride )
constexpr

constructor when both the number of components and the stride are only known at run time

Parameters
[in]squadrature space
[in]vvalues
[in]dsizenumber of components of the function
[in]dstridestride of the data

◆ FunctionView() [4/16]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires ((layout.data_size == dynamic_extent) && (layout.data_stride == dynamic_extent))
template<bool doPreconditionsCheck>
requires ((layout.data_size == dynamic_extent) && (layout.data_stride == dynamic_extent))
mgis::function::FunctionView< Space, layout, is_mutable >::FunctionView ( const PreconditionsCheck< doPreconditionsCheck > & pcheck,
const Space & s,
FunctionView< Space, layout, is_mutable >::ExternalData v,
const size_type dsize,
const size_type dstride )
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

Template Parameters
doPreconditionsCheckif true, the preconditions are checked, otherwise they are skipped
Parameters
[in]pchecktag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check)
[in]squadrature space
[in]vvalues
[in]dsizenumber of components of the function
[in]dstridestride of the data

◆ FunctionView() [5/16]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout = FunctionDataLayoutDescription{}, bool is_mutable = true>
mgis::function::FunctionView< Space, layout, is_mutable >::FunctionView ( const Space & ,
ExternalData ,
const size_type  )
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

Parameters
[in]squadrature space
[in]vvalues
[in]dsizenumber of components of the function

◆ FunctionView() [6/16]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout = FunctionDataLayoutDescription{}, bool is_mutable = true>
template<bool doPreconditionsCheck>
requires ((layout.data_size == dynamic_extent) && (layout.data_stride == dynamic_extent))
mgis::function::FunctionView< Space, layout, is_mutable >::FunctionView ( const PreconditionsCheck< doPreconditionsCheck > & ,
const Space & ,
ExternalData ,
const size_type  )
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

Template Parameters
doPreconditionsCheckif true, the preconditions are checked, otherwise they are skipped
Parameters
[in]pchecktag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check)
[in]squadrature space
[in]vvalues
[in]dsizenumber of components of the function

◆ FunctionView() [7/16]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout = FunctionDataLayoutDescription{}, bool is_mutable = true>
mgis::function::FunctionView< Space, layout, is_mutable >::FunctionView ( const Space & ,
ExternalData ,
const size_type  )
constexpr

constructor when the number of components is only known at run time and the stride is known at compile time

Parameters
[in]squadrature space
[in]vvalues
[in]dsizenumber of components of the function

◆ FunctionView() [8/16]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout = FunctionDataLayoutDescription{}, bool is_mutable = true>
template<bool doPreconditionsCheck>
requires ((layout.data_size == dynamic_extent) && (layout.data_stride != dynamic_extent))
mgis::function::FunctionView< Space, layout, is_mutable >::FunctionView ( const PreconditionsCheck< doPreconditionsCheck > & ,
const Space & ,
ExternalData ,
const size_type  )
constexpr

constructor when the number of components is only known at run time and the stride is known at compile time

Template Parameters
doPreconditionsCheckif true, the preconditions are checked, otherwise they are skipped
Parameters
[in]pchecktag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check)
[in]squadrature space
[in]vvalues
[in]dsizenumber of components of the function

◆ FunctionView() [9/16]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires ((layout.data_size != dynamic_extent) && (layout.data_stride != dynamic_extent))
mgis::function::FunctionView< Space, layout, is_mutable >::FunctionView ( const Space & s,
typename FunctionView< Space, layout, is_mutable >::ExternalData v )
constexpr

constructor when both the number of components and the stride are known at compile time

Parameters
[in]squadrature space
[in]vvalues

◆ FunctionView() [10/16]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires ((layout.data_size != dynamic_extent) && (layout.data_stride != dynamic_extent))
template<bool doPreconditionsCheck>
requires ((layout.data_size != dynamic_extent) && (layout.data_stride != dynamic_extent))
mgis::function::FunctionView< Space, layout, is_mutable >::FunctionView ( const PreconditionsCheck< doPreconditionsCheck > & pcheck,
const Space & s,
typename FunctionView< Space, layout, is_mutable >::ExternalData v )
constexpr

constructor when both the number of components and the stride are known at compile time

Template Parameters
doPreconditionsCheckif true, the preconditions are checked, otherwise they are skipped
Parameters
[in]pchecktag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check)
[in]squadrature space
[in]vvalues

◆ FunctionView() [11/16]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires ((layout.data_size == dynamic_extent) && (layout.data_stride == dynamic_extent))
mgis::function::FunctionView< Space, layout, is_mutable >::FunctionView ( const Space & s,
FunctionView< Space, layout, is_mutable >::ExternalData v,
const FunctionDataLayout< layout > & l )
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

Parameters
[in]squadrature space
[in]vvalues
[in]ldata layout

◆ FunctionView() [12/16]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires ((layout.data_size == dynamic_extent) && (layout.data_stride == dynamic_extent))
template<bool doPreconditionsCheck>
requires ((layout.data_size == dynamic_extent) && (layout.data_stride == dynamic_extent))
mgis::function::FunctionView< Space, layout, is_mutable >::FunctionView ( const PreconditionsCheck< doPreconditionsCheck > & pcheck,
const Space & s,
FunctionView< Space, layout, is_mutable >::ExternalData v,
const FunctionDataLayout< layout > & l )
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

Template Parameters
doPreconditionsCheckif true, the preconditions are checked, otherwise they are skipped
Parameters
[in]pchecktag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check)
[in]squadrature space
[in]vvalues
[in]ldata layout

◆ FunctionView() [13/16]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout = FunctionDataLayoutDescription{}, bool is_mutable = true>
mgis::function::FunctionView< Space, layout, is_mutable >::FunctionView ( const Space & ,
ExternalData ,
const FunctionDataLayout< 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

Parameters
[in]squadrature space
[in]vvalues
[in]ldata layout

◆ FunctionView() [14/16]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout = FunctionDataLayoutDescription{}, bool is_mutable = true>
template<bool doPreconditionsCheck>
requires ((layout.data_size != dynamic_extent) && (layout.data_stride == dynamic_extent))
mgis::function::FunctionView< Space, layout, is_mutable >::FunctionView ( const PreconditionsCheck< doPreconditionsCheck > & ,
const Space & ,
ExternalData ,
const FunctionDataLayout< 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

Template Parameters
doPreconditionsCheckif true, the preconditions are checked, otherwise they are skipped
Parameters
[in]pchecktag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check)
[in]squadrature space
[in]vvalues
[in]ldata layout

◆ FunctionView() [15/16]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout = FunctionDataLayoutDescription{}, bool is_mutable = true>
mgis::function::FunctionView< Space, layout, is_mutable >::FunctionView ( const Space & ,
ExternalData ,
const FunctionDataLayout< 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

Parameters
[in]squadrature space
[in]vvalues
[in]ldata layout

◆ FunctionView() [16/16]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout = FunctionDataLayoutDescription{}, bool is_mutable = true>
template<bool doPreconditionsCheck>
requires ((layout.data_size == dynamic_extent) && (layout.data_stride != dynamic_extent))
mgis::function::FunctionView< Space, layout, is_mutable >::FunctionView ( const PreconditionsCheck< doPreconditionsCheck > & ,
const Space & ,
ExternalData ,
const FunctionDataLayout< 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

Template Parameters
doPreconditionsCheckif true, the preconditions are checked, otherwise they are skipped
Parameters
[in]pchecktag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check)
[in]squadrature space
[in]vvalues
[in]ldata layout

Member Function Documentation

◆ checkCompatibility()

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
bool mgis::function::FunctionView< Space, layout, is_mutable >::checkCompatibility ( const FunctionView< Space, layout, is_mutable > & v) const
nodiscardconstexpr

check if the given view can be used in place of the current one

Parameters
[in]vview to compare with the current view
Returns
true if the current view and the given view are defined on equivalent spaces and have the same number of components

◆ checkPreconditions() [1/6]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires ((layout.data_size != dynamic_extent) && (layout.data_stride != dynamic_extent))
bool mgis::function::FunctionView< Space, layout, is_mutable >::checkPreconditions ( AbstractErrorHandler & eh,
const Space & s,
typename FunctionView< Space, layout, is_mutable >::ExternalData v )
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

Parameters
[in]eherror handler used to report the detected errors
[in]squadrature space
[in]vvalues
Returns
true if the external data is large enough to hold the values of the function
Note
a space of size zero is always accepted, which may happen due to partitioning in parallel

◆ checkPreconditions() [2/6]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires ((layout.data_size == dynamic_extent) && (layout.data_stride == dynamic_extent))
bool mgis::function::FunctionView< Space, layout, is_mutable >::checkPreconditions ( AbstractErrorHandler & eh,
const Space & s,
FunctionView< Space, layout, is_mutable >::ExternalData v,
const FunctionDataLayout< layout > & l )
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

Parameters
[in]eherror handler used to report the detected errors
[in]squadrature space
[in]vvalues
[in]ldata layout, which gives the number of components and the stride of the function
Returns
true if the preconditions are met

◆ checkPreconditions() [3/6]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout = FunctionDataLayoutDescription{}, bool is_mutable = true>
constexpr bool mgis::function::FunctionView< Space, layout, is_mutable >::checkPreconditions ( AbstractErrorHandler & ,
const Space & ,
ExternalData ,
const size_type  )
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

Parameters
[in]eherror handler used to report the detected errors
[in]squadrature space
[in]vvalues
[in]dsizenumber of components of the function
Returns
true if the preconditions are met

◆ checkPreconditions() [4/6]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout = FunctionDataLayoutDescription{}, bool is_mutable = true>
constexpr bool mgis::function::FunctionView< Space, layout, is_mutable >::checkPreconditions ( AbstractErrorHandler & ,
const Space & ,
ExternalData ,
const size_type  )
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

Parameters
[in]eherror handler used to report the detected errors
[in]squadrature space
[in]vvalues
[in]dstridestride of the data
Returns
true if the stride is not smaller than the number of components and the external data is large enough to hold the values of the function

◆ checkPreconditions() [5/6]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires ((layout.data_size == dynamic_extent) && (layout.data_stride != dynamic_extent))
bool mgis::function::FunctionView< Space, layout, is_mutable >::checkPreconditions ( AbstractErrorHandler & eh,
const Space & s,
FunctionView< Space, layout, is_mutable >::ExternalData v,
const size_type dsize )
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

Parameters
[in]eherror handler used to report the detected errors
[in]squadrature space
[in]vvalues
[in]dsizenumber of components of the function
Returns
true if the number of components is not greater than the stride and the external data is large enough to hold the values of the function

◆ checkPreconditions() [6/6]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires ((layout.data_size == dynamic_extent) && (layout.data_stride == dynamic_extent))
bool mgis::function::FunctionView< Space, layout, is_mutable >::checkPreconditions ( AbstractErrorHandler & eh,
const Space & s,
FunctionView< Space, layout, is_mutable >::ExternalData v,
const size_type dsize,
const size_type dstride )
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

Parameters
[in]eherror handler used to report the detected errors
[in]squadrature space
[in]vvalues
[in]dsizenumber of components of the function
[in]dstridestride of the data
Returns
true if the number of components and the stride are valid and the external data is large enough to hold the values of the function

◆ data() [1/6]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires (is_mutable)
std::span< real > mgis::function::FunctionView< Space, layout, is_mutable >::data ( )
nodiscardconstexpr
Returns
a mutable view to all the values stored in the external memory region
Note
the returned span covers the whole external memory region, which may contain data not related to the function, for instance when the data stride is greater than the number of components

◆ data() [2/6]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
std::span< const real > mgis::function::FunctionView< Space, layout, is_mutable >::data ( ) const
nodiscardconstexpr
Returns
a view to all the constant values stored in the external memory region
Note
the returned span covers the whole external memory region, which may contain data not related to the function, for instance when the data stride is greater than the number of components

◆ data() [3/6]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires ( is_mutable&& LinearElementSpaceConcept<Space> && (!hasElementWorkspace<Space>))
real * mgis::function::FunctionView< Space, layout, is_mutable >::data ( mgis::attributes::UnsafeAttribute ,
const size_type o )
nodiscardconstexpr

return a pointer to the values associated with an integration point, given its offset

Parameters
[in]ttag stating that no bound checking is performed (mgis::unsafe), the offset must be strictly smaller than the size of the space
[in]ooffset associated with the integration point
Returns
a pointer to the first value of the integration point
Note
this function is available on mutable views defined on linear element spaces without element workspaces

◆ data() [4/6]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires (LinearElementSpaceConcept<Space> && (!hasElementWorkspace<Space>))
const real * mgis::function::FunctionView< Space, layout, is_mutable >::data ( mgis::attributes::UnsafeAttribute ,
const size_type o ) const
nodiscardconstexpr

return a pointer to the constant values associated with an integration point, given its offset

Parameters
[in]ttag stating that no bound checking is performed (mgis::unsafe), the offset must be strictly smaller than the size of the space
[in]ooffset associated with the integration point
Returns
a pointer to the first value of the integration point
Note
this function is available on views defined on linear element spaces without element workspaces

◆ data() [5/6]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires (is_mutable&& LinearQuadratureSpaceConcept<Space> && (!hasCellWorkspace<Space>))
real * mgis::function::FunctionView< Space, layout, is_mutable >::data ( mgis::attributes::UnsafeAttribute ,
const size_type e,
const size_type i )
nodiscardconstexpr

return a pointer to the values associated with an integration point, given the index of its cell and its own index

Parameters
[in]ttag stating that no bound checking is performed (mgis::unsafe), the indices must be valid
[in]ecell index
[in]iquadrature point index
Returns
a pointer to the first value of the integration point
Note
this function is available on mutable views defined on linear quadrature spaces without cell workspaces

◆ data() [6/6]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires (LinearQuadratureSpaceConcept<Space> && (!hasCellWorkspace<Space>))
const real * mgis::function::FunctionView< Space, layout, is_mutable >::data ( mgis::attributes::UnsafeAttribute ,
const size_type e,
const size_type i ) const
nodiscardconstexpr

return a pointer to the constant values associated with an integration point, given the index of its cell and its own index

Parameters
[in]ttag stating that no bound checking is performed (mgis::unsafe), the indices must be valid
[in]ecell index
[in]iquadrature point index
Returns
a pointer to the first value of the integration point
Note
this function is available on views defined on linear quadrature spaces without cell workspaces

◆ getSpace()

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
const Space & mgis::function::FunctionView< Space, layout, is_mutable >::getSpace ( ) const
nodiscardconstexpr
Returns
the underlying quadrature space

◆ operator()() [1/4]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires ( is_mutable&& LinearElementSpaceConcept<Space> && (!hasElementWorkspace<Space>))
FunctionView< Space, layout, is_mutable >::ValuesView mgis::function::FunctionView< Space, layout, is_mutable >::operator() ( const size_type o)
nodiscardconstexpr

return the values associated with an integration point, given its offset

Parameters
[in]ooffset associated with the integration point
Returns
a view to the values of the integration point, of type ValuesView
Note
this function is available on mutable views defined on linear element spaces without element workspaces

◆ operator()() [2/4]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires (LinearElementSpaceConcept<Space> && (!hasElementWorkspace<Space>))
FunctionView< Space, layout, is_mutable >::ConstValuesView constexpr mgis::function::FunctionView< Space, layout, is_mutable >::operator() ( const size_type o) const
nodiscardconstexpr

return the constant values associated with an integration point, given its offset

Parameters
[in]ooffset associated with the integration point
Returns
a view to the values of the integration point, of type ConstValuesView
Note
this function is available on views defined on linear element spaces without element workspaces

◆ operator()() [3/4]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires ( is_mutable&& LinearQuadratureSpaceConcept<Space> && (!hasCellWorkspace<Space>))
FunctionView< Space, layout, is_mutable >::ValuesView constexpr mgis::function::FunctionView< Space, layout, is_mutable >::operator() ( const size_type e,
const size_type i )
nodiscardconstexpr

return the values associated with an integration point, given the index of its cell and its own index

Parameters
[in]ecell index
[in]iquadrature point index
Returns
a view to the values of the integration point, of type ValuesView
Note
this function is available on mutable views defined on linear quadrature spaces without cell workspaces

◆ operator()() [4/4]

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout, bool is_mutable>
requires (LinearQuadratureSpaceConcept<Space> && (!hasCellWorkspace<Space>))
FunctionView< Space, layout, is_mutable >::ConstValuesView constexpr mgis::function::FunctionView< Space, layout, is_mutable >::operator() ( const size_type e,
const size_type i ) const
nodiscardconstexpr

return the constant values associated with an integration point, given the index of its cell and its own index

Parameters
[in]ecell index
[in]iquadrature point index
Returns
a view to the values of the integration point, of type ConstValuesView
Note
this function is available on views defined on linear quadrature spaces without cell workspaces

Member Data Documentation

◆ allowScalarAccessor

template<LinearFunctionalSpaceConcept Space, FunctionDataLayoutDescription layout = FunctionDataLayoutDescription{}, bool is_mutable = true>
bool mgis::function::FunctionView< Space, layout, is_mutable >::allowScalarAccessor
staticconstexpr
Initial value:
=
(layout.data_size == dynamic_extent) ? true : layout.data_size == 1

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


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