47 #ifndef __INTREPID2_PROJECTIONSTRUCT_HPP__
48 #define __INTREPID2_PROJECTIONSTRUCT_HPP__
50 #include "Intrepid2_ConfigDefs.hpp"
57 namespace Experimental {
81 KOKKOS_INLINE_FUNCTION
82 range_size(
const Kokkos::pair<ordinal_type, ordinal_type>& range) {
83 return range.second - range.first;
86 template<
typename SpT,
typename ValueType>
90 enum EvalPointsType {BASIS, TARGET};
92 typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
93 typedef typename Kokkos::Impl::is_space<SpT>::host_mirror_space::execution_space host_space_type;
94 typedef Kokkos::DynRankView<ValueType,host_space_type> view_type;
95 typedef Kokkos::View<range_type**,host_space_type> range_tag;
96 static constexpr
int numberSubCellDims = 4;
100 static constexpr
int maxSubCellsCount = 12;
101 typedef std::array<std::array<view_type, maxSubCellsCount>, numberSubCellDims> view_tag;
102 typedef Kokkos::View<unsigned**,host_space_type> key_tag;
107 return numBasisEvalPoints;
113 return numBasisDerivEvalPoints;
119 return numTargetEvalPoints;
125 return numTargetDerivEvalPoints;
136 return maxNumBasisDerivEvalPoints;
138 return maxNumTargetDerivEvalPoints;
149 return maxNumBasisEvalPoints;
151 return maxNumTargetEvalPoints;
167 return basisCubPoints[subCellDim][subCellId];
184 return basisDerivCubPoints[subCellDim][subCellId];
201 return targetCubPoints[subCellDim][subCellId];
218 return targetDerivCubPoints[subCellDim][subCellId];
236 view_type
getEvalPoints(
const ordinal_type subCellDim,
const ordinal_type subCellId, EvalPointsType type)
const{
238 return basisCubPoints[subCellDim][subCellId];
240 return targetCubPoints[subCellDim][subCellId];
257 view_type
getDerivEvalPoints(
const ordinal_type subCellDim,
const ordinal_type subCellId, EvalPointsType type)
const{
259 return basisDerivCubPoints[subCellDim][subCellId];
261 return targetDerivCubPoints[subCellDim][subCellId];
278 return basisCubWeights[subCellDim][subCellId];
294 return basisDerivCubWeights[subCellDim][subCellId];
310 return targetCubWeights[subCellDim][subCellId];
326 return targetDerivCubWeights[subCellDim][subCellId];
335 return basisPointsRange;
346 return basisPointsRange;
348 return targetPointsRange;
357 return basisDerivPointsRange;
368 return basisDerivPointsRange;
370 return targetDerivPointsRange;
379 return targetPointsRange;
388 return targetDerivPointsRange;
396 return subCellTopologyKey;
406 template<
typename BasisPtrType>
408 const ordinal_type targetCubDegree);
416 template<
typename BasisPtrType>
418 const ordinal_type targetCubDegree,
419 const ordinal_type targetGradCubDegre);
427 template<
typename BasisPtrType>
429 const ordinal_type targetCubDegree,
430 const ordinal_type targetCurlCubDegre);
438 template<
typename BasisPtrType>
440 const ordinal_type targetCubDegree,
441 const ordinal_type targetDivCubDegre);
447 template<
typename BasisPtrType>
449 const ordinal_type targetCubDegree);
451 key_tag subCellTopologyKey;
452 range_tag basisPointsRange;
453 range_tag basisDerivPointsRange;
454 range_tag targetPointsRange;
455 range_tag targetDerivPointsRange;
456 view_tag basisCubPoints;
457 view_tag basisCubWeights;
458 view_tag basisDerivCubPoints;
459 view_tag basisDerivCubWeights;
460 view_tag targetCubPoints;
461 view_tag targetCubWeights;
462 view_tag targetDerivCubPoints;
463 view_tag targetDerivCubWeights;
464 ordinal_type numBasisEvalPoints;
465 ordinal_type numBasisDerivEvalPoints;
466 ordinal_type numTargetEvalPoints;
467 ordinal_type numTargetDerivEvalPoints;
468 ordinal_type maxNumBasisEvalPoints;
469 ordinal_type maxNumTargetEvalPoints;
470 ordinal_type maxNumBasisDerivEvalPoints;
471 ordinal_type maxNumTargetDerivEvalPoints;
void createL2ProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree)
Initialize the ProjectionStruct for L2 projections.
void createHDivProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree, const ordinal_type targetDivCubDegre)
Initialize the ProjectionStruct for HDIV projections.
const range_tag getPointsRange(const EvalPointsType type) const
Returns the range tag of the basis/target evaluation points in subcells.
const range_tag getDerivPointsRange(const EvalPointsType type) const
Returns the range tag of the basis/target derivative evaluation points on subcells.
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.
view_type getTargetEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the function evaluation weights on a subcell.
ordinal_type getMaxNumEvalPoints(const EvalPointsType type) const
Returns the maximum number of evaluation points across all the subcells.
view_type getTargetDerivEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the function derivatives evaluation weights on a subcell.
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.
const range_tag getBasisPointsRange() const
Returns the range tag of the basis evaluation points subcells.
view_type getBasisEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis evaluation points on a subcell.
const range_tag getTargetPointsRange() const
Returns the range of the target function evaluation points on subcells.
ordinal_type getNumTargetDerivEvalPoints()
Returns number of points where to evaluate the derivatives of the target function.
Contains definitions of custom data types in Intrepid2.
ordinal_type getMaxNumDerivPoints(const EvalPointsType type) const
Returns the maximum number of derivative evaluation points across all the subcells.
const range_tag getBasisDerivPointsRange() const
Returns the range tag of the derivative evaluation points on subcell.
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.
void createHCurlProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree, const ordinal_type targetCurlCubDegre)
Initialize the ProjectionStruct for HCURL projections.
void createHGradProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree, const ordinal_type targetGradCubDegre)
Initialize the ProjectionStruct for HGRAD projections.
view_type getBasisDerivEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the evaluation points for basis derivatives on a subcell.
ordinal_type getNumBasisEvalPoints()
Returns number of basis evaluation points.
view_type getBasisDerivEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis derivatives evaluation weights on a subcell.
view_type getTargetEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the points where to evaluate the target function on a subcell.
An helper class to compute the evaluation points and weights needed for performing projections...
ordinal_type getNumTargetEvalPoints()
Returns number of points where to evaluate the target function.
const key_tag getTopologyKey() const
Returns the key tag for subcells.
view_type getBasisEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis evaluation weights on a subcell.
view_type getEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId, EvalPointsType type) const
Returns the basis/target evaluation points on a subcell.
const range_tag getTargetDerivPointsRange() const
Returns the range tag of the target function derivative evaluation points on subcells.
Header file for the Intrepid2::Experimental::ProjectionStruct containing definitions.