Intrepid2
Intrepid2::BasisValues< Scalar, DeviceType > Class Template Reference

The data containers in Intrepid2 that support sum factorization and other reduced-data optimizations distinguish between scalar-valued data that is a simple product of elements in tensor components, and vector-valued data that is made up of a series of such products. More...

#include <Intrepid2_BasisValues.hpp>

Public Member Functions

 BasisValues (TensorDataType tensorData)
 Constructor for scalar-valued BasisValues with a single family of values.
 BasisValues (std::vector< TensorDataType > tensorDataFamilies)
 Constructor for scalar-valued BasisValues, with potentially multiple families of values. (Used, e.g., for op = DIV and functionSpace = HDIV.).
 BasisValues (VectorDataType vectorData)
 Constructor for vector-valued BasisValues.
 BasisValues ()
 Default constructor.
template<typename OtherDeviceType, class = typename std::enable_if<!std::is_same<DeviceType, OtherDeviceType>::value>::type>
 BasisValues (const BasisValues< Scalar, OtherDeviceType > &basisValues)
 copy-like constructor for differing execution spaces. This does a deep copy of underlying views.
BasisValues< Scalar, DeviceType > basisValuesForFields (const int &fieldStartOrdinal, const int &numFields)
 field start and length must align with families in vectorData_ or tensorDataFamilies_ (whichever is valid).
KOKKOS_INLINE_FUNCTION int familyFieldOrdinalOffset (const int &familyOrdinal) const
 Returns the field ordinal offset for the specified family.
TensorDataType & tensorData ()
 TensorData accessor for single-family scalar data.
const TensorDataType & tensorData (const int &familyOrdinal) const
 TensorData accessor for multi-family scalar data.
KOKKOS_INLINE_FUNCTION int numFamilies () const
 For valid vectorData, returns the number of families in vectorData; otherwise, returns number of TensorData families.
KOKKOS_INLINE_FUNCTION int numTensorDataFamilies () const
KOKKOS_INLINE_FUNCTION int numFieldsInFamily (int familyOrdinal) const
const Kokkos::Array< TensorDataType, Parameters::MaxTensorComponents > & tensorDataFamilies () const
 TensorDataFamilies accessor.
const VectorDataType & vectorData () const
 VectorData accessor.
KOKKOS_INLINE_FUNCTION Scalar operator() (const int &fieldOrdinal, const int &pointOrdinal) const
 operator() for (F,P) scalar data; throws an exception if this is not a scalar-valued container
KOKKOS_INLINE_FUNCTION Scalar operator() (const int &fieldOrdinal, const int &pointOrdinal, const int &dim) const
 operator() for (F,P,D) vector data; throws an exception if this is not a vector-valued container
KOKKOS_INLINE_FUNCTION Scalar operator() (const int &cellOrdinal, const int &fieldOrdinal, const int &pointOrdinal, const int &dim) const
 operator() for (C,F,P,D) data, which arises in CVFEM; at present unimplemented, and only declared here to allow a generic setJacobian() method in CellTools to compile.
KOKKOS_INLINE_FUNCTION int extent_int (const int &i) const
KOKKOS_INLINE_FUNCTION size_t extent (const int &i) const
KOKKOS_INLINE_FUNCTION size_t rank () const
void setOrdinalFilter (Kokkos::View< ordinal_type *, DeviceType > ordinalFilter)
Kokkos::View< ordinal_type *, DeviceType > ordinalFilter () const

Private Types

using TensorDataType = TensorData<Scalar,DeviceType>
using VectorDataType = VectorData<Scalar,DeviceType>

Private Attributes

Kokkos::Array< TensorDataType, Parameters::MaxTensorComponentstensorDataFamilies_
VectorDataType vectorData_
int numTensorDataFamilies_ = -1
Kokkos::View< ordinal_type *, DeviceType > ordinalFilter_

Detailed Description

template<class Scalar, typename DeviceType>
class Intrepid2::BasisValues< Scalar, DeviceType >

The data containers in Intrepid2 that support sum factorization and other reduced-data optimizations distinguish between scalar-valued data that is a simple product of elements in tensor components, and vector-valued data that is made up of a series of such products.

BasisValues contains both a VectorData and a TensorData object; only one of them will be valid in any BasisValues object. This allows us to maintain a common getValues() interface in the Basis class, rather than distinguishing at the interface level between operations that result in vector values and those that result in scalars.

Definition at line 35 of file Intrepid2_BasisValues.hpp.

Member Typedef Documentation

◆ TensorDataType

template<class Scalar, typename DeviceType>
using Intrepid2::BasisValues< Scalar, DeviceType >::TensorDataType = TensorData<Scalar,DeviceType>
private

Definition at line 37 of file Intrepid2_BasisValues.hpp.

◆ VectorDataType

