48 #ifndef __INTREPID2_PROJECTIONSTRUCT_HPP__
49 #define __INTREPID2_PROJECTIONSTRUCT_HPP__
51 #include "Intrepid2_ConfigDefs.hpp"
82 KOKKOS_INLINE_FUNCTION
83 range_size(
const Kokkos::pair<ordinal_type, ordinal_type>& range) {
84 return range.second - range.first;
87 template<
typename DeviceType,
typename ValueType>
91 enum EvalPointsType {BASIS, TARGET};
93 using range_type = Kokkos::pair<ordinal_type,ordinal_type>;
94 using HostExecutionSpaceType = Kokkos::DefaultHostExecutionSpace;
95 using HostMemorySpaceType = Kokkos::HostSpace;
96 using MemSpaceType =
typename DeviceType::memory_space;
97 using HostDeviceType = Kokkos::Device<HostExecutionSpaceType,HostMemorySpaceType>;
98 using view_type = Kokkos::DynRankView<ValueType,DeviceType >;
99 using host_view_type = Kokkos::DynRankView<ValueType,HostDeviceType >;
100 using range_tag = Kokkos::View<range_type**,HostDeviceType>;
101 static constexpr
int numberSubCellDims = 4;
105 static constexpr
int maxSubCellsCount = 12;
106 using view_tag = std::array<std::array<host_view_type, maxSubCellsCount>, numberSubCellDims>;
107 using key_tag = Kokkos::View<unsigned**,HostDeviceType >;
113 return numBasisEvalPoints;
119 return numBasisDerivEvalPoints;
125 return numTargetEvalPoints;
131 return numTargetDerivEvalPoints;
142 return maxNumBasisDerivEvalPoints;
144 return maxNumTargetDerivEvalPoints;
155 return maxNumBasisEvalPoints;
157 return maxNumTargetEvalPoints;
173 return basisCubPoints[subCellDim][subCellId];
190 return basisDerivCubPoints[subCellDim][subCellId];
207 return targetCubPoints[subCellDim][subCellId];
224 return targetDerivCubPoints[subCellDim][subCellId];
242 host_view_type
getEvalPoints(
const ordinal_type subCellDim,
const ordinal_type subCellId, EvalPointsType type)
const{
244 return basisCubPoints[subCellDim][subCellId];
246 return targetCubPoints[subCellDim][subCellId];
263 return allBasisEPoints;
265 return allTargetEPoints;
282 host_view_type
getDerivEvalPoints(
const ordinal_type subCellDim,
const ordinal_type subCellId, EvalPointsType type)
const{
284 return basisDerivCubPoints[subCellDim][subCellId];
286 return targetDerivCubPoints[subCellDim][subCellId];
303 return allBasisDerivEPoints;
305 return allTargetDerivEPoints;
321 return basisCubWeights[subCellDim][subCellId];
337 return basisDerivCubWeights[subCellDim][subCellId];
353 return targetCubWeights[subCellDim][subCellId];
369 return targetDerivCubWeights[subCellDim][subCellId];
378 return basisPointsRange;
389 return basisPointsRange;
391 return targetPointsRange;
400 return basisDerivPointsRange;
411 return basisDerivPointsRange;
413 return targetDerivPointsRange;
422 return targetPointsRange;
431 return targetDerivPointsRange;
439 return subCellTopologyKey;
446 template<
typename BasisPtrType>
448 const ordinal_type targetCubDegree);
455 template<
typename BasisPtrType>
457 const ordinal_type targetCubDegree) {
467 template<
typename BasisPtrType>
469 const ordinal_type targetCubDegree,
470 const ordinal_type targetGradCubDegre);
478 template<
typename BasisPtrType>
480 const ordinal_type targetCubDegree,
481 const ordinal_type targetCurlCubDegre);
489 template<
typename BasisPtrType>
491 const ordinal_type targetCubDegree,
492 const ordinal_type targetDivCubDegre);
498 template<
typename BasisPtrType>
500 const ordinal_type targetCubDegree);
502 key_tag subCellTopologyKey;
503 range_tag basisPointsRange;
504 range_tag basisDerivPointsRange;
505 range_tag targetPointsRange;
506 range_tag targetDerivPointsRange;
507 view_tag basisCubPoints;
508 view_tag basisCubWeights;
509 view_tag basisDerivCubPoints;
510 view_tag basisDerivCubWeights;
511 view_tag targetCubPoints;
512 view_tag targetCubWeights;
513 view_tag targetDerivCubPoints;
514 view_tag targetDerivCubWeights;
515 view_type allBasisEPoints;
516 view_type allBasisDerivEPoints;
517 view_type allTargetEPoints;
518 view_type allTargetDerivEPoints;
519 ordinal_type numBasisEvalPoints;
520 ordinal_type numBasisDerivEvalPoints;
521 ordinal_type numTargetEvalPoints;
522 ordinal_type numTargetDerivEvalPoints;
523 ordinal_type maxNumBasisEvalPoints;
524 ordinal_type maxNumTargetEvalPoints;
525 ordinal_type maxNumBasisDerivEvalPoints;
526 ordinal_type maxNumTargetDerivEvalPoints;
ordinal_type getNumBasisDerivEvalPoints()
Returns number of evaluation points for basis derivatives.
void createHVolProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree)
Initialize the ProjectionStruct for HVOL (local-L2) projection.
const range_tag getBasisPointsRange() const
Returns the range tag of the basis evaluation points subcells.
ordinal_type getMaxNumDerivPoints(const EvalPointsType type) const
Returns the maximum number of derivative evaluation points across all the subcells.
const range_tag getTargetDerivPointsRange() const
Returns the range tag of the target function derivative evaluation points on subcells.
host_view_type getTargetDerivEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the function derivatives evaluation weights on a subcell.
host_view_type getEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId, EvalPointsType type) const
Returns the basis/target evaluation points on a subcell.
host_view_type getDerivEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId, EvalPointsType type) const
Returns the evaluation points for basis/target derivatives on a subcell.
void createHDivProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree, const ordinal_type targetDivCubDegre)
Initialize the ProjectionStruct for HDIV projections.
ordinal_type getNumBasisEvalPoints()
Returns number of basis evaluation points.
ordinal_type getMaxNumEvalPoints(const EvalPointsType type) const
Returns the maximum number of evaluation points across all the subcells.
const range_tag getDerivPointsRange(const EvalPointsType type) const
Returns the range tag of the basis/target derivative evaluation points on subcells.
host_view_type getBasisEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis evaluation points on a subcell.
view_type getAllDerivEvalPoints(EvalPointsType type=TARGET) const
Returns all the evaluation points for basis/target derivatives in the cell.
const key_tag getTopologyKey() const
Returns the key tag for subcells.
view_type getAllEvalPoints(EvalPointsType type=TARGET) const
Returns the basis/target evaluation points in the cell.
const range_tag getPointsRange(const EvalPointsType type) const
Returns the range tag of the basis/target evaluation points in subcells.
host_view_type getBasisEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis evaluation weights on a subcell.
Contains definitions of custom data types in Intrepid2.
host_view_type getTargetEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the points where to evaluate the target function on a subcell.
ordinal_type getNumTargetEvalPoints()
Returns number of points where to evaluate the target function.
const range_tag getBasisDerivPointsRange() const
Returns the range tag of the derivative evaluation points on subcell.
void createHCurlProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree, const ordinal_type targetCurlCubDegre)
Initialize the ProjectionStruct for HCURL projections.
const range_tag getTargetPointsRange() const
Returns the range of the target function evaluation points on subcells.
host_view_type getBasisDerivEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis derivatives evaluation weights on a subcell.
void createL2ProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree)
Initialize the ProjectionStruct for L2 projections.
ordinal_type getNumTargetDerivEvalPoints()
Returns number of points where to evaluate the derivatives of the target function.
host_view_type getTargetEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the function evaluation weights on a subcell.
void createL2DGProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree)
Initialize the ProjectionStruct for (discontinuous local-L2) projection.
void createHGradProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree, const ordinal_type targetGradCubDegre)
Initialize the ProjectionStruct for HGRAD projections.
host_view_type getBasisDerivEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the evaluation points for basis derivatives on a subcell.
host_view_type getTargetDerivEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the points where to evaluate the derivatives of the target function on a subcell.
An helper class to compute the evaluation points and weights needed for performing projections...
Stateless class that acts as a factory for a family of nodal bases (hypercube topologies only at this...
Header file for the Intrepid2::ProjectionStruct containing definitions.