44 namespace LocalRegions
52 Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
55 Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
57 StdPrismExp (Ba, Bb, Bc),
61 boost::bind(&
PrismExp::CreateMatrix, this, _1),
62 std::string(
"PrismExpMatrix")),
63 m_staticCondMatrixManager(
64 boost::bind(&
PrismExp::CreateStaticCondMatrix, this, _1),
65 std::string(
"PrismExpStaticCondMatrix"))
72 StdRegions::StdPrismExp(T),
75 m_matrixManager(T.m_matrixManager),
76 m_staticCondMatrixManager(T.m_staticCondMatrixManager)
111 int nquad0 =
m_base[0]->GetNumPoints();
112 int nquad1 =
m_base[1]->GetNumPoints();
113 int nquad2 =
m_base[2]->GetNumPoints();
115 Array<OneD, NekDouble> tmp(nquad0*nquad1*nquad2);
136 Array<OneD, NekDouble>& out_d0,
137 Array<OneD, NekDouble>& out_d1,
138 Array<OneD, NekDouble>& out_d2)
142 Array<TwoD, const NekDouble> df =
144 Array<OneD, NekDouble> diff0(nqtot);
145 Array<OneD, NekDouble> diff1(nqtot);
146 Array<OneD, NekDouble> diff2(nqtot);
152 if(out_d0.num_elements())
154 Vmath::Vmul (nqtot,&df[0][0],1,&diff0[0],1,&out_d0[0],1);
155 Vmath::Vvtvp (nqtot,&df[1][0],1,&diff1[0],1,&out_d0[0],1,&out_d0[0],1);
156 Vmath::Vvtvp (nqtot,&df[2][0],1,&diff2[0],1,&out_d0[0],1,&out_d0[0],1);
159 if(out_d1.num_elements())
161 Vmath::Vmul (nqtot,&df[3][0],1,&diff0[0],1,&out_d1[0],1);
162 Vmath::Vvtvp (nqtot,&df[4][0],1,&diff1[0],1,&out_d1[0],1,&out_d1[0],1);
163 Vmath::Vvtvp (nqtot,&df[5][0],1,&diff2[0],1,&out_d1[0],1,&out_d1[0],1);
166 if(out_d2.num_elements())
168 Vmath::Vmul (nqtot,&df[6][0],1,&diff0[0],1,&out_d2[0],1);
169 Vmath::Vvtvp (nqtot,&df[7][0],1,&diff1[0],1,&out_d2[0],1,&out_d2[0],1);
170 Vmath::Vvtvp (nqtot,&df[8][0],1,&diff2[0],1,&out_d2[0],1,&out_d2[0],1);
175 if(out_d0.num_elements())
177 Vmath::Smul (nqtot,df[0][0],&diff0[0],1,&out_d0[0],1);
178 Blas::Daxpy (nqtot,df[1][0],&diff1[0],1,&out_d0[0],1);
179 Blas::Daxpy (nqtot,df[2][0],&diff2[0],1,&out_d0[0],1);
182 if(out_d1.num_elements())
184 Vmath::Smul (nqtot,df[3][0],&diff0[0],1,&out_d1[0],1);
185 Blas::Daxpy (nqtot,df[4][0],&diff1[0],1,&out_d1[0],1);
186 Blas::Daxpy (nqtot,df[5][0],&diff2[0],1,&out_d1[0],1);
189 if(out_d2.num_elements())
191 Vmath::Smul (nqtot,df[6][0],&diff0[0],1,&out_d2[0],1);
192 Blas::Daxpy (nqtot,df[7][0],&diff1[0],1,&out_d2[0],1);
193 Blas::Daxpy (nqtot,df[8][0],&diff2[0],1,&out_d2[0],1);
216 Array<OneD, NekDouble>& outarray)
218 if(
m_base[0]->Collocation() &&
219 m_base[1]->Collocation() &&
271 const Array<OneD, const NekDouble>& inarray,
272 Array<OneD, NekDouble>& outarray)
278 const Array<OneD, const NekDouble>& inarray,
279 Array<OneD, NekDouble>& outarray)
281 const int nquad0 =
m_base[0]->GetNumPoints();
282 const int nquad1 =
m_base[1]->GetNumPoints();
283 const int nquad2 =
m_base[2]->GetNumPoints();
284 const int order0 =
m_base[0]->GetNumModes();
285 const int order1 =
m_base[1]->GetNumModes();
287 Array<OneD, NekDouble> tmp(nquad0*nquad1*nquad2);
288 Array<OneD, NekDouble> wsp(order0*nquad2*(nquad1+order1));
331 const Array<OneD, const NekDouble> &inarray,
332 Array<OneD, NekDouble> &outarray)
339 const Array<OneD, const NekDouble> &inarray,
340 Array<OneD, NekDouble> &outarray)
342 const int nquad0 =
m_base[0]->GetNumPoints();
343 const int nquad1 =
m_base[1]->GetNumPoints();
344 const int nquad2 =
m_base[2]->GetNumPoints();
345 const int order0 =
m_base[0]->GetNumModes ();
346 const int order1 =
m_base[1]->GetNumModes ();
347 const int nqtot = nquad0*nquad1*nquad2;
350 const Array<OneD, const NekDouble> &z0 =
m_base[0]->GetZ();
351 const Array<OneD, const NekDouble> &z2 =
m_base[2]->GetZ();
353 Array<OneD, NekDouble> gfac0(nquad0 );
354 Array<OneD, NekDouble> gfac2(nquad2 );
355 Array<OneD, NekDouble> tmp1 (nqtot );
356 Array<OneD, NekDouble> tmp2 (nqtot );
357 Array<OneD, NekDouble> tmp3 (nqtot );
358 Array<OneD, NekDouble> tmp4 (nqtot );
359 Array<OneD, NekDouble> tmp5 (nqtot );
361 Array<OneD, NekDouble> wsp (order0*nquad2*(nquad1+order1));
363 const Array<TwoD, const NekDouble>& df =
370 Vmath::Vmul(nqtot,&df[3*dir][0], 1,tmp1.get(),1,tmp2.get(),1);
371 Vmath::Vmul(nqtot,&df[3*dir+1][0],1,tmp1.get(),1,tmp3.get(),1);
372 Vmath::Vmul(nqtot,&df[3*dir+2][0],1,tmp1.get(),1,tmp4.get(),1);
376 Vmath::Smul(nqtot, df[3*dir][0], tmp1.get(),1,tmp2.get(), 1);
377 Vmath::Smul(nqtot, df[3*dir+1][0],tmp1.get(),1,tmp3.get(), 1);
378 Vmath::Smul(nqtot, df[3*dir+2][0],tmp1.get(),1,tmp4.get(), 1);
382 for (i = 0; i < nquad0; ++i)
384 gfac0[i] = 0.5*(1+z0[i]);
388 for (i = 0; i < nquad2; ++i)
390 gfac2[i] = 2.0/(1-z2[i]);
393 const int nq01 = nquad0*nquad1;
395 for (i = 0; i < nquad2; ++i)
397 Vmath::Smul(nq01,gfac2[i],&tmp2[0]+i*nq01,1,&tmp2[0]+i*nq01,1);
398 Vmath::Smul(nq01,gfac2[i],&tmp4[0]+i*nq01,1,&tmp5[0]+i*nq01,1);
401 for(i = 0; i < nquad1*nquad2; ++i)
403 Vmath::Vmul(nquad0,&gfac0[0],1,&tmp5[0]+i*nquad0,1,
404 &tmp5[0]+i*nquad0,1);
407 Vmath::Vadd(nqtot, &tmp2[0], 1, &tmp5[0], 1, &tmp2[0], 1);
441 Array<OneD, NekDouble>& coords)
445 ASSERTL1(Lcoords[0] <= -1.0 && Lcoords[0] >= 1.0 &&
446 Lcoords[1] <= -1.0 && Lcoords[1] >= 1.0 &&
447 Lcoords[2] <= -1.0 && Lcoords[2] >= 1.0,
448 "Local coordinates are not in region [-1,1]");
452 for(i = 0; i <
m_geom->GetCoordim(); ++i)
454 coords[i] =
m_geom->GetCoord(i,Lcoords);
459 Array<OneD, NekDouble> &coords_0,
460 Array<OneD, NekDouble> &coords_1,
461 Array<OneD, NekDouble> &coords_2)
472 const Array<OneD, const NekDouble> &Lcoord,
473 const Array<OneD, const NekDouble> &physvals)
480 const Array<OneD, const NekDouble>& physvals)
482 Array<OneD, NekDouble> Lcoord(3);
486 m_geom->GetLocCoords(coord, Lcoord);
498 return m_geom->GetCoordim();
503 const std::vector<unsigned int >& nummodes,
504 const int mode_offset,
507 int data_order0 = nummodes[mode_offset];
508 int fillorder0 = min(
m_base[0]->GetNumModes(),data_order0);
509 int data_order1 = nummodes[mode_offset+1];
510 int order1 =
m_base[1]->GetNumModes();
511 int fillorder1 = min(order1,data_order1);
512 int data_order2 = nummodes[mode_offset+2];
513 int order2 =
m_base[2]->GetNumModes();
514 int fillorder2 = min(order2,data_order2);
526 "Extraction routine not set up for this basis");
529 "Extraction routine not set up for this basis");
532 for(j = 0; j < fillorder0; ++j)
534 for(i = 0; i < fillorder1; ++i)
538 cnt += data_order2-j;
543 for(i = fillorder1; i < data_order1; ++i)
545 cnt += data_order2-j;
548 for(i = fillorder1; i < order1; ++i)
556 ASSERTL0(
false,
"basis is either not set up or not "
571 const Array<OneD, const NekDouble> &inarray,
572 Array<OneD, NekDouble> &outarray,
581 const Array<OneD, const NekDouble> &inarray,
582 Array<OneD, NekDouble> &outarray,
585 int nquad0 =
m_base[0]->GetNumPoints();
586 int nquad1 =
m_base[1]->GetNumPoints();
587 int nquad2 =
m_base[2]->GetNumPoints();
589 Array<OneD,NekDouble> o_tmp(nquad0*nquad1*nquad2);
602 Vmath::Vcopy(nquad0*nquad1,&(inarray[0]),1,&(outarray[0]),1);
607 for (
int j=0; j<nquad1; j++)
609 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+j*nquad0,-1,&(outarray[0])+(j*nquad0),1);
615 for (
int j=0; j<nquad1; j++)
617 Vmath::Vcopy(nquad0,&(inarray[0])+nquad0*(nquad1-1-j),1,&(outarray[0])+(j*nquad0),1);
623 for(
int j=0; j<nquad1; j++)
625 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1-j*nquad0),-1,&(outarray[0])+(j*nquad0),1);
631 for (
int i=0; i<nquad0; i++)
633 Vmath::Vcopy(nquad1,&(inarray[0])+i,nquad0,&(outarray[0])+(i*nquad1),1);
639 for (
int i=0; i<nquad0; i++)
641 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0-1-i),nquad0,&(outarray[0])+(i*nquad1),1);
647 for (
int i=0; i<nquad0; i++)
649 Vmath::Vcopy(nquad1,&(inarray[0])+i+nquad0*(nquad1-1),-nquad0,&(outarray[0])+(i*nquad1),1);
655 for (
int i=0; i<nquad0; i++)
657 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0*nquad1-1-i),-nquad0,&(outarray[0])+(i*nquad1),1);
663 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),outarray);
669 for (
int k=0; k<nquad2; k++)
671 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1*k),1,&(outarray[0])+(k*nquad0),1);
678 for (
int k=0; k<nquad2; k++)
680 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+(nquad0*nquad1*k),-1,&(outarray[0])+(k*nquad0),1);
687 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),outarray);
694 nquad0,&(outarray[0]),1);
699 for (
int k=0; k<nquad2; k++)
701 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(k*nquad0*nquad1),
702 -nquad0,&(outarray[0])+(k*nquad0),1);
708 for (
int k=0; k<nquad2; k++)
710 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+(nquad0*nquad1*(nquad2-1-k)),
711 nquad0,&(outarray[0])+(k*nquad0),1);
717 for (
int k=0; k<nquad2; k++)
719 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(nquad0*nquad1*(nquad2-1-k)),
720 -nquad0,&(outarray[0])+(k*nquad0),1);
726 for (
int j=0; j<nquad1; j++)
728 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0-1)+(j*nquad0),
729 nquad0*nquad1,&(outarray[0])+(j*nquad2),1);
735 for (
int j=0; j<nquad0; j++)
737 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1-1-j*nquad0),
738 nquad0*nquad1,&(outarray[0])+(j*nquad2),1);
744 for (
int j=0; j<nquad0; j++)
746 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*(nquad2-1)+nquad0+j*nquad0,
747 -nquad0*nquad1,&(outarray[0])+(j*nquad2),1);
753 for (
int j=0; j<nquad0; j++)
755 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1*nquad2-1-j*nquad0),
756 -nquad0*nquad1,&(outarray[0])+(j*nquad2),1);
762 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),outarray);
768 for (
int k=0; k<nquad2; k++)
770 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*(nquad1-1))+(k*nquad0*nquad1),
771 1,&(outarray[0])+(k*nquad0),1);
777 for (
int k=0; k<nquad2; k++)
779 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(k*nquad0*nquad1),
780 -1,&(outarray[0])+(k*nquad0),1);
786 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),outarray);
793 Vmath::Vcopy(nquad1*nquad2,&(inarray[0]),nquad0,&(outarray[0]),1);
798 for (
int k=0; k<nquad2; k++)
800 Vmath::Vcopy(nquad1,&(inarray[0])+nquad0*(nquad1-1)+(k*nquad0*nquad1),
801 -nquad0,&(outarray[0])+(k*nquad1),1);
807 for (
int k=0; k<nquad2; k++)
809 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0*nquad1*(nquad2-1-k)),
810 nquad0,&(outarray[0])+(k*nquad1),1);
816 for (
int k=0; k<nquad2; k++)
818 Vmath::Vcopy(nquad1,&(inarray[0])+nquad0*(nquad1-1)+(nquad0*nquad1*(nquad2-1-k)),
819 -nquad0,&(outarray[0])+(k*nquad1),1);
825 for (
int j=0; j<nquad1; j++)
827 Vmath::Vcopy(nquad2,&(inarray[0])+j*nquad0,nquad0*nquad1,
828 &(outarray[0])+(j*nquad2),1);
834 for (
int j=0; j<nquad1; j++)
836 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*(nquad1-1)-j*nquad0),
837 nquad0*nquad1,&(outarray[0])+(j*nquad2),1);
843 for (
int j=0; j<nquad1; j++)
845 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*(nquad2-1)+j*nquad0,
846 -nquad0*nquad1,&(outarray[0])+(j*nquad2),1);
852 for (
int j=0; j<nquad1; j++)
854 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*(nquad1*nquad2-1)-j*nquad0),
855 -nquad0*nquad1,&(outarray[0])+(j*nquad2),1);
861 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),outarray);
864 ASSERTL0(
false,
"face value (> 4) is out of range");
875 const Array<TwoD, const NekDouble> &df = geomFactors->GetDerivFactors(ptsKeys);
876 const Array<OneD, const NekDouble> &jac = geomFactors->GetJac(ptsKeys);
879 int nq =
m_base[0]->GetNumPoints()*
m_base[0]->GetNumPoints();
883 m_faceNormals[face] = Array<OneD, Array<OneD, NekDouble> >(vCoordDim);
884 Array<OneD, Array<OneD, NekDouble> > &normal =
m_faceNormals[face];
885 for (i = 0; i < vCoordDim; ++i)
887 normal[i] = Array<OneD, NekDouble>(nq);
900 for(i = 0; i < vCoordDim; ++i)
908 for(i = 0; i < vCoordDim; ++i)
916 for(i = 0; i < vCoordDim; ++i)
918 Vmath::Fill(nq,df[3*i][0]+df[3*i+2][0],normal[i],1);
924 for(i = 0; i < vCoordDim; ++i)
932 for(i = 0; i < vCoordDim; ++i)
939 ASSERTL0(
false,
"face is out of range (face < 4)");
944 for(i = 0; i < vCoordDim; ++i)
946 fac += normal[i][0]*normal[i][0];
949 for (i = 0; i < vCoordDim; ++i)
959 int nq0 = ptsKeys[0].GetNumPoints();
960 int nq1 = ptsKeys[1].GetNumPoints();
961 int nq2 = ptsKeys[2].GetNumPoints();
970 else if (face == 1 || face == 3)
982 Array<OneD, NekDouble> work (nq, 0.0);
983 Array<OneD, NekDouble> normals(vCoordDim*nqtot,0.0);
992 for(j = 0; j < nq01; ++j)
994 normals[j] = -df[2][j]*jac[j];
995 normals[nqtot+j] = -df[5][j]*jac[j];
996 normals[2*nqtot+j] = -df[8][j]*jac[j];
999 points0 = ptsKeys[0];
1000 points1 = ptsKeys[1];
1006 for (j = 0; j < nq0; ++j)
1008 for(k = 0; k < nq2; ++k)
1012 -df[1][tmp]*jac[tmp];
1013 normals[nqtot+j+k*nq0] =
1014 -df[4][tmp]*jac[tmp];
1015 normals[2*nqtot+j+k*nq0] =
1016 -df[7][tmp]*jac[tmp];
1020 points0 = ptsKeys[0];
1021 points1 = ptsKeys[2];
1027 for (j = 0; j < nq1; ++j)
1029 for(k = 0; k < nq2; ++k)
1031 int tmp = nq0-1+nq0*j+nq01*k;
1033 (df[0][tmp]+df[2][tmp])*jac[tmp];
1034 normals[nqtot+j+k*nq1] =
1035 (df[3][tmp]+df[5][tmp])*jac[tmp];
1036 normals[2*nqtot+j+k*nq1] =
1037 (df[6][tmp]+df[8][tmp])*jac[tmp];
1041 points0 = ptsKeys[1];
1042 points1 = ptsKeys[2];
1048 for (j = 0; j < nq0; ++j)
1050 for(k = 0; k < nq2; ++k)
1052 int tmp = nq0*(nq1-1) + j + nq01*k;
1054 df[1][tmp]*jac[tmp];
1055 normals[nqtot+j+k*nq0] =
1056 df[4][tmp]*jac[tmp];
1057 normals[2*nqtot+j+k*nq0] =
1058 df[7][tmp]*jac[tmp];
1062 points0 = ptsKeys[0];
1063 points1 = ptsKeys[2];
1069 for (j = 0; j < nq1; ++j)
1071 for(k = 0; k < nq2; ++k)
1073 int tmp = j*nq0+nq01*k;
1075 -df[0][tmp]*jac[tmp];
1076 normals[nqtot+j+k*nq1] =
1077 -df[3][tmp]*jac[tmp];
1078 normals[2*nqtot+j+k*nq1] =
1079 -df[6][tmp]*jac[tmp];
1083 points0 = ptsKeys[1];
1084 points1 = ptsKeys[2];
1089 ASSERTL0(
false,
"face is out of range (face < 4)");
1094 m_base[0]->GetPointsKey(),
1095 m_base[0]->GetPointsKey(),
1100 for(i = 0; i < vCoordDim; ++i)
1104 m_base[0]->GetPointsKey(),
1105 m_base[0]->GetPointsKey(),
1114 Vmath::Vvtvp(nq,normal[i],1,normal[i],1,work,1,work,1);
1128 const Array<OneD, const NekDouble> &inarray,
1129 Array<OneD, NekDouble> &outarray,
1136 const Array<OneD, const NekDouble> &inarray,
1137 Array<OneD, NekDouble> &outarray,
1146 const Array<OneD, const NekDouble> &inarray,
1147 Array<OneD, NekDouble> &outarray,
1154 const Array<OneD, const NekDouble> &inarray,
1155 Array<OneD, NekDouble> &outarray,
1162 const Array<OneD, const NekDouble> &inarray,
1163 Array<OneD, NekDouble> &outarray,
1168 if(inarray.get() == outarray.get())
1173 Blas::Dgemv(
'N',
m_ncoeffs,
m_ncoeffs,mat->Scale(),(mat->GetOwnedMatrix())->GetPtr().get(),
1174 m_ncoeffs, tmp.get(), 1, 0.0, outarray.get(), 1);
1178 Blas::Dgemv(
'N',
m_ncoeffs,
m_ncoeffs,mat->Scale(),(mat->GetOwnedMatrix())->GetPtr().get(),
1179 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
1185 const Array<OneD, const NekDouble> &inarray,
1186 Array<OneD, NekDouble> &outarray)
1188 int n_coeffs = inarray.num_elements();
1189 int nquad0 =
m_base[0]->GetNumPoints();
1190 int nquad1 =
m_base[1]->GetNumPoints();
1191 int nquad2 =
m_base[2]->GetNumPoints();
1192 int nqtot = nquad0*nquad1*nquad2;
1193 int nmodes0 =
m_base[0]->GetNumModes();
1194 int nmodes1 =
m_base[1]->GetNumModes();
1195 int nmodes2 =
m_base[2]->GetNumModes();
1196 int numMax = nmodes0;
1198 Array<OneD, NekDouble> coeff (n_coeffs);
1199 Array<OneD, NekDouble> coeff_tmp1(n_coeffs, 0.0);
1200 Array<OneD, NekDouble> coeff_tmp2(n_coeffs, 0.0);
1201 Array<OneD, NekDouble> phys_tmp(nqtot,0.0);
1202 Array<OneD, NekDouble> tmp, tmp2, tmp3, tmp4;
1233 m_PrismExp ->BwdTrans(inarray,phys_tmp);
1234 m_OrthoPrismExp->FwdTrans(phys_tmp, coeff);
1239 for (
int u = 0; u < numMax; ++u)
1241 for (
int i = 0; i < numMax-u; ++i)
1245 tmp2 = coeff_tmp1+cnt,1);
1251 m_OrthoPrismExp->BwdTrans(coeff_tmp1,phys_tmp);
1252 m_PrismExp ->FwdTrans(phys_tmp, outarray);
1290 return tmp->GetStdMatrix(mkey);
1314 "Geometric information is not set up");
1369 Array<TwoD, const NekDouble> df =
1399 int rows = deriv0.GetRows();
1400 int cols = deriv1.GetColumns();
1405 (*WeakDeriv) = df[3*dir ][0]*deriv0
1406 + df[3*dir+1][0]*deriv1
1407 + df[3*dir+2][0]*deriv2;
1449 Array<TwoD, const NekDouble> gmat
1452 int rows = lap00.GetRows();
1453 int cols = lap00.GetColumns();
1458 (*lap) = gmat[0][0]*lap00
1463 + gmat[7][0]*(lap12 +
Transpose(lap12));
1481 int rows = LapMat.GetRows();
1482 int cols = LapMat.GetColumns();
1487 (*helm) = LapMat + factor*MassMat;
1633 unsigned int nint = (
unsigned int)(
m_ncoeffs - nbdry);
1634 unsigned int exp_size[] = {nbdry, nint};
1635 unsigned int nblks=2;
1645 goto UseLocRegionsMatrix;
1651 goto UseLocRegionsMatrix;
1656 factor = mat->Scale();
1657 goto UseStdRegionsMatrix;
1660 UseStdRegionsMatrix:
1675 UseLocRegionsMatrix:
1686 Array<OneD,unsigned int> bmap(nbdry);
1687 Array<OneD,unsigned int> imap(nint);
1691 for(i = 0; i < nbdry; ++i)
1693 for(j = 0; j < nbdry; ++j)
1695 (*A)(i,j) = mat(bmap[i],bmap[j]);
1698 for(j = 0; j < nint; ++j)
1700 (*B)(i,j) = mat(bmap[i],imap[j]);
1704 for(i = 0; i < nint; ++i)
1706 for(j = 0; j < nbdry; ++j)
1708 (*C)(i,j) = mat(imap[i],bmap[j]);
1711 for(j = 0; j < nint; ++j)
1713 (*D)(i,j) = mat(imap[i],imap[j]);
1722 (*A) = (*A) - (*B)*(*C);
1758 const Array<OneD, const NekDouble> &inarray,
1759 Array<OneD, NekDouble> &outarray,
1760 Array<OneD, NekDouble> &wsp)
1762 int nquad0 =
m_base[0]->GetNumPoints();
1763 int nquad1 =
m_base[1]->GetNumPoints();
1764 int nquad2 =
m_base[2]->GetNumPoints();
1765 int nqtot = nquad0*nquad1*nquad2;
1769 Array<OneD,NekDouble> alloc(11*nqtot,0.0);
1770 Array<OneD,NekDouble> wsp1 (alloc );
1771 Array<OneD,NekDouble> wsp2 (alloc+ 1*nqtot);
1772 Array<OneD,NekDouble> wsp3 (alloc+ 2*nqtot);
1773 Array<OneD,NekDouble> g0 (alloc+ 3*nqtot);
1774 Array<OneD,NekDouble> g1 (alloc+ 4*nqtot);
1775 Array<OneD,NekDouble> g2 (alloc+ 5*nqtot);
1776 Array<OneD,NekDouble> g3 (alloc+ 6*nqtot);
1777 Array<OneD,NekDouble> g4 (alloc+ 7*nqtot);
1778 Array<OneD,NekDouble> g5 (alloc+ 8*nqtot);
1779 Array<OneD,NekDouble> h0 (alloc+ 3*nqtot);
1780 Array<OneD,NekDouble> h1 (alloc+ 6*nqtot);
1781 Array<OneD,NekDouble> wsp4 (alloc+ 4*nqtot);
1782 Array<OneD,NekDouble> wsp5 (alloc+ 5*nqtot);
1783 Array<OneD,NekDouble> wsp6 (alloc+ 8*nqtot);
1784 Array<OneD,NekDouble> wsp7 (alloc+ 3*nqtot);
1785 Array<OneD,NekDouble> wsp8 (alloc+ 9*nqtot);
1786 Array<OneD,NekDouble> wsp9 (alloc+10*nqtot);
1788 const Array<OneD, const NekDouble>& base0 =
m_base[0]->GetBdata();
1789 const Array<OneD, const NekDouble>& base1 =
m_base[1]->GetBdata();
1790 const Array<OneD, const NekDouble>& base2 =
m_base[2]->GetBdata();
1791 const Array<OneD, const NekDouble>& dbase0 =
m_base[0]->GetDbdata();
1792 const Array<OneD, const NekDouble>& dbase1 =
m_base[1]->GetDbdata();
1793 const Array<OneD, const NekDouble>& dbase2 =
m_base[2]->GetDbdata();
1801 const Array<TwoD, const NekDouble>& df =
1803 const Array<OneD, const NekDouble>& z0 =
m_base[0]->GetZ();
1804 const Array<OneD, const NekDouble>& z2 =
m_base[2]->GetZ();
1808 for (i = 0; i < nquad2; ++i)
1810 Vmath::Fill(nquad0*nquad1, 2.0/(1.0-z2[i]), &h0[0]+i*nquad0*nquad1,1);
1811 Vmath::Fill(nquad0*nquad1, 2.0/(1.0-z2[i]), &h1[0]+i*nquad0*nquad1,1);
1813 for (i = 0; i < nquad0; i++)
1815 Blas::Dscal(nquad1*nquad2, 0.5*(1+z0[i]), &h1[0]+i, nquad0);
1824 Vmath::Vvtvvtp(nqtot, &df[0][0], 1, &h0[0], 1, &df[2][0], 1, &h1[0], 1, &wsp4[0], 1);
1826 Vmath::Vvtvvtp(nqtot, &df[3][0], 1, &h0[0], 1, &df[5][0], 1, &h1[0], 1, &wsp5[0], 1);
1828 Vmath::Vvtvvtp(nqtot, &df[6][0], 1, &h0[0], 1, &df[8][0], 1, &h1[0], 1, &wsp6[0], 1);
1831 Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp4[0], 1, &wsp5[0], 1, &wsp5[0], 1, &g0[0], 1);
1832 Vmath::Vvtvp (nqtot, &wsp6[0], 1, &wsp6[0], 1, &g0[0], 1, &g0[0], 1);
1835 Vmath::Vvtvvtp(nqtot, &df[1][0], 1, &wsp4[0], 1, &df[4][0], 1, &wsp5[0], 1, &g3[0], 1);
1836 Vmath::Vvtvp (nqtot, &df[7][0], 1, &wsp6[0], 1, &g3[0], 1, &g3[0], 1);
1839 Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &wsp4[0], 1, &df[5][0], 1, &wsp5[0], 1, &g4[0], 1);
1840 Vmath::Vvtvp (nqtot, &df[8][0], 1, &wsp6[0], 1, &g4[0], 1, &g4[0], 1);
1844 Vmath::Vvtvvtp(nqtot, &df[1][0], 1, &df[1][0], 1, &df[4][0], 1, &df[4][0], 1, &g1[0], 1);
1845 Vmath::Vvtvp (nqtot, &df[7][0], 1, &df[7][0], 1, &g1[0], 1, &g1[0], 1);
1848 Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &df[2][0], 1, &df[5][0], 1, &df[5][0], 1, &g2[0], 1);
1849 Vmath::Vvtvp (nqtot, &df[8][0], 1, &df[8][0], 1, &g2[0], 1, &g2[0], 1);
1852 Vmath::Vvtvvtp(nqtot, &df[1][0], 1, &df[2][0], 1, &df[4][0], 1, &df[5][0], 1, &g5[0], 1);
1853 Vmath::Vvtvp (nqtot, &df[7][0], 1, &df[8][0], 1, &g5[0], 1, &g5[0], 1);
1858 Vmath::Svtsvtp(nqtot, df[0][0], &h0[0], 1, df[2][0], &h1[0], 1, &wsp4[0], 1);
1860 Vmath::Svtsvtp(nqtot, df[3][0], &h0[0], 1, df[5][0], &h1[0], 1, &wsp5[0], 1);
1862 Vmath::Svtsvtp(nqtot, df[6][0], &h0[0], 1, df[8][0], &h1[0], 1, &wsp6[0], 1);
1865 Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp4[0], 1, &wsp5[0], 1, &wsp5[0], 1, &g0[0], 1);
1866 Vmath::Vvtvp (nqtot, &wsp6[0], 1, &wsp6[0], 1, &g0[0], 1, &g0[0], 1);
1869 Vmath::Svtsvtp(nqtot, df[1][0], &wsp4[0], 1, df[4][0], &wsp5[0], 1, &g3[0], 1);
1870 Vmath::Svtvp (nqtot, df[7][0], &wsp6[0], 1, &g3[0], 1, &g3[0], 1);
1873 Vmath::Svtsvtp(nqtot, df[2][0], &wsp4[0], 1, df[5][0], &wsp5[0], 1, &g4[0], 1);
1874 Vmath::Svtvp (nqtot, df[8][0], &wsp6[0], 1, &g4[0], 1, &g4[0], 1);
1878 Vmath::Fill(nqtot, df[1][0]*df[1][0] + df[4][0]*df[4][0] + df[7][0]*df[7][0], &g1[0], 1);
1881 Vmath::Fill(nqtot, df[2][0]*df[2][0] + df[5][0]*df[5][0] + df[8][0]*df[8][0], &g2[0], 1);
1884 Vmath::Fill(nqtot, df[1][0]*df[2][0] + df[4][0]*df[5][0] + df[7][0]*df[8][0], &g5[0], 1);
1888 Vmath::Vvtvvtp(nqtot,&g0[0],1,&wsp1[0],1,&g3[0],1,&wsp2[0],1,&wsp7[0],1);
1889 Vmath::Vvtvp (nqtot,&g4[0],1,&wsp3[0],1,&wsp7[0],1,&wsp7[0],1);
1890 Vmath::Vvtvvtp(nqtot,&g1[0],1,&wsp2[0],1,&g3[0],1,&wsp1[0],1,&wsp8[0],1);
1891 Vmath::Vvtvp (nqtot,&g5[0],1,&wsp3[0],1,&wsp8[0],1,&wsp8[0],1);
1892 Vmath::Vvtvvtp(nqtot,&g2[0],1,&wsp3[0],1,&g4[0],1,&wsp1[0],1,&wsp9[0],1);
1893 Vmath::Vvtvp (nqtot,&g5[0],1,&wsp2[0],1,&wsp9[0],1,&wsp9[0],1);