template<class Scalar, typename DeviceType>
using Intrepid2::BasisValues< Scalar, DeviceType >::VectorDataType = VectorData<Scalar,DeviceType>
private

Definition at line 38 of file Intrepid2_BasisValues.hpp.

Constructor & Destructor Documentation

◆ BasisValues() [1/5]

template<class Scalar, typename DeviceType>
Intrepid2::BasisValues< Scalar, DeviceType >::BasisValues ( TensorDataType tensorData)
inline

Constructor for scalar-valued BasisValues with a single family of values.

Definition at line 48 of file Intrepid2_BasisValues.hpp.

References tensorData().

Referenced by BasisValues(), and basisValuesForFields().

◆ BasisValues() [2/5]

template<class Scalar, typename DeviceType>
Intrepid2::BasisValues< Scalar, DeviceType >::BasisValues ( std::vector< TensorDataType > tensorDataFamilies)
inline

Constructor for scalar-valued BasisValues, with potentially multiple families of values. (Used, e.g., for op = DIV and functionSpace = HDIV.).

Definition at line 55 of file Intrepid2_BasisValues.hpp.

References tensorDataFamilies().

◆ BasisValues() [3/5]

template<class Scalar, typename DeviceType>
Intrepid2::BasisValues< Scalar, DeviceType >::BasisValues ( VectorDataType vectorData)
inline

Constructor for vector-valued BasisValues.

Definition at line 66 of file Intrepid2_BasisValues.hpp.

References vectorData().

◆ BasisValues() [4/5]

template<class Scalar, typename DeviceType>
Intrepid2::BasisValues< Scalar, DeviceType >::BasisValues ( )
inline

Default constructor.

Definition at line 72 of file Intrepid2_BasisValues.hpp.

Referenced by basisValuesForFields().

◆ BasisValues() [5/5]

template<class Scalar, typename DeviceType>
template<typename OtherDeviceType, class = typename std::enable_if<!std::is_same<DeviceType, OtherDeviceType>::value>::type>
Intrepid2::BasisValues< Scalar, DeviceType >::BasisValues ( const BasisValues< Scalar, OtherDeviceType > & basisValues)
inline

copy-like constructor for differing execution spaces. This does a deep copy of underlying views.

Definition at line 80 of file Intrepid2_BasisValues.hpp.

References BasisValues(), tensorDataFamilies(), and vectorData().

Member Function Documentation

◆ basisValuesForFields()

template<class Scalar, typename DeviceType>
BasisValues< Scalar, DeviceType > Intrepid2::BasisValues< Scalar, DeviceType >::basisValuesForFields ( const int & fieldStartOrdinal,
const int & numFields )
inline

field start and length must align with families in vectorData_ or tensorDataFamilies_ (whichever is valid).

Definition at line 97 of file Intrepid2_BasisValues.hpp.

References BasisValues(), BasisValues(), numFamilies(), and tensorDataFamilies().

Referenced by Intrepid2::Basis_DirectSumBasis< typename HGRAD_LINE::BasisBase >::getValues().

◆ extent()

template<class Scalar, typename DeviceType>
KOKKOS_INLINE_FUNCTION size_t Intrepid2::BasisValues< Scalar, DeviceType >::extent ( const int & i) const
inline

Definition at line 308 of file Intrepid2_BasisValues.hpp.

◆ extent_int()

template<class Scalar, typename DeviceType>
KOKKOS_INLINE_FUNCTION int Intrepid2::BasisValues< Scalar, DeviceType >::extent_int ( const int & i) const
inline

Definition at line 270 of file Intrepid2_BasisValues.hpp.

◆ familyFieldOrdinalOffset()

template<class Scalar, typename DeviceType>
KOKKOS_INLINE_FUNCTION int Intrepid2::BasisValues< Scalar, DeviceType >::familyFieldOrdinalOffset ( const int & familyOrdinal) const
inline

Returns the field ordinal offset for the specified family.

Definition at line 140 of file Intrepid2_BasisValues.hpp.

◆ numFamilies()

template<class Scalar, typename DeviceType>
KOKKOS_INLINE_FUNCTION int Intrepid2::BasisValues< Scalar, DeviceType >::numFamilies ( ) const
inline

For valid vectorData, returns the number of families in vectorData; otherwise, returns number of TensorData families.

Definition at line 174 of file Intrepid2_BasisValues.hpp.

Referenced by basisValuesForFields(), and Intrepid2::Basis_TensorBasis< BasisBase >::getValues().

◆ numFieldsInFamily()

template<class Scalar, typename DeviceType>
KOKKOS_INLINE_FUNCTION int Intrepid2::BasisValues< Scalar, DeviceType >::numFieldsInFamily ( int familyOrdinal) const
inline

Definition at line 193 of file Intrepid2_BasisValues.hpp.

◆ numTensorDataFamilies()

template<class Scalar, typename DeviceType>
KOKKOS_INLINE_FUNCTION int Intrepid2::BasisValues< Scalar, DeviceType >::numTensorDataFamilies ( ) const
inline

