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 "
666 const Array<OneD, const NekDouble> &inarray,
667 Array<OneD, NekDouble> &outarray,
678 const Array<OneD, const NekDouble> &inarray,
679 Array<OneD, NekDouble> &outarray,
682 int nquad0 =
m_base[0]->GetNumPoints();
683 int nquad1 =
m_base[1]->GetNumPoints();
684 int nquad2 =
m_base[2]->GetNumPoints();
698 Vmath::Vcopy(nquad0*nquad1,&(inarray[0]),1,&(o_tmp[0]),1);
703 for (
int j=0; j<nquad1; j++)
705 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+j*nquad0,-1,&(o_tmp[0])+(j*nquad0),1);
711 for (
int j=0; j<nquad1; j++)
713 Vmath::Vcopy(nquad0,&(inarray[0])+nquad0*(nquad1-1-j),1,&(o_tmp[0])+(j*nquad0),1);
719 for(
int j=0; j<nquad1; j++)
721 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1-j*nquad0),-1,&(o_tmp[0])+(j*nquad0),1);
727 for (
int i=0; i<nquad0; i++)
729 Vmath::Vcopy(nquad1,&(inarray[0])+i,nquad0,&(o_tmp[0])+(i*nquad1),1);
735 for (
int i=0; i<nquad0; i++)
737 Vmath::Vcopy(nquad1,&(inarray[0])+i+nquad0*(nquad1-1),-nquad0,&(o_tmp[0])+(i*nquad1),1);
743 for (
int i=0; i<nquad0; i++)
745 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0-1-i),nquad0,&(o_tmp[0])+(i*nquad1),1);
751 for (
int i=0; i<nquad0; i++)
753 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0*nquad1-1-i),-nquad0,&(o_tmp[0])+(i*nquad1),1);
758 m_base[1]->GetPointsKey(), o_tmp,
759 FaceExp->GetBasis(0)->GetPointsKey(),
760 FaceExp->GetBasis(1)->GetPointsKey(),
767 for (
int k=0; k<nquad2; k++)
770 1,&(o_tmp[0])+(k*nquad0),1);
776 for (
int k=0; k<nquad2; k++)
778 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+(nquad0*nquad1*k),
779 -1,&(o_tmp[0])+(k*nquad0),1);
785 for (
int k=0; k<nquad2; k++)
787 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1*(nquad2-1-k)),
788 1,&(o_tmp[0])+(k*nquad0),1);
794 for(
int k=0; k<nquad2; k++)
796 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+(nquad0*nquad1*(nquad2-1-k)),
797 -1,&(o_tmp[0])+(k*nquad0),1);
803 for (
int i=0; i<nquad0; i++)
806 &(o_tmp[0])+(i*nquad2),1);
812 for (
int i=0; i<nquad0; i++)
814 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*(nquad2-1)+i,
815 -nquad0*nquad1,&(o_tmp[0])+(i*nquad2),1);
821 for (
int i=0; i<nquad0; i++)
823 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0-1-i),nquad0*nquad1,
824 &(o_tmp[0])+(i*nquad2),1);
830 for (
int i=0; i<nquad0; i++)
832 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*nquad2+(nquad0-1-i),
833 -nquad0*nquad1,&(o_tmp[0])+(i*nquad2),1);
838 m_base[2]->GetPointsKey(), o_tmp,
839 FaceExp->GetBasis(0)->GetPointsKey(),
840 FaceExp->GetBasis(1)->GetPointsKey(),
848 nquad0,&(o_tmp[0]),1);
853 for (
int k=0; k<nquad2; k++)
855 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(k*nquad0*nquad1),
856 -nquad0,&(o_tmp[0])+(k*nquad0),1);
862 for (
int k=0; k<nquad2; k++)
864 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+(nquad0*nquad1*(nquad2-1-k)),
865 nquad0,&(o_tmp[0])+(k*nquad0),1);
871 for (
int k=0; k<nquad2; k++)
873 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(nquad0*nquad1*(nquad2-1-k)),
874 -nquad0,&(o_tmp[0])+(k*nquad0),1);
880 for (
int j=0; j<nquad1; j++)
882 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0-1)+(j*nquad0),
883 nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
889 for (
int j=0; j<nquad0; j++)
891 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*(nquad2-1)+nquad0+j*nquad0,
892 -nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
898 for (
int j=0; j<nquad0; j++)
900 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1-1-j*nquad0),
901 nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
907 for (
int j=0; j<nquad0; j++)
909 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1*nquad2-1-j*nquad0),
910 -nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
915 m_base[2]->GetPointsKey(), o_tmp,
916 FaceExp->GetBasis(0)->GetPointsKey(),
917 FaceExp->GetBasis(1)->GetPointsKey(),
924 for (
int k=0; k<nquad2; k++)
926 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*(nquad1-1))+(k*nquad0*nquad1),
927 1,&(o_tmp[0])+(k*nquad0),1);
933 for (
int k=0; k<nquad2; k++)
935 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(k*nquad0*nquad1),
936 -1,&(o_tmp[0])+(k*nquad0),1);
942 for (
int k=0; k<nquad2; k++)
944 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*(nquad1-1))+(nquad0*nquad1*(nquad2-1-k)),
945 1,&(o_tmp[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,&(o_tmp[0])+(k*nquad0),1);
960 for (
int i=0; i<nquad0; i++)
962 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*(nquad1-1)+i,nquad0*nquad1,
963 &(o_tmp[0])+(i*nquad2),1);
969 for (
int i=0; i<nquad0; i++)
971 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*(nquad1*nquad2-1)+i,-nquad0*nquad1,
972 &(o_tmp[0])+(i*nquad2),1);
978 for (
int i=0; i<nquad0; i++)
980 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1-1-i),nquad0*nquad1,
981 &(o_tmp[0])+(i*nquad2),1);
987 for (
int i=0; i<nquad0; i++)
989 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1*nquad2-1-i),-nquad0*nquad1,
990 &(o_tmp[0])+(i*nquad2),1);
995 m_base[2]->GetPointsKey(), o_tmp,
996 FaceExp->GetBasis(0)->GetPointsKey(),
997 FaceExp->GetBasis(1)->GetPointsKey(),
1004 Vmath::Vcopy(nquad0*nquad1,&(inarray[0]),nquad0,&(o_tmp[0]),1);
1009 for (
int k=0; k<nquad2; k++)
1011 Vmath::Vcopy(nquad0,&(inarray[0])+nquad0*(nquad1-1)+(k*nquad0*nquad1),
1012 -nquad0,&(o_tmp[0])+(k*nquad0),1);
1018 for (
int k=0; k<nquad2; k++)
1020 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1*(nquad2-1-k)),
1021 nquad0,&(o_tmp[0])+(k*nquad0),1);
1027 for (
int k=0; k<nquad2; k++)
1029 Vmath::Vcopy(nquad0,&(inarray[0])+nquad0*(nquad1-1)+(nquad0*nquad1*(nquad2-1-k)),
1030 -nquad0,&(o_tmp[0])+(k*nquad0),1);
1036 for (
int j=0; j<nquad0; j++)
1038 Vmath::Vcopy(nquad2,&(inarray[0])+j*nquad0,nquad0*nquad1,
1039 &(o_tmp[0])+(j*nquad2),1);
1045 for (
int j=0; j<nquad0; j++)
1047 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*(nquad2-1)+j*nquad0,
1048 -nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
1054 for (
int j=0; j<nquad0; j++)
1056 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*(nquad1-1)-j*nquad0),
1057 nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
1063 for (
int j=0; j<nquad0; j++)
1065 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*(nquad1*nquad2-1)-j*nquad0),
1066 -nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
1071 m_base[2]->GetPointsKey(), o_tmp,
1072 FaceExp->GetBasis(0)->GetPointsKey(),
1073 FaceExp->GetBasis(1)->GetPointsKey(),
1080 Vmath::Vcopy(nquad0*nquad1,&(inarray[0])+nquad0*nquad1*(nquad2-1),1,&(o_tmp[0]),1);
1085 for (
int j=0; j<nquad1; j++)
1087 Vmath::Vcopy(nquad0,&(inarray[0])+nquad0*nquad1*(nquad2-1)+(nquad0-1+j*nquad0),
1088 -1,&(o_tmp[0])+(j*nquad0),1);
1094 for (
int j=0; j<nquad1; j++)
1096 Vmath::Vcopy(nquad0,&(inarray[0])+((nquad0*nquad1*nquad2-1)-(nquad0-1)-j*nquad0),
1097 1,&(o_tmp[0])+(j*nquad0),1);
1103 for (
int j=0; j<nquad1; j++)
1105 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1*nquad2-1-j*nquad0),
1106 -1,&(o_tmp[0])+(j*nquad0),1);
1112 for (
int i=0; i<nquad0; i++)
1114 Vmath::Vcopy(nquad1,&(inarray[0])+nquad0*nquad1*(nquad2-1)+i,nquad0,
1115 &(o_tmp[0])+(i*nquad1),1);
1121 for (
int i=0; i<nquad0; i++)
1123 Vmath::Vcopy(nquad1,&(inarray[0])+nquad0*(nquad1*nquad2-1)+i,-nquad0,
1124 &(o_tmp[0])+(i*nquad1),1);
1130 for (
int i=0; i<nquad0; i++)
1132 Vmath::Vcopy(nquad1,&(inarray[0])+nquad0*nquad1*(nquad2-1)+(nquad0-1-i),
1133 nquad0,&(o_tmp[0])+(i*nquad1),1);
1139 for (
int i=0; i<nquad0; i++)
1141 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0*nquad1*nquad2-1-i),-nquad0,
1142 &(o_tmp[0])+(i*nquad1),1);
1147 m_base[1]->GetPointsKey(), o_tmp,
1148 FaceExp->GetBasis(0)->GetPointsKey(),
1149 FaceExp->GetBasis(1)->GetPointsKey(),
1153 ASSERTL0(
false,
"face value (> 5) is out of range");
1166 const Array<TwoD, const NekDouble> & df = geomFactors->GetDerivFactors(ptsKeys);
1167 const Array<OneD, const NekDouble> & jac = geomFactors->GetJac(ptsKeys);
1177 m_faceNormals[face] = Array<OneD, Array<OneD, NekDouble> >(vCoordDim);
1178 Array<OneD, Array<OneD, NekDouble> > &normal =
m_faceNormals[face];
1179 for (i = 0; i < vCoordDim; ++i)
1181 normal[i] = Array<OneD, NekDouble>(nq_face);
1191 for(i = 0; i < vCoordDim; ++i)
1193 normal[i][0] = -df[3*i+2][0];
1197 for(i = 0; i < vCoordDim; ++i)
1199 normal[i][0] = -df[3*i+1][0];
1203 for(i = 0; i < vCoordDim; ++i)
1205 normal[i][0] = df[3*i][0];
1209 for(i = 0; i < vCoordDim; ++i)
1211 normal[i][0] = df[3*i+1][0];
1215 for(i = 0; i < vCoordDim; ++i)
1217 normal[i][0] = -df[3*i][0];
1221 for(i = 0; i < vCoordDim; ++i)
1223 normal[i][0] = df[3*i+2][0];
1227 ASSERTL0(
false,
"face is out of range (edge < 5)");
1232 for(i =0 ; i < vCoordDim; ++i)
1234 fac += normal[i][0]*normal[i][0];
1236 fac = 1.0/sqrt(fac);
1237 for (i = 0; i < vCoordDim; ++i)
1239 Vmath::Fill(nq_face,fac*normal[i][0],normal[i],1);
1247 int nqe0 =
m_base[0]->GetNumPoints();
1248 int nqe1 =
m_base[1]->GetNumPoints();
1249 int nqe2 =
m_base[2]->GetNumPoints();
1250 int nqe01 = nqe0*nqe1;
1251 int nqe02 = nqe0*nqe2;
1252 int nqe12 = nqe1*nqe2;
1255 if (face == 0 || face == 5)
1259 else if (face == 1 || face == 3)
1271 Array<OneD, NekDouble> normals(vCoordDim*nqe,0.0);
1279 for(j = 0; j < nqe; ++j)
1281 normals[j] = -df[2][j]*jac[j];
1282 normals[nqe+j] = -df[5][j]*jac[j];
1283 normals[2*nqe+j] = -df[8][j]*jac[j];
1286 points0 = ptsKeys[0];
1287 points1 = ptsKeys[1];
1290 for (j = 0; j < nqe0; ++j)
1292 for(k = 0; k < nqe2; ++k)
1294 int idx = j + nqe01*k;
1295 normals[j+k*nqe0] = -df[1][idx]*jac[idx];
1296 normals[nqe+j+k*nqe0] = -df[4][idx]*jac[idx];
1297 normals[2*nqe+j+k*nqe0] = -df[7][idx]*jac[idx];
1300 points0 = ptsKeys[0];
1301 points1 = ptsKeys[2];
1304 for (j = 0; j < nqe1; ++j)
1306 for(k = 0; k < nqe2; ++k)
1308 int idx = nqe0-1+nqe0*j+nqe01*k;
1309 normals[j+k*nqe0] = df[0][idx]*jac[idx];
1310 normals[nqe+j+k*nqe0] = df[3][idx]*jac[idx];
1311 normals[2*nqe+j+k*nqe0] = df[6][idx]*jac[idx];
1314 points0 = ptsKeys[1];
1315 points1 = ptsKeys[2];
1318 for (j = 0; j < nqe0; ++j)
1320 for(k = 0; k < nqe2; ++k)
1322 int idx = nqe0*(nqe1-1)+j+nqe01*k;
1323 normals[j+k*nqe0] = df[1][idx]*jac[idx];
1324 normals[nqe+j+k*nqe0] = df[4][idx]*jac[idx];
1325 normals[2*nqe+j+k*nqe0] = df[7][idx]*jac[idx];
1328 points0 = ptsKeys[0];
1329 points1 = ptsKeys[2];
1332 for (j = 0; j < nqe0; ++j)
1334 for(k = 0; k < nqe2; ++k)
1336 int idx = j*nqe0+nqe01*k;
1337 normals[j+k*nqe0] = -df[0][idx]*jac[idx];
1338 normals[nqe+j+k*nqe0] = -df[3][idx]*jac[idx];
1339 normals[2*nqe+j+k*nqe0] = -df[6][idx]*jac[idx];
1342 points0 = ptsKeys[1];
1343 points1 = ptsKeys[2];
1346 for (j = 0; j < nqe01; ++j)
1348 int idx = j+nqe01*(nqe2-1);
1349 normals[j] = df[2][idx]*jac[idx];
1350 normals[nqe+j] = df[5][idx]*jac[idx];
1351 normals[2*nqe+j] = df[8][idx]*jac[idx];
1353 points0 = ptsKeys[0];
1354 points1 = ptsKeys[1];
1357 ASSERTL0(
false,
"face is out of range (face < 5)");
1360 Array<OneD, NekDouble> work (nq_face, 0.0);
1377 Vmath::Vmul(nq_face,work,1,normal[i],1,normal[i],1);
1384 Vmath::Vvtvp(nq_face,normal[i],1, normal[i],1,work,1,work,1);
1392 Vmath::Vmul(nq_face,normal[i],1,work,1,normal[i],1);
1401 const Array<OneD, const NekDouble> &inarray,
1402 Array<OneD,NekDouble> &outarray,
1409 const Array<OneD, const NekDouble> &inarray,
1410 Array<OneD,NekDouble> &outarray,
1419 const Array<OneD, const NekDouble> &inarray,
1420 Array<OneD,NekDouble> &outarray,
1429 const Array<OneD, const NekDouble> &inarray,
1430 Array<OneD,NekDouble> &outarray,
1437 const Array<OneD, const NekDouble> &inarray,
1438 Array<OneD,NekDouble> &outarray,
1446 const Array<OneD, const NekDouble> &inarray,
1447 Array<OneD,NekDouble> &outarray,
1455 const Array<OneD, const NekDouble> &inarray,
1456 Array<OneD,NekDouble> &outarray,
1464 const Array<OneD, const NekDouble> &inarray,
1465 Array<OneD,NekDouble> &outarray,
1496 if(inarray.get() == outarray.get())
1501 Blas::Dgemv(
'N',
m_ncoeffs,
m_ncoeffs,mat->Scale(),(mat->GetOwnedMatrix())->GetPtr().get(),
1502 m_ncoeffs, tmp.get(), 1, 0.0, outarray.get(), 1);
1506 Blas::Dgemv(
'N',
m_ncoeffs,
m_ncoeffs,mat->Scale(),(mat->GetOwnedMatrix())->GetPtr().get(),
1507 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
1524 const Array<OneD, const NekDouble> &inarray,
1525 Array<OneD, NekDouble> &outarray)
1527 int n_coeffs = inarray.num_elements();
1528 int nmodes0 =
m_base[0]->GetNumModes();
1529 int nmodes1 =
m_base[1]->GetNumModes();
1530 int nmodes2 =
m_base[2]->GetNumModes();
1531 int numMax = nmodes0;
1533 Array<OneD, NekDouble> coeff (n_coeffs);
1534 Array<OneD, NekDouble> coeff_tmp1(nmodes0*nmodes1, 0.0);
1535 Array<OneD, NekDouble> coeff_tmp2(n_coeffs, 0.0);
1536 Array<OneD, NekDouble> tmp, tmp2, tmp3, tmp4;
1561 b0, b1, b2, coeff_tmp2,
1562 bortho0, bortho1, bortho2, coeff);
1566 int cnt = 0, cnt2 = 0;
1568 for (
int u = 0; u < numMin+1; ++u)
1570 for (
int i = 0; i < numMin; ++i)
1573 tmp = coeff+cnt+cnt2,1,
1574 tmp2 = coeff_tmp1+cnt,1);
1580 tmp3 = coeff_tmp1,1,
1581 tmp4 = coeff_tmp2+cnt2,1);
1583 cnt2 = u*nmodes0*nmodes1;
1587 bortho0, bortho1, bortho2, coeff_tmp2,
1588 b0, b1, b2, outarray);
1628 return tmp->GetStdMatrix(mkey);
1638 "Geometric information is not set up");
1701 Array<TwoD, const NekDouble> df
1731 int rows = deriv0.GetRows();
1732 int cols = deriv1.GetColumns();
1737 (*WeakDeriv) = df[3*dir ][0]*deriv0
1738 + df[3*dir+1][0]*deriv1
1739 + df[3*dir+2][0]*deriv2;
1782 Array<TwoD, const NekDouble> gmat
1785 int rows = lap00.GetRows();
1786 int cols = lap00.GetColumns();
1791 (*lap) = gmat[0][0]*lap00
1796 + gmat[7][0]*(lap12 +
Transpose(lap12));
1813 int rows = LapMat.GetRows();
1814 int cols = LapMat.GetColumns();
1819 (*helm) = LapMat + lambda*MassMat;
1965 unsigned int nint = (
unsigned int)(
m_ncoeffs - nbdry);
1966 unsigned int exp_size[] = {nbdry,nint};
1967 unsigned int nblks = 2;
1978 goto UseLocRegionsMatrix;
1985 goto UseLocRegionsMatrix;
1990 factor = mat->Scale();
1991 goto UseStdRegionsMatrix;
1994 UseStdRegionsMatrix:
2008 UseLocRegionsMatrix:
2019 Array<OneD,unsigned int> bmap(nbdry);
2020 Array<OneD,unsigned int> imap(nint);
2024 for(i = 0; i < nbdry; ++i)
2026 for(j = 0; j < nbdry; ++j)
2028 (*A)(i,j) = mat(bmap[i],bmap[j]);
2031 for(j = 0; j < nint; ++j)
2033 (*B)(i,j) = mat(bmap[i],imap[j]);
2037 for(i = 0; i < nint; ++i)
2039 for(j = 0; j < nbdry; ++j)
2041 (*C)(i,j) = mat(imap[i],bmap[j]);
2044 for(j = 0; j < nint; ++j)
2046 (*D)(i,j) = mat(imap[i],imap[j]);
2055 (*A) = (*A) - (*B)*(*C);
2089 const Array<OneD, const NekDouble> &inarray,
2090 Array<OneD, NekDouble> &outarray,
2091 Array<OneD, NekDouble> &wsp)
2100 int nquad0 =
m_base[0]->GetNumPoints();
2101 int nquad1 =
m_base[1]->GetNumPoints();
2102 int nquad2 =
m_base[2]->GetNumPoints();
2103 int nqtot = nquad0*nquad1*nquad2;
2105 ASSERTL1(wsp.num_elements() >= 6*nqtot,
2106 "Insufficient workspace size.");
2108 const Array<OneD, const NekDouble>& base0 =
m_base[0]->GetBdata();
2109 const Array<OneD, const NekDouble>& base1 =
m_base[1]->GetBdata();
2110 const Array<OneD, const NekDouble>& base2 =
m_base[2]->GetBdata();
2111 const Array<OneD, const NekDouble>& dbase0 =
m_base[0]->GetDbdata();
2112 const Array<OneD, const NekDouble>& dbase1 =
m_base[1]->GetDbdata();
2113 const Array<OneD, const NekDouble>& dbase2 =
m_base[2]->GetDbdata();
2122 Array<OneD,NekDouble> wsp0(wsp);
2123 Array<OneD,NekDouble> wsp1(wsp+1*nqtot);
2124 Array<OneD,NekDouble> wsp2(wsp+2*nqtot);
2125 Array<OneD,NekDouble> wsp3(wsp+3*nqtot);
2126 Array<OneD,NekDouble> wsp4(wsp+4*nqtot);
2127 Array<OneD,NekDouble> wsp5(wsp+5*nqtot);
2135 Vmath::Vvtvvtp(nqtot,&metric00[0],1,&wsp0[0],1,&metric01[0],1,&wsp1[0],1,&wsp3[0],1);
2136 Vmath::Vvtvp (nqtot,&metric02[0],1,&wsp2[0],1,&wsp3[0],1,&wsp3[0],1);
2137 Vmath::Vvtvvtp(nqtot,&metric01[0],1,&wsp0[0],1,&metric11[0],1,&wsp1[0],1,&wsp4[0],1);
2138 Vmath::Vvtvp (nqtot,&metric12[0],1,&wsp2[0],1,&wsp4[0],1,&wsp4[0],1);
2139 Vmath::Vvtvvtp(nqtot,&metric02[0],1,&wsp0[0],1,&metric12[0],1,&wsp1[0],1,&wsp5[0],1);
2140 Vmath::Vvtvp (nqtot,&metric22[0],1,&wsp2[0],1,&wsp5[0],1,&wsp5[0],1);
2161 const unsigned int dim = 3;
2167 for (
unsigned int i = 0; i < dim; ++i)
2169 for (
unsigned int j = i; j < dim; ++j)
2171 m_metrics[m[i][j]] = Array<OneD, NekDouble>(nqtot);
2172 const Array<TwoD, const NekDouble> &gmat =