Intrepid2
|
A helper class that allows iteration over three Kokkos Views simultaneously, according to tensor combination rules: More...
#include <Intrepid2_TensorViewIterator.hpp>
Public Member Functions | |
KOKKOS_INLINE_FUNCTION | TensorViewIterator (TensorViewType tensor_view, ViewType1 view1, ViewType2 view2, RankCombinationViewType rank_combination_types) |
Constructor. More... | |
KOKKOS_INLINE_FUNCTION int | nextIncrementRank () |
KOKKOS_INLINE_FUNCTION int | increment () |
KOKKOS_INLINE_FUNCTION void | setLocation (const Kokkos::Array< int, 7 > location) |
KOKKOS_INLINE_FUNCTION void | setLocation (Kokkos::Array< int, 7 > location1, Kokkos::Array< int, 7 > location2) |
KOKKOS_INLINE_FUNCTION ScalarType | getView1Entry () |
KOKKOS_INLINE_FUNCTION ScalarType | getView2Entry () |
KOKKOS_INLINE_FUNCTION void | set (ScalarType value) |
Protected Attributes | |
ViewIterator< TensorViewType, ScalarType > | tensor_view_iterator_ |
ViewIterator< ViewType1, ScalarType > | view1_iterator_ |
ViewIterator< ViewType2, ScalarType > | view2_iterator_ |
RankCombinationViewType | rank_combination_types_ |
A helper class that allows iteration over three Kokkos Views simultaneously, according to tensor combination rules:
- component view 1, - component view 2, and - the combination tensor view
Definition at line 40 of file Intrepid2_TensorViewIterator.hpp.
|
inline |
Constructor.
[in] | tensor_view | - the view that stores the tensor combination |
[in] | view1 | - first component view |
[in] | view2 | - second component view |
[in] | rank_combination_types | - vector with length equal to the maximum rank of the views provided, specifying how component views should be combined to produce tensor view. rank_combination_types entries can be as follows:
|
For TENSOR_PRODUCT combinations in a given rank, view1 increments first. For example, if view1 has entries [x,y] and view2 has entries [0,1] in a given TENSOR_PRODUCT rank, there will be four entries in the tensor_view, in the following order:
Tensor contractions are only allowed in the final dimension(s); if rank d has a TENSOR_CONTRACTION entry, then all subsequent ranks must also contract.
Definition at line 78 of file Intrepid2_TensorViewIterator.hpp.
References INTREPID2_TEST_FOR_EXCEPTION_DEVICE_SAFE.
|
inline |
Getter for view1.
Definition at line 263 of file Intrepid2_TensorViewIterator.hpp.
References Intrepid2::ViewIterator< ViewType, ScalarType >::get().
|
inline |
Getter for view1.
Definition at line 271 of file Intrepid2_TensorViewIterator.hpp.
References Intrepid2::ViewIterator< ViewType, ScalarType >::get().
|
inline |
Move to the next location. Note that during contractions, the tensor view location will not change; the returned rank corresponds to the other two views in that case.
Definition at line 155 of file Intrepid2_TensorViewIterator.hpp.
References Intrepid2::ViewIterator< ViewType, ScalarType >::increment(), Intrepid2::ViewIterator< ViewType, ScalarType >::nextIncrementRank(), and Intrepid2::ViewIterator< ViewType, ScalarType >::reset().
|
inline |
Definition at line 144 of file Intrepid2_TensorViewIterator.hpp.
References Intrepid2::ViewIterator< ViewType, ScalarType >::nextIncrementRank().
|
inline |
Setter for tensor view.
[in] | value | - the value to set in the tensor view |
Definition at line 279 of file Intrepid2_TensorViewIterator.hpp.
References Intrepid2::ViewIterator< ViewType, ScalarType >::set().
|
inline |
Sets the current location in all three views to the specified location.
[in] | location | - the location as a 7-element array value. |
Definition at line 205 of file Intrepid2_TensorViewIterator.hpp.
References Intrepid2::ViewIterator< ViewType, ScalarType >::setLocation().
|
inline |
Sets the current location in the two component views to the specified locations, and sets the tensor view location to the location corresponding to the two component locations.
[in] | location1 | - the location in view1 as a 7-element array value. |
[in] | location2 | - the location in view2 as a 7-element array value. |
Definition at line 216 of file Intrepid2_TensorViewIterator.hpp.
References Intrepid2::ViewIterator< ViewType, ScalarType >::getExtent(), and Intrepid2::ViewIterator< ViewType, ScalarType >::setLocation().