47#ifndef __INTREPID2_PROJECTIONSTRUCT_HPP__
48#define __INTREPID2_PROJECTIONSTRUCT_HPP__
50#include "Intrepid2_ConfigDefs.hpp"
57namespace Experimental {
82range_size(
const Kokkos::pair<ordinal_type, ordinal_type>& range) {
83 return range.second - range.first;
86template<
typename DeviceType,
typename ValueType>
90 enum EvalPointsType {BASIS, TARGET};
92 typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
95 typedef Kokkos::HostSpace HostMemorySpaceType;
96 typedef Kokkos::Device<HostExecutionSpaceType,HostMemorySpaceType> HostDeviceType;
97 typedef Kokkos::DynRankView<ValueType,HostDeviceType > view_type;
98 typedef Kokkos::View<range_type**,HostDeviceType> range_tag;
99 static constexpr int numberSubCellDims = 4;
103 static constexpr int maxSubCellsCount = 12;
104 typedef std::array<std::array<view_type, maxSubCellsCount>, numberSubCellDims> view_tag;
105 typedef Kokkos::View<unsigned**,HostDeviceType > key_tag;
110 return numBasisEvalPoints;
116 return numBasisDerivEvalPoints;
122 return numTargetEvalPoints;
128 return numTargetDerivEvalPoints;
139 return maxNumBasisDerivEvalPoints;
141 return maxNumTargetDerivEvalPoints;
152 return maxNumBasisEvalPoints;
154 return maxNumTargetEvalPoints;
170 return basisCubPoints[subCellDim][subCellId];
187 return basisDerivCubPoints[subCellDim][subCellId];
204 return targetCubPoints[subCellDim][subCellId];
221 return targetDerivCubPoints[subCellDim][subCellId];
239 view_type
getEvalPoints(
const ordinal_type subCellDim,
const ordinal_type subCellId, EvalPointsType type)
const{
241 return basisCubPoints[subCellDim][subCellId];
243 return targetCubPoints[subCellDim][subCellId];
260 view_type
getDerivEvalPoints(
const ordinal_type subCellDim,
const ordinal_type subCellId, EvalPointsType type)
const{
262 return basisDerivCubPoints[subCellDim][subCellId];
264 return targetDerivCubPoints[subCellDim][subCellId];
281 return basisCubWeights[subCellDim][subCellId];
297 return basisDerivCubWeights[subCellDim][subCellId];
313 return targetCubWeights[subCellDim][subCellId];
329 return targetDerivCubWeights[subCellDim][subCellId];
338 return basisPointsRange;
349 return basisPointsRange;
351 return targetPointsRange;
360 return basisDerivPointsRange;
371 return basisDerivPointsRange;
373 return targetDerivPointsRange;
382 return targetPointsRange;
391 return targetDerivPointsRange;
399 return subCellTopologyKey;
409 template<
typename BasisPtrType>
411 const ordinal_type targetCubDegree);
418 template<
typename BasisPtrType>
420 const ordinal_type targetCubDegree) {
430 template<
typename BasisPtrType>
432 const ordinal_type targetCubDegree,
433 const ordinal_type targetGradCubDegre);
441 template<
typename BasisPtrType>
443 const ordinal_type targetCubDegree,
444 const ordinal_type targetCurlCubDegre);
452 template<
typename BasisPtrType>
454 const ordinal_type targetCubDegree,
455 const ordinal_type targetDivCubDegre);
461 template<
typename BasisPtrType>
463 const ordinal_type targetCubDegree);
465 key_tag subCellTopologyKey;
466 range_tag basisPointsRange;
467 range_tag basisDerivPointsRange;
468 range_tag targetPointsRange;
469 range_tag targetDerivPointsRange;
470 view_tag basisCubPoints;
471 view_tag basisCubWeights;
472 view_tag basisDerivCubPoints;
473 view_tag basisDerivCubWeights;
474 view_tag targetCubPoints;
475 view_tag targetCubWeights;
476 view_tag targetDerivCubPoints;
477 view_tag targetDerivCubWeights;
478 ordinal_type numBasisEvalPoints;
479 ordinal_type numBasisDerivEvalPoints;
480 ordinal_type numTargetEvalPoints;
481 ordinal_type numTargetDerivEvalPoints;
482 ordinal_type maxNumBasisEvalPoints;
483 ordinal_type maxNumTargetEvalPoints;
484 ordinal_type maxNumBasisDerivEvalPoints;
485 ordinal_type maxNumTargetDerivEvalPoints;
Header file for the Intrepid2::Experimental::ProjectionStruct containing definitions.
Contains definitions of custom data types in Intrepid2.
An helper class to compute the evaluation points and weights needed for performing projections.
ordinal_type getNumBasisEvalPoints()
Returns number of basis evaluation points.
ordinal_type getNumTargetEvalPoints()
Returns number of points where to evaluate the target function.
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 createHCurlProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree, const ordinal_type targetCurlCubDegre)
Initialize the ProjectionStruct for HCURL projections.
const range_tag getDerivPointsRange(const EvalPointsType type) const
Returns the range tag of the basis/target derivative evaluation points on subcells.
ordinal_type getMaxNumDerivPoints(const EvalPointsType type) const
Returns the maximum number of derivative evaluation points across all the subcells.
const range_tag getBasisPointsRange() const
Returns the range tag of the basis evaluation points subcells.
const range_tag getBasisDerivPointsRange() const
Returns the range tag of the derivative evaluation points on subcell.
view_type getBasisDerivEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the evaluation points for basis derivatives on a subcell.
const range_tag getTargetPointsRange() const
Returns the range of the target function evaluation points on subcells.
void createHDivProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree, const ordinal_type targetDivCubDegre)
Initialize the ProjectionStruct for HDIV projections.
view_type getBasisEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis evaluation points on a subcell.
ordinal_type getNumTargetDerivEvalPoints()
Returns number of points where to evaluate the derivatives of the target function.
void createL2ProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree)
Initialize the ProjectionStruct for L2 projections.
view_type getEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId, EvalPointsType type) const
Returns the basis/target evaluation points on a subcell.
Kokkos::DefaultHostExecutionSpace HostExecutionSpaceType
KK : do we really need this complication instead of using default host exec space ?...
const key_tag getTopologyKey() const
Returns the key tag for subcells.
view_type getTargetDerivEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the function derivatives evaluation weights on a 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.
view_type getBasisEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis evaluation weights on a subcell.
const range_tag getTargetDerivPointsRange() const
Returns the range tag of the target function derivative evaluation points on subcells.
ordinal_type getMaxNumEvalPoints(const EvalPointsType type) const
Returns the maximum number of evaluation points across all the subcells.
void createL2DGProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree)
Initialize the ProjectionStruct for (discontinuous local-L2) projection.
void createHVolProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree)
Initialize the ProjectionStruct for HVOL (local-L2) projection.
ordinal_type getNumBasisDerivEvalPoints()
Returns number of evaluation points for basis derivatives.
view_type getTargetEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the function evaluation weights on a subcell.
void createHGradProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree, const ordinal_type targetGradCubDegre)
Initialize the ProjectionStruct for HGRAD projections.
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.
const range_tag getPointsRange(const EvalPointsType type) const
Returns the range tag of the basis/target evaluation points in subcells.