Intrepid2
|
Reference-space field values for a basis, designed to support typical vector-valued bases. More...
#include <Intrepid2_VectorData.hpp>
Public Types | |
using | VectorArray = Kokkos::Array< TensorData<Scalar,DeviceType>, Parameters::MaxVectorComponents > |
using | FamilyVectorArray = Kokkos::Array< VectorArray, Parameters::MaxTensorComponents> |
Public Member Functions | |
void | initialize () |
Initialize members based on constructor parameters; all constructors should call this after populating numFamilies_, numComponents_, and vectorComponents_. | |
template<size_t numFamilies, size_t numComponents> | |
VectorData (Kokkos::Array< Kokkos::Array< TensorData< Scalar, DeviceType >, numComponents >, numFamilies > vectorComponents) | |
Standard constructor for the arbitrary case, accepting a fixed-length array argument. | |
VectorData (const std::vector< std::vector< TensorData< Scalar, DeviceType > > > &vectorComponents) | |
Standard constructor for the arbitrary case, accepting a variable-length std::vector argument. | |
template<size_t numComponents> | |
VectorData (Kokkos::Array< TensorData< Scalar, DeviceType >, numComponents > vectorComponents, bool axialComponents) | |
Simplified constructor for gradients of HGRAD, and values of HDIV and HCURL vector bases. | |
VectorData (std::vector< TensorData< Scalar, DeviceType > > vectorComponents, bool axialComponents) | |
Simplified constructor for gradients of HGRAD, and values of HDIV and HCURL vector bases. | |
template<typename OtherDeviceType , class = typename std::enable_if< std::is_same<typename DeviceType::memory_space, typename OtherDeviceType::memory_space>::value>::type, class = typename std::enable_if<!std::is_same<DeviceType,OtherDeviceType>::value>::type> | |
VectorData (const VectorData< Scalar, OtherDeviceType > &vectorData) | |
copy-like constructor for differing device type, but same memory space. This does a shallow copy of the underlying view. | |
template<typename OtherDeviceType , class = typename std::enable_if<!std::is_same<typename DeviceType::memory_space, typename OtherDeviceType::memory_space>::value>::type> | |
VectorData (const VectorData< Scalar, OtherDeviceType > &vectorData) | |
copy-like constructor for differing execution spaces. This does a deep copy of underlying views. | |
VectorData (TensorData< Scalar, DeviceType > data) | |
Simple 1-argument constructor for the case of trivial tensor product structure. The argument should have shape (F,P,D) where D has extent equal to the spatial dimension. | |
VectorData (Data< Scalar, DeviceType > data) | |
Simple 1-argument constructor for the case of trivial tensor product structure. The argument should have shape (F,P,D) where D has extent equal to the spatial dimension. | |
VectorData () | |
default constructor; results in an invalid container. | |
KOKKOS_INLINE_FUNCTION bool | axialComponents () const |
Returns true only if the families are so structured that the first family has nonzeros only in the x component, the second only in the y component, etc. | |
KOKKOS_INLINE_FUNCTION int | numDimsForComponent (int &componentOrdinal) const |
Returns the number of dimensions corresponding to the specified component. | |
KOKKOS_INLINE_FUNCTION int | numFields () const |
Returns the total number of fields; corresponds to the first dimension of this container. | |
KOKKOS_INLINE_FUNCTION int | familyFieldOrdinalOffset (const int &familyOrdinal) const |
Returns the field ordinal offset for the specified family. | |
KOKKOS_INLINE_FUNCTION int | numPoints () const |
Returns the number of points; corresponds to the second dimension of this container. | |
KOKKOS_INLINE_FUNCTION int | spaceDim () const |
Returns the spatial dimension; corresponds to the third dimension of this container. | |
KOKKOS_INLINE_FUNCTION Scalar | operator() (const int &fieldOrdinal, const int &pointOrdinal, const int &dim) const |
Accessor for the container, which has shape (F,P,D). | |
KOKKOS_INLINE_FUNCTION const TensorData< Scalar, DeviceType > & | getComponent (const int &componentOrdinal) const |
Single-argument component accessor for the axial-component or the single-family case; in this case, one argument suffices to uniquely identify the component. | |
KOKKOS_INLINE_FUNCTION const TensorData< Scalar, DeviceType > & | getComponent (const int &familyOrdinal, const int &componentOrdinal) const |
General component accessor. | |
KOKKOS_INLINE_FUNCTION int | extent_int (const int &r) const |
Returns the extent in the specified dimension as an int. | |
KOKKOS_INLINE_FUNCTION unsigned | rank () const |
Returns the rank of this container, which is 3. | |
KOKKOS_INLINE_FUNCTION int | numComponents () const |
returns the number of components | |
KOKKOS_INLINE_FUNCTION int | numFamilies () const |
returns the number of families | |
KOKKOS_INLINE_FUNCTION int | familyForFieldOrdinal (const int &fieldOrdinal) const |
Returns the family ordinal corresponding to the indicated field ordinal. | |
KOKKOS_INLINE_FUNCTION int | numFieldsInFamily (const unsigned &familyOrdinal) const |
returns the number of fields in the specified family | |
KOKKOS_INLINE_FUNCTION constexpr bool | isValid () const |
returns true for containers that have data; false for those that don't (e.g., those that have been constructed by the default constructor). | |
Public Attributes | |
FamilyVectorArray | vectorComponents_ |
bool | axialComponents_ |
int | totalDimension_ |
Kokkos::Array< int, Parameters::MaxVectorComponents > | dimToComponent_ |
Kokkos::Array< int, Parameters::MaxVectorComponents > | dimToComponentDim_ |
Kokkos::Array< int, Parameters::MaxVectorComponents > | numDimsForComponent_ |
Kokkos::Array< int, Parameters::MaxTensorComponents > | familyFieldUpperBound_ |
unsigned | numFamilies_ |
unsigned | numComponents_ |
unsigned | numPoints_ |
Reference-space field values for a basis, designed to support typical vector-valued bases.
VectorData is designed with typical HDIV/HCURL bases in mind; these often involve reference-space basis functions each of which is zero in every dimension but one. Moreover, on tensor product topologies each nonzero scalar function can be expressed as a product of functions defined on the topological components. Also supported: gradients of typical H^1 bases, which have a full vector, each component of which is a product of basis functions defined on lower-dimensional topologies.
Typically, HDIV and HCURL bases have multiple families corresponding to the nonzero structure of the vector components. VectorData therefore supports multiple families. (Gradients of H^1 are expressed as a single family.)
Definition at line 65 of file Intrepid2_VectorData.hpp.
using Intrepid2::VectorData< Scalar, DeviceType >::FamilyVectorArray = Kokkos::Array< VectorArray, Parameters::MaxTensorComponents> |
Definition at line 69 of file Intrepid2_VectorData.hpp.
using Intrepid2::VectorData< Scalar, DeviceType >::VectorArray = Kokkos::Array< TensorData<Scalar,DeviceType>, Parameters::MaxVectorComponents > |
Definition at line 68 of file Intrepid2_VectorData.hpp.
|
inline |
Standard constructor for the arbitrary case, accepting a fixed-length array argument.
[in] | vectorComponents | - an array of arrays, where the outer dimension corresponds to the family, and the inner to the number of components in each vector. |
Outer dimension: number of families; inner dimension: number of components in each vector. Use empty/invalid TensorData objects to indicate zeroes. Each family, and each vector component dimension, must have at least one valid entry, and the number of points in each valid entry must agree with each other. The field count within components of a family must also agree; across families these may differ. Vector components are allowed to span multiple spatial dimensions, but when they do, any valid TensorData object in that vector position must agree in the dimension across families.
Definition at line 184 of file Intrepid2_VectorData.hpp.
References Intrepid2::VectorData< Scalar, DeviceType >::initialize(), Intrepid2::Parameters::MaxTensorComponents, Intrepid2::Parameters::MaxVectorComponents, Intrepid2::VectorData< Scalar, DeviceType >::numComponents(), and Intrepid2::VectorData< Scalar, DeviceType >::numFamilies().
|
inline |
Standard constructor for the arbitrary case, accepting a variable-length std::vector argument.
[in] | vectorComponents | - an array of arrays, where the outer dimension corresponds to the family, and the inner to the number of components in each vector. |
Outer dimension: number of families; inner dimension: number of components in each vector. Use empty/invalid TensorData objects to indicate zeroes. Each family, and each vector component dimension, must have at least one valid entry, and the number of points in each valid entry must agree with each other. The field count within components of a family must also agree; across families these may differ. Vector components are allowed to span multiple spatial dimensions, but when they do, any valid TensorData object in that vector position must agree in the dimension across families.
Definition at line 207 of file Intrepid2_VectorData.hpp.
References Intrepid2::VectorData< Scalar, DeviceType >::initialize(), Intrepid2::Parameters::MaxTensorComponents, and Intrepid2::Parameters::MaxVectorComponents.
|
inline |
Simplified constructor for gradients of HGRAD, and values of HDIV and HCURL vector bases.
[in] | vectorComponents | - an array of components; see below for interpretation |
[in] | axialComponents | - use false for a "full" vector, such as the gradient of a scalar HGRAD basis; use true for all-but-one zero entries in each vector, as for the values in a typical HDIV or HCURL basis |
For the gradient use case, VectorData will have a single family. For the HDIV and HCURL use cases, will have the same number of families as there are components in the vectorComponents argument; each family will consist of vectors that have one entry filled, the others zeroes; this is what we mean by "axial components."
Definition at line 237 of file Intrepid2_VectorData.hpp.
References Intrepid2::VectorData< Scalar, DeviceType >::axialComponents(), Intrepid2::VectorData< Scalar, DeviceType >::initialize(), and Intrepid2::VectorData< Scalar, DeviceType >::numComponents().
|
inline |
Simplified constructor for gradients of HGRAD, and values of HDIV and HCURL vector bases.
[in] | vectorComponents | - an array of components; see below for interpretation |
[in] | axialComponents | - use false for a "full" vector, such as the gradient of a scalar HGRAD basis; use true for all-but-one zero entries in each vector, as for the values in a typical HDIV or HCURL basis |
For the gradient use case, VectorData will have a single family. For the HDIV and HCURL use cases, will have the same number of families as there are components in the vectorComponents argument; each family will consist of vectors that have one entry filled, the others zeroes; this is what we mean by "axial components."
Definition at line 267 of file Intrepid2_VectorData.hpp.
References Intrepid2::VectorData< Scalar, DeviceType >::axialComponents(), and Intrepid2::VectorData< Scalar, DeviceType >::initialize().
|
inline |
copy-like constructor for differing device type, but same memory space. This does a shallow copy of the underlying view.
Definition at line 292 of file Intrepid2_VectorData.hpp.
References Intrepid2::VectorData< Scalar, DeviceType >::getComponent().
|
inline |
copy-like constructor for differing execution spaces. This does a deep copy of underlying views.
Definition at line 312 of file Intrepid2_VectorData.hpp.
References Intrepid2::VectorData< Scalar, DeviceType >::getComponent(), Intrepid2::VectorData< Scalar, DeviceType >::initialize(), and Intrepid2::VectorData< Scalar, DeviceType >::isValid().
|
inline |
Simple 1-argument constructor for the case of trivial tensor product structure. The argument should have shape (F,P,D) where D has extent equal to the spatial dimension.
Definition at line 331 of file Intrepid2_VectorData.hpp.
|
inline |
Simple 1-argument constructor for the case of trivial tensor product structure. The argument should have shape (F,P,D) where D has extent equal to the spatial dimension.
Definition at line 337 of file Intrepid2_VectorData.hpp.
|
inline |
default constructor; results in an invalid container.
Definition at line 343 of file Intrepid2_VectorData.hpp.
|
inline |
Returns true only if the families are so structured that the first family has nonzeros only in the x component, the second only in the y component, etc.
Definition at line 350 of file Intrepid2_VectorData.hpp.
Referenced by Intrepid2::VectorData< Scalar, DeviceType >::VectorData(), and Intrepid2::VectorData< Scalar, DeviceType >::VectorData().
|
inline |
Returns the extent in the specified dimension as an int.
Definition at line 483 of file Intrepid2_VectorData.hpp.
References INTREPID2_TEST_FOR_EXCEPTION_DEVICE_SAFE, Intrepid2::VectorData< Scalar, DeviceType >::numFields(), and Intrepid2::VectorData< Scalar, DeviceType >::numPoints().
Referenced by Intrepid2::VectorData< Scalar, DeviceType >::initialize().
|
inline |
Returns the field ordinal offset for the specified family.
Definition at line 371 of file Intrepid2_VectorData.hpp.
Referenced by Intrepid2::BasisValues< Scalar, ExecSpaceType >::familyFieldOrdinalOffset().
|
inline |
Returns the family ordinal corresponding to the indicated field ordinal.
Definition at line 516 of file Intrepid2_VectorData.hpp.
References Intrepid2::VectorData< Scalar, DeviceType >::numFieldsInFamily().
|
inline |
Single-argument component accessor for the axial-component or the single-family case; in this case, one argument suffices to uniquely identify the component.
[in] | componentOrdinal | - the vector component ordinal. |
Definition at line 447 of file Intrepid2_VectorData.hpp.
References INTREPID2_TEST_FOR_EXCEPTION_DEVICE_SAFE.
Referenced by Intrepid2::BasisValues< Scalar, ExecSpaceType >::basisValuesForFields(), Intrepid2::Basis< Device, outputValueType, pointValueType >::getValues(), Intrepid2::Basis_TensorBasis< BasisBaseClass >::getValues(), and Intrepid2::VectorData< Scalar, DeviceType >::VectorData().
|
inline |
General component accessor.
[in] | familyOrdinal | - the family ordinal for the requested component. |
[in] | componentOrdinal | - the vector component ordinal. |
Definition at line 471 of file Intrepid2_VectorData.hpp.
References INTREPID2_TEST_FOR_EXCEPTION_DEVICE_SAFE.
|
inline |
Initialize members based on constructor parameters; all constructors should call this after populating numFamilies_, numComponents_, and vectorComponents_.
Definition at line 88 of file Intrepid2_VectorData.hpp.
References Intrepid2::VectorData< Scalar, DeviceType >::extent_int(), Intrepid2::VectorData< Scalar, DeviceType >::isValid(), Intrepid2::VectorData< Scalar, DeviceType >::numDimsForComponent(), Intrepid2::VectorData< Scalar, DeviceType >::numFieldsInFamily(), and Intrepid2::VectorData< Scalar, DeviceType >::numPoints().
Referenced by Intrepid2::VectorData< Scalar, DeviceType >::VectorData(), Intrepid2::VectorData< Scalar, DeviceType >::VectorData(), Intrepid2::VectorData< Scalar, DeviceType >::VectorData(), Intrepid2::VectorData< Scalar, DeviceType >::VectorData(), and Intrepid2::VectorData< Scalar, DeviceType >::VectorData().
|
inlineconstexpr |
returns true for containers that have data; false for those that don't (e.g., those that have been constructed by the default constructor).
Definition at line 546 of file Intrepid2_VectorData.hpp.
Referenced by Intrepid2::Basis_DirectSumBasis< BasisBaseClass >::allocateBasisValues(), Intrepid2::BasisValues< Scalar, ExecSpaceType >::familyFieldOrdinalOffset(), Intrepid2::Basis< Device, outputValueType, pointValueType >::getValues(), Intrepid2::VectorData< Scalar, DeviceType >::initialize(), Intrepid2::BasisValues< Scalar, ExecSpaceType >::numFamilies(), Intrepid2::BasisValues< Scalar, ExecSpaceType >::operator()(), and Intrepid2::VectorData< Scalar, DeviceType >::VectorData().
|
inline |
returns the number of components
Definition at line 504 of file Intrepid2_VectorData.hpp.
Referenced by Intrepid2::BasisValues< Scalar, ExecSpaceType >::basisValuesForFields(), Intrepid2::Basis< Device, outputValueType, pointValueType >::getValues(), Intrepid2::VectorData< Scalar, DeviceType >::VectorData(), and Intrepid2::VectorData< Scalar, DeviceType >::VectorData().
|
inline |
Returns the number of dimensions corresponding to the specified component.
Definition at line 357 of file Intrepid2_VectorData.hpp.
Referenced by Intrepid2::VectorData< Scalar, DeviceType >::initialize().
|
inline |
returns the number of families
Definition at line 510 of file Intrepid2_VectorData.hpp.
Referenced by Intrepid2::Basis_DirectSumBasis< BasisBaseClass >::allocateBasisValues(), Intrepid2::BasisValues< Scalar, ExecSpaceType >::numFamilies(), and Intrepid2::VectorData< Scalar, DeviceType >::VectorData().
|
inline |
Returns the total number of fields; corresponds to the first dimension of this container.
Definition at line 364 of file Intrepid2_VectorData.hpp.
Referenced by Intrepid2::VectorData< Scalar, DeviceType >::extent_int(), and Intrepid2::VectorData< Scalar, DeviceType >::numFieldsInFamily().
|
inline |
returns the number of fields in the specified family
Definition at line 533 of file Intrepid2_VectorData.hpp.
References INTREPID2_TEST_FOR_EXCEPTION_DEVICE_SAFE, and Intrepid2::VectorData< Scalar, DeviceType >::numFields().
Referenced by Intrepid2::VectorData< Scalar, DeviceType >::familyForFieldOrdinal(), and Intrepid2::VectorData< Scalar, DeviceType >::initialize().
|
inline |
Returns the number of points; corresponds to the second dimension of this container.
Definition at line 378 of file Intrepid2_VectorData.hpp.
Referenced by Intrepid2::VectorData< Scalar, DeviceType >::extent_int(), and Intrepid2::VectorData< Scalar, DeviceType >::initialize().
|
inline |
Accessor for the container, which has shape (F,P,D).
Definition at line 392 of file Intrepid2_VectorData.hpp.
References INTREPID2_TEST_FOR_EXCEPTION_DEVICE_SAFE.
|
inline |
Returns the rank of this container, which is 3.
Definition at line 497 of file Intrepid2_VectorData.hpp.
|
inline |
Returns the spatial dimension; corresponds to the third dimension of this container.
Definition at line 385 of file Intrepid2_VectorData.hpp.
bool Intrepid2::VectorData< Scalar, DeviceType >::axialComponents_ |
Definition at line 72 of file Intrepid2_VectorData.hpp.
Kokkos::Array<int, Parameters::MaxVectorComponents> Intrepid2::VectorData< Scalar, DeviceType >::dimToComponent_ |
Definition at line 75 of file Intrepid2_VectorData.hpp.
Kokkos::Array<int, Parameters::MaxVectorComponents> Intrepid2::VectorData< Scalar, DeviceType >::dimToComponentDim_ |
Definition at line 76 of file Intrepid2_VectorData.hpp.
Kokkos::Array<int,Parameters::MaxTensorComponents> Intrepid2::VectorData< Scalar, DeviceType >::familyFieldUpperBound_ |
Definition at line 79 of file Intrepid2_VectorData.hpp.
unsigned Intrepid2::VectorData< Scalar, DeviceType >::numComponents_ |
Definition at line 82 of file Intrepid2_VectorData.hpp.
Kokkos::Array<int, Parameters::MaxVectorComponents> Intrepid2::VectorData< Scalar, DeviceType >::numDimsForComponent_ |
Definition at line 77 of file Intrepid2_VectorData.hpp.
unsigned Intrepid2::VectorData< Scalar, DeviceType >::numFamilies_ |
Definition at line 81 of file Intrepid2_VectorData.hpp.
unsigned Intrepid2::VectorData< Scalar, DeviceType >::numPoints_ |
Definition at line 83 of file Intrepid2_VectorData.hpp.
int Intrepid2::VectorData< Scalar, DeviceType >::totalDimension_ |
Definition at line 74 of file Intrepid2_VectorData.hpp.
FamilyVectorArray Intrepid2::VectorData< Scalar, DeviceType >::vectorComponents_ |
Definition at line 71 of file Intrepid2_VectorData.hpp.