49 #ifndef __INTREPID2_PROJECTIONTOOLSDEFHVOL_HPP__
50 #define __INTREPID2_PROJECTIONTOOLSDEFHVOL_HPP__
58 namespace Experimental {
60 template<
typename SpT>
61 template<
typename BasisType,
62 typename ortValueType,
class ...ortProperties>
65 const Kokkos::DynRankView<ortValueType, ortProperties...> ,
66 const BasisType* cellBasis,
67 ProjectionStruct<SpT, typename BasisType::scalarType> * projStruct,
68 const EvalPointsType ePointType) {
69 ordinal_type dim = cellBasis->getBaseCellTopology().getDimension();
70 auto refEPoints = Kokkos::create_mirror_view_and_copy(
typename SpT::memory_space(),projStruct->getEvalPoints(dim,0,ePointType));
71 auto ePointsRange = projStruct->getPointsRange(ePointType);
76 template<
typename SpT>
77 template<
typename basisCoeffsValueType,
class ...basisCoeffsProperties,
78 typename funValsValueType,
class ...funValsProperties,
80 typename ortValueType,
class ...ortProperties>
83 const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtTargetEPoints,
84 const typename BasisType::ScalarViewType targetEPoints,
85 const Kokkos::DynRankView<ortValueType, ortProperties...> orts,
86 const BasisType* cellBasis,
87 ProjectionStruct<SpT, typename BasisType::scalarType> * projStruct){
89 typedef typename BasisType::scalarType scalarType;
90 typedef Kokkos::DynRankView<scalarType,SpT> ScalarViewType;
91 ordinal_type dim = cellBasis->getBaseCellTopology().getDimension();
93 ordinal_type basisCardinality = cellBasis->getCardinality();
95 ordinal_type numCells = targetAtTargetEPoints.extent(0);
97 auto refTargetEWeights = Kokkos::create_mirror_view_and_copy(
typename SpT::memory_space(),projStruct->getTargetEvalWeights(dim,0));
98 auto targetEPointsRange = Kokkos::create_mirror_view_and_copy(
typename SpT::memory_space(),projStruct->getTargetPointsRange());
100 auto refBasisEWeights = Kokkos::create_mirror_view_and_copy(
typename SpT::memory_space(),projStruct->getBasisEvalWeights(dim,0));
101 auto basisEPointsRange = Kokkos::create_mirror_view_and_copy(
typename SpT::memory_space(),projStruct->getBasisPointsRange());
103 ordinal_type numTargetEPoints = range_size(targetEPointsRange(dim,0));
104 ordinal_type numBasisEPoints = range_size(basisEPointsRange(dim,0));
106 ScalarViewType basisAtBasisEPoints(
"basisAtBasisEPoints", 1, basisCardinality, numBasisEPoints);
107 ScalarViewType basisAtTargetEPoints(
"basisAtTargetEPoints", basisCardinality, numTargetEPoints);
109 ScalarViewType basisEPoints(
"basisEPoints",numCells,projStruct->getNumBasisEvalPoints(), dim);
110 getHVolEvaluationPoints(basisEPoints, orts, cellBasis, projStruct, EvalPointsType::BASIS);
112 cellBasis->getValues(Kokkos::subview(basisAtBasisEPoints, 0, Kokkos::ALL(), Kokkos::ALL()), Kokkos::subview(basisEPoints,0, Kokkos::ALL(), Kokkos::ALL()));
113 if(targetEPoints.rank()==3)
114 cellBasis->getValues(basisAtTargetEPoints, Kokkos::subview(targetEPoints, 0, Kokkos::ALL(), Kokkos::ALL()));
116 cellBasis->getValues(basisAtTargetEPoints, targetEPoints);
118 ScalarViewType weightedBasisAtTargetEPoints(
"weightedBasisAtTargetEPoints_",numCells, basisCardinality, numTargetEPoints);
119 ScalarViewType weightedBasisAtBasisEPoints(
"weightedBasisAtBasisEPoints", 1, basisCardinality, numBasisEPoints);
121 auto tagToOrdinal = Kokkos::create_mirror_view_and_copy(
typename SpT::memory_space(), cellBasis->getAllDofOrdinal());
122 auto cellDofs = Kokkos::subview(tagToOrdinal, dim, 0, Kokkos::ALL());
125 massMat0(
"massMat0", 1, basisCardinality, basisCardinality),
126 massMat(
"massMat", numCells, basisCardinality, basisCardinality),
127 rhsMat(
"rhsMat", numCells, basisCardinality );
129 ordinal_type offsetBasis = basisEPointsRange(dim,0).first;
130 ordinal_type offsetTarget = targetEPointsRange(dim,0).first;
131 for(ordinal_type j=0; j <basisCardinality; ++j) {
132 ordinal_type idof = cellDofs(j);
133 for(ordinal_type iq=0; iq <ordinal_type(refBasisEWeights.extent(0)); ++iq)
134 weightedBasisAtBasisEPoints(0,j,iq) = basisAtBasisEPoints(0,idof,offsetBasis+iq) * refBasisEWeights(iq);
135 for(ordinal_type iq=0; iq <ordinal_type(refTargetEWeights.extent(0)); ++iq)
136 weightedBasisAtTargetEPoints(0,j,iq) = basisAtTargetEPoints(idof,offsetTarget+iq)* refTargetEWeights(iq);
141 RealSpaceTools<SpT>::clone(weightedBasisAtTargetEPoints, Kokkos::subview(weightedBasisAtTargetEPoints,0,Kokkos::ALL(), Kokkos::ALL()));
144 typedef Kokkos::DynRankView<scalarType, Kokkos::LayoutRight, SpT> WorkArrayViewType;
145 ScalarViewType t_(
"t",numCells, basisCardinality);
146 WorkArrayViewType w_(
"w",numCells,basisCardinality);
148 ElemSystem cellSystem(
"cellSystem",
true);
149 cellSystem.solve(basisCoeffs, massMat, rhsMat, t_, w_, cellDofs, basisCardinality);
Header file for the abstract base class Intrepid2::DefaultCubatureFactory.