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 DeviceType,
typename ValueType>
90 enum EvalPointsType {BASIS, TARGET};
92 typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
93 typedef typename Kokkos::Impl::is_space<DeviceType>::host_mirror_space::execution_space HostSpaceType;
94 typedef Kokkos::DynRankView<ValueType,HostSpaceType> view_type;
95 typedef Kokkos::View<range_type**,HostSpaceType> 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**,HostSpaceType> 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);
415 template<
typename BasisPtrType>
417 const ordinal_type targetCubDegree) {
427 template<
typename BasisPtrType>
429 const ordinal_type targetCubDegree,
430 const ordinal_type targetGradCubDegre);
438 template<
typename BasisPtrType>
440 const ordinal_type targetCubDegree,
441 const ordinal_type targetCurlCubDegre);
449 template<
typename BasisPtrType>
451 const ordinal_type targetCubDegree,
452 const ordinal_type targetDivCubDegre);
458 template<
typename BasisPtrType>
460 const ordinal_type targetCubDegree);
462 key_tag subCellTopologyKey;
463 range_tag basisPointsRange;
464 range_tag basisDerivPointsRange;
465 range_tag targetPointsRange;
466 range_tag targetDerivPointsRange;
467 view_tag basisCubPoints;
468 view_tag basisCubWeights;
469 view_tag basisDerivCubPoints;
470 view_tag basisDerivCubWeights;
471 view_tag targetCubPoints;
472 view_tag targetCubWeights;
473 view_tag targetDerivCubPoints;
474 view_tag targetDerivCubWeights;
475 ordinal_type numBasisEvalPoints;
476 ordinal_type numBasisDerivEvalPoints;
477 ordinal_type numTargetEvalPoints;
478 ordinal_type numTargetDerivEvalPoints;
479 ordinal_type maxNumBasisEvalPoints;
480 ordinal_type maxNumTargetEvalPoints;
481 ordinal_type maxNumBasisDerivEvalPoints;
482 ordinal_type maxNumTargetDerivEvalPoints;
ordinal_type getNumBasisDerivEvalPoints()
Returns number of evaluation points for basis derivatives.
void createHDivProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree, const ordinal_type targetDivCubDegre)
Initialize the ProjectionStruct for HDIV projections.
const range_tag getTargetDerivPointsRange() const
Returns the range tag of the target function derivative evaluation points on subcells.
void createL2ProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree)
Initialize the ProjectionStruct for L2 projections.
const range_tag getBasisPointsRange() const
Returns the range tag of the basis evaluation points subcells.
view_type getTargetEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the points where to evaluate the target function 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 getBasisDerivPointsRange() const
Returns the range tag of the derivative evaluation points on subcell.
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.
ordinal_type getMaxNumDerivPoints(const EvalPointsType type) const
Returns the maximum number of derivative 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.
const range_tag getDerivPointsRange(const EvalPointsType type) const
Returns the range tag of the basis/target derivative evaluation points on subcells.
view_type getBasisEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis evaluation weights on a subcell.
view_type getBasisDerivEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis derivatives evaluation weights on a subcell.
ordinal_type getMaxNumEvalPoints(const EvalPointsType type) const
Returns the maximum number of evaluation points across all the subcells.
void createHCurlProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree, const ordinal_type targetCurlCubDegre)
Initialize the ProjectionStruct for HCURL projections.
const range_tag getPointsRange(const EvalPointsType type) const
Returns the range tag of the basis/target evaluation points in subcells.
view_type getBasisEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis evaluation points on a subcell.
Contains definitions of custom data types in Intrepid2.
ordinal_type getNumBasisEvalPoints()
Returns number of basis evaluation points.
void createL2DGProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree)
Initialize the ProjectionStruct for (discontinuous local-L2) projection.
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.
void createHVolProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree)
Initialize the ProjectionStruct for HVOL (local-L2) projection.
ordinal_type getNumTargetEvalPoints()
Returns number of points where to evaluate the target function.
An helper class to compute the evaluation points and weights needed for performing projections...
const key_tag getTopologyKey() const
Returns the key tag for subcells.
view_type getBasisDerivEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the evaluation points for basis derivatives 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.
void createHGradProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree, const ordinal_type targetGradCubDegre)
Initialize the ProjectionStruct for HGRAD projections.
Header file for the Intrepid2::Experimental::ProjectionStruct containing definitions.
view_type getTargetEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the function evaluation weights on a subcell.