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"))
84 StdRegions::StdHexExp(T),
87 m_matrixManager(T.m_matrixManager),
88 m_staticCondMatrixManager(T.m_staticCondMatrixManager)
117 int nquad0 =
m_base[0]->GetNumPoints();
118 int nquad1 =
m_base[1]->GetNumPoints();
119 int nquad2 =
m_base[2]->GetNumPoints();
138 returnVal = StdHexExp::v_Integral(tmp);
163 int nquad0 =
m_base[0]->GetNumPoints();
164 int nquad1 =
m_base[1]->GetNumPoints();
165 int nquad2 =
m_base[2]->GetNumPoints();
166 int ntot = nquad0 * nquad1 * nquad2;
174 StdHexExp::v_PhysDeriv(inarray, Diff0, Diff1, Diff2);
178 if(out_d0.num_elements())
180 Vmath::Vmul (ntot,&df[0][0],1,&Diff0[0],1, &out_d0[0], 1);
181 Vmath::Vvtvp(ntot,&df[1][0],1,&Diff1[0],1, &out_d0[0], 1,
183 Vmath::Vvtvp(ntot,&df[2][0],1,&Diff2[0],1, &out_d0[0], 1,
187 if(out_d1.num_elements())
189 Vmath::Vmul (ntot,&df[3][0],1,&Diff0[0],1, &out_d1[0], 1);
190 Vmath::Vvtvp(ntot,&df[4][0],1,&Diff1[0],1, &out_d1[0], 1,
192 Vmath::Vvtvp(ntot,&df[5][0],1,&Diff2[0],1, &out_d1[0], 1,
196 if(out_d2.num_elements())
198 Vmath::Vmul (ntot,&df[6][0],1,&Diff0[0],1, &out_d2[0], 1);
199 Vmath::Vvtvp(ntot,&df[7][0],1,&Diff1[0],1, &out_d2[0], 1,
201 Vmath::Vvtvp(ntot,&df[8][0],1,&Diff2[0],1, &out_d2[0], 1,
207 if(out_d0.num_elements())
209 Vmath::Smul (ntot,df[0][0],&Diff0[0],1, &out_d0[0], 1);
210 Blas::Daxpy (ntot,df[1][0],&Diff1[0],1, &out_d0[0], 1);
211 Blas::Daxpy (ntot,df[2][0],&Diff2[0],1, &out_d0[0], 1);
214 if(out_d1.num_elements())
216 Vmath::Smul (ntot,df[3][0],&Diff0[0],1, &out_d1[0], 1);
217 Blas::Daxpy (ntot,df[4][0],&Diff1[0],1, &out_d1[0], 1);
218 Blas::Daxpy (ntot,df[5][0],&Diff2[0],1, &out_d1[0], 1);
221 if(out_d2.num_elements())
223 Vmath::Smul (ntot,df[6][0],&Diff0[0],1, &out_d2[0], 1);
224 Blas::Daxpy (ntot,df[7][0],&Diff1[0],1, &out_d2[0], 1);
225 Blas::Daxpy (ntot,df[8][0],&Diff2[0],1, &out_d2[0], 1);
267 ASSERTL1(
false,
"input dir is out of range");
290 if(
m_base[0]->Collocation() &&
m_base[1]->Collocation()
291 &&
m_base[2]->Collocation())
366 bool multiplybyweights)
368 int nquad0 =
m_base[0]->GetNumPoints();
369 int nquad1 =
m_base[1]->GetNumPoints();
370 int nquad2 =
m_base[2]->GetNumPoints();
371 int order0 =
m_base[0]->GetNumModes();
372 int order1 =
m_base[1]->GetNumModes();
375 order0*order1*nquad2);
377 if(multiplybyweights)
393 inarray,outarray,wsp,
433 ASSERTL1((dir==0)||(dir==1)||(dir==2),
"Invalid direction.");
435 const int nq0 =
m_base[0]->GetNumPoints();
436 const int nq1 =
m_base[1]->GetNumPoints();
437 const int nq2 =
m_base[2]->GetNumPoints();
438 const int nq = nq0*nq1*nq2;
439 const int nm0 =
m_base[0]->GetNumModes();
440 const int nm1 =
m_base[1]->GetNumModes();
457 Vmath::Vmul(nq,&df[3*dir][0], 1,tmp1.get(),1,tmp2.get(),1);
458 Vmath::Vmul(nq,&df[3*dir+1][0],1,tmp1.get(),1,tmp3.get(),1);
459 Vmath::Vmul(nq,&df[3*dir+2][0],1,tmp1.get(),1,tmp4.get(),1);
463 Vmath::Smul(nq, df[3*dir][0], tmp1.get(),1,tmp2.get(), 1);
464 Vmath::Smul(nq, df[3*dir+1][0],tmp1.get(),1,tmp3.get(), 1);
465 Vmath::Smul(nq, df[3*dir+2][0],tmp1.get(),1,tmp4.get(), 1);
517 ASSERTL1(
false,
"input dir is out of range");
525 Blas::Dgemv(
'N',
m_ncoeffs,nq,iprodmat->Scale(),(iprodmat->GetOwnedMatrix())->GetPtr().get(),
526 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
545 return StdHexExp::v_PhysEvaluate(Lcoord,physvals);
555 m_geom->GetLocCoords(coord,Lcoord);
556 return StdHexExp::v_PhysEvaluate(Lcoord, physvals);
564 m_base[2]->GetBasisKey());
581 ASSERTL1(Lcoords[0] >= -1.0 && Lcoords[0] <= 1.0 &&
582 Lcoords[1] >= -1.0 && Lcoords[1] <= 1.0 &&
583 Lcoords[2] >= -1.0 && Lcoords[2] <= 1.0,
584 "Local coordinates are not in region [-1,1]");
588 for(i = 0; i <
m_geom->GetCoordim(); ++i)
590 coords[i] =
m_geom->GetCoord(i,Lcoords);
615 const std::vector<unsigned int > &nummodes,
616 const int mode_offset,
619 int data_order0 = nummodes[mode_offset];
620 int fillorder0 = min(
m_base[0]->GetNumModes(),data_order0);
621 int data_order1 = nummodes[mode_offset+1];
622 int order1 =
m_base[1]->GetNumModes();
623 int fillorder1 = min(order1,data_order1);
624 int data_order2 = nummodes[mode_offset+2];
625 int order2 =
m_base[2]->GetNumModes();
626 int fillorder2 = min(order2,data_order2);
638 "Extraction routine not set up for this basis");
641 "Extraction routine not set up for this basis");
644 for(j = 0; j < fillorder0; ++j)
646 for(i = 0; i < fillorder1; ++i)
655 for(i = fillorder1; i < data_order1; ++i)
660 for(i = fillorder1; i < order1; ++i)
668 ASSERTL0(
false,
"basis is either not set up or not "
703 int nquad0 =
m_base[0]->GetNumPoints();
704 int nquad1 =
m_base[1]->GetNumPoints();
705 int nquad2 =
m_base[2]->GetNumPoints();
719 Vmath::Vcopy(nquad0*nquad1,&(inarray[0]),1,&(o_tmp[0]),1);
724 for (
int j=0; j<nquad1; j++)
726 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+j*nquad0,-1,&(o_tmp[0])+(j*nquad0),1);
732 for (
int j=0; j<nquad1; j++)
734 Vmath::Vcopy(nquad0,&(inarray[0])+nquad0*(nquad1-1-j),1,&(o_tmp[0])+(j*nquad0),1);
740 for(
int j=0; j<nquad1; j++)
742 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1-j*nquad0),-1,&(o_tmp[0])+(j*nquad0),1);
748 for (
int i=0; i<nquad0; i++)
750 Vmath::Vcopy(nquad1,&(inarray[0])+i,nquad0,&(o_tmp[0])+(i*nquad1),1);
756 for (
int i=0; i<nquad0; i++)
758 Vmath::Vcopy(nquad1,&(inarray[0])+i+nquad0*(nquad1-1),-nquad0,&(o_tmp[0])+(i*nquad1),1);
764 for (
int i=0; i<nquad0; i++)
766 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0-1-i),nquad0,&(o_tmp[0])+(i*nquad1),1);
772 for (
int i=0; i<nquad0; i++)
774 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0*nquad1-1-i),-nquad0,&(o_tmp[0])+(i*nquad1),1);
782 m_base[1]->GetPointsKey(), o_tmp,
783 FaceExp->GetBasis(0)->GetPointsKey(),
784 FaceExp->GetBasis(1)->GetPointsKey(),
790 m_base[0]->GetPointsKey(), o_tmp,
791 FaceExp->GetBasis(0)->GetPointsKey(),
792 FaceExp->GetBasis(1)->GetPointsKey(),
800 for (
int k=0; k<nquad2; k++)
803 1,&(o_tmp[0])+(k*nquad0),1);
809 for (
int k=0; k<nquad2; k++)
811 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+(nquad0*nquad1*k),
812 -1,&(o_tmp[0])+(k*nquad0),1);
818 for (
int k=0; k<nquad2; k++)
820 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1*(nquad2-1-k)),
821 1,&(o_tmp[0])+(k*nquad0),1);
827 for(
int k=0; k<nquad2; k++)
829 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+(nquad0*nquad1*(nquad2-1-k)),
830 -1,&(o_tmp[0])+(k*nquad0),1);
836 for (
int i=0; i<nquad0; i++)
839 &(o_tmp[0])+(i*nquad2),1);
845 for (
int i=0; i<nquad0; i++)
847 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*(nquad2-1)+i,
848 -nquad0*nquad1,&(o_tmp[0])+(i*nquad2),1);
854 for (
int i=0; i<nquad0; i++)
856 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0-1-i),nquad0*nquad1,
857 &(o_tmp[0])+(i*nquad2),1);
863 for (
int i=0; i<nquad0; i++)
865 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*nquad2+(nquad0-1-i),
866 -nquad0*nquad1,&(o_tmp[0])+(i*nquad2),1);
874 m_base[2]->GetPointsKey(), o_tmp,
875 FaceExp->GetBasis(0)->GetPointsKey(),
876 FaceExp->GetBasis(1)->GetPointsKey(),
882 m_base[0]->GetPointsKey(), o_tmp,
883 FaceExp->GetBasis(0)->GetPointsKey(),
884 FaceExp->GetBasis(1)->GetPointsKey(),
893 nquad0,&(o_tmp[0]),1);
898 for (
int k=0; k<nquad2; k++)
900 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(k*nquad0*nquad1),
901 -nquad0,&(o_tmp[0])+(k*nquad0),1);
907 for (
int k=0; k<nquad2; k++)
909 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+(nquad0*nquad1*(nquad2-1-k)),
910 nquad0,&(o_tmp[0])+(k*nquad0),1);
916 for (
int k=0; k<nquad2; k++)
918 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(nquad0*nquad1*(nquad2-1-k)),
919 -nquad0,&(o_tmp[0])+(k*nquad0),1);
925 for (
int j=0; j<nquad1; j++)
927 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0-1)+(j*nquad0),
928 nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
934 for (
int j=0; j<nquad0; j++)
936 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*(nquad2-1)+nquad0+j*nquad0,
937 -nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
943 for (
int j=0; j<nquad0; j++)
945 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1-1-j*nquad0),
946 nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
952 for (
int j=0; j<nquad0; j++)
954 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1*nquad2-1-j*nquad0),
955 -nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
962 m_base[2]->GetPointsKey(), o_tmp,
963 FaceExp->GetBasis(0)->GetPointsKey(),
964 FaceExp->GetBasis(1)->GetPointsKey(),
970 m_base[1]->GetPointsKey(), o_tmp,
971 FaceExp->GetBasis(0)->GetPointsKey(),
972 FaceExp->GetBasis(1)->GetPointsKey(),
981 for (
int k=0; k<nquad2; k++)
983 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*(nquad1-1))+(k*nquad0*nquad1),
984 1,&(o_tmp[0])+(k*nquad0),1);
990 for (
int k=0; k<nquad2; k++)
992 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(k*nquad0*nquad1),
993 -1,&(o_tmp[0])+(k*nquad0),1);
999 for (
int k=0; k<nquad2; k++)
1001 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*(nquad1-1))+(nquad0*nquad1*(nquad2-1-k)),
1002 1,&(o_tmp[0])+(k*nquad0),1);
1008 for (
int k=0; k<nquad2; k++)
1010 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(nquad0*nquad1*(nquad2-1-k)),
1011 -1,&(o_tmp[0])+(k*nquad0),1);
1017 for (
int i=0; i<nquad0; i++)
1019 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*(nquad1-1)+i,nquad0*nquad1,
1020 &(o_tmp[0])+(i*nquad2),1);
1026 for (
int i=0; i<nquad0; i++)
1028 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*(nquad1*nquad2-1)+i,-nquad0*nquad1,
1029 &(o_tmp[0])+(i*nquad2),1);
1035 for (
int i=0; i<nquad0; i++)
1037 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1-1-i),nquad0*nquad1,
1038 &(o_tmp[0])+(i*nquad2),1);
1044 for (
int i=0; i<nquad0; i++)
1046 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1*nquad2-1-i),-nquad0*nquad1,
1047 &(o_tmp[0])+(i*nquad2),1);
1054 m_base[2]->GetPointsKey(), o_tmp,
1055 FaceExp->GetBasis(0)->GetPointsKey(),
1056 FaceExp->GetBasis(1)->GetPointsKey(),
1062 m_base[0]->GetPointsKey(), o_tmp,
1063 FaceExp->GetBasis(0)->GetPointsKey(),
1064 FaceExp->GetBasis(1)->GetPointsKey(),
1072 Vmath::Vcopy(nquad0*nquad1,&(inarray[0]),nquad0,&(o_tmp[0]),1);
1077 for (
int k=0; k<nquad2; k++)
1079 Vmath::Vcopy(nquad0,&(inarray[0])+nquad0*(nquad1-1)+(k*nquad0*nquad1),
1080 -nquad0,&(o_tmp[0])+(k*nquad0),1);
1086 for (
int k=0; k<nquad2; k++)
1088 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1*(nquad2-1-k)),
1089 nquad0,&(o_tmp[0])+(k*nquad0),1);
1095 for (
int k=0; k<nquad2; k++)
1097 Vmath::Vcopy(nquad0,&(inarray[0])+nquad0*(nquad1-1)+(nquad0*nquad1*(nquad2-1-k)),
1098 -nquad0,&(o_tmp[0])+(k*nquad0),1);
1104 for (
int j=0; j<nquad0; j++)
1106 Vmath::Vcopy(nquad2,&(inarray[0])+j*nquad0,nquad0*nquad1,
1107 &(o_tmp[0])+(j*nquad2),1);
1113 for (
int j=0; j<nquad0; j++)
1115 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*(nquad2-1)+j*nquad0,
1116 -nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
1122 for (
int j=0; j<nquad0; j++)
1124 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*(nquad1-1)-j*nquad0),
1125 nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
1131 for (
int j=0; j<nquad0; j++)
1133 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*(nquad1*nquad2-1)-j*nquad0),
1134 -nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
1141 m_base[2]->GetPointsKey(), o_tmp,
1142 FaceExp->GetBasis(0)->GetPointsKey(),
1143 FaceExp->GetBasis(1)->GetPointsKey(),
1149 m_base[1]->GetPointsKey(), o_tmp,
1150 FaceExp->GetBasis(0)->GetPointsKey(),
1151 FaceExp->GetBasis(1)->GetPointsKey(),
1159 Vmath::Vcopy(nquad0*nquad1,&(inarray[0])+nquad0*nquad1*(nquad2-1),1,&(o_tmp[0]),1);
1164 for (
int j=0; j<nquad1; j++)
1166 Vmath::Vcopy(nquad0,&(inarray[0])+nquad0*nquad1*(nquad2-1)+(nquad0-1+j*nquad0),
1167 -1,&(o_tmp[0])+(j*nquad0),1);
1173 for (
int j=0; j<nquad1; j++)
1175 Vmath::Vcopy(nquad0,&(inarray[0])+((nquad0*nquad1*nquad2-1)-(nquad0-1)-j*nquad0),
1176 1,&(o_tmp[0])+(j*nquad0),1);
1182 for (
int j=0; j<nquad1; j++)
1184 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1*nquad2-1-j*nquad0),
1185 -1,&(o_tmp[0])+(j*nquad0),1);
1191 for (
int i=0; i<nquad0; i++)
1193 Vmath::Vcopy(nquad1,&(inarray[0])+nquad0*nquad1*(nquad2-1)+i,nquad0,
1194 &(o_tmp[0])+(i*nquad1),1);
1200 for (
int i=0; i<nquad0; i++)
1202 Vmath::Vcopy(nquad1,&(inarray[0])+nquad0*(nquad1*nquad2-1)+i,-nquad0,
1203 &(o_tmp[0])+(i*nquad1),1);
1209 for (
int i=0; i<nquad0; i++)
1211 Vmath::Vcopy(nquad1,&(inarray[0])+nquad0*nquad1*(nquad2-1)+(nquad0-1-i),
1212 nquad0,&(o_tmp[0])+(i*nquad1),1);
1218 for (
int i=0; i<nquad0; i++)
1220 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0*nquad1*nquad2-1-i),-nquad0,
1221 &(o_tmp[0])+(i*nquad1),1);
1228 m_base[1]->GetPointsKey(), o_tmp,
1229 FaceExp->GetBasis(0)->GetPointsKey(),
1230 FaceExp->GetBasis(1)->GetPointsKey(),
1236 m_base[0]->GetPointsKey(), o_tmp,
1237 FaceExp->GetBasis(0)->GetPointsKey(),
1238 FaceExp->GetBasis(1)->GetPointsKey(),
1243 ASSERTL0(
false,
"face value (> 5) is out of range");
1269 for (i = 0; i < vCoordDim; ++i)
1281 for(i = 0; i < vCoordDim; ++i)
1283 normal[i][0] = -df[3*i+2][0];
1287 for(i = 0; i < vCoordDim; ++i)
1289 normal[i][0] = -df[3*i+1][0];
1293 for(i = 0; i < vCoordDim; ++i)
1295 normal[i][0] = df[3*i][0];
1299 for(i = 0; i < vCoordDim; ++i)
1301 normal[i][0] = df[3*i+1][0];
1305 for(i = 0; i < vCoordDim; ++i)
1307 normal[i][0] = -df[3*i][0];
1311 for(i = 0; i < vCoordDim; ++i)
1313 normal[i][0] = df[3*i+2][0];
1317 ASSERTL0(
false,
"face is out of range (edge < 5)");
1322 for(i =0 ; i < vCoordDim; ++i)
1324 fac += normal[i][0]*normal[i][0];
1326 fac = 1.0/sqrt(fac);
1327 for (i = 0; i < vCoordDim; ++i)
1329 Vmath::Fill(nq_face,fac*normal[i][0],normal[i],1);
1337 int nqe0 =
m_base[0]->GetNumPoints();
1338 int nqe1 =
m_base[1]->GetNumPoints();
1339 int nqe2 =
m_base[2]->GetNumPoints();
1340 int nqe01 = nqe0*nqe1;
1341 int nqe02 = nqe0*nqe2;
1342 int nqe12 = nqe1*nqe2;
1345 if (face == 0 || face == 5)
1349 else if (face == 1 || face == 3)
1370 for(j = 0; j < nqe; ++j)
1372 normals[j] = -df[2][j]*jac[j];
1373 normals[nqe+j] = -df[5][j]*jac[j];
1374 normals[2*nqe+j] = -df[8][j]*jac[j];
1375 faceJac[j] = jac[j];
1378 points0 = ptsKeys[0];
1379 points1 = ptsKeys[1];
1382 for (j = 0; j < nqe0; ++j)
1384 for(k = 0; k < nqe2; ++k)
1386 int idx = j + nqe01*k;
1387 normals[j+k*nqe0] = -df[1][idx]*jac[idx];
1388 normals[nqe+j+k*nqe0] = -df[4][idx]*jac[idx];
1389 normals[2*nqe+j+k*nqe0] = -df[7][idx]*jac[idx];
1390 faceJac[j+k*nqe0] = jac[idx];
1393 points0 = ptsKeys[0];
1394 points1 = ptsKeys[2];
1397 for (j = 0; j < nqe1; ++j)
1399 for(k = 0; k < nqe2; ++k)
1401 int idx = nqe0-1+nqe0*j+nqe01*k;
1402 normals[j+k*nqe1] = df[0][idx]*jac[idx];
1403 normals[nqe+j+k*nqe1] = df[3][idx]*jac[idx];
1404 normals[2*nqe+j+k*nqe1] = df[6][idx]*jac[idx];
1405 faceJac[j+k*nqe1] = jac[idx];
1408 points0 = ptsKeys[1];
1409 points1 = ptsKeys[2];
1412 for (j = 0; j < nqe0; ++j)
1414 for(k = 0; k < nqe2; ++k)
1416 int idx = nqe0*(nqe1-1)+j+nqe01*k;
1417 normals[j+k*nqe0] = df[1][idx]*jac[idx];
1418 normals[nqe+j+k*nqe0] = df[4][idx]*jac[idx];
1419 normals[2*nqe+j+k*nqe0] = df[7][idx]*jac[idx];
1420 faceJac[j+k*nqe0] = jac[idx];
1423 points0 = ptsKeys[0];
1424 points1 = ptsKeys[2];
1427 for (j = 0; j < nqe1; ++j)
1429 for(k = 0; k < nqe2; ++k)
1431 int idx = j*nqe0+nqe01*k;
1432 normals[j+k*nqe1] = -df[0][idx]*jac[idx];
1433 normals[nqe+j+k*nqe1] = -df[3][idx]*jac[idx];
1434 normals[2*nqe+j+k*nqe1] = -df[6][idx]*jac[idx];
1435 faceJac[j+k*nqe1] = jac[idx];
1438 points0 = ptsKeys[1];
1439 points1 = ptsKeys[2];
1442 for (j = 0; j < nqe01; ++j)
1444 int idx = j+nqe01*(nqe2-1);
1445 normals[j] = df[2][idx]*jac[idx];
1446 normals[nqe+j] = df[5][idx]*jac[idx];
1447 normals[2*nqe+j] = df[8][idx]*jac[idx];
1448 faceJac[j] = jac[idx];
1450 points0 = ptsKeys[0];
1451 points1 = ptsKeys[1];
1454 ASSERTL0(
false,
"face is out of range (face < 5)");
1474 Vmath::Vmul(nq_face,work,1,normal[i],1,normal[i],1);
1481 Vmath::Vvtvp(nq_face,normal[i],1, normal[i],1,work,1,work,1);
1489 Vmath::Vmul(nq_face,normal[i],1,work,1,normal[i],1);
1502 StdExpansion::MassMatrixOp_MatFree(inarray,outarray,mkey);
1520 StdExpansion::LaplacianMatrixOp_MatFree(k1,k2,inarray,outarray,
1530 StdExpansion::WeakDerivMatrixOp_MatFree(i,inarray,outarray,mkey);
1538 StdExpansion::WeakDirectionalDerivMatrixOp_MatFree(inarray,
1547 StdExpansion::MassLevelCurvatureMatrixOp_MatFree(inarray,
1593 if(inarray.get() == outarray.get())
1598 Blas::Dgemv(
'N',
m_ncoeffs,
m_ncoeffs,mat->Scale(),(mat->GetOwnedMatrix())->GetPtr().get(),
1599 m_ncoeffs, tmp.get(), 1, 0.0, outarray.get(), 1);
1603 Blas::Dgemv(
'N',
m_ncoeffs,
m_ncoeffs,mat->Scale(),(mat->GetOwnedMatrix())->GetPtr().get(),
1604 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
1624 int n_coeffs = inarray.num_elements();
1625 int nmodes0 =
m_base[0]->GetNumModes();
1626 int nmodes1 =
m_base[1]->GetNumModes();
1627 int nmodes2 =
m_base[2]->GetNumModes();
1628 int numMax = nmodes0;
1658 b0, b1, b2, coeff_tmp2,
1659 bortho0, bortho1, bortho2, coeff);
1663 int cnt = 0, cnt2 = 0;
1665 for (
int u = 0; u < numMin+1; ++u)
1667 for (
int i = 0; i < numMin; ++i)
1670 tmp = coeff+cnt+cnt2,1,
1671 tmp2 = coeff_tmp1+cnt,1);
1677 tmp3 = coeff_tmp1,1,
1678 tmp4 = coeff_tmp2+cnt2,1);
1680 cnt2 = u*nmodes0*nmodes1;
1684 bortho0, bortho1, bortho2, coeff_tmp2,
1685 b0, b1, b2, outarray);
1711 StdHexExp::v_SVVLaplacianFilter( array, mkey);
1737 returnval = StdHexExp::v_GenMatrix(mkey);
1754 return tmp->GetStdMatrix(mkey);
1764 "Geometric information is not set up");
1857 int rows = deriv0.GetRows();
1858 int cols = deriv1.GetColumns();
1863 (*WeakDeriv) = df[3*dir ][0]*deriv0
1864 + df[3*dir+1][0]*deriv1
1865 + df[3*dir+2][0]*deriv2;
1911 int rows = lap00.GetRows();
1912 int cols = lap00.GetColumns();
1917 (*lap) = gmat[0][0]*lap00
1922 + gmat[7][0]*(lap12 +
Transpose(lap12));
1939 int rows = LapMat.GetRows();
1940 int cols = LapMat.GetColumns();
1945 (*helm) = LapMat + lambda*MassMat;
2091 unsigned int nint = (
unsigned int)(
m_ncoeffs - nbdry);
2092 unsigned int exp_size[] = {nbdry,nint};
2093 unsigned int nblks = 2;
2104 goto UseLocRegionsMatrix;
2111 goto UseLocRegionsMatrix;
2116 factor = mat->Scale();
2117 goto UseStdRegionsMatrix;
2120 UseStdRegionsMatrix:
2134 UseLocRegionsMatrix:
2150 for(i = 0; i < nbdry; ++i)
2152 for(j = 0; j < nbdry; ++j)
2154 (*A)(i,j) = mat(bmap[i],bmap[j]);
2157 for(j = 0; j < nint; ++j)
2159 (*B)(i,j) = mat(bmap[i],imap[j]);
2163 for(i = 0; i < nint; ++i)
2165 for(j = 0; j < nbdry; ++j)
2167 (*C)(i,j) = mat(imap[i],bmap[j]);
2170 for(j = 0; j < nint; ++j)
2172 (*D)(i,j) = mat(imap[i],imap[j]);
2181 (*A) = (*A) - (*B)*(*C);
2226 int nquad0 =
m_base[0]->GetNumPoints();
2227 int nquad1 =
m_base[1]->GetNumPoints();
2228 int nquad2 =
m_base[2]->GetNumPoints();
2229 int nqtot = nquad0*nquad1*nquad2;
2231 ASSERTL1(wsp.num_elements() >= 6*nqtot,
2232 "Insufficient workspace size.");
2255 StdExpansion3D::PhysTensorDeriv(inarray,wsp0,wsp1,wsp2);
2261 Vmath::Vvtvvtp(nqtot,&metric00[0],1,&wsp0[0],1,&metric01[0],1,&wsp1[0],1,&wsp3[0],1);
2262 Vmath::Vvtvp (nqtot,&metric02[0],1,&wsp2[0],1,&wsp3[0],1,&wsp3[0],1);
2263 Vmath::Vvtvvtp(nqtot,&metric01[0],1,&wsp0[0],1,&metric11[0],1,&wsp1[0],1,&wsp4[0],1);
2264 Vmath::Vvtvp (nqtot,&metric12[0],1,&wsp2[0],1,&wsp4[0],1,&wsp4[0],1);
2265 Vmath::Vvtvvtp(nqtot,&metric02[0],1,&wsp0[0],1,&metric12[0],1,&wsp1[0],1,&wsp5[0],1);
2266 Vmath::Vvtvp (nqtot,&metric22[0],1,&wsp2[0],1,&wsp5[0],1,&wsp5[0],1);
2287 const unsigned int dim = 3;
2293 for (
unsigned int i = 0; i < dim; ++i)
2295 for (
unsigned int j = i; j < dim; ++j)
void ComputeLaplacianMetric()
const LibUtilities::PointsKeyVector GetPointsKeys() const
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
NekDouble GetConstFactor(const ConstFactorType &factor) const
DNekMatSharedPtr GenMatrix(const StdMatrixKey &mkey)
#define ASSERTL0(condition, msg)
int GetFaceNumPoints(const int i) const
This function returns the number of quadrature points belonging to the i-th face. ...
const ConstFactorMap & GetConstFactors() const
const VarCoeffMap & GetVarCoeffs() const
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
std::vector< PointsKey > PointsKeyVector
DNekMatSharedPtr BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
MatrixType GetMatrixType() const
static Array< OneD, NekDouble > NullNekDouble1DArray
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
virtual void v_LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual LibUtilities::ShapeType v_DetShapeType() const
Return the region shape using the enum-list of ShapeType.
void v_ComputeFaceNormal(const int face)
void IProductWRTDerivBase_MatOp(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_ComputeLaplacianMetric()
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Calculate the inner product of inarray with respect to the given basis B = base0 * base1 * base2...
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
this function calculates the inner product of a given function f with the different modes of the expa...
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrate the physical point list inarray over region.
SpatialDomains::Geometry3DSharedPtr GetGeom3D() const
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
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
Principle Modified Functions .
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculate the inner product of inarray with respect to the elements basis.
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/y.
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
DNekMatSharedPtr BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
LibUtilities::ShapeType GetShapeType() const
void IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculates the inner product .
boost::shared_ptr< StdHexExp > StdHexExpSharedPtr
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
SpatialDomains::GeometrySharedPtr m_geom
StdRegions::Orientation GetForient(int face)
virtual void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
boost::shared_ptr< HexGeom > HexGeomSharedPtr
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
This function evaluates the expansion at a single (arbitrary) point of the domain.
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
boost::shared_ptr< DNekMat > DNekMatSharedPtr
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
void PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
virtual bool v_GetFaceDGForwards(const int i) const
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
void v_GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
bool ConstFactorExists(const ConstFactorType &factor) const
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
virtual void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
Calculate the derivative of the physical points.
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis...
int NumBndryCoeffs(void) const
DNekBlkMatSharedPtr GetStdStaticCondMatrix(const StdMatrixKey &mkey)
void IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
Retrieves the physical coordinates of a given set of reference coordinates.
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
int GetNumPoints() const
Return points order at which basis is defined.
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
void GetInteriorMap(Array< OneD, unsigned int > &outarray)
Principle Orthogonal Functions .
NekMatrix< InnerMatrixType, BlockMatrixTag > Transpose(NekMatrix< InnerMatrixType, BlockMatrixTag > &rhs)
Defines a specification for a set of points.
virtual void v_WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
virtual void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
std::map< int, NormalVector > m_faceNormals
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
boost::shared_ptr< DNekBlkMat > DNekBlkMatSharedPtr
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
PointsKey GetPointsKey() const
Return distribution of points.
SpatialDomains::GeometrySharedPtr GetGeom() const
boost::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
void Vvtvvtp(int n, const T *v, int incv, const T *w, int incw, const T *x, int incx, const T *y, int incy, T *z, int incz)
vvtvvtp (vector times vector plus vector times vector):
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Geometry is straight-sided with constant geometric factors.
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
virtual void v_GetFacePhysVals(const int face, const StdRegions::StdExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient)
Returns the physical values at the quadrature points of a face.
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
void ComputeQuadratureMetric()
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
const LibUtilities::BasisKey DetFaceBasisKey(const int i, const int k) const
GeomType
Indicates the type of element geometry.
void Zero(int n, T *x, const int incx)
Zero vector.
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
void InterpCoeff3D(const BasisKey &fbasis0, const BasisKey &fbasis1, const BasisKey &fbasis2, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, const BasisKey &tbasis2, Array< OneD, NekDouble > &to)
virtual void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs)
Unpack data from input file assuming it comes from the same expansion type.
virtual void v_HelmholtzMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Geometry is curved or has non-constant factors.
virtual void v_GetTracePhysVals(const int face, const StdRegions::StdExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient)
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
Describes the specification for a Basis.
1D Gauss-Lobatto-Legendre quadrature points
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Forward transform from physical quadrature space stored in inarray and evaluate the expansion coeffic...
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
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.
virtual void v_MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)