36 #include <loki/Singleton.h>
43 namespace Collections {
72 int nPhys = m_stdExp->GetTotPoints();
73 int ntot = m_numElmt*nPhys;
77 out[0] = output0; out[1] = output1; out[2] = output2;
79 for(
int i = 0; i < m_dim; ++i)
81 Diff[i] = wsp + i*ntot;
85 for(
int i = 0; i < m_dim; ++i)
87 Blas::Dgemm(
'N',
'N', m_derivMat[i]->GetRows(), m_numElmt,
88 m_derivMat[i]->GetColumns(), 1.0,
89 m_derivMat[i]->GetRawPtr(),
90 m_derivMat[i]->GetRows(), input.get(), nPhys,
91 0.0, &Diff[i][0],nPhys);
95 for(
int i = 0; i < m_coordim; ++i)
98 for(
int j = 0; j < m_dim; ++j)
114 int nPhys = m_stdExp->GetTotPoints();
115 int ntot = m_numElmt*nPhys;
119 for(
int i = 0; i < m_dim; ++i)
121 Diff[i] = wsp + i*ntot;
125 for(
int i = 0; i < m_dim; ++i)
127 Blas::Dgemm(
'N',
'N', m_derivMat[i]->GetRows(), m_numElmt,
128 m_derivMat[i]->GetColumns(), 1.0,
129 m_derivMat[i]->GetRawPtr(),
130 m_derivMat[i]->GetRows(), input.get(), nPhys,
131 0.0, &Diff[i][0],nPhys);
136 for(
int j = 0; j < m_dim; ++j)
153 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
159 m_dim = PtsKey.size();
160 m_coordim = m_stdExp->GetCoordim();
162 for(
int i = 0; i < m_dim; ++i)
164 nqtot *= PtsKey[i].GetNumPoints();
168 for(
int i = 0; i < m_dim; ++i)
173 for(
int j = 0; j < nqtot; ++j)
177 m_stdExp->PhysDeriv(i,tmp,tmp1);
179 &(m_derivMat[i]->GetPtr())[0] + j*nqtot, 1);
182 m_derivFac = pGeomData->GetDerivFactors(pCollExp);
183 m_wspSize = 3*nqtot*m_numElmt;
192 PhysDeriv_StdMat::create,
"PhysDeriv_StdMat_Seg"),
195 PhysDeriv_StdMat::create,
"PhysDeriv_StdMat_Tri"),
198 PhysDeriv_StdMat::create,
"PhysDeriv_StdMat_NodalTri"),
201 PhysDeriv_StdMat::create,
"PhysDeriv_StdMat_Quad"),
204 PhysDeriv_StdMat::create,
"PhysDeriv_StdMat_Tet"),
207 PhysDeriv_StdMat::create,
"PhysDeriv_StdMat_Tet"),
210 PhysDeriv_StdMat::create,
"PhysDeriv_StdMat_NodalTet"),
213 PhysDeriv_StdMat::create,
"PhysDeriv_StdMat_Pyr"),
216 PhysDeriv_StdMat::create,
"PhysDeriv_StdMat_Prism"),
219 PhysDeriv_StdMat::create,
"PhysDeriv_StdMat_NodalPrism"),
222 PhysDeriv_StdMat::create,
"PhysDeriv_StdMat_Hex")
245 int nPhys = m_stdExp->GetTotPoints();
246 int ntot = m_numElmt*nPhys;
250 out[0] = output0; out[1] = output1; out[2] = output2;
252 for(
int i = 0; i < m_dim; ++i)
254 Diff[i] = wsp + i*ntot;
258 for (
int i = 0; i < m_numElmt; ++i)
260 m_stdExp->PhysDeriv(input + i*nPhys,
261 tmp0 = Diff[0] + i*nPhys,
262 tmp1 = Diff[1] + i*nPhys,
263 tmp2 = Diff[2] + i*nPhys);
267 for(
int i = 0; i < m_coordim; ++i)
269 Vmath::Vmul(ntot,m_derivFac[i*m_dim],1,Diff[0],1,out[i],1);
270 for(
int j = 1; j < m_dim; ++j)
286 int nPhys = m_stdExp->GetTotPoints();
287 int ntot = m_numElmt*nPhys;
291 for(
int i = 0; i < m_dim; ++i)
293 Diff[i] = wsp + i*ntot;
297 for (
int i = 0; i < m_numElmt; ++i)
299 m_stdExp->PhysDeriv(input + i*nPhys,
300 tmp0 = Diff[0] + i*nPhys,
301 tmp1 = Diff[1] + i*nPhys,
302 tmp2 = Diff[2] + i*nPhys);
306 Vmath::Vmul(ntot,m_derivFac[dir*m_dim],1,Diff[0],1,output,1);
307 for(
int j = 1; j < m_dim; ++j)
323 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
329 m_dim = PtsKey.size();
330 m_coordim = m_stdExp->GetCoordim();
332 for(
int i = 0; i < m_dim; ++i)
334 nqtot *= PtsKey[i].GetNumPoints();
336 m_derivFac = pGeomData->GetDerivFactors(pCollExp);
337 m_wspSize = 3*nqtot*m_numElmt;
346 PhysDeriv_IterPerExp::create,
"PhysDeriv_IterPerExp_Seg"),
349 PhysDeriv_IterPerExp::create,
"PhysDeriv_IterPerExp_Tri"),
352 PhysDeriv_IterPerExp::create,
"PhysDeriv_IterPerExp_NodalTri"),
355 PhysDeriv_IterPerExp::create,
"PhysDeriv_IterPerExp_Quad"),
358 PhysDeriv_IterPerExp::create,
"PhysDeriv_IterPerExp_Tet"),
361 PhysDeriv_IterPerExp::create,
"PhysDeriv_IterPerExp_NodalTet"),
364 PhysDeriv_IterPerExp::create,
"PhysDeriv_IterPerExp_Pyr"),
367 PhysDeriv_IterPerExp::create,
"PhysDeriv_IterPerExp_Prism"),
370 PhysDeriv_IterPerExp::create,
"PhysDeriv_IterPerExp_NodalPrism"),
373 PhysDeriv_IterPerExp::create,
"PhysDeriv_IterPerExp_Hex")
396 const int nPhys = m_expList[0]->GetTotPoints();
400 switch (m_expList[0]->GetShapeDimension())
404 for (
int i = 0; i < m_numElmt; ++i)
406 m_expList[i]->PhysDeriv(input + i*nPhys,
407 tmp0 = output0 + i*nPhys);
413 for (
int i = 0; i < m_numElmt; ++i)
415 m_expList[i]->PhysDeriv(input + i*nPhys,
416 tmp0 = output0 + i*nPhys,
417 tmp1 = output1 + i*nPhys);
423 for (
int i = 0; i < m_numElmt; ++i)
425 m_expList[i]->PhysDeriv(input + i*nPhys,
426 tmp0 = output0 + i*nPhys,
427 tmp1 = output1 + i*nPhys,
428 tmp2 = output2 + i*nPhys);
433 ASSERTL0(
false,
"Unknown dimension.");
443 const int nPhys = m_expList[0]->GetTotPoints();
447 for (
int i = 0; i < m_numElmt; ++i)
449 m_expList[i]->PhysDeriv(dir, input + i*nPhys,
450 tmp = output + i*nPhys);
459 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
463 m_expList = pCollExp;
472 PhysDeriv_NoCollection::create,
"PhysDeriv_NoCollection_Seg"),
475 PhysDeriv_NoCollection::create,
"PhysDeriv_NoCollection_Tri"),
478 PhysDeriv_NoCollection::create,
"PhysDeriv_NoCollection_NodalTri"),
481 PhysDeriv_NoCollection::create,
"PhysDeriv_NoCollection_Quad"),
484 PhysDeriv_NoCollection::create,
"PhysDeriv_NoCollection_Tet"),
487 PhysDeriv_NoCollection::create,
"PhysDeriv_NoCollection_NodalTet"),
490 PhysDeriv_NoCollection::create,
"PhysDeriv_NoCollection_Pyr"),
493 PhysDeriv_NoCollection::create,
"PhysDeriv_NoCollection_Prism"),
496 PhysDeriv_NoCollection::create,
"PhysDeriv_NoCollection_NodalPrism"),
499 PhysDeriv_NoCollection::create,
"PhysDeriv_NoCollection_Hex")
522 const int nqcol = m_nquad0*m_numElmt;
524 ASSERTL1(wsp.num_elements() == m_wspSize,
525 "Incorrect workspace size");
526 ASSERTL1(input.num_elements() >= nqcol,
527 "Incorrect input size");
531 Blas::Dgemm(
'N',
'N', m_nquad0, m_numElmt,
532 m_nquad0, 1.0, m_Deriv0, m_nquad0,
533 input.get(), m_nquad0, 0.0,
534 diff0.get(), m_nquad0);
536 Vmath::Vmul (nqcol, m_derivFac[0], 1, diff0, 1, output0, 1);
540 Vmath::Vmul (nqcol, m_derivFac[1], 1, diff0, 1, output1, 1);
542 else if (m_coordim == 3)
544 Vmath::Vmul (nqcol, m_derivFac[1], 1, diff0, 1, output1, 1);
545 Vmath::Vmul (nqcol, m_derivFac[2], 1, diff0, 1, output2, 1);
555 const int nqcol = m_nquad0*m_numElmt;
557 ASSERTL1(wsp.num_elements() == m_wspSize,
558 "Incorrect workspace size");
559 ASSERTL1(input.num_elements() >= nqcol,
560 "Incorrect input size");
564 Blas::Dgemm(
'N',
'N', m_nquad0, m_numElmt,
565 m_nquad0, 1.0, m_Deriv0, m_nquad0,
566 input.get(), m_nquad0, 0.0,
567 diff0.get(), m_nquad0);
569 Vmath::Vmul(nqcol, m_derivFac[dir], 1, diff0, 1, output, 1);
580 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
583 m_nquad0 (m_stdExp->GetNumPoints(0))
586 m_coordim = m_stdExp->GetCoordim();
588 m_derivFac = pGeomData->GetDerivFactors(pCollExp);
590 m_Deriv0 = &((m_stdExp->GetBasis(0)->GetD())->GetPtr())[0];
591 m_wspSize = m_nquad0*m_numElmt;
598 RegisterCreatorFunction(
600 PhysDeriv_SumFac_Seg::create,
"PhysDeriv_SumFac_Seg");
623 const int nqtot = m_nquad0 * m_nquad1;
624 const int nqcol = nqtot*m_numElmt;
626 ASSERTL1(wsp.num_elements() == m_wspSize,
627 "Incorrect workspace size");
628 ASSERTL1(input.num_elements() >= nqcol,
629 "Incorrect input size");
634 Blas::Dgemm(
'N',
'N', m_nquad0, m_nquad1*m_numElmt,
635 m_nquad0, 1.0, m_Deriv0, m_nquad0,
636 input.get(), m_nquad0, 0.0,
637 diff0.get(), m_nquad0);
640 for (
int i = 0; i < m_numElmt; ++i, cnt += nqtot)
642 Blas::Dgemm(
'N',
'T', m_nquad0, m_nquad1, m_nquad1, 1.0,
643 input.get() + cnt, m_nquad0,
644 m_Deriv1, m_nquad1, 0.0,
645 diff1.get() + cnt, m_nquad0);
648 Vmath::Vmul (nqcol, m_derivFac[0], 1, diff0, 1, output0, 1);
649 Vmath::Vvtvp (nqcol, m_derivFac[1], 1, diff1, 1, output0, 1,
651 Vmath::Vmul (nqcol, m_derivFac[2], 1, diff0, 1, output1, 1);
652 Vmath::Vvtvp (nqcol, m_derivFac[3], 1, diff1, 1, output1, 1,
657 Vmath::Vmul (nqcol, m_derivFac[4], 1, diff0, 1, output2, 1);
658 Vmath::Vvtvp (nqcol, m_derivFac[5], 1, diff1, 1, output2, 1,
669 const int nqtot = m_nquad0 * m_nquad1;
670 const int nqcol = nqtot*m_numElmt;
672 ASSERTL1(wsp.num_elements() == m_wspSize,
673 "Incorrect workspace size");
674 ASSERTL1(input.num_elements() >= nqcol,
675 "Incorrect input size");
680 Blas::Dgemm(
'N',
'N', m_nquad0, m_nquad1*m_numElmt,
681 m_nquad0, 1.0, m_Deriv0, m_nquad0,
682 input.get(), m_nquad0, 0.0,
683 diff0.get(), m_nquad0);
686 for (
int i = 0; i < m_numElmt; ++i, cnt += nqtot)
688 Blas::Dgemm(
'N',
'T', m_nquad0, m_nquad1, m_nquad1, 1.0,
689 input.get() + cnt, m_nquad0,
690 m_Deriv1, m_nquad1, 0.0,
691 diff1.get() + cnt, m_nquad0);
694 Vmath::Vmul (nqcol, m_derivFac[2*dir] , 1, diff0, 1, output, 1);
695 Vmath::Vvtvp (nqcol, m_derivFac[2*dir+1], 1, diff1, 1, output, 1,
709 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
712 m_nquad0 (m_stdExp->GetNumPoints(0)),
713 m_nquad1 (m_stdExp->GetNumPoints(1))
716 m_coordim = m_stdExp->GetCoordim();
718 m_derivFac = pGeomData->GetDerivFactors(pCollExp);
720 m_Deriv0 = &((m_stdExp->GetBasis(0)->GetD())->GetPtr())[0];
721 m_Deriv1 = &((m_stdExp->GetBasis(1)->GetD())->GetPtr())[0];
722 m_wspSize = 2 * m_nquad0*m_nquad1*m_numElmt;
728 RegisterCreatorFunction(
730 PhysDeriv_SumFac_Quad::create,
"PhysDeriv_SumFac_Quad");
752 const int nqtot = m_nquad0 * m_nquad1;
753 const int nqcol = nqtot*m_numElmt;
755 ASSERTL1(wsp.num_elements() == m_wspSize,
756 "Incorrect workspace size");
757 ASSERTL1(input.num_elements() >= nqcol,
758 "Incorrect input size");
764 Blas::Dgemm(
'N',
'N', m_nquad0, m_nquad1*m_numElmt,
765 m_nquad0, 1.0, m_Deriv0, m_nquad0,
766 input.get(), m_nquad0, 0.0,
767 diff0.get(), m_nquad0);
770 for (
int i = 0; i < m_numElmt; ++i, cnt += nqtot)
776 Blas::Dgemm(
'N',
'T', m_nquad0, m_nquad1, m_nquad1, 1.0,
777 input.get() + cnt, m_nquad0,
778 m_Deriv1, m_nquad1, 0.0,
779 diff1.get() + cnt, m_nquad0);
783 diff1.get()+cnt,1,diff1.get()+cnt,1);
787 Vmath::Vmul (nqcol, m_derivFac[0], 1, diff0, 1, output0, 1);
789 output0, 1, output0, 1);
790 Vmath::Vmul (nqcol, m_derivFac[2], 1, diff0, 1, output1, 1);
792 output1, 1, output1, 1);
799 output2, 1, output2, 1);
809 const int nqtot = m_nquad0 * m_nquad1;
810 const int nqcol = nqtot*m_numElmt;
812 ASSERTL1(wsp.num_elements() == m_wspSize,
813 "Incorrect workspace size");
814 ASSERTL1(input.num_elements() >= nqcol,
815 "Incorrect input size");
821 Blas::Dgemm(
'N',
'N', m_nquad0, m_nquad1*m_numElmt,
822 m_nquad0, 1.0, m_Deriv0, m_nquad0,
823 input.get(), m_nquad0, 0.0,
824 diff0.get(), m_nquad0);
827 for (
int i = 0; i < m_numElmt; ++i, cnt += nqtot)
833 Blas::Dgemm(
'N',
'T', m_nquad0, m_nquad1, m_nquad1, 1.0,
834 input.get() + cnt, m_nquad0,
835 m_Deriv1, m_nquad1, 0.0,
836 diff1.get() + cnt, m_nquad0);
840 diff1.get()+cnt,1,diff1.get()+cnt,1);
844 Vmath::Vmul (nqcol, m_derivFac[2*dir] , 1, diff0, 1, output, 1);
845 Vmath::Vvtvp (nqcol, m_derivFac[2*dir+1], 1, diff1, 1, output, 1,
861 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
864 m_nquad0 (m_stdExp->GetNumPoints(0)),
865 m_nquad1 (m_stdExp->GetNumPoints(1))
868 m_coordim = m_stdExp->GetCoordim();
870 m_derivFac = pGeomData->GetDerivFactors(pCollExp);
873 = m_stdExp->GetBasis(0)->GetZ();
875 = m_stdExp->GetBasis(1)->GetZ();
878 for (
int i = 0; i < m_nquad0; ++i)
880 for(
int j = 0; j < m_nquad1; ++j)
882 m_fac0[i+j*m_nquad0] = 0.5*(1+z0[i]);
888 for (
int i = 0; i < m_nquad0; ++i)
890 for(
int j = 0; j < m_nquad1; ++j)
892 m_fac1[i+j*m_nquad0] = 2.0/(1-z1[j]);
897 m_Deriv0 = &((m_stdExp->GetBasis(0)->GetD())->GetPtr())[0];
898 m_Deriv1 = &((m_stdExp->GetBasis(1)->GetD())->GetPtr())[0];
899 m_wspSize = 2 * m_nquad0*m_nquad1*m_numElmt;
908 PhysDeriv_SumFac_Tri::create,
"PhysDeriv_SumFac_Tri"),
911 PhysDeriv_SumFac_Tri::create,
"PhysDeriv_SumFac_NodalTri")
934 int nPhys = m_stdExp->GetTotPoints();
935 int ntot = m_numElmt*nPhys;
939 out[0] = output0; out[1] = output1; out[2] = output2;
941 for(
int i = 0; i < m_dim; ++i)
943 Diff[i] = wsp + i*ntot;
946 Blas::Dgemm(
'N',
'N', m_nquad0,m_nquad1*m_nquad2*m_numElmt,
947 m_nquad0,1.0, m_Deriv0,m_nquad0,&input[0],
948 m_nquad0,0.0,&Diff[0][0],m_nquad0);
950 for(
int i = 0; i < m_numElmt; ++i)
952 for (
int j = 0; j < m_nquad2; ++j)
954 Blas::Dgemm(
'N',
'T', m_nquad0, m_nquad1, m_nquad1,
955 1.0, &input[i*nPhys+j*m_nquad0*m_nquad1],
956 m_nquad0, m_Deriv1, m_nquad1, 0.0,
957 &Diff[1][i*nPhys+j*m_nquad0*m_nquad1],
961 Blas::Dgemm(
'N',
'T',m_nquad0*m_nquad1,m_nquad2,m_nquad2,
962 1.0, &input[i*nPhys],m_nquad0*m_nquad1,
963 m_Deriv2,m_nquad2, 0.0,&Diff[2][i*nPhys],
968 for(
int i = 0; i < m_coordim; ++i)
970 Vmath::Vmul(ntot,m_derivFac[i*m_dim],1,Diff[0],1,out[i],1);
971 for(
int j = 1; j < m_dim; ++j)
987 int nPhys = m_stdExp->GetTotPoints();
988 int ntot = m_numElmt*nPhys;
992 for(
int i = 0; i < m_dim; ++i)
994 Diff[i] = wsp + i*ntot;
997 Blas::Dgemm(
'N',
'N', m_nquad0,m_nquad1*m_nquad2*m_numElmt,
998 m_nquad0,1.0, m_Deriv0,m_nquad0,&input[0],
999 m_nquad0,0.0,&Diff[0][0],m_nquad0);
1001 for(
int i = 0; i < m_numElmt; ++i)
1003 for (
int j = 0; j < m_nquad2; ++j)
1005 Blas::Dgemm(
'N',
'T', m_nquad0, m_nquad1, m_nquad1,
1006 1.0, &input[i*nPhys+j*m_nquad0*m_nquad1],
1007 m_nquad0, m_Deriv1, m_nquad1, 0.0,
1008 &Diff[1][i*nPhys+j*m_nquad0*m_nquad1],
1012 Blas::Dgemm(
'N',
'T',m_nquad0*m_nquad1,m_nquad2,m_nquad2,
1013 1.0, &input[i*nPhys],m_nquad0*m_nquad1,
1014 m_Deriv2,m_nquad2, 0.0,&Diff[2][i*nPhys],
1019 Vmath::Vmul(ntot,m_derivFac[dir*m_dim],1,Diff[0],1,output,1);
1020 for(
int j = 1; j < m_dim; ++j)
1042 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
1045 m_nquad0 (m_stdExp->GetNumPoints(0)),
1046 m_nquad1 (m_stdExp->GetNumPoints(1)),
1047 m_nquad2 (m_stdExp->GetNumPoints(2))
1051 m_dim = PtsKey.size();
1052 m_coordim = m_stdExp->GetCoordim();
1054 m_derivFac = pGeomData->GetDerivFactors(pCollExp);
1056 m_Deriv0 = &((m_stdExp->GetBasis(0)->GetD())->GetPtr())[0];
1057 m_Deriv1 = &((m_stdExp->GetBasis(1)->GetD())->GetPtr())[0];
1058 m_Deriv2 = &((m_stdExp->GetBasis(2)->GetD())->GetPtr())[0];
1060 m_wspSize = 3*m_nquad0*m_nquad1*m_nquad2*m_numElmt;
1069 PhysDeriv_SumFac_Hex::create,
"PhysDeriv_SumFac_Hex")
1092 int nPhys = m_stdExp->GetTotPoints();
1093 int ntot = m_numElmt*nPhys;
1097 out[0] = output0; out[1] = output1; out[2] = output2;
1099 for(
int i = 0; i < m_dim; ++i)
1101 Diff[i] = wsp + i*ntot;
1105 Blas::Dgemm(
'N',
'N', m_nquad0,m_nquad1*m_nquad2*m_numElmt,
1106 m_nquad0,1.0, m_Deriv0,m_nquad0,&input[0],
1107 m_nquad0,0.0,&Diff[0][0],m_nquad0);
1110 for(
int i = 0; i < m_numElmt; ++i)
1112 Blas::Dgemm(
'N',
'T',m_nquad0*m_nquad1,m_nquad2,m_nquad2,
1113 1.0, &input[i*nPhys],m_nquad0*m_nquad1,
1114 m_Deriv2,m_nquad2, 0.0,&Diff[2][i*nPhys],
1118 for(
int i = 0; i < m_numElmt; ++i)
1122 for (
int j = 0; j < m_nquad2; ++j)
1124 Blas::Dgemm(
'N',
'T', m_nquad0, m_nquad1, m_nquad1,
1125 1.0, &input[i*nPhys+j*m_nquad0*m_nquad1],
1126 m_nquad0, m_Deriv1, m_nquad1, 0.0,
1127 &Diff[1][i*nPhys+j*m_nquad0*m_nquad1],
1133 Diff[1].get() + i*nPhys, 1,
1134 Diff[2].get() + i*nPhys, 1,
1135 Diff[2].get() + i*nPhys, 1);
1139 Diff[1].get() + i*nPhys, 1,
1140 Diff[1].get() + i*nPhys, 1);
1144 Diff[0].get() + i*nPhys, 1,
1145 Diff[1].get() + i*nPhys, 1,
1146 Diff[1].get() + i*nPhys, 1);
1150 Diff[0].get() + i*nPhys, 1,
1151 Diff[2].get() + i*nPhys, 1,
1152 Diff[2].get() + i*nPhys, 1);
1156 Diff[0].get() + i*nPhys, 1,
1157 Diff[0].get() + i*nPhys, 1);
1162 for(
int i = 0; i < m_coordim; ++i)
1164 Vmath::Vmul(ntot,m_derivFac[i*m_dim],1,Diff[0],1,out[i],1);
1165 for(
int j = 1; j < m_dim; ++j)
1168 Diff[j], 1, out[i], 1, out[i], 1);
1179 int nPhys = m_stdExp->GetTotPoints();
1180 int ntot = m_numElmt*nPhys;
1184 for(
int i = 0; i < m_dim; ++i)
1186 Diff[i] = wsp + i*ntot;
1190 Blas::Dgemm(
'N',
'N', m_nquad0,m_nquad1*m_nquad2*m_numElmt,
1191 m_nquad0,1.0, m_Deriv0,m_nquad0,&input[0],
1192 m_nquad0,0.0,&Diff[0][0],m_nquad0);
1195 for(
int i = 0; i < m_numElmt; ++i)
1197 Blas::Dgemm(
'N',
'T',m_nquad0*m_nquad1,m_nquad2,m_nquad2,
1198 1.0, &input[i*nPhys],m_nquad0*m_nquad1,
1199 m_Deriv2,m_nquad2, 0.0,&Diff[2][i*nPhys],
1203 for(
int i = 0; i < m_numElmt; ++i)
1207 for (
int j = 0; j < m_nquad2; ++j)
1209 Blas::Dgemm(
'N',
'T', m_nquad0, m_nquad1, m_nquad1,
1210 1.0, &input[i*nPhys+j*m_nquad0*m_nquad1],
1211 m_nquad0, m_Deriv1, m_nquad1, 0.0,
1212 &Diff[1][i*nPhys+j*m_nquad0*m_nquad1],
1218 Diff[1].get() + i*nPhys, 1,
1219 Diff[2].get() + i*nPhys, 1,
1220 Diff[2].get() + i*nPhys, 1);
1224 Diff[1].get() + i*nPhys, 1,
1225 Diff[1].get() + i*nPhys, 1);
1229 Diff[0].get() + i*nPhys, 1,
1230 Diff[1].get() + i*nPhys, 1,
1231 Diff[1].get() + i*nPhys, 1);
1235 Diff[0].get() + i*nPhys, 1,
1236 Diff[2].get() + i*nPhys, 1,
1237 Diff[2].get() + i*nPhys, 1);
1241 Diff[0].get() + i*nPhys, 1,
1242 Diff[0].get() + i*nPhys, 1);
1247 Vmath::Vmul(ntot,m_derivFac[dir*m_dim],1,Diff[0],1,output,1);
1248 for(
int j = 1; j < m_dim; ++j)
1251 Diff[j], 1, output, 1, output, 1);
1272 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
1275 m_nquad0 (m_stdExp->GetNumPoints(0)),
1276 m_nquad1 (m_stdExp->GetNumPoints(1)),
1277 m_nquad2 (m_stdExp->GetNumPoints(2))
1281 m_dim = PtsKey.size();
1282 m_coordim = m_stdExp->GetCoordim();
1284 m_derivFac = pGeomData->GetDerivFactors(pCollExp);
1286 m_Deriv0 = &((m_stdExp->GetBasis(0)->GetD())->GetPtr())[0];
1287 m_Deriv1 = &((m_stdExp->GetBasis(1)->GetD())->GetPtr())[0];
1288 m_Deriv2 = &((m_stdExp->GetBasis(2)->GetD())->GetPtr())[0];
1290 m_wspSize = 3*m_nquad0*m_nquad1*m_nquad2*m_numElmt;
1293 = m_stdExp->GetBasis(0)->GetZ();
1295 = m_stdExp->GetBasis(1)->GetZ();
1297 = m_stdExp->GetBasis(2)->GetZ();
1304 for (
int i = 0; i < m_nquad0; ++i)
1306 for(
int j = 0; j < m_nquad1; ++j)
1308 for(
int k = 0; k < m_nquad2; ++k)
1311 m_fac0[i + j*m_nquad0 + k*m_nquad0*m_nquad1]
1312 = 4.0/((1-z1[j])*(1-z2[k]));
1313 m_fac1[i + j*m_nquad0 + k*m_nquad0*m_nquad1]
1314 = 2.0*(1+z0[i])/((1-z1[j])*(1-z2[k]));
1315 m_fac2[i + j*m_nquad0 + k*m_nquad0*m_nquad1]
1317 m_fac3[i + j*m_nquad0 + k*m_nquad0*m_nquad1]
1318 = (1+z1[j])/(1-z2[k]);
1331 PhysDeriv_SumFac_Tet::create,
"PhysDeriv_SumFac_Tet")
1354 int nPhys = m_stdExp->GetTotPoints();
1355 int ntot = m_numElmt*nPhys;
1359 out[0] = output0; out[1] = output1; out[2] = output2;
1361 for(
int i = 0; i < m_dim; ++i)
1363 Diff[i] = wsp + i*ntot;
1367 Blas::Dgemm(
'N',
'N', m_nquad0,m_nquad1*m_nquad2*m_numElmt,
1368 m_nquad0,1.0, m_Deriv0,m_nquad0,&input[0],
1369 m_nquad0,0.0,&Diff[0][0],m_nquad0);
1372 for(
int i = 0; i < m_numElmt; ++i)
1376 for (
int j = 0; j < m_nquad2; ++j)
1378 Blas::Dgemm(
'N',
'T', m_nquad0, m_nquad1, m_nquad1,
1379 1.0, &input[i*nPhys+j*m_nquad0*m_nquad1],
1380 m_nquad0, m_Deriv1, m_nquad1, 0.0,
1381 &Diff[1][i*nPhys+j*m_nquad0*m_nquad1],
1386 Blas::Dgemm(
'N',
'T',m_nquad0*m_nquad1,m_nquad2,m_nquad2,
1387 1.0, &input[i*nPhys],m_nquad0*m_nquad1,
1388 m_Deriv2,m_nquad2, 0.0,&Diff[2][i*nPhys],
1392 Vmath::Vmul(nPhys,&m_fac0[0],1,Diff[0].
get()+cnt,1,
1393 Diff[0].
get()+cnt,1);
1397 Diff[2].
get()+cnt,1,Diff[2].
get()+cnt,1);
1402 for(
int i = 0; i < m_coordim; ++i)
1404 Vmath::Vmul(ntot,m_derivFac[i*m_dim],1,Diff[0],1,out[i],1);
1405 for(
int j = 1; j < m_dim; ++j)
1408 Diff[j], 1, out[i], 1, out[i], 1);
1419 int nPhys = m_stdExp->GetTotPoints();
1420 int ntot = m_numElmt*nPhys;
1424 for(
int i = 0; i < m_dim; ++i)
1426 Diff[i] = wsp + i*ntot;
1430 Blas::Dgemm(
'N',
'N', m_nquad0,m_nquad1*m_nquad2*m_numElmt,
1431 m_nquad0,1.0, m_Deriv0,m_nquad0,&input[0],
1432 m_nquad0,0.0,&Diff[0][0],m_nquad0);
1435 for(
int i = 0; i < m_numElmt; ++i)
1439 for (
int j = 0; j < m_nquad2; ++j)
1441 Blas::Dgemm(
'N',
'T', m_nquad0, m_nquad1, m_nquad1,
1442 1.0, &input[i*nPhys+j*m_nquad0*m_nquad1],
1443 m_nquad0, m_Deriv1, m_nquad1, 0.0,
1444 &Diff[1][i*nPhys+j*m_nquad0*m_nquad1],
1449 Blas::Dgemm(
'N',
'T',m_nquad0*m_nquad1,m_nquad2,m_nquad2,
1450 1.0, &input[i*nPhys],m_nquad0*m_nquad1,
1451 m_Deriv2,m_nquad2, 0.0,&Diff[2][i*nPhys],
1455 Vmath::Vmul(nPhys,&m_fac0[0],1,Diff[0].
get()+cnt,1,
1456 Diff[0].
get()+cnt,1);
1460 Diff[2].
get()+cnt,1,Diff[2].
get()+cnt,1);
1465 Vmath::Vmul(ntot,m_derivFac[dir*m_dim],1,Diff[0],1,output,1);
1466 for(
int j = 1; j < m_dim; ++j)
1469 Diff[j], 1, output, 1, output, 1);
1488 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
1491 m_nquad0 (m_stdExp->GetNumPoints(0)),
1492 m_nquad1 (m_stdExp->GetNumPoints(1)),
1493 m_nquad2 (m_stdExp->GetNumPoints(2))
1497 m_dim = PtsKey.size();
1498 m_coordim = m_stdExp->GetCoordim();
1500 m_derivFac = pGeomData->GetDerivFactors(pCollExp);
1503 = m_stdExp->GetBasis(0)->GetZ();
1505 = m_stdExp->GetBasis(2)->GetZ();
1508 for (
int i = 0; i < m_nquad0; ++i)
1510 for(
int j = 0; j < m_nquad1; ++j)
1512 for(
int k = 0; k < m_nquad2; ++k)
1514 m_fac0[i+j*m_nquad0 + k*m_nquad0*m_nquad1] =
1516 m_fac1[i+j*m_nquad0 + k*m_nquad0*m_nquad1] =
1524 m_Deriv0 = &((m_stdExp->GetBasis(0)->GetD())->GetPtr())[0];
1525 m_Deriv1 = &((m_stdExp->GetBasis(1)->GetD())->GetPtr())[0];
1526 m_Deriv2 = &((m_stdExp->GetBasis(2)->GetD())->GetPtr())[0];
1528 m_wspSize = 3*m_nquad0*m_nquad1*m_nquad2*m_numElmt;
1533 OperatorKey PhysDeriv_SumFac_Prism::m_typeArr[] = {
1536 PhysDeriv_SumFac_Prism::create,
"PhysDeriv_SumFac_Prism")
Phys deriv operator using sum-factorisation (Prism)
#define ASSERTL0(condition, msg)
std::vector< PointsKey > PointsKeyVector
PhysDeriv_SumFac_Quad(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
PhysDeriv_SumFac_Hex(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
PhysDeriv_SumFac_Tet(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
virtual void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
Perform operation.
boost::tuple< LibUtilities::ShapeType, OperatorType, ImplementationType, ExpansionIsNodal > OperatorKey
Key for describing an Operator.
Array< TwoD, const NekDouble > m_derivFac
PhysDeriv_SumFac_Seg(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
virtual void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
Perform operation.
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
Phys deriv operator using sum-factorisation (Segment)
vector< StdRegions::StdExpansionSharedPtr > m_expList
Array< OneD, NekDouble > m_fac2
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Array< TwoD, const NekDouble > m_derivFac
Array< TwoD, const NekDouble > m_derivFac
Phys deriv operator using element-wise operation.
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
PhysDeriv_SumFac_Prism(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
Array< OneD, NekDouble > m_fac0
Phys deriv operator using sum-factorisation (Tri)
Base class for operators on a collection of elements.
virtual void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
Perform operation.
Array< OneD, NekDouble > m_fac0
Array< TwoD, const NekDouble > m_derivFac
Phys deriv operator using standard matrix approach.
virtual void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
Perform operation.
virtual void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
Perform operation.
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
Array< TwoD, const NekDouble > m_derivFac
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
Array< OneD, NekDouble > m_fac1
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
Array< TwoD, const NekDouble > m_derivFac
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
OperatorFactory & GetOperatorFactory()
Returns the singleton Operator factory object.
Phys deriv operator using sum-factorisation (Tet)
virtual void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
Perform operation.
Array< OneD, NekDouble > m_fac1
Array< OneD, NekDouble > m_fac0
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
#define OPERATOR_CREATE(cname)
Array< TwoD, const NekDouble > m_derivFac
Array< OneD, NekDouble > m_fac3
Array< OneD, DNekMatSharedPtr > m_derivMat
Phys deriv operator using original LocalRegions implementation.
Array< OneD, NekDouble > m_fac1
boost::shared_ptr< CoalescedGeomData > CoalescedGeomDataSharedPtr
PhysDeriv_SumFac_Tri(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
Phys deriv operator using sum-factorisation (Hex)
PhysDeriv_StdMat(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
virtual void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
Perform operation.
void Zero(int n, T *x, const int incx)
Zero vector.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Phys deriv operator using sum-factorisation (Quad)
Array< TwoD, const NekDouble > m_derivFac
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
virtual void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
Perform operation.
virtual void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
Perform operation.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
PhysDeriv_NoCollection(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
PhysDeriv_IterPerExp(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.