Definition at line 187 of file Intrepid2_BasisValues.hpp.

◆ operator()() [1/3]

template<class Scalar, typename DeviceType>
KOKKOS_INLINE_FUNCTION Scalar Intrepid2::BasisValues< Scalar, DeviceType >::operator() ( const int & cellOrdinal,
const int & fieldOrdinal,
const int & pointOrdinal,
const int & dim ) const
inline

operator() for (C,F,P,D) data, which arises in CVFEM; at present unimplemented, and only declared here to allow a generic setJacobian() method in CellTools to compile.

Definition at line 263 of file Intrepid2_BasisValues.hpp.

References INTREPID2_TEST_FOR_EXCEPTION_DEVICE_SAFE.

◆ operator()() [2/3]

template<class Scalar, typename DeviceType>
KOKKOS_INLINE_FUNCTION Scalar Intrepid2::BasisValues< Scalar, DeviceType >::operator() ( const int & fieldOrdinal,
const int & pointOrdinal ) const
inline

operator() for (F,P) scalar data; throws an exception if this is not a scalar-valued container

Definition at line 219 of file Intrepid2_BasisValues.hpp.

References INTREPID2_TEST_FOR_EXCEPTION_DEVICE_SAFE.

◆ operator()() [3/3]

template<class Scalar, typename DeviceType>
KOKKOS_INLINE_FUNCTION Scalar Intrepid2::BasisValues< Scalar, DeviceType >::operator() ( const int & fieldOrdinal,
const int & pointOrdinal,
const int & dim ) const
inline

operator() for (F,P,D) vector data; throws an exception if this is not a vector-valued container

Definition at line 252 of file Intrepid2_BasisValues.hpp.

References INTREPID2_TEST_FOR_EXCEPTION_DEVICE_SAFE.

◆ ordinalFilter()

template<class Scalar, typename DeviceType>
Kokkos::View< ordinal_type *, DeviceType > Intrepid2::BasisValues< Scalar, DeviceType >::ordinalFilter ( ) const
inline

Definition at line 335 of file Intrepid2_BasisValues.hpp.

◆ rank()

template<class Scalar, typename DeviceType>
KOKKOS_INLINE_FUNCTION size_t Intrepid2::BasisValues< Scalar, DeviceType >::rank ( ) const
inline

Definition at line 314 of file Intrepid2_BasisValues.hpp.

◆ setOrdinalFilter()

template<class Scalar, typename DeviceType>
void Intrepid2::BasisValues< Scalar, DeviceType >::setOrdinalFilter ( Kokkos::View< ordinal_type *, DeviceType > ordinalFilter)
inline

Definition at line 330 of file Intrepid2_BasisValues.hpp.

◆ tensorData() [1/2]

◆ tensorData() [2/2]

template<class Scalar, typename DeviceType>
const TensorDataType & Intrepid2::BasisValues< Scalar, DeviceType >::tensorData ( const int & familyOrdinal) const
inline

TensorData accessor for multi-family scalar data.

Definition at line 165 of file Intrepid2_BasisValues.hpp.

References INTREPID2_TEST_FOR_EXCEPTION_DEVICE_SAFE.

◆ tensorDataFamilies()

template<class Scalar, typename DeviceType>
const Kokkos::Array< TensorDataType, Parameters::MaxTensorComponents > & Intrepid2::BasisValues< Scalar, DeviceType >::tensorDataFamilies ( ) const
inline

TensorDataFamilies accessor.

Definition at line 206 of file Intrepid2_BasisValues.hpp.

Referenced by BasisValues(), BasisValues(), and basisValuesForFields().

◆ vectorData()

Member Data Documentation

◆ numTensorDataFamilies_

template<class Scalar, typename DeviceType>
int Intrepid2::BasisValues< Scalar, DeviceType >::numTensorDataFamilies_ = -1
private

Definition at line 43 of file Intrepid2_BasisValues.hpp.

◆ ordinalFilter_

template<class Scalar, typename DeviceType>
Kokkos::View<ordinal_type*,DeviceType> Intrepid2::BasisValues< Scalar, DeviceType >::ordinalFilter_
private

Definition at line 45 of file Intrepid2_BasisValues.hpp.

◆ tensorDataFamilies_

template<class Scalar, typename DeviceType>
Kokkos::Array<TensorDataType,Parameters::MaxTensorComponents> Intrepid2::BasisValues< Scalar, DeviceType >::tensorDataFamilies_
private

Definition at line 40 of file Intrepid2_BasisValues.hpp.

◆ vectorData_

template<class Scalar, typename DeviceType>
VectorDataType Intrepid2::BasisValues< Scalar, DeviceType >::vectorData_
private

Definition at line 41 of file Intrepid2_BasisValues.hpp.


The documentation for this class was generated from the following file: