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 evalPointType) {
69 typedef typename BasisType::scalarType scalarType;
70 typedef Kokkos::DynRankView<scalarType,SpT> scalarViewType;
71 ordinal_type dim = cellBasis->getBaseCellTopology().getDimension();
73 scalarViewType cubPoints;
74 if(evalPointType == TARGET) {
75 cubPoints = projStruct->getTargetEvalPoints(dim, 0);
77 cubPoints = projStruct->getBasisEvalPoints(dim, 0);
83 template<
typename SpT>
84 template<
typename basisCoeffsValueType,
class ...basisCoeffsProperties,
85 typename funValsValueType,
class ...funValsProperties,
87 typename ortValueType,
class ...ortProperties>
90 const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtEvalPoints,
91 const typename BasisType::scalarViewType evaluationPoints,
92 const Kokkos::DynRankView<ortValueType, ortProperties...> orts,
93 const BasisType* cellBasis,
94 ProjectionStruct<SpT, typename BasisType::scalarType> * projStruct){
96 typedef typename Kokkos::Impl::is_space<SpT>::host_mirror_space::execution_space host_space_type;
97 typedef typename BasisType::scalarType scalarType;
98 typedef Kokkos::DynRankView<scalarType,SpT> scalarViewType;
99 ordinal_type dim = cellBasis->getBaseCellTopology().getDimension();
101 ordinal_type basisCardinality = cellBasis->getCardinality();
103 ordinal_type numCubPoints = projStruct->getNumBasisEvalPoints(dim, 0);
104 ordinal_type numTargetCubPoints = projStruct->getNumTargetEvalPoints(dim, 0);
105 scalarViewType cubPoints = projStruct->getBasisEvalPoints(dim, 0);
106 scalarViewType cubWeights = projStruct->getBasisEvalWeights(dim, 0);
107 scalarViewType cubTargetWeights = projStruct->getTargetEvalWeights(dim, 0);
109 ordinal_type numCells = targetAtEvalPoints.extent(0);
111 scalarViewType basisAtCubPoints(
"basisAtcubPoints", basisCardinality, numCubPoints);
112 scalarViewType basisAtcubTargetPoints(
"basisAtcubTargetPoints", basisCardinality, numTargetCubPoints);
114 cellBasis->getValues(basisAtCubPoints, cubPoints);
115 if(evaluationPoints.rank()==3)
116 cellBasis->getValues(basisAtcubTargetPoints, Kokkos::subview(evaluationPoints,0,Kokkos::ALL(),Kokkos::ALL()));
118 cellBasis->getValues(basisAtcubTargetPoints, evaluationPoints);
121 scalarViewType weightedBasisAtcubTargetPoints_(
"weightedBasisAtcubTargetPoints_",numCells, basisCardinality, numTargetCubPoints);
122 scalarViewType cubWeights_(cubWeights.data(),1,numCubPoints);
123 scalarViewType evaluationWeights_(cubTargetWeights.data(),1,numTargetCubPoints);
124 scalarViewType basisAtcubTargetPoints_(basisAtcubTargetPoints.data(),1, basisCardinality, numTargetCubPoints);
125 scalarViewType basisAtCubPoints_(basisAtCubPoints.data(),1, basisCardinality, numCubPoints);
126 scalarViewType weightedBasisAtCubPoints(
"weightedBasisAtCubPoints",1,basisCardinality, numCubPoints);
127 scalarViewType weightedBasisAtcubTargetPoints(
"weightedBasisAtcubTargetPoints",1, basisCardinality, numTargetCubPoints);
130 RealSpaceTools<SpT>::clone(weightedBasisAtcubTargetPoints_,Kokkos::subview(weightedBasisAtcubTargetPoints,0,Kokkos::ALL(), Kokkos::ALL()));
132 Kokkos::View<funValsValueType**,Kokkos::LayoutLeft,host_space_type>
133 massMat(
"massMat", basisCardinality, basisCardinality),
134 rhsMat(
"rhsMat", basisCardinality, numCells );
136 Kokkos::DynRankView<funValsValueType,Kokkos::LayoutLeft,host_space_type> massMat_(massMat.data(),1,basisCardinality,basisCardinality);
137 Kokkos::DynRankView<funValsValueType,Kokkos::LayoutLeft,host_space_type> rhsMatTrans(
"rhsMatTrans",numCells,basisCardinality);
142 for(ordinal_type i=0; i<basisCardinality; ++i)
143 for(ordinal_type j=0; j<numCells; ++j)
144 rhsMat(i,j) = rhsMatTrans(j,i);
146 Teuchos::LAPACK<ordinal_type,funValsValueType> lapack;
147 ordinal_type info = 0;
149 lapack.POSV(
'U', basisCardinality, numCells,
156 for(ordinal_type i=0; i<basisCardinality; ++i)
157 for(ordinal_type j=0; j<numCells; ++j) {
158 basisCoeffs(j,i) = rhsMat(i,j);
162 std::stringstream ss;
163 ss <<
">>> ERROR (Intrepid::ProjectionTools::getBasisCoeffs): "
164 <<
"LAPACK return with error code: "
166 INTREPID2_TEST_FOR_EXCEPTION(
true, std::runtime_error, ss.str().c_str() );
Header file for the abstract base class Intrepid2::DefaultCubatureFactory.