18 #ifndef Intrepid2_TransformedBasisValues_h
19 #define Intrepid2_TransformedBasisValues_h
23 #include "Intrepid2_ScalarView.hpp"
32 template<
class Scalar,
typename DeviceType>
36 ordinal_type numCells_;
50 transform_(transform),
51 basisValues_(basisValues)
65 basisValues_(basisValues)
69 template<typename OtherDeviceType, class = typename std::enable_if<!std::is_same<DeviceType, OtherDeviceType>::value>::type>
72 numCells_(transformedVectorData.
numCells()),
73 transform_(transformedVectorData.
transform()),
74 basisValues_(transformedVectorData.basisValues())
117 template<
class ViewType>
120 ordinal_type weightRank = getFunctorRank(weights);
128 transform_ = weightData;
133 if ((transform_.
rank() == 4) || (transform_.
rank() == 3))
141 result.storeInPlaceProduct(weightData,transform_);
156 return basisValues_.extent_int(0);
162 return basisValues_.extent_int(1);
168 if ((transform_.
rank() == 3) && (basisValues_.rank() == 3))
172 else if ((transform_.
rank() == 3) && (basisValues_.rank() == 2))
182 return basisValues_.extent_int(2);
187 KOKKOS_INLINE_FUNCTION Scalar
operator()(
const int &cellOrdinal,
const int &fieldOrdinal,
const int &pointOrdinal)
const
192 return basisValues_(fieldOrdinal,pointOrdinal);
194 else if (transform_.
rank() == 2)
196 return transform_(cellOrdinal,pointOrdinal) * basisValues_(fieldOrdinal,pointOrdinal);
198 else if (transform_.
rank() == 3)
201 for (
int d=0; d<transform_.
extent_int(2); d++)
203 value += transform_(cellOrdinal,pointOrdinal,d) * basisValues_(fieldOrdinal,pointOrdinal,d);
211 KOKKOS_INLINE_FUNCTION Scalar
operator()(
const int &cellOrdinal,
const int &fieldOrdinal,
const int &pointOrdinal,
const int &dim)
const
216 return basisValues_(fieldOrdinal,pointOrdinal,dim);
220 return transform_(cellOrdinal,pointOrdinal,dim,dim) * basisValues_(fieldOrdinal,pointOrdinal,dim);
222 else if (transform_.
rank() == 4)
225 for (
int d2=0; d2<transform_.
extent_int(2); d2++)
227 value += transform_(cellOrdinal,pointOrdinal,dim,d2) * basisValues_(fieldOrdinal,pointOrdinal,d2);
231 else if (transform_.
rank() == 3)
233 Scalar value = transform_(cellOrdinal,pointOrdinal,dim) * basisValues_(fieldOrdinal,pointOrdinal);
238 Scalar value = transform_(cellOrdinal,pointOrdinal) * basisValues_(fieldOrdinal,pointOrdinal,dim);
244 KOKKOS_INLINE_FUNCTION Scalar
transformWeight(
const int &cellOrdinal,
const int &pointOrdinal)
const
253 return transform_(cellOrdinal,pointOrdinal);
258 KOKKOS_INLINE_FUNCTION Scalar
transformWeight(
const int &cellOrdinal,
const int &pointOrdinal,
const int &d)
const
262 INTREPID2_TEST_FOR_EXCEPTION_DEVICE_SAFE(
true, std::invalid_argument,
"three-argument transformWeight() is not supported for invalid transform_ object -- no meaningful interpretation for vector-valued identity");
266 return transform_(cellOrdinal,pointOrdinal,d);
271 KOKKOS_INLINE_FUNCTION Scalar
transformWeight(
const int &cellOrdinal,
const int &pointOrdinal,
const int &dim1,
const int &dim2)
const
276 return (dim1 == dim2) ? 1.0 : 0.0;
280 return transform_(cellOrdinal,pointOrdinal,dim1,dim2);
293 return basisValues_.vectorData();
297 KOKKOS_INLINE_FUNCTION
300 if ((transform_.
rank() == 4) && (basisValues_.rank() == 3))
304 else if (transform_.
rank() == 2)
306 return basisValues_.rank() + 1;
308 else if (transform_.
rank() == 3)
310 if (basisValues_.rank() == 3)
315 else if (basisValues_.rank() == 2)
324 KOKKOS_INLINE_FUNCTION
331 else if (r > 3)
return 1;
static Data< DataScalar, DeviceType > allocateInPlaceCombinationResult(const Data< DataScalar, DeviceType > &A, const Data< DataScalar, DeviceType > &B)
#define INTREPID2_TEST_FOR_EXCEPTION_DEVICE_SAFE(test, x, msg)
KOKKOS_INLINE_FUNCTION const Kokkos::Array< DataVariationType, 7 > & getVariationTypes() const
Returns an array with the variation types in each logical dimension.
Header function for Intrepid2::Util class and other utility functions.
KOKKOS_INLINE_FUNCTION bool isDiagonal() const
returns true for containers that have two dimensions marked as BLOCK_PLUS_DIAGONAL for which the non-...
The data containers in Intrepid2 that support sum factorization and other reduced-data optimizations ...
KOKKOS_INLINE_FUNCTION constexpr bool isValid() const
returns true for containers that have data; false for those that don't (namely, those that have been ...
KOKKOS_INLINE_FUNCTION unsigned rank() const
Returns the logical rank of the Data container.
KOKKOS_INLINE_FUNCTION int extent_int(const int &r) const
Returns the logical extent in the specified dimension.
KOKKOS_INLINE_FUNCTION int getDataExtent(const ordinal_type &d) const
returns the true extent of the data corresponding to the logical dimension provided; if the data does...
Header file for the data-wrapper class Intrepid2::BasisValues.
Reference-space field values for a basis, designed to support typical vector-valued bases...