|
Intrepid2
|
Allows systematic enumeration of all entries in a TensorData object, tracking indices for each tensor component. More...
#include <Intrepid2_TensorArgumentIterator.hpp>
Public Member Functions | |
| template<class Scalar , typename ExecSpaceType > | |
| KOKKOS_INLINE_FUNCTION | TensorArgumentIterator (const TensorData< Scalar, ExecSpaceType > &tensorData, const ordinal_type argumentOrdinal) |
| template<class Scalar , typename ExecSpaceType > | |
| KOKKOS_INLINE_FUNCTION | TensorArgumentIterator (const TensorData< Scalar, ExecSpaceType > &tensorData, const ordinal_type argumentOrdinal, const ordinal_type numTensorComponents) |
| Variant that allows truncation of the tensor components at the specified number of components. | |
| TensorArgumentIterator (const std::vector< ordinal_type > tensorComponentBounds) | |
| Basic constructor in which only the bounds of the tensor components are required. | |
| template<size_t rank> | |
| KOKKOS_INLINE_FUNCTION | TensorArgumentIterator (const Kokkos::Array< ordinal_type, rank > &tensorComponentBounds) |
| Basic constructor in which only the bounds of the tensor components are required. | |
| KOKKOS_INLINE_FUNCTION ordinal_type | increment () |
| Proceed to next entry. | |
| KOKKOS_INLINE_FUNCTION ordinal_type | nextIncrementResult () const |
| KOKKOS_INLINE_FUNCTION const ordinal_type & | argument (const ordinal_type &r) const |
| KOKKOS_INLINE_FUNCTION ordinal_type | enumerationIndex () const |
| Note: enumerationIndex() matches the ordering in TensorData. This is different from the order in which this iterator proceeds through the tensor arguments. | |
| KOKKOS_INLINE_FUNCTION ordinal_type | relativeEnumerationIndex (const ordinal_type &startingComponent) const |
| Note: relativeEnumerationIndex() matches the ordering in TensorData. This is different from the order in which this iterator proceeds through the tensor arguments. | |
| KOKKOS_INLINE_FUNCTION ordinal_type | relativeEnumerationSpan (const ordinal_type &startingComponent) const |
| total number of enumeration indices with arguments prior to the startingComponent fixed | |
| KOKKOS_INLINE_FUNCTION void | reset (ordinal_type from_component_number=0) |
| KOKKOS_INLINE_FUNCTION void | setArgumentForComponent (const ordinal_type &r, const ordinal_type &i) |
| KOKKOS_INLINE_FUNCTION void | setEnumerationIndex (const ordinal_type &enumerationIndex) |
| Sets the enumeration index; this refers to a 1D enumeration of the possible in-bound arguments. | |
| KOKKOS_INLINE_FUNCTION void | copyArguments (TensorArgumentIterator &otherArgumentIterator, const ordinal_type &r0_from, const ordinal_type &r0_to, const ordinal_type &numArguments) |
| Sets a subset of this iterator's component arguments to match the component arguments from otherArgumentIterator. | |
Private Attributes | |
| Kokkos::Array< ordinal_type, Parameters::MaxTensorComponents > | arguments_ |
| Kokkos::Array< ordinal_type, Parameters::MaxTensorComponents > | bounds_ |
| ordinal_type | numTensorComponents_ |
Allows systematic enumeration of all entries in a TensorData object, tracking indices for each tensor component.
For example, you might have a 3D basis that is the product of 3 1D bases. The components might have shape (F_d,P_d), with N_F_d and N_P_d as the extents for each. If we think of the tensor container as having shape (F,P), then F = N_F_0 * N_F_1 * N_F_2, and P = N_P_0 * N_P_1 * N_P_2. TensorArgumentIterator lets you say that you want to iterate through all the point indices. When you want to move to the next point, call increment(); this will return the index of the most significant component whose argument changed. (Component indices that are greater than this one may also have had their argument changed; lower-indexed components will have stayed the same.)
Definition at line 28 of file Intrepid2_TensorArgumentIterator.hpp.
|
inline |
Definition at line 35 of file Intrepid2_TensorArgumentIterator.hpp.
|
inline |
Variant that allows truncation of the tensor components at the specified number of components.
Definition at line 49 of file Intrepid2_TensorArgumentIterator.hpp.
References Intrepid2::Data< DataScalar, DeviceType >::extent_int(), and Intrepid2::TensorData< Scalar, DeviceType >::getTensorComponent().
|
inline |
Basic constructor in which only the bounds of the tensor components are required.
Definition at line 61 of file Intrepid2_TensorArgumentIterator.hpp.
|
inline |
Basic constructor in which only the bounds of the tensor components are required.
Definition at line 75 of file Intrepid2_TensorArgumentIterator.hpp.
|
inline |
| [in] | r | - component whose argument is being requested. |
Definition at line 116 of file Intrepid2_TensorArgumentIterator.hpp.
Referenced by copyArguments().
|
inline |
Sets a subset of this iterator's component arguments to match the component arguments from otherArgumentIterator.
Definition at line 221 of file Intrepid2_TensorArgumentIterator.hpp.
References argument().
|
inline |
Note: enumerationIndex() matches the ordering in TensorData. This is different from the order in which this iterator proceeds through the tensor arguments.
Definition at line 122 of file Intrepid2_TensorArgumentIterator.hpp.
Referenced by setEnumerationIndex().
|
inline |
Proceed to next entry.
Definition at line 87 of file Intrepid2_TensorArgumentIterator.hpp.
|
inline |
Definition at line 103 of file Intrepid2_TensorArgumentIterator.hpp.
|
inline |
Note: relativeEnumerationIndex() matches the ordering in TensorData. This is different from the order in which this iterator proceeds through the tensor arguments.
Definition at line 147 of file Intrepid2_TensorArgumentIterator.hpp.
|
inline |
total number of enumeration indices with arguments prior to the startingComponent fixed
Definition at line 172 of file Intrepid2_TensorArgumentIterator.hpp.
|
inline |
Resets the location to index 0 in each dimension, starting from the specified dimension.
| [in] | from_rank_number | - the first dimension in which to set the index to 0. |
Definition at line 185 of file Intrepid2_TensorArgumentIterator.hpp.
|
inline |
Sets the current argument in the specified component.
| [in] | r | - the component index |
| [in] | i | - the argument to set for component r< > |
Definition at line 197 of file Intrepid2_TensorArgumentIterator.hpp.
|
inline |
Sets the enumeration index; this refers to a 1D enumeration of the possible in-bound arguments.
| [in] | enumerationIndex | - the index to corresponding to the arguments to set. |
Definition at line 208 of file Intrepid2_TensorArgumentIterator.hpp.
References enumerationIndex().
|
private |
Definition at line 29 of file Intrepid2_TensorArgumentIterator.hpp.
|
private |
Definition at line 30 of file Intrepid2_TensorArgumentIterator.hpp.
|
private |
Definition at line 31 of file Intrepid2_TensorArgumentIterator.hpp.