14#ifndef __INTREPID2_PROJECTIONSTRUCT_HPP__
15#define __INTREPID2_PROJECTIONSTRUCT_HPP__
17#include "Intrepid2_ConfigDefs.hpp"
49range_size(
const Kokkos::pair<ordinal_type, ordinal_type>& range) {
50 return range.second - range.first;
53template<
typename DeviceType,
typename ValueType>
57 enum EvalPointsType {BASIS, TARGET};
59 using range_type = Kokkos::pair<ordinal_type,ordinal_type>;
60 using HostExecutionSpaceType = Kokkos::DefaultHostExecutionSpace;
61 using HostMemorySpaceType = Kokkos::HostSpace;
62 using MemSpaceType =
typename DeviceType::memory_space;
63 using HostDeviceType = Kokkos::Device<HostExecutionSpaceType,HostMemorySpaceType>;
64 using view_type = Kokkos::DynRankView<ValueType,DeviceType >;
65 using host_view_type = Kokkos::DynRankView<ValueType,HostDeviceType >;
66 using range_tag = Kokkos::View<range_type**,HostDeviceType>;
67 static constexpr int numberSubCellDims = 4;
71 static constexpr int maxSubCellsCount = 12;
72 using view_tag = std::array<std::array<host_view_type, maxSubCellsCount>, numberSubCellDims>;
73 using key_tag = Kokkos::View<unsigned**,HostDeviceType >;
79 return numBasisEvalPoints;
85 return numBasisDerivEvalPoints;
91 return numTargetEvalPoints;
97 return numTargetDerivEvalPoints;
108 return maxNumBasisDerivEvalPoints;
110 return maxNumTargetDerivEvalPoints;
121 return maxNumBasisEvalPoints;
123 return maxNumTargetEvalPoints;
139 return basisCubPoints[subCellDim][subCellId];
156 return basisDerivCubPoints[subCellDim][subCellId];
173 return targetCubPoints[subCellDim][subCellId];
190 return targetDerivCubPoints[subCellDim][subCellId];
208 host_view_type
getEvalPoints(
const ordinal_type subCellDim,
const ordinal_type subCellId, EvalPointsType type)
const{
210 return basisCubPoints[subCellDim][subCellId];
212 return targetCubPoints[subCellDim][subCellId];
229 return allBasisEPoints;
231 return allTargetEPoints;
248 host_view_type
getDerivEvalPoints(
const ordinal_type subCellDim,
const ordinal_type subCellId, EvalPointsType type)
const{
250 return basisDerivCubPoints[subCellDim][subCellId];
252 return targetDerivCubPoints[subCellDim][subCellId];
269 return allBasisDerivEPoints;
271 return allTargetDerivEPoints;
287 return basisCubWeights[subCellDim][subCellId];
303 return basisDerivCubWeights[subCellDim][subCellId];
319 return targetCubWeights[subCellDim][subCellId];
335 return targetDerivCubWeights[subCellDim][subCellId];
344 return basisPointsRange;
355 return basisPointsRange;
357 return targetPointsRange;
366 return basisDerivPointsRange;
377 return basisDerivPointsRange;
379 return targetDerivPointsRange;
388 return targetPointsRange;
397 return targetDerivPointsRange;
405 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 view_type allBasisEPoints;
482 view_type allBasisDerivEPoints;
483 view_type allTargetEPoints;
484 view_type allTargetDerivEPoints;
485 ordinal_type numBasisEvalPoints;
486 ordinal_type numBasisDerivEvalPoints;
487 ordinal_type numTargetEvalPoints;
488 ordinal_type numTargetDerivEvalPoints;
489 ordinal_type maxNumBasisEvalPoints;
490 ordinal_type maxNumTargetEvalPoints;
491 ordinal_type maxNumBasisDerivEvalPoints;
492 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::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.
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.
const range_tag getTargetDerivPointsRange() const
Returns the range tag of the target function derivative evaluation points on subcells.
ordinal_type getNumBasisDerivEvalPoints()
Returns number of evaluation points for basis derivatives.
host_view_type getTargetEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the points where to evaluate the target function on a subcell.
const key_tag getTopologyKey() const
Returns the key tag for subcells.
host_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.
host_view_type getTargetDerivEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the function derivatives evaluation weights on a subcell.
const range_tag getBasisPointsRange() const
Returns the range tag of the basis evaluation points subcells.
host_view_type getBasisDerivEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis derivatives evaluation weights 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.
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.
host_view_type getBasisDerivEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the evaluation points for basis derivatives on a subcell.
ordinal_type getMaxNumEvalPoints(const EvalPointsType type) const
Returns the maximum number of evaluation points across all the subcells.
host_view_type getEvalPoints(const ordinal_type subCellDim, const ordinal_type subCellId, EvalPointsType type) const
Returns the basis/target evaluation points on a subcell.
ordinal_type getNumBasisEvalPoints()
Returns number of basis evaluation points.
host_view_type getTargetEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the function evaluation weights on a subcell.
host_view_type getBasisEvalWeights(const ordinal_type subCellDim, const ordinal_type subCellId)
Returns the basis 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.
void createHDivProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree, const ordinal_type targetDivCubDegre)
Initialize the ProjectionStruct for HDIV projections.
const range_tag getBasisDerivPointsRange() const
Returns the range tag of the derivative evaluation points on subcell.
const range_tag getTargetPointsRange() const
Returns the range of the target function evaluation points on subcells.
void createL2ProjectionStruct(const BasisPtrType cellBasis, const ordinal_type targetCubDegree)
Initialize the ProjectionStruct for L2 projections.
ordinal_type getMaxNumDerivPoints(const EvalPointsType type) const
Returns the maximum number of derivative evaluation points across all the subcells.
view_type getAllDerivEvalPoints(EvalPointsType type=TARGET) const
Returns all the evaluation points for basis/target derivatives in the cell.
ordinal_type getNumTargetEvalPoints()
Returns number of points where to evaluate the target function.
view_type getAllEvalPoints(EvalPointsType type=TARGET) const
Returns the basis/target evaluation points in the cell.
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.
const range_tag getPointsRange(const EvalPointsType type) const
Returns the range tag of the basis/target evaluation points in subcells.