48#ifndef __INTREPID2_PROJECTIONSTRUCT_HPP__
49#define __INTREPID2_PROJECTIONSTRUCT_HPP__
51#include "Intrepid2_ConfigDefs.hpp"
60namespace Experimental {
85range_size(
const Kokkos::pair<ordinal_type, ordinal_type>& range) {
86 return range.second - range.first;
89template<
typename DeviceType,
typename ValueType>
93 enum EvalPointsType {BASIS, TARGET};
95 typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
98 typedef Kokkos::HostSpace HostMemorySpaceType;
99 typedef Kokkos::Device<HostExecutionSpaceType,HostMemorySpaceType> HostDeviceType;
100 typedef Kokkos::DynRankView<ValueType,HostDeviceType > view_type;
101 typedef Kokkos::View<range_type**,HostDeviceType> range_tag;
102 static constexpr int numberSubCellDims = 4;
106 static constexpr int maxSubCellsCount = 12;
107 typedef std::array<std::array<view_type, maxSubCellsCount>, numberSubCellDims> view_tag;
108 typedef Kokkos::View<unsigned**,HostDeviceType > key_tag;
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 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 view_type
getDerivEvalPoints(
const ordinal_type subCellDim,
const ordinal_type subCellId, EvalPointsType type)
const{
265 return basisDerivCubPoints[subCellDim][subCellId];
267 return targetDerivCubPoints[subCellDim][subCellId];
284 return basisCubWeights[subCellDim][subCellId];
300 return basisDerivCubWeights[subCellDim][subCellId];
316 return targetCubWeights[subCellDim][subCellId];
332 return targetDerivCubWeights[subCellDim][subCellId];
341 return basisPointsRange;
352 return basisPointsRange;
354 return targetPointsRange;
363 return basisDerivPointsRange;
374 return basisDerivPointsRange;
376 return targetDerivPointsRange;
385 return targetPointsRange;
394 return targetDerivPointsRange;
402 return subCellTopologyKey;
412 template<
typename BasisPtrType>
414 const ordinal_type targetCubDegree);
421 template<
typename BasisPtrType>
423 const ordinal_type targetCubDegree) {
433 template<
typename BasisPtrType>
435 const ordinal_type targetCubDegree,
436 const ordinal_type targetGradCubDegre);
444 template<
typename BasisPtrType>
446 const ordinal_type targetCubDegree,
447 const ordinal_type targetCurlCubDegre);
455 template<
typename BasisPtrType>
457 const ordinal_type targetCubDegree,
458 const ordinal_type targetDivCubDegre);
464 template<
typename BasisPtrType>
466 const ordinal_type targetCubDegree);
468 key_tag subCellTopologyKey;
469 range_tag basisPointsRange;
470 range_tag basisDerivPointsRange;
471 range_tag targetPointsRange;
472 range_tag targetDerivPointsRange;
473 view_tag basisCubPoints;
474 view_tag basisCubWeights;
475 view_tag basisDerivCubPoints;
476 view_tag basisDerivCubWeights;
477 view_tag targetCubPoints;
478 view_tag targetCubWeights;
479 view_tag targetDerivCubPoints;
480 view_tag targetDerivCubWeights;
481 ordinal_type numBasisEvalPoints;
482 ordinal_type numBasisDerivEvalPoints;
483 ordinal_type numTargetEvalPoints;
484 ordinal_type numTargetDerivEvalPoints;
485 ordinal_type maxNumBasisEvalPoints;
486 ordinal_type maxNumTargetEvalPoints;
487 ordinal_type maxNumBasisDerivEvalPoints;
488 ordinal_type maxNumTargetDerivEvalPoints;
Stateless class that acts as a factory for a family of nodal bases (hypercube topologies only at this...
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.