44 namespace LocalRegions
63 StdExpansion (Ba.GetNumModes()*Bb.GetNumModes()*Bc.GetNumModes(),3,Ba,Bb,Bc),
64 StdExpansion3D(Ba.GetNumModes()*Bb.GetNumModes()*Bc.GetNumModes(),Ba,Bb,Bc),
65 StdRegions::StdHexExp(Ba,Bb,Bc),
69 boost::bind(&
HexExp::CreateMatrix, this, _1),
70 std::string(
"HexExpMatrix")),
71 m_staticCondMatrixManager(
72 boost::bind(&
HexExp::CreateStaticCondMatrix, this, _1),
73 std::string(
"HexExpStaticCondMatrix"))
86 StdRegions::StdHexExp(T),
89 m_matrixManager(T.m_matrixManager),
90 m_staticCondMatrixManager(T.m_staticCondMatrixManager)
117 const Array<OneD, const NekDouble> &inarray)
119 int nquad0 =
m_base[0]->GetNumPoints();
120 int nquad1 =
m_base[1]->GetNumPoints();
121 int nquad2 =
m_base[2]->GetNumPoints();
124 Array<OneD,NekDouble> tmp(nquad0*nquad1*nquad2);
160 const Array<OneD, const NekDouble> & inarray,
161 Array<OneD,NekDouble> &out_d0,
162 Array<OneD,NekDouble> &out_d1,
163 Array<OneD,NekDouble> &out_d2)
165 int nquad0 =
m_base[0]->GetNumPoints();
166 int nquad1 =
m_base[1]->GetNumPoints();
167 int nquad2 =
m_base[2]->GetNumPoints();
168 int ntot = nquad0 * nquad1 * nquad2;
170 Array<TwoD, const NekDouble> df =
172 Array<OneD,NekDouble> Diff0 = Array<OneD,NekDouble>(ntot);
173 Array<OneD,NekDouble> Diff1 = Array<OneD,NekDouble>(ntot);
174 Array<OneD,NekDouble> Diff2 = Array<OneD,NekDouble>(ntot);
180 if(out_d0.num_elements())
182 Vmath::Vmul (ntot,&df[0][0],1,&Diff0[0],1, &out_d0[0], 1);
183 Vmath::Vvtvp(ntot,&df[1][0],1,&Diff1[0],1, &out_d0[0], 1,
185 Vmath::Vvtvp(ntot,&df[2][0],1,&Diff2[0],1, &out_d0[0], 1,
189 if(out_d1.num_elements())
191 Vmath::Vmul (ntot,&df[3][0],1,&Diff0[0],1, &out_d1[0], 1);
192 Vmath::Vvtvp(ntot,&df[4][0],1,&Diff1[0],1, &out_d1[0], 1,
194 Vmath::Vvtvp(ntot,&df[5][0],1,&Diff2[0],1, &out_d1[0], 1,
198 if(out_d2.num_elements())
200 Vmath::Vmul (ntot,&df[6][0],1,&Diff0[0],1, &out_d2[0], 1);
201 Vmath::Vvtvp(ntot,&df[7][0],1,&Diff1[0],1, &out_d2[0], 1,
203 Vmath::Vvtvp(ntot,&df[8][0],1,&Diff2[0],1, &out_d2[0], 1,
209 if(out_d0.num_elements())
211 Vmath::Smul (ntot,df[0][0],&Diff0[0],1, &out_d0[0], 1);
212 Blas::Daxpy (ntot,df[1][0],&Diff1[0],1, &out_d0[0], 1);
213 Blas::Daxpy (ntot,df[2][0],&Diff2[0],1, &out_d0[0], 1);
216 if(out_d1.num_elements())
218 Vmath::Smul (ntot,df[3][0],&Diff0[0],1, &out_d1[0], 1);
219 Blas::Daxpy (ntot,df[4][0],&Diff1[0],1, &out_d1[0], 1);
220 Blas::Daxpy (ntot,df[5][0],&Diff2[0],1, &out_d1[0], 1);
223 if(out_d2.num_elements())
225 Vmath::Smul (ntot,df[6][0],&Diff0[0],1, &out_d2[0], 1);
226 Blas::Daxpy (ntot,df[7][0],&Diff1[0],1, &out_d2[0], 1);
227 Blas::Daxpy (ntot,df[8][0],&Diff2[0],1, &out_d2[0], 1);
244 const Array<OneD, const NekDouble>& inarray,
245 Array<OneD, NekDouble>& outarray)
269 ASSERTL1(
false,
"input dir is out of range");
289 const Array<OneD, const NekDouble> & inarray,
290 Array<OneD,NekDouble> &outarray)
292 if(
m_base[0]->Collocation() &&
m_base[1]->Collocation()
293 &&
m_base[2]->Collocation())
327 const Array<OneD, const NekDouble> &inarray,
328 Array<OneD, NekDouble> &outarray)
366 const Array<OneD, const NekDouble> &inarray,
367 Array<OneD, NekDouble> &outarray)
369 int nquad0 =
m_base[0]->GetNumPoints();
370 int nquad1 =
m_base[1]->GetNumPoints();
371 int nquad2 =
m_base[2]->GetNumPoints();
372 int order0 =
m_base[0]->GetNumModes();
373 int order1 =
m_base[1]->GetNumModes();
375 Array<OneD, NekDouble> tmp(inarray.num_elements());
376 Array<OneD, NekDouble> wsp(nquad0*nquad1*(nquad2+order0) +
377 order0*order1*nquad2);
389 const Array<OneD, const NekDouble>& inarray,
390 Array<OneD, NekDouble> & outarray)
418 const Array<OneD, const NekDouble>& inarray,
419 Array<OneD, NekDouble> & outarray)
421 ASSERTL1((dir==0)||(dir==1)||(dir==2),
"Invalid direction.");
423 const int nq0 =
m_base[0]->GetNumPoints();
424 const int nq1 =
m_base[1]->GetNumPoints();
425 const int nq2 =
m_base[2]->GetNumPoints();
426 const int nq = nq0*nq1*nq2;
427 const int nm0 =
m_base[0]->GetNumModes();
428 const int nm1 =
m_base[1]->GetNumModes();
430 const Array<TwoD, const NekDouble>& df =
433 Array<OneD, NekDouble> alloc(4*nq +
m_ncoeffs + nm0*nq2*(nq1+nm1));
434 Array<OneD, NekDouble> tmp1 (alloc);
435 Array<OneD, NekDouble> tmp2 (alloc + nq);
436 Array<OneD, NekDouble> tmp3 (alloc + 2*nq);
437 Array<OneD, NekDouble> tmp4 (alloc + 3*nq);
438 Array<OneD, NekDouble> tmp5 (alloc + 4*nq);
439 Array<OneD, NekDouble> wsp (tmp5 +
m_ncoeffs);
445 Vmath::Vmul(nq,&df[3*dir][0], 1,tmp1.get(),1,tmp2.get(),1);
446 Vmath::Vmul(nq,&df[3*dir+1][0],1,tmp1.get(),1,tmp3.get(),1);
447 Vmath::Vmul(nq,&df[3*dir+2][0],1,tmp1.get(),1,tmp4.get(),1);
451 Vmath::Smul(nq, df[3*dir][0], tmp1.get(),1,tmp2.get(), 1);
452 Vmath::Smul(nq, df[3*dir+1][0],tmp1.get(),1,tmp3.get(), 1);
453 Vmath::Smul(nq, df[3*dir+2][0],tmp1.get(),1,tmp4.get(), 1);
480 const Array<OneD, const NekDouble>& inarray,
481 Array<OneD, NekDouble> &outarray)
505 ASSERTL1(
false,
"input dir is out of range");
513 Blas::Dgemv(
'N',
m_ncoeffs,nq,iprodmat->Scale(),(iprodmat->GetOwnedMatrix())->GetPtr().get(),
514 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
529 const Array<OneD, const NekDouble> &Lcoord,
530 const Array<OneD, const NekDouble> &physvals)
537 const Array<OneD, const NekDouble> &coord,
538 const Array<OneD, const NekDouble> & physvals)
540 Array<OneD,NekDouble> Lcoord = Array<OneD,NekDouble>(3);
543 m_geom->GetLocCoords(coord,Lcoord);
555 const Array<OneD, const NekDouble> &Lcoords,
556 Array<OneD,NekDouble> &coords)
560 ASSERTL1(Lcoords[0] >= -1.0 && Lcoords[0] <= 1.0 &&
561 Lcoords[1] >= -1.0 && Lcoords[1] <= 1.0 &&
562 Lcoords[2] >= -1.0 && Lcoords[2] <= 1.0,
563 "Local coordinates are not in region [-1,1]");
567 for(i = 0; i <
m_geom->GetCoordim(); ++i)
569 coords[i] =
m_geom->GetCoord(i,Lcoords);
574 Array<OneD, NekDouble> &coords_0,
575 Array<OneD, NekDouble> &coords_1,
576 Array<OneD, NekDouble> &coords_2)
594 const std::vector<unsigned int > &nummodes,
595 const int mode_offset,
598 int data_order0 = nummodes[mode_offset];
599 int fillorder0 = min(
m_base[0]->GetNumModes(),data_order0);
600 int data_order1 = nummodes[mode_offset+1];
601 int order1 =
m_base[1]->GetNumModes();
602 int fillorder1 = min(order1,data_order1);
603 int data_order2 = nummodes[mode_offset+2];
604 int order2 =
m_base[2]->GetNumModes();
605 int fillorder2 = min(order2,data_order2);
617 "Extraction routine not set up for this basis");
620 "Extraction routine not set up for this basis");
623 for(j = 0; j < fillorder0; ++j)
625 for(i = 0; i < fillorder1; ++i)
634 for(i = fillorder1; i < data_order1; ++i)
639 for(i = fillorder1; i < order1; ++i)
647 ASSERTL0(
false,
"basis is either not set up or not "
672 const Array<OneD, const NekDouble> &inarray,
673 Array<OneD, NekDouble> &outarray,
684 const Array<OneD, const NekDouble> &inarray,
685 Array<OneD, NekDouble> &outarray,
688 int nquad0 =
m_base[0]->GetNumPoints();
689 int nquad1 =
m_base[1]->GetNumPoints();
690 int nquad2 =
m_base[2]->GetNumPoints();
691 Array<OneD, NekDouble> o_tmp(nquad0*nquad1*nquad2);
704 Vmath::Vcopy(nquad0*nquad1,&(inarray[0]),1,&(outarray[0]),1);
709 for (
int j=0; j<nquad1; j++)
711 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+j*nquad0,-1,&(outarray[0])+(j*nquad0),1);
717 for (
int j=0; j<nquad1; j++)
719 Vmath::Vcopy(nquad0,&(inarray[0])+nquad0*(nquad1-1-j),1,&(outarray[0])+(j*nquad0),1);
725 for(
int j=0; j<nquad1; j++)
727 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1-j*nquad0),-1,&(outarray[0])+(j*nquad0),1);
733 for (
int i=0; i<nquad0; i++)
735 Vmath::Vcopy(nquad1,&(inarray[0])+i,nquad0,&(outarray[0])+(i*nquad1),1);
741 for (
int i=0; i<nquad0; i++)
743 Vmath::Vcopy(nquad1,&(inarray[0])+i+nquad0*(nquad1-1),-nquad0,&(outarray[0])+(i*nquad1),1);
749 for (
int i=0; i<nquad0; i++)
751 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0-1-i),nquad0,&(outarray[0])+(i*nquad1),1);
757 for (
int i=0; i<nquad0; i++)
759 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0*nquad1-1-i),-nquad0,&(outarray[0])+(i*nquad1),1);
765 m_base[1]->GetPointsKey(), o_tmp,
766 FaceExp->GetBasis(0)->GetPointsKey(),
767 FaceExp->GetBasis(1)->GetPointsKey(),
774 for (
int k=0; k<nquad2; k++)
777 1,&(outarray[0])+(k*nquad0),1);
783 for (
int k=0; k<nquad2; k++)
785 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+(nquad0*nquad1*k),
786 -1,&(outarray[0])+(k*nquad0),1);
792 for (
int k=0; k<nquad2; k++)
794 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1*(nquad2-1-k)),
795 1,&(outarray[0])+(k*nquad0),1);
801 for(
int k=0; k<nquad2; k++)
803 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+(nquad0*nquad1*(nquad2-1-k)),
804 -1,&(outarray[0])+(k*nquad0),1);
810 for (
int i=0; i<nquad0; i++)
813 &(outarray[0])+(i*nquad2),1);
819 for (
int i=0; i<nquad0; i++)
821 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*(nquad2-1)+i,
822 -nquad0*nquad1,&(outarray[0])+(i*nquad2),1);
828 for (
int i=0; i<nquad0; i++)
830 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0-1-i),nquad0*nquad1,
831 &(outarray[0])+(i*nquad2),1);
837 for (
int i=0; i<nquad0; i++)
839 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*nquad2+(nquad0-1-i),
840 -nquad0*nquad1,&(outarray[0])+(i*nquad2),1);
846 m_base[2]->GetPointsKey(), o_tmp,
847 FaceExp->GetBasis(0)->GetPointsKey(),
848 FaceExp->GetBasis(1)->GetPointsKey(),
856 nquad0,&(outarray[0]),1);
861 for (
int k=0; k<nquad2; k++)
863 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(k*nquad0*nquad1),
864 -nquad0,&(outarray[0])+(k*nquad0),1);
870 for (
int k=0; k<nquad2; k++)
872 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+(nquad0*nquad1*(nquad2-1-k)),
873 nquad0,&(outarray[0])+(k*nquad0),1);
879 for (
int k=0; k<nquad2; k++)
881 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(nquad0*nquad1*(nquad2-1-k)),
882 -nquad0,&(outarray[0])+(k*nquad0),1);
888 for (
int j=0; j<nquad1; j++)
890 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0-1)+(j*nquad0),
891 nquad0*nquad1,&(outarray[0])+(j*nquad2),1);
897 for (
int j=0; j<nquad0; j++)
899 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*(nquad2-1)+nquad0+j*nquad0,
900 -nquad0*nquad1,&(outarray[0])+(j*nquad2),1);
906 for (
int j=0; j<nquad0; j++)
908 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1-1-j*nquad0),
909 nquad0*nquad1,&(outarray[0])+(j*nquad2),1);
915 for (
int j=0; j<nquad0; j++)
917 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1*nquad2-1-j*nquad0),
918 -nquad0*nquad1,&(outarray[0])+(j*nquad2),1);
924 m_base[2]->GetPointsKey(), o_tmp,
925 FaceExp->GetBasis(0)->GetPointsKey(),
926 FaceExp->GetBasis(1)->GetPointsKey(),
933 for (
int k=0; k<nquad2; k++)
935 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*(nquad1-1))+(k*nquad0*nquad1),
936 1,&(outarray[0])+(k*nquad0),1);
942 for (
int k=0; k<nquad2; k++)
944 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(k*nquad0*nquad1),
945 -1,&(outarray[0])+(k*nquad0),1);
951 for (
int k=0; k<nquad2; k++)
953 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*(nquad1-1))+(nquad0*nquad1*(nquad2-1-k)),
954 1,&(outarray[0])+(k*nquad0),1);
960 for (
int k=0; k<nquad2; k++)
962 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(nquad0*nquad1*(nquad2-1-k)),
963 -1,&(outarray[0])+(k*nquad0),1);
969 for (
int i=0; i<nquad0; i++)
971 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*(nquad1-1)+i,nquad0*nquad1,
972 &(outarray[0])+(i*nquad2),1);
978 for (
int i=0; i<nquad0; i++)
980 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*(nquad1*nquad2-1)+i,-nquad0*nquad1,
981 &(outarray[0])+(i*nquad2),1);
987 for (
int i=0; i<nquad0; i++)
989 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1-1-i),nquad0*nquad1,
990 &(outarray[0])+(i*nquad2),1);
996 for (
int i=0; i<nquad0; i++)
998 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1*nquad2-1-i),-nquad0*nquad1,
999 &(outarray[0])+(i*nquad2),1);
1005 m_base[2]->GetPointsKey(), o_tmp,
1006 FaceExp->GetBasis(0)->GetPointsKey(),
1007 FaceExp->GetBasis(1)->GetPointsKey(),
1014 Vmath::Vcopy(nquad0*nquad1,&(inarray[0]),nquad0,&(outarray[0]),1);
1019 for (
int k=0; k<nquad2; k++)
1021 Vmath::Vcopy(nquad0,&(inarray[0])+nquad0*(nquad1-1)+(k*nquad0*nquad1),
1022 -nquad0,&(outarray[0])+(k*nquad0),1);
1028 for (
int k=0; k<nquad2; k++)
1030 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1*(nquad2-1-k)),
1031 nquad0,&(outarray[0])+(k*nquad0),1);
1037 for (
int k=0; k<nquad2; k++)
1039 Vmath::Vcopy(nquad0,&(inarray[0])+nquad0*(nquad1-1)+(nquad0*nquad1*(nquad2-1-k)),
1040 -nquad0,&(outarray[0])+(k*nquad0),1);
1046 for (
int j=0; j<nquad0; j++)
1048 Vmath::Vcopy(nquad2,&(inarray[0])+j*nquad0,nquad0*nquad1,
1049 &(outarray[0])+(j*nquad2),1);
1055 for (
int j=0; j<nquad0; j++)
1057 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*(nquad2-1)+j*nquad0,
1058 -nquad0*nquad1,&(outarray[0])+(j*nquad2),1);
1064 for (
int j=0; j<nquad0; j++)
1066 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*(nquad1-1)-j*nquad0),
1067 nquad0*nquad1,&(outarray[0])+(j*nquad2),1);
1073 for (
int j=0; j<nquad0; j++)
1075 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*(nquad1*nquad2-1)-j*nquad0),
1076 -nquad0*nquad1,&(outarray[0])+(j*nquad2),1);
1082 m_base[2]->GetPointsKey(), o_tmp,
1083 FaceExp->GetBasis(0)->GetPointsKey(),
1084 FaceExp->GetBasis(1)->GetPointsKey(),
1091 Vmath::Vcopy(nquad0*nquad1,&(inarray[0])+nquad0*nquad1*(nquad2-1),1,&(outarray[0]),1);
1096 for (
int j=0; j<nquad1; j++)
1098 Vmath::Vcopy(nquad0,&(inarray[0])+nquad0*nquad1*(nquad2-1)+(nquad0-1+j*nquad0),
1099 -1,&(outarray[0])+(j*nquad0),1);
1105 for (
int j=0; j<nquad1; j++)
1107 Vmath::Vcopy(nquad0,&(inarray[0])+((nquad0*nquad1*nquad2-1)-(nquad0-1)-j*nquad0),
1108 1,&(outarray[0])+(j*nquad0),1);
1114 for (
int j=0; j<nquad1; j++)
1116 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1*nquad2-1-j*nquad0),
1117 -1,&(outarray[0])+(j*nquad0),1);
1123 for (
int i=0; i<nquad0; i++)
1125 Vmath::Vcopy(nquad1,&(inarray[0])+nquad0*nquad1*(nquad2-1)+i,nquad0,
1126 &(outarray[0])+(i*nquad1),1);
1132 for (
int i=0; i<nquad0; i++)
1134 Vmath::Vcopy(nquad1,&(inarray[0])+nquad0*(nquad1*nquad2-1)+i,-nquad0,
1135 &(outarray[0])+(i*nquad1),1);
1141 for (
int i=0; i<nquad0; i++)
1143 Vmath::Vcopy(nquad1,&(inarray[0])+nquad0*nquad1*(nquad2-1)+(nquad0-1-i),
1144 nquad0,&(outarray[0])+(i*nquad1),1);
1150 for (
int i=0; i<nquad0; i++)
1152 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0*nquad1*nquad2-1-i),-nquad0,
1153 &(outarray[0])+(i*nquad1),1);
1159 m_base[1]->GetPointsKey(), o_tmp,
1160 FaceExp->GetBasis(0)->GetPointsKey(),
1161 FaceExp->GetBasis(1)->GetPointsKey(),
1165 ASSERTL0(
false,
"face value (> 5) is out of range");
1178 const Array<TwoD, const NekDouble> & df = geomFactors->GetDerivFactors(ptsKeys);
1179 const Array<OneD, const NekDouble> & jac = geomFactors->GetJac(ptsKeys);
1181 int nqe0 =
m_base[0]->GetNumPoints();
1182 int nqe1 =
m_base[1]->GetNumPoints();
1183 int nqe2 =
m_base[2]->GetNumPoints();
1184 int nqe01 = nqe0*nqe1;
1185 int nqe02 = nqe0*nqe2;
1186 int nqe12 = nqe1*nqe2;
1189 if (face == 0 || face == 5)
1193 else if (face == 1 || face == 3)
1204 m_faceNormals[face] = Array<OneD, Array<OneD, NekDouble> >(vCoordDim);
1205 Array<OneD, Array<OneD, NekDouble> > &normal =
m_faceNormals[face];
1206 for (i = 0; i < vCoordDim; ++i)
1208 normal[i] = Array<OneD, NekDouble>(nqe);
1218 for(i = 0; i < vCoordDim; ++i)
1224 for(i = 0; i < vCoordDim; ++i)
1230 for(i = 0; i < vCoordDim; ++i)
1236 for(i = 0; i < vCoordDim; ++i)
1242 for(i = 0; i < vCoordDim; ++i)
1248 for(i = 0; i < vCoordDim; ++i)
1254 ASSERTL0(
false,
"face is out of range (edge < 5)");
1259 for(i =0 ; i < vCoordDim; ++i)
1261 fac += normal[i][0]*normal[i][0];
1263 fac = 1.0/sqrt(fac);
1264 for (i = 0; i < vCoordDim; ++i)
1274 Array<OneD,NekDouble> work(nqe,0.0);
1282 for(j = 0; j < nqe; ++j)
1284 normal[0][j] = -df[2][j]*jac[j];
1285 normal[1][j] = -df[5][j]*jac[j];
1286 normal[2][j] = -df[8][j]*jac[j];
1290 for (j = 0; j < nqe0; ++j)
1292 for(k = 0; k < nqe2; ++k)
1294 int idx = j + nqe01*k;
1295 normal[0][j+k*nqe0] = -df[1][idx]*jac[idx];
1296 normal[1][j+k*nqe0] = -df[4][idx]*jac[idx];
1297 normal[2][j+k*nqe0] = -df[7][idx]*jac[idx];
1302 for (j = 0; j < nqe1; ++j)
1304 for(k = 0; k < nqe2; ++k)
1306 int idx = nqe0-1+nqe0*j+nqe01*k;
1307 normal[0][j+k*nqe0] = df[0][idx]*jac[idx];
1308 normal[1][j+k*nqe0] = df[3][idx]*jac[idx];
1309 normal[2][j+k*nqe0] = df[6][idx]*jac[idx];
1314 for (j = 0; j < nqe0; ++j)
1316 for(k = 0; k < nqe2; ++k)
1318 int idx = nqe0*(nqe1-1)+j+nqe01*k;
1319 normal[0][j+k*nqe0] = df[1][idx]*jac[idx];
1320 normal[1][j+k*nqe0] = df[4][idx]*jac[idx];
1321 normal[2][j+k*nqe0] = df[7][idx]*jac[idx];
1326 for (j = 0; j < nqe0; ++j)
1328 for(k = 0; k < nqe2; ++k)
1330 int idx = j*nqe0+nqe01*k;
1331 normal[0][j+k*nqe0] = -df[0][idx]*jac[idx];
1332 normal[1][j+k*nqe0] = -df[3][idx]*jac[idx];
1333 normal[2][j+k*nqe0] = -df[6][idx]*jac[idx];
1338 for (j = 0; j < nqe01; ++j)
1340 int idx = j+nqe01*(nqe2-1);
1341 normal[0][j] = df[2][idx]*jac[idx];
1342 normal[1][j] = df[5][idx]*jac[idx];
1343 normal[2][j] = df[8][idx]*jac[idx];
1347 ASSERTL0(
false,
"face is out of range (face < 5)");
1362 Vmath::Vvtvp(nqe,normal[i],1, normal[i],1,work,1,work,1);
1379 const Array<OneD, const NekDouble> &inarray,
1380 Array<OneD,NekDouble> &outarray,
1387 const Array<OneD, const NekDouble> &inarray,
1388 Array<OneD,NekDouble> &outarray,
1397 const Array<OneD, const NekDouble> &inarray,
1398 Array<OneD,NekDouble> &outarray,
1407 const Array<OneD, const NekDouble> &inarray,
1408 Array<OneD,NekDouble> &outarray,
1415 const Array<OneD, const NekDouble> &inarray,
1416 Array<OneD,NekDouble> &outarray,
1424 const Array<OneD, const NekDouble> &inarray,
1425 Array<OneD,NekDouble> &outarray,
1433 const Array<OneD, const NekDouble> &inarray,
1434 Array<OneD,NekDouble> &outarray,
1442 const Array<OneD, const NekDouble> &inarray,
1443 Array<OneD,NekDouble> &outarray,
1474 if(inarray.get() == outarray.get())
1479 Blas::Dgemv(
'N',
m_ncoeffs,
m_ncoeffs,mat->Scale(),(mat->GetOwnedMatrix())->GetPtr().get(),
1480 m_ncoeffs, tmp.get(), 1, 0.0, outarray.get(), 1);
1484 Blas::Dgemv(
'N',
m_ncoeffs,
m_ncoeffs,mat->Scale(),(mat->GetOwnedMatrix())->GetPtr().get(),
1485 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
1502 const Array<OneD, const NekDouble> &inarray,
1503 Array<OneD, NekDouble> &outarray)
1505 int n_coeffs = inarray.num_elements();
1506 int nmodes0 =
m_base[0]->GetNumModes();
1507 int nmodes1 =
m_base[1]->GetNumModes();
1508 int nmodes2 =
m_base[2]->GetNumModes();
1509 int numMax = nmodes0;
1511 Array<OneD, NekDouble> coeff (n_coeffs);
1512 Array<OneD, NekDouble> coeff_tmp1(nmodes0*nmodes1, 0.0);
1513 Array<OneD, NekDouble> coeff_tmp2(n_coeffs, 0.0);
1514 Array<OneD, NekDouble> tmp, tmp2, tmp3, tmp4;
1539 b0, b1, b2, coeff_tmp2,
1540 bortho0, bortho1, bortho2, coeff);
1544 int cnt = 0, cnt2 = 0;
1546 for (
int u = 0; u < numMin+1; ++u)
1548 for (
int i = 0; i < numMin; ++i)
1551 tmp = coeff+cnt+cnt2,1,
1552 tmp2 = coeff_tmp1+cnt,1);
1558 tmp3 = coeff_tmp1,1,
1559 tmp4 = coeff_tmp2+cnt2,1);
1561 cnt2 = u*nmodes0*nmodes1;
1565 bortho0, bortho1, bortho2, coeff_tmp2,
1566 b0, b1, b2, outarray);
1606 return tmp->GetStdMatrix(mkey);
1616 "Geometric information is not set up");
1679 Array<TwoD, const NekDouble> df
1709 int rows = deriv0.GetRows();
1710 int cols = deriv1.GetColumns();
1715 (*WeakDeriv) = df[3*dir ][0]*deriv0
1716 + df[3*dir+1][0]*deriv1
1717 + df[3*dir+2][0]*deriv2;
1760 Array<TwoD, const NekDouble> gmat
1763 int rows = lap00.GetRows();
1764 int cols = lap00.GetColumns();
1769 (*lap) = gmat[0][0]*lap00
1774 + gmat[7][0]*(lap12 +
Transpose(lap12));
1791 int rows = LapMat.GetRows();
1792 int cols = LapMat.GetColumns();
1797 (*helm) = LapMat + lambda*MassMat;
1943 unsigned int nint = (
unsigned int)(
m_ncoeffs - nbdry);
1944 unsigned int exp_size[] = {nbdry,nint};
1945 unsigned int nblks = 2;
1956 goto UseLocRegionsMatrix;
1963 goto UseLocRegionsMatrix;
1968 factor = mat->Scale();
1969 goto UseStdRegionsMatrix;
1972 UseStdRegionsMatrix:
1986 UseLocRegionsMatrix:
1997 Array<OneD,unsigned int> bmap(nbdry);
1998 Array<OneD,unsigned int> imap(nint);
2002 for(i = 0; i < nbdry; ++i)
2004 for(j = 0; j < nbdry; ++j)
2006 (*A)(i,j) = mat(bmap[i],bmap[j]);
2009 for(j = 0; j < nint; ++j)
2011 (*B)(i,j) = mat(bmap[i],imap[j]);
2015 for(i = 0; i < nint; ++i)
2017 for(j = 0; j < nbdry; ++j)
2019 (*C)(i,j) = mat(imap[i],bmap[j]);
2022 for(j = 0; j < nint; ++j)
2024 (*D)(i,j) = mat(imap[i],imap[j]);
2033 (*A) = (*A) - (*B)*(*C);
2067 const Array<OneD, const NekDouble> &inarray,
2068 Array<OneD, NekDouble> &outarray,
2069 Array<OneD, NekDouble> &wsp)
2078 int nquad0 =
m_base[0]->GetNumPoints();
2079 int nquad1 =
m_base[1]->GetNumPoints();
2080 int nquad2 =
m_base[2]->GetNumPoints();
2081 int nqtot = nquad0*nquad1*nquad2;
2083 ASSERTL1(wsp.num_elements() >= 6*nqtot,
2084 "Insufficient workspace size.");
2086 const Array<OneD, const NekDouble>& base0 =
m_base[0]->GetBdata();
2087 const Array<OneD, const NekDouble>& base1 =
m_base[1]->GetBdata();
2088 const Array<OneD, const NekDouble>& base2 =
m_base[2]->GetBdata();
2089 const Array<OneD, const NekDouble>& dbase0 =
m_base[0]->GetDbdata();
2090 const Array<OneD, const NekDouble>& dbase1 =
m_base[1]->GetDbdata();
2091 const Array<OneD, const NekDouble>& dbase2 =
m_base[2]->GetDbdata();
2100 Array<OneD,NekDouble> wsp0(wsp);
2101 Array<OneD,NekDouble> wsp1(wsp+1*nqtot);
2102 Array<OneD,NekDouble> wsp2(wsp+2*nqtot);
2103 Array<OneD,NekDouble> wsp3(wsp+3*nqtot);
2104 Array<OneD,NekDouble> wsp4(wsp+4*nqtot);
2105 Array<OneD,NekDouble> wsp5(wsp+5*nqtot);
2113 Vmath::Vvtvvtp(nqtot,&metric00[0],1,&wsp0[0],1,&metric01[0],1,&wsp1[0],1,&wsp3[0],1);
2114 Vmath::Vvtvp (nqtot,&metric02[0],1,&wsp2[0],1,&wsp3[0],1,&wsp3[0],1);
2115 Vmath::Vvtvvtp(nqtot,&metric01[0],1,&wsp0[0],1,&metric11[0],1,&wsp1[0],1,&wsp4[0],1);
2116 Vmath::Vvtvp (nqtot,&metric12[0],1,&wsp2[0],1,&wsp4[0],1,&wsp4[0],1);
2117 Vmath::Vvtvvtp(nqtot,&metric02[0],1,&wsp0[0],1,&metric12[0],1,&wsp1[0],1,&wsp5[0],1);
2118 Vmath::Vvtvp (nqtot,&metric22[0],1,&wsp2[0],1,&wsp5[0],1,&wsp5[0],1);
2139 const unsigned int dim = 3;
2145 for (
unsigned int i = 0; i < dim; ++i)
2147 for (
unsigned int j = i; j < dim; ++j)
2149 m_metrics[m[i][j]] = Array<OneD, NekDouble>(nqtot);
2150 const Array<TwoD, const NekDouble> &gmat =