72 const auto &nq = stdMatKey.
m_nq;
97 bkey[0], bkey[1], nodaltype);
109 bkey[0], bkey[1], bkey[2]);
115 bkey[0], bkey[1], bkey[2], nodaltype);
121 bkey[0], bkey[1], bkey[2]);
127 bkey[0], bkey[1], bkey[2], nodaltype);
133 bkey[0], bkey[1], bkey[2]);
139 bkey[0], bkey[1], bkey[2], nodaltype);
145 bkey[0], bkey[1], bkey[2]);
152 const auto dimension = stdExp->GetShapeDimension();
153 const auto nqTot = stdExp->GetTotPoints();
154 const auto nmTot = stdExp->GetNcoeffs();
162 for (
unsigned int i = 0; i < nmTot; ++i)
166 stdExp->BwdTrans(tmp, t = mat + i * nqTot);
176 for (
unsigned int i = 0; i < nmTot; ++i)
180 stdExp->BwdTrans(tmp, t);
192 for (
unsigned int d = 0; d < dimension; ++d)
194 for (
unsigned int i = 0; i < nqTot; ++i)
198 stdExp->PhysDeriv(d, tmp,
199 t = mat + d * nqTot * nqTot + i * nqTot);
210 for (
unsigned int d = 0; d < dimension; ++d)
212 for (
unsigned int i = 0; i < nqTot; ++i)
216 stdExp->PhysDeriv(d, tmp, t);
218 Vmath::Vcopy(nqTot, &t[0], 1, &mat[i + d * nqTot * nqTot],
231 for (
unsigned int d = 0; d < dimension; ++d)
233 for (
unsigned int i = 0; i < nmTot; ++i)
237 stdExp->BwdTrans(tmp0, tmp1);
238 stdExp->PhysDeriv(d, tmp1,
239 t = mat + d * nqTot * nmTot + i * nqTot);
251 for (
unsigned int d = 0; d < dimension; ++d)
253 for (
unsigned int i = 0; i < nmTot; ++i)
257 stdExp->BwdTrans(tmp0, tmp1);
258 stdExp->PhysDeriv(d, tmp1, t);
260 Vmath::Vcopy(nqTot, &t[0], 1, &mat[i + d * nqTot * nmTot],
272 for (
unsigned int i = 0; i < nqTot; ++i)
276 stdExp->IProductWRTBase(tmp, t = mat + i * nmTot);
286 for (
unsigned int i = 0; i < nqTot; ++i)
290 stdExp->IProductWRTBase(tmp, t);
302 for (
unsigned int d = 0; d < dimension; ++d)
304 for (
unsigned int i = 0; i < nqTot; ++i)
308 stdExp->IProductWRTDerivBase(
309 d, tmp, t = mat + d * nmTot * nqTot + i * nmTot);
320 for (
unsigned int d = 0; d < dimension; ++d)
322 for (
unsigned int i = 0; i < nqTot; ++i)
326 stdExp->IProductWRTDerivBase(d, tmp, t);
328 Vmath::Vcopy(nmTot, &t[0], 1, &mat[i + d * nmTot * nqTot],
338 const auto nmTot = stdExp->GetTotPoints();
340 std::accumulate(nq.begin(), nq.end(), 1, std::multiplies());
343 for (
unsigned int i = 0; i < nmTot; ++i)
348 if (stdExp->GetShapeDimension() == 1)
352 stdExp->GetBasis(0)->GetPointsKey();
356 nq[0], stdExp->GetBasis(0)->GetPointsType());
358 Interp1D(inkey0, tmp, outkey0, t = mat + i * nqTot);
360 else if (stdExp->GetShapeDimension() == 2)
364 stdExp->GetBasis(0)->GetPointsKey();
366 stdExp->GetBasis(1)->GetPointsKey();
370 nq[0], stdExp->GetBasis(0)->GetPointsType());
372 nq[1], stdExp->GetBasis(1)->GetPointsType());
374 Interp2D(inkey0, inkey1, tmp, outkey0, outkey1,
375 t = mat + i * nqTot);
377 else if (stdExp->GetShapeDimension() == 3)
381 stdExp->GetBasis(0)->GetPointsKey();
383 stdExp->GetBasis(1)->GetPointsKey();
385 stdExp->GetBasis(2)->GetPointsKey();
389 nq[0], stdExp->GetBasis(0)->GetPointsType());
391 nq[1], stdExp->GetBasis(1)->GetPointsType());
393 nq[2], stdExp->GetBasis(2)->GetPointsType());
395 Interp3D(inkey0, inkey1, inkey2, tmp, outkey0, outkey1,
396 outkey2, t = mat + i * nqTot);
405 const auto nmTot = stdExp->GetTotPoints();
407 std::accumulate(nq.begin(), nq.end(), 1, std::multiplies());
410 for (
unsigned int i = 0; i < nmTot; ++i)
415 if (stdExp->GetShapeDimension() == 1)
419 stdExp->GetBasis(0)->GetPointsKey();
423 nq[0], stdExp->GetBasis(0)->GetPointsType());
429 else if (stdExp->GetShapeDimension() == 2)
433 stdExp->GetBasis(0)->GetPointsKey();
435 stdExp->GetBasis(1)->GetPointsKey();
439 nq[0], stdExp->GetBasis(0)->GetPointsType());
441 nq[1], stdExp->GetBasis(1)->GetPointsType());
443 Interp2D(inkey0, inkey1, tmp, outkey0, outkey1, t);
447 else if (stdExp->GetShapeDimension() == 3)
451 stdExp->GetBasis(0)->GetPointsKey();
453 stdExp->GetBasis(1)->GetPointsKey();
455 stdExp->GetBasis(2)->GetPointsKey();
459 nq[0], stdExp->GetBasis(0)->GetPointsType());
461 nq[1], stdExp->GetBasis(1)->GetPointsType());
463 nq[2], stdExp->GetBasis(2)->GetPointsType());
465 Interp3D(inkey0, inkey1, inkey2, tmp, outkey0, outkey1,
480 const auto nmTot = stdExp->GetTotPoints();
482 std::accumulate(nq.begin(), nq.end(), 1, std::multiplies());
485 for (
unsigned int i = 0; i < nqTot; ++i)
490 if (stdExp->GetShapeDimension() == 1)
494 nq[0], stdExp->GetBasis(0)->GetPointsType());
498 stdExp->GetBasis(0)->GetPointsKey();
501 t = mat + i * nmTot);
503 else if (stdExp->GetShapeDimension() == 2)
507 nq[0], stdExp->GetBasis(0)->GetPointsType());
509 nq[1], stdExp->GetBasis(1)->GetPointsType());
513 stdExp->GetBasis(0)->GetPointsKey();
515 stdExp->GetBasis(1)->GetPointsKey();
519 t = mat + i * nmTot);
521 else if (stdExp->GetShapeDimension() == 3)
525 nq[0], stdExp->GetBasis(0)->GetPointsType());
527 nq[1], stdExp->GetBasis(1)->GetPointsType());
529 nq[2], stdExp->GetBasis(2)->GetPointsType());
533 stdExp->GetBasis(0)->GetPointsKey();
535 stdExp->GetBasis(1)->GetPointsKey();
537 stdExp->GetBasis(2)->GetPointsKey();
540 inkey0, inkey1, inkey2, tmp, outkey0, outkey1, outkey2,
541 t = mat + i * nmTot);
550 const auto nmTot = stdExp->GetTotPoints();
552 std::accumulate(nq.begin(), nq.end(), 1, std::multiplies());
555 for (
unsigned int i = 0; i < nqTot; ++i)
560 if (stdExp->GetShapeDimension() == 1)
564 nq[0], stdExp->GetBasis(0)->GetPointsType());
568 stdExp->GetBasis(0)->GetPointsKey();
575 else if (stdExp->GetShapeDimension() == 2)
579 nq[0], stdExp->GetBasis(0)->GetPointsType());
581 nq[1], stdExp->GetBasis(1)->GetPointsType());
585 stdExp->GetBasis(0)->GetPointsKey();
587 stdExp->GetBasis(1)->GetPointsKey();
590 outkey0, outkey1, t);
594 else if (stdExp->GetShapeDimension() == 3)
598 nq[0], stdExp->GetBasis(0)->GetPointsType());
600 nq[1], stdExp->GetBasis(1)->GetPointsType());
602 nq[2], stdExp->GetBasis(2)->GetPointsType());
606 stdExp->GetBasis(0)->GetPointsKey();
608 stdExp->GetBasis(1)->GetPointsKey();
610 stdExp->GetBasis(2)->GetPointsKey();
613 tmp, outkey0, outkey1,
628 for (
unsigned int i = 0; i < nmTot; ++i)
632 stdExp->MassMatrixOp(tmp, t = mat + i * nmTot, mkey);
643 for (
unsigned int i = 0; i < nmTot; ++i)
647 stdExp->MassMatrixOp(tmp, t, mkey);
658 const auto &InvMass = stdExp->GetStdMatrix(mkey);
660 std::copy_n(InvMass->GetRawPtr(), nmTot * nmTot, mat.data());
668 const auto &InvMass = stdExp->GetStdMatrix(mkey);
672 for (
unsigned int i = 0; i < nmTot; ++i)
674 Vmath::Vcopy(nmTot, &InvMass->GetRawPtr()[i * nmTot], 1,
685 auto vdmMat = stdExp->GetStdMatrix(Nkey);
689 vdm.template GetPtr<NektarSpaces::HostSpace, WriteOnly>();
690 unsigned int cnt = 0;
691 for (
unsigned int i = 0; i < nmTot; ++i)
693 for (
unsigned int j = 0; j < nmTot; ++j, ++cnt)
695 vdmptr[cnt] = vdmMat->GetValue(i, j);
706 auto vdmMat = stdExp->GetStdMatrix(Nkey);
710 vdm.template GetPtr<NektarSpaces::HostSpace, WriteOnly>();
711 unsigned int cnt = 0;
712 for (
unsigned int i = 0; i < nmTot; ++i)
714 for (
unsigned int j = 0; j < nmTot; ++j, ++cnt)
716 vdmptr[cnt] = vdmMat->GetValue(i, j);
727 auto vdmMat = stdExp->GetStdMatrix(Nkey);
731 vdm.template GetPtr<NektarSpaces::HostSpace, WriteOnly>();
732 unsigned int cnt = 0;
733 for (
unsigned int i = 0; i < nmTot; ++i)
735 for (
unsigned int j = 0; j < nmTot; ++j, ++cnt)
737 vdmptr[cnt] = vdmMat->GetValue(j, i);
745 const auto nBoundaryDofs = stdExp->NumBndryCoeffs();
746 const auto nInteriorDofs = nmTot - nBoundaryDofs;
748 const auto &InvMassInterior =
749 stdExp->GetStdStaticCondMatrix(mkey)->GetBlock(1, 1);
751 std::copy_n(InvMassInterior->GetRawPtr(),
752 nInteriorDofs * nInteriorDofs, mat.data());
759 const auto nBoundaryDofs = stdExp->NumBndryCoeffs();
760 const auto nInteriorDofs = nmTot - nBoundaryDofs;
762 const auto &InvMassInterior =
763 stdExp->GetStdStaticCondMatrix(mkey)->GetBlock(1, 1);
764 InvMassInterior->Transpose();
766 std::copy_n(InvMassInterior->GetRawPtr(),
767 nInteriorDofs * nInteriorDofs, mat.data());
775 const auto &invMass = stdExp->GetStdMatrix(mkey);
777 for (
unsigned int i = 0; i < nmTot; ++i)
779 diag[i] = invMass->GetValue(i, i);
791 const auto &invMass = stdExp->GetStdMatrix(mkey);
793 for (
unsigned int i = 0; i < nmTot; ++i)
797 stdExp->BwdTrans(tmp, t = bmat + i * nqTot);
800 for (
unsigned int j = 0; j < nqTot; ++j)
802 for (
unsigned int r = 0; r < nmTot; ++r)
805 for (
unsigned int c = 0; c < nmTot; ++c)
807 sum += invMass->GetValue(r, c) * bmat[c * nqTot + j];
811 stdExp->BwdTrans(coef, t = mat + j * nqTot);