49 #ifndef __INTREPID2_PROJECTIONTOOLSDEFL2_HPP__
50 #define __INTREPID2_PROJECTIONTOOLSDEFL2_HPP__
58 namespace Experimental {
60 template<
typename SpT>
61 template<
typename BasisType,
62 typename ortValueType,
class ...ortProperties>
65 const Kokkos::DynRankView<ortValueType, ortProperties...> orts,
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 typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
72 const auto cellTopo = cellBasis->getBaseCellTopology();
73 ordinal_type dim = cellTopo.getDimension();
74 ordinal_type numCells = evaluationPoints.extent(0);
75 const ordinal_type edgeDim = 1;
76 const ordinal_type faceDim = 2;
78 ordinal_type numVertices = (cellBasis->getDofCount(0, 0) > 0) ? cellTopo.getVertexCount() : 0;
79 ordinal_type numEdges = (cellBasis->getDofCount(1, 0) > 0) ? cellTopo.getEdgeCount() : 0;
80 ordinal_type numFaces = (cellBasis->getDofCount(2, 0) > 0) ? cellTopo.getFaceCount() : 0;
82 Kokkos::View<ordinal_type*> eOrt(
"eOrt", numEdges), fOrt(
"fOrt", numFaces);
86 scalarViewType dofCoords(
"dofCoords", cellBasis->getCardinality(), dim);
87 cellBasis->getDofCoords(dofCoords);
88 for(ordinal_type iv=0; iv<numVertices; ++iv) {
89 ordinal_type idof = cellBasis->getDofOrdinal(0, iv, 0);
90 for(ordinal_type d=0; d<dim; d++)
91 for(ordinal_type ic=0; ic<numCells; ++ic)
92 evaluationPoints(ic,iv,d) = dofCoords(idof,d);
96 for(ordinal_type ie=0; ie<numEdges; ++ie) {
97 range_type edgePointsRange;
98 scalarViewType cubPoints;
99 if(evalPointType == TARGET) {
100 edgePointsRange = projStruct->getTargetPointsRange(edgeDim, ie);
101 cubPoints = projStruct->getTargetEvalPoints(edgeDim, ie);
104 edgePointsRange = projStruct->getBasisPointsRange(edgeDim, ie);
105 cubPoints = projStruct->getBasisEvalPoints(edgeDim, ie);
108 scalarViewType orientedTargetCubPoints(
"orientedTargetCubPoints", cubPoints.extent(0),edgeDim);
110 const auto topoKey = projStruct->getTopologyKey(edgeDim,ie);
112 for(ordinal_type ic=0; ic<numCells; ++ic) {
113 orts(ic).getEdgeOrientation(eOrt.data(), numEdges);
114 ordinal_type ort = eOrt(ie);
121 for(ordinal_type iface=0; iface<numFaces; ++iface) {
123 scalarViewType cubPoints;
124 range_type facePointsRange;
125 if(evalPointType == TARGET) {
126 cubPoints = projStruct->getTargetEvalPoints(faceDim, iface);
127 facePointsRange = projStruct->getTargetPointsRange(faceDim, iface);
129 cubPoints = projStruct->getBasisEvalPoints(faceDim, iface);
130 facePointsRange = projStruct->getBasisPointsRange(faceDim, iface);
133 scalarViewType faceCubPoints(
"faceCubPoints", cubPoints.extent(0), faceDim);
135 const auto topoKey = projStruct->getTopologyKey(faceDim,iface);
136 for(ordinal_type ic=0; ic<numCells; ++ic) {
138 orts(ic).getFaceOrientation(fOrt.data(), numFaces);
140 ordinal_type ort = fOrt(iface);
146 if(cellBasis->getDofCount(dim,0)>0) {
147 range_type cellPointsRange;
148 scalarViewType cubPoints;
149 if(evalPointType == TARGET) {
150 cubPoints = projStruct->getTargetEvalPoints(dim, 0);
151 cellPointsRange = projStruct->getTargetPointsRange(dim, 0);
153 cubPoints = projStruct->getBasisEvalPoints(dim, 0);
154 cellPointsRange = projStruct->getBasisPointsRange(dim, 0);
161 template<
typename SpT>
162 template<
typename basisCoeffsValueType,
class ...basisCoeffsProperties,
163 typename funValsValueType,
class ...funValsProperties,
165 typename ortValueType,
class ...ortProperties>
168 const Kokkos::DynRankView<funValsValueType,funValsProperties...> targetAtEvalPoints,
169 const typename BasisType::scalarViewType evaluationPoints,
170 const Kokkos::DynRankView<ortValueType, ortProperties...> orts,
171 const BasisType* cellBasis,
172 ProjectionStruct<SpT, typename BasisType::scalarType> * projStruct){
174 typedef typename Kokkos::Impl::is_space<SpT>::host_mirror_space::execution_space host_space_type;
175 typedef typename BasisType::scalarType scalarType;
176 typedef Kokkos::DynRankView<scalarType,SpT> scalarViewType;
177 typedef Kokkos::pair<ordinal_type,ordinal_type> range_type;
178 const auto cellTopo = cellBasis->getBaseCellTopology();
179 ordinal_type dim = cellTopo.getDimension();
180 ordinal_type numTotalEvaluationPoints(targetAtEvalPoints.extent(1));
181 ordinal_type basisCardinality = cellBasis->getCardinality();
182 ordinal_type numCells = targetAtEvalPoints.extent(0);
183 const ordinal_type edgeDim = 1;
184 const ordinal_type faceDim = 2;
185 const ordinal_type fieldDim = (targetAtEvalPoints.rank()==2) ? 1 : targetAtEvalPoints.extent(2);
187 const std::string& name = cellBasis->getName();
189 ordinal_type numVertices = (cellBasis->getDofCount(0, 0) > 0) ? cellTopo.getVertexCount() : 0;
190 ordinal_type numEdges = (cellBasis->getDofCount(1, 0) > 0) ? cellTopo.getEdgeCount() : 0;
191 ordinal_type numFaces = (cellBasis->getDofCount(2, 0) > 0) ? cellTopo.getFaceCount() : 0;
193 Kokkos::View<ordinal_type*> eOrt(
"eOrt", numEdges);
194 Kokkos::View<ordinal_type*> fOrt(
"fOrt", numFaces);
195 scalarViewType refEdgeTan(
"refEdgeTan", dim);
196 scalarViewType refEdgeNormal(
"refEdgeNormal", dim);
197 scalarViewType refFaceTangents(
"refFaceTangents", dim, 2);
198 scalarViewType refFaceNormal(
"refFaceNormal", dim);
199 auto refFaceTanU = Kokkos::subview(refFaceTangents, Kokkos::ALL, 0);
200 auto refFaceTanV = Kokkos::subview(refFaceTangents, Kokkos::ALL, 1);
202 ordinal_type numVertexDofs = numVertices;
204 ordinal_type numEdgeDofs(0);
205 for(ordinal_type ie=0; ie<numEdges; ++ie)
206 numEdgeDofs += cellBasis->getDofCount(edgeDim,ie);
208 ordinal_type numFaceDofs(0);
209 for(ordinal_type iface=0; iface<numFaces; ++iface)
210 numFaceDofs += cellBasis->getDofCount(faceDim,iface);
212 Kokkos::View<ordinal_type*> computedDofs(
"computedDofs",numVertexDofs+numEdgeDofs+numFaceDofs);
214 ordinal_type computedDofsCount = 0;
216 ordinal_type numTotalCubPoints = projStruct->getNumBasisEvalPoints();
217 scalarViewType cubPoints(
"cubPoints",numCells,numTotalCubPoints, dim);
218 getL2EvaluationPoints(cubPoints, orts, cellBasis, projStruct, BASIS);
220 scalarViewType basisAtCubPoints(
"basisAtCubPoints",numCells,basisCardinality, numTotalCubPoints, fieldDim);
221 scalarViewType basisAtTargetCubPoints(
"basisAtTargetCubPoints",numCells,basisCardinality, numTotalEvaluationPoints, fieldDim);
224 scalarViewType nonOrientedBasisAtCubPoints(
"nonOrientedBasisAtCubPoints",numCells,basisCardinality, numTotalCubPoints);
225 scalarViewType nonOrientedBasisAtTargetCubPoints(
"nonOrientedBasisAtTargetCubPoints",numCells,basisCardinality, numTotalEvaluationPoints);
226 for(ordinal_type ic=0; ic<numCells; ++ic) {
227 cellBasis->getValues(Kokkos::subview(nonOrientedBasisAtTargetCubPoints,ic,Kokkos::ALL(),Kokkos::ALL()), Kokkos::subview(evaluationPoints, ic, Kokkos::ALL(), Kokkos::ALL()));
228 cellBasis->getValues(Kokkos::subview(nonOrientedBasisAtCubPoints,ic,Kokkos::ALL(),Kokkos::ALL()), Kokkos::subview(cubPoints, ic, Kokkos::ALL(), Kokkos::ALL()));
231 Kokkos::ALL(),0), nonOrientedBasisAtCubPoints, orts, cellBasis);
233 Kokkos::ALL(), Kokkos::ALL(),0), nonOrientedBasisAtTargetCubPoints, orts, cellBasis);
237 scalarViewType nonOrientedBasisAtCubPoints(
"nonOrientedBasisAtCubPoints",numCells,basisCardinality, numTotalCubPoints,fieldDim);
238 scalarViewType nonOrientedBasisAtTargetCubPoints(
"nonOrientedBasisAtTargetCubPoints",numCells,basisCardinality, numTotalEvaluationPoints,fieldDim);
239 for(ordinal_type ic=0; ic<numCells; ++ic) {
240 cellBasis->getValues(Kokkos::subview(nonOrientedBasisAtTargetCubPoints,ic,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL()), Kokkos::subview(evaluationPoints, ic, Kokkos::ALL(), Kokkos::ALL()));
241 cellBasis->getValues(Kokkos::subview(nonOrientedBasisAtCubPoints,ic,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL()), Kokkos::subview(cubPoints, ic, Kokkos::ALL(), Kokkos::ALL()));
248 for(ordinal_type iv=0; iv<numVertices; ++iv) {
249 ordinal_type idof = cellBasis->getDofOrdinal(0, iv, 0);
250 computedDofs(computedDofsCount++) = idof;
251 for(ordinal_type ic=0; ic<numCells; ++ic)
252 basisCoeffs(ic,idof) = targetAtEvalPoints(ic,iv);
255 bool isHCurlBAsis = name.find(
"HCURL") != std::string::npos;
257 ordinal_type faceDofDim = isHCurlBAsis ? 2 : 1;
259 scalarViewType edgeCoeff(
"edgeCoeff", fieldDim);
260 for(ordinal_type ie=0; ie<numEdges; ++ie) {
264 else if(isHCurlBAsis) {
266 Kokkos::deep_copy(edgeCoeff,refEdgeTan);
269 Kokkos::deep_copy(edgeCoeff,refEdgeNormal);
272 ordinal_type edgeCardinality = cellBasis->getDofCount(edgeDim,ie);
273 ordinal_type numCubPoints = projStruct->getNumBasisEvalPoints(edgeDim, ie);
274 ordinal_type numTargetCubPoints = projStruct->getNumTargetEvalPoints(edgeDim, ie);
276 scalarViewType edgeBasisAtCubPoints(
"tanBasisAtElemCubPoints",numCells,edgeCardinality, numCubPoints);
277 scalarViewType edgeTargetAtTargetCubPoints(
"tanBasisAtTargetCubPoints",numCells, numTargetCubPoints);
278 scalarViewType weightedBasisAtElemCubPoints(
"weightedTanBasisAtElemCubPoints",numCells,edgeCardinality, numCubPoints);
279 scalarViewType weightedBasisAtTargetCubPoints(
"weightedTanBasisAtTargetCubPoints",numCells,edgeCardinality, numTargetCubPoints);
280 scalarViewType mComputedProjection(
"mComputedProjection", numCells, numCubPoints);
282 scalarViewType targetEvalWeights = projStruct->getTargetEvalWeights(edgeDim, ie);
283 scalarViewType basisEvalWeights = projStruct->getBasisEvalWeights(edgeDim, ie);
286 ordinal_type offsetBasis = projStruct->getBasisPointsRange(edgeDim, ie).first;
287 ordinal_type offsetTarget = projStruct->getTargetPointsRange(edgeDim, ie).first;
288 for(ordinal_type j=0; j <edgeCardinality; ++j) {
289 ordinal_type jdof = cellBasis->getDofOrdinal(edgeDim, ie, j);
290 for(ordinal_type ic=0; ic<numCells; ++ic) {
291 for(ordinal_type iq=0; iq <numCubPoints; ++iq) {
292 for(ordinal_type d=0; d <fieldDim; ++d)
293 edgeBasisAtCubPoints(ic,j,iq) += basisAtCubPoints(ic,jdof,offsetBasis+iq,d)*edgeCoeff(d);
294 weightedBasisAtElemCubPoints(ic,j,iq) = edgeBasisAtCubPoints(ic,j,iq)*basisEvalWeights(iq);
296 for(ordinal_type iq=0; iq <numTargetCubPoints; ++iq) {
297 for(ordinal_type d=0; d <fieldDim; ++d)
298 weightedBasisAtTargetCubPoints(ic,j,iq) += basisAtTargetCubPoints(ic,jdof,offsetTarget+iq,d)*edgeCoeff(d)*targetEvalWeights(iq);
303 for(ordinal_type ic=0; ic<numCells; ++ic)
304 for(ordinal_type iq=0; iq <numTargetCubPoints; ++iq)
305 for(ordinal_type d=0; d <fieldDim; ++d)
306 edgeTargetAtTargetCubPoints(ic,iq) += targetAtEvalPoints(ic,offsetTarget+iq,d)*edgeCoeff(d);
308 for(ordinal_type j=0; j <numVertexDofs; ++j) {
309 ordinal_type jdof = computedDofs(j);
310 for(ordinal_type ic=0; ic<numCells; ++ic)
311 for(ordinal_type iq=0; iq <numCubPoints; ++iq)
312 for(ordinal_type d=0; d <fieldDim; ++d)
313 mComputedProjection(ic,iq) -= basisCoeffs(ic,jdof)*basisAtCubPoints(ic,jdof,offsetBasis+iq,d)*edgeCoeff(d);
317 scalarViewType edgeMassMat_(
"edgeMassMat_", numCells, edgeCardinality, edgeCardinality),
318 edgeRhsMat_(
"rhsMat_", numCells, edgeCardinality);
320 scalarViewType cubWeights_(
"cubWeights_", numCells, 1, basisEvalWeights.extent(0)), targetEvalWeights_(
"targetEvalWeights", numCells, 1, targetEvalWeights.extent(0));
329 Kokkos::View<funValsValueType**,Kokkos::LayoutLeft,host_space_type> edgeMassMat(
"edgeMassMat", edgeCardinality,edgeCardinality);
330 Kokkos::View<funValsValueType**,Kokkos::LayoutLeft,host_space_type> edgeRhsMat(
"edgeRhsMat",edgeCardinality, 1);
332 Teuchos::LAPACK<ordinal_type,funValsValueType> lapack;
333 ordinal_type info = 0;
334 for(ordinal_type ic=0; ic<numCells; ++ic) {
335 for(ordinal_type i=0; i<edgeCardinality; ++i) {
336 edgeRhsMat(i,0) = edgeRhsMat_(ic,i);
337 for(ordinal_type j=0; j<edgeCardinality; ++j)
338 edgeMassMat(i,j) = edgeMassMat_(ic,i,j);
341 lapack.POSV(
'U', edgeCardinality, 1,
343 edgeMassMat.stride_1(),
345 edgeRhsMat.stride_1(),
349 std::stringstream ss;
350 ss <<
">>> ERROR (Intrepid::ProjectionTools::getBasisCoeffs): "
351 <<
"LAPACK return with error code: "
353 INTREPID2_TEST_FOR_EXCEPTION(
true, std::runtime_error, ss.str().c_str() );
356 for(ordinal_type i=0; i<edgeCardinality; ++i){
357 ordinal_type edge_dof = cellBasis->getDofOrdinal(edgeDim, ie, i);
358 basisCoeffs(ic,edge_dof) = edgeRhsMat(i,0);
361 for(ordinal_type i=0; i<edgeCardinality; ++i)
362 computedDofs(computedDofsCount++) = cellBasis->getDofOrdinal(edgeDim, ie, i);
365 scalarViewType ortJacobian(
"ortJacobian", faceDim, faceDim);
367 scalarViewType faceCoeff(
"faceCoeff", fieldDim, faceDofDim);
368 for(ordinal_type iface=0; iface<numFaces; ++iface) {
371 const auto topoKey = projStruct->getTopologyKey(faceDim,iface);
374 ordinal_type faceCardinality = cellBasis->getDofCount(faceDim,iface);
376 ordinal_type numTargetCubPoints = projStruct->getNumTargetEvalPoints(faceDim, iface);
377 ordinal_type numCubPoints = projStruct->getNumBasisEvalPoints(faceDim, iface);
381 else if(isHCurlBAsis) {
385 for(ordinal_type d=0; d <dim; ++d)
386 faceCoeff(d,0) = refFaceNormal(d);
389 scalarViewType faceBasisDofAtCubPoints(
"normaBasisAtCubPoints",numCells,faceCardinality, numCubPoints,faceDofDim);
390 scalarViewType wBasisDofAtCubPoints(
"weightedNormalBasisAtCubPoints",numCells,faceCardinality, numCubPoints,faceDofDim);
392 scalarViewType faceBasisAtTargetCubPoints(
"normalBasisAtTargetCubPoints",numCells,faceCardinality, numTargetCubPoints,faceDofDim);
393 scalarViewType wBasisBasisAtTargetCubPoints(
"weightedNormalBasisAtTargetCubPoints",numCells,faceCardinality, numTargetCubPoints,faceDofDim);
395 scalarViewType targetAtTargetCubPoints(
"targetAtTargetCubPoints",numCells, numTargetCubPoints,faceDofDim);
396 scalarViewType mComputedProjection(
"mNormalComputedProjection", numCells,numCubPoints,faceDofDim);
398 ordinal_type offsetBasis = projStruct->getBasisPointsRange(faceDim, iface).first;
399 ordinal_type offsetTarget = projStruct->getTargetPointsRange(faceDim, iface).first;
400 scalarViewType targetCubWeights = projStruct->getTargetEvalWeights(faceDim, iface);
401 scalarViewType CubWeights = projStruct->getBasisEvalWeights(faceDim, iface);
404 for(ordinal_type ic=0; ic<numCells; ++ic) {
406 orts(ic).getFaceOrientation(fOrt.data(), numFaces);
408 ordinal_type ort = fOrt(iface);
410 Kokkos::deep_copy(faceCoeff,0);
412 for(ordinal_type d=0; d <dim; ++d)
413 for(ordinal_type itan=0; itan <faceDim; ++itan)
414 for(ordinal_type jtan=0; jtan <faceDim; ++jtan)
415 faceCoeff(d,itan) += refFaceTangents(d, jtan)*ortJacobian(jtan,itan);
417 for(ordinal_type j=0; j <faceCardinality; ++j) {
418 ordinal_type jdof = cellBasis->getDofOrdinal(faceDim, iface, j);
419 for(ordinal_type itan=0; itan <faceDofDim; ++itan) {
420 for(ordinal_type iq=0; iq <numCubPoints; ++iq) {
421 for(ordinal_type d=0; d <fieldDim; ++d)
422 faceBasisDofAtCubPoints(ic,j,iq,itan) += faceCoeff(d, itan)*basisAtCubPoints(ic,jdof,offsetBasis+iq,d);
423 wBasisDofAtCubPoints(ic,j,iq,itan) = faceBasisDofAtCubPoints(ic,j,iq,itan) * CubWeights(iq);
425 for(ordinal_type iq=0; iq <numTargetCubPoints; ++iq) {
426 for(ordinal_type d=0; d <fieldDim; ++d)
427 faceBasisAtTargetCubPoints(ic,j,iq,itan) += faceCoeff(d, itan)*basisAtTargetCubPoints(ic,jdof,offsetTarget+iq,d);
428 wBasisBasisAtTargetCubPoints(ic,j,iq,itan) = faceBasisAtTargetCubPoints(ic,j,iq,itan) * targetCubWeights(iq);
433 for(ordinal_type d=0; d <fieldDim; ++d)
434 for(ordinal_type itan=0; itan <faceDofDim; ++itan)
435 for(ordinal_type iq=0; iq <numTargetCubPoints; ++iq)
436 targetAtTargetCubPoints(ic,iq,itan) += faceCoeff(d, itan)*targetAtEvalPoints(ic,offsetTarget+iq,d);
438 for(ordinal_type j=0; j <numVertexDofs+numEdgeDofs; ++j) {
439 ordinal_type jdof = computedDofs(j);
440 for(ordinal_type iq=0; iq <numCubPoints; ++iq)
441 for(ordinal_type d=0; d <fieldDim; ++d)
442 for(ordinal_type itan=0; itan <faceDofDim; ++itan)
443 mComputedProjection(ic,iq,itan) -= basisCoeffs(ic,jdof)*faceCoeff(d, itan)*basisAtCubPoints(ic,jdof,offsetBasis+iq,d);
447 scalarViewType faceMassMat_(
"faceMassMat_", numCells, faceCardinality, faceCardinality),
448 faceRhsMat_(
"rhsMat_", numCells, faceCardinality);
454 Kokkos::View<funValsValueType**,Kokkos::LayoutLeft,host_space_type> faceMassMat(
"faceMassMat", faceCardinality,faceCardinality);
455 Kokkos::View<funValsValueType**,Kokkos::LayoutLeft,host_space_type> faceRhsMat(
"faceRhsMat",faceCardinality, 1);
457 Teuchos::LAPACK<ordinal_type,funValsValueType> lapack;
458 ordinal_type info = 0;
459 for(ordinal_type ic=0; ic<numCells; ++ic) {
461 for(ordinal_type i=0; i<faceCardinality; ++i) {
462 faceRhsMat(i,0) = faceRhsMat_(ic,i);
463 for(ordinal_type j=0; j<faceCardinality; ++j){
464 faceMassMat(i,j) = faceMassMat_(ic,i,j);
468 lapack.POSV(
'U', faceCardinality, 1,
470 faceMassMat.stride_1(),
472 faceRhsMat.stride_1(),
476 std::stringstream ss;
477 ss <<
">>> ERROR (Intrepid::ProjectionTools::getBasisCoeffs): "
478 <<
"LAPACK return with error code: "
480 INTREPID2_TEST_FOR_EXCEPTION(
true, std::runtime_error, ss.str().c_str() );
483 for(ordinal_type i=0; i<faceCardinality; ++i){
484 ordinal_type face_dof = cellBasis->getDofOrdinal(faceDim, iface, i);
485 basisCoeffs(ic,face_dof) = faceRhsMat(i,0);
489 for(ordinal_type i=0; i<faceCardinality; ++i)
490 computedDofs(computedDofsCount++) = cellBasis->getDofOrdinal(faceDim, iface, i);
493 ordinal_type numElemDofs = cellBasis->getDofCount(dim,0);
497 range_type cellPointsRange = projStruct->getTargetPointsRange(dim, 0);
499 ordinal_type numTargetCubPoints = projStruct->getNumTargetEvalPoints(dim,0);
500 ordinal_type numCubPoints = projStruct->getNumBasisEvalPoints(dim,0);
502 scalarViewType internalBasisAtCubPoints(
"internalBasisAtCubPoints",numCells,numElemDofs, numCubPoints, fieldDim);
503 scalarViewType mComputedProjection(
"mComputedProjection", numCells, numCubPoints, fieldDim);
505 scalarViewType targetCubWeights = projStruct->getTargetEvalWeights(dim, 0);
506 scalarViewType cubWeights = projStruct->getBasisEvalWeights(dim, 0);
507 ordinal_type offsetBasis = projStruct->getBasisPointsRange(dim, 0).first;
508 ordinal_type offsetTarget = projStruct->getTargetPointsRange(dim, 0).first;
511 scalarViewType wBasisAtCubPoints(
"weightedBasisAtCubPoints",numCells,numElemDofs, numCubPoints,fieldDim);
512 scalarViewType wBasisBasisAtTargetCubPoints(
"weightedBasisAtTargetCubPoints",numCells,numElemDofs, numTargetCubPoints,fieldDim);
513 for(ordinal_type j=0; j <numElemDofs; ++j) {
514 ordinal_type idof = cellBasis->getDofOrdinal(dim, 0, j);
515 for(ordinal_type ic=0; ic<numCells; ++ic) {
516 for(ordinal_type d=0; d <fieldDim; ++d) {
517 for(ordinal_type iq=0; iq <numCubPoints; ++iq) {
518 internalBasisAtCubPoints(ic,j,iq,d) = basisAtCubPoints(ic,idof,offsetBasis+iq,d);
519 wBasisAtCubPoints(ic,j,iq,d) = internalBasisAtCubPoints(ic,j,iq,d) * cubWeights(iq);
521 for(ordinal_type iq=0; iq <numTargetCubPoints; ++iq) {
522 wBasisBasisAtTargetCubPoints(ic,j,iq,d) = basisAtTargetCubPoints(ic,idof,offsetTarget+iq,d)* targetCubWeights(iq);
528 for(ordinal_type j=0; j <numVertexDofs+numEdgeDofs+numFaceDofs; ++j) {
529 ordinal_type jdof = computedDofs(j);
530 for(ordinal_type iq=0; iq <numCubPoints; ++iq)
531 for(ordinal_type ic=0; ic<numCells; ++ic) {
532 for(ordinal_type d=0; d <fieldDim; ++d) {
533 mComputedProjection(ic,iq,d) -= basisCoeffs(ic,jdof)*basisAtCubPoints(ic,jdof,offsetBasis+iq,d);
539 scalarViewType cellMassMat_(
"cellMassMat_", numCells, numElemDofs, numElemDofs),
540 cellRhsMat_(
"rhsMat_", numCells, numElemDofs);
545 Kokkos::subview(wBasisBasisAtTargetCubPoints,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL(),0));
550 Kokkos::View<funValsValueType**,Kokkos::LayoutLeft,host_space_type> cellMassMat(
"cellMassMat", numElemDofs,numElemDofs);
551 Kokkos::View<funValsValueType**,Kokkos::LayoutLeft,host_space_type> cellRhsMat(
"cellRhsMat",numElemDofs, 1);
553 Teuchos::LAPACK<ordinal_type,funValsValueType> lapack;
554 ordinal_type info = 0;
555 for(ordinal_type ic=0; ic<numCells; ++ic) {
556 for(ordinal_type i=0; i<numElemDofs; ++i) {
557 cellRhsMat(i,0) = cellRhsMat_(ic,i);
558 for(ordinal_type j=0; j<numElemDofs; ++j)
559 cellMassMat(i,j) = cellMassMat_(ic,i,j);
562 lapack.POSV(
'U', numElemDofs, 1,
564 cellMassMat.stride_1(),
566 cellRhsMat.stride_1(),
569 for(ordinal_type i=0; i<numElemDofs; ++i){
570 ordinal_type idof = cellBasis->getDofOrdinal(dim, 0, i);
571 basisCoeffs(ic,idof) = cellRhsMat(i,0);
575 std::stringstream ss;
576 ss <<
">>> ERROR (Intrepid::ProjectionTools::getBasisCoeffs): "
577 <<
"LAPACK return with error code: "
579 INTREPID2_TEST_FOR_EXCEPTION(
true, std::runtime_error, ss.str().c_str() );
Header file for the abstract base class Intrepid2::DefaultCubatureFactory.