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 "
565 const Array<OneD, const NekDouble> &inarray,
566 Array<OneD, NekDouble> &outarray,
575 const Array<OneD, const NekDouble> &inarray,
576 Array<OneD, NekDouble> &outarray,
579 int nquad0 =
m_base[0]->GetNumPoints();
580 int nquad1 =
m_base[1]->GetNumPoints();
581 int nquad2 =
m_base[2]->GetNumPoints();
596 Vmath::Vcopy(nquad0*nquad1,&(inarray[0]),1,&(o_tmp[0]),1);
601 for (
int j=0; j<nquad1; j++)
603 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+j*nquad0,-1,&(o_tmp[0])+(j*nquad0),1);
609 for (
int j=0; j<nquad1; j++)
611 Vmath::Vcopy(nquad0,&(inarray[0])+nquad0*(nquad1-1-j),1,&(o_tmp[0])+(j*nquad0),1);
617 for(
int j=0; j<nquad1; j++)
619 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1-j*nquad0),-1,&(o_tmp[0])+(j*nquad0),1);
625 for (
int i=0; i<nquad0; i++)
627 Vmath::Vcopy(nquad1,&(inarray[0])+i,nquad0,&(o_tmp[0])+(i*nquad1),1);
633 for (
int i=0; i<nquad0; i++)
635 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0-1-i),nquad0,&(o_tmp[0])+(i*nquad1),1);
641 for (
int i=0; i<nquad0; i++)
643 Vmath::Vcopy(nquad1,&(inarray[0])+i+nquad0*(nquad1-1),-nquad0,&(o_tmp[0])+(i*nquad1),1);
649 for (
int i=0; i<nquad0; i++)
651 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0*nquad1-1-i),-nquad0,&(o_tmp[0])+(i*nquad1),1);
656 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),outarray);
662 for (
int k=0; k<nquad2; k++)
664 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1*k),1,&(o_tmp[0])+(k*nquad0),1);
670 for (
int k=0; k<nquad2; k++)
672 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+(nquad0*nquad1*k),-1,&(o_tmp[0])+(k*nquad0),1);
678 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),outarray);
685 nquad0,&(o_tmp[0]),1);
690 for (
int k=0; k<nquad2; k++)
692 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(k*nquad0*nquad1),
693 -nquad0,&(o_tmp[0])+(k*nquad0),1);
699 for (
int k=0; k<nquad2; k++)
701 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+(nquad0*nquad1*(nquad2-1-k)),
702 nquad0,&(o_tmp[0])+(k*nquad0),1);
708 for (
int k=0; k<nquad2; k++)
710 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(nquad0*nquad1*(nquad2-1-k)),
711 -nquad0,&(o_tmp[0])+(k*nquad0),1);
717 for (
int j=0; j<nquad1; j++)
719 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0-1)+(j*nquad0),
720 nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
726 for (
int j=0; j<nquad0; j++)
728 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1-1-j*nquad0),
729 nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
735 for (
int j=0; j<nquad0; j++)
737 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*(nquad2-1)+nquad0+j*nquad0,
738 -nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
744 for (
int j=0; j<nquad0; j++)
746 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1*nquad2-1-j*nquad0),
747 -nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
752 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),outarray);
758 for (
int k=0; k<nquad2; k++)
760 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*(nquad1-1))+(k*nquad0*nquad1),
761 1,&(o_tmp[0])+(k*nquad0),1);
767 for (
int k=0; k<nquad2; k++)
769 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(k*nquad0*nquad1),
770 -1,&(o_tmp[0])+(k*nquad0),1);
775 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),outarray);
782 Vmath::Vcopy(nquad1*nquad2,&(inarray[0]),nquad0,&(o_tmp[0]),1);
787 for (
int k=0; k<nquad2; k++)
789 Vmath::Vcopy(nquad1,&(inarray[0])+nquad0*(nquad1-1)+(k*nquad0*nquad1),
790 -nquad0,&(o_tmp[0])+(k*nquad1),1);
796 for (
int k=0; k<nquad2; k++)
798 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0*nquad1*(nquad2-1-k)),
799 nquad0,&(o_tmp[0])+(k*nquad1),1);
805 for (
int k=0; k<nquad2; k++)
807 Vmath::Vcopy(nquad1,&(inarray[0])+nquad0*(nquad1-1)+(nquad0*nquad1*(nquad2-1-k)),
808 -nquad0,&(o_tmp[0])+(k*nquad1),1);
814 for (
int j=0; j<nquad1; j++)
816 Vmath::Vcopy(nquad2,&(inarray[0])+j*nquad0,nquad0*nquad1,
817 &(o_tmp[0])+(j*nquad2),1);
823 for (
int j=0; j<nquad1; j++)
825 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*(nquad1-1)-j*nquad0),
826 nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
832 for (
int j=0; j<nquad1; j++)
834 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*(nquad2-1)+j*nquad0,
835 -nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
841 for (
int j=0; j<nquad1; j++)
843 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*(nquad1*nquad2-1)-j*nquad0),
844 -nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
849 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),outarray);
852 ASSERTL0(
false,
"face value (> 4) is out of range");
863 const Array<TwoD, const NekDouble> &df = geomFactors->GetDerivFactors(ptsKeys);
864 const Array<OneD, const NekDouble> &jac = geomFactors->GetJac(ptsKeys);
866 int nq0 = ptsKeys[0].GetNumPoints();
867 int nq1 = ptsKeys[1].GetNumPoints();
868 int nq2 = ptsKeys[2].GetNumPoints();
882 m_faceNormals[face] = Array<OneD, Array<OneD, NekDouble> >(vCoordDim);
883 Array<OneD, Array<OneD, NekDouble> > &normal =
m_faceNormals[face];
884 for (i = 0; i < vCoordDim; ++i)
886 normal[i] = Array<OneD, NekDouble>(nq_face);
899 for(i = 0; i < vCoordDim; ++i)
901 normal[i][0] = -df[3*i+2][0];;
907 for(i = 0; i < vCoordDim; ++i)
909 normal[i][0] = -df[3*i+1][0];
915 for(i = 0; i < vCoordDim; ++i)
917 normal[i][0] = df[3*i][0]+df[3*i+2][0];
923 for(i = 0; i < vCoordDim; ++i)
925 normal[i][0] = df[3*i+1][0];
931 for(i = 0; i < vCoordDim; ++i)
933 normal[i][0] = -df[3*i][0];
938 ASSERTL0(
false,
"face is out of range (face < 4)");
943 for(i = 0; i < vCoordDim; ++i)
945 fac += normal[i][0]*normal[i][0];
948 for (i = 0; i < vCoordDim; ++i)
963 else if (face == 1 || face == 3)
975 Array<OneD, NekDouble> normals(vCoordDim*nqtot,0.0);
984 for(j = 0; j < nq01; ++j)
986 normals[j] = -df[2][j]*jac[j];
987 normals[nqtot+j] = -df[5][j]*jac[j];
988 normals[2*nqtot+j] = -df[8][j]*jac[j];
991 points0 = ptsKeys[0];
992 points1 = ptsKeys[1];
998 for (j = 0; j < nq0; ++j)
1000 for(k = 0; k < nq2; ++k)
1004 -df[1][tmp]*jac[tmp];
1005 normals[nqtot+j+k*nq0] =
1006 -df[4][tmp]*jac[tmp];
1007 normals[2*nqtot+j+k*nq0] =
1008 -df[7][tmp]*jac[tmp];
1012 points0 = ptsKeys[0];
1013 points1 = ptsKeys[2];
1019 for (j = 0; j < nq1; ++j)
1021 for(k = 0; k < nq2; ++k)
1023 int tmp = nq0-1+nq0*j+nq01*k;
1025 (df[0][tmp]+df[2][tmp])*jac[tmp];
1026 normals[nqtot+j+k*nq1] =
1027 (df[3][tmp]+df[5][tmp])*jac[tmp];
1028 normals[2*nqtot+j+k*nq1] =
1029 (df[6][tmp]+df[8][tmp])*jac[tmp];
1033 points0 = ptsKeys[1];
1034 points1 = ptsKeys[2];
1040 for (j = 0; j < nq0; ++j)
1042 for(k = 0; k < nq2; ++k)
1044 int tmp = nq0*(nq1-1) + j + nq01*k;
1046 df[1][tmp]*jac[tmp];
1047 normals[nqtot+j+k*nq0] =
1048 df[4][tmp]*jac[tmp];
1049 normals[2*nqtot+j+k*nq0] =
1050 df[7][tmp]*jac[tmp];
1054 points0 = ptsKeys[0];
1055 points1 = ptsKeys[2];
1061 for (j = 0; j < nq1; ++j)
1063 for(k = 0; k < nq2; ++k)
1065 int tmp = j*nq0+nq01*k;
1067 -df[0][tmp]*jac[tmp];
1068 normals[nqtot+j+k*nq1] =
1069 -df[3][tmp]*jac[tmp];
1070 normals[2*nqtot+j+k*nq1] =
1071 -df[6][tmp]*jac[tmp];
1075 points0 = ptsKeys[1];
1076 points1 = ptsKeys[2];
1081 ASSERTL0(
false,
"face is out of range (face < 4)");
1085 Array<OneD, NekDouble> work (nq_face, 0.0);
1091 Vmath::Sdiv(nq_face, 1.0, &work[0], 1, &work[0], 1);
1094 for(i = 0; i < vCoordDim; ++i)
1101 Vmath::Vmul(nq_face,work,1,normal[i],1,normal[i],1);
1108 Vmath::Vvtvp(nq_face,normal[i],1,normal[i],1,work,1,work,1);
1116 Vmath::Vmul(nq_face,normal[i],1,work,1,normal[i],1);
1122 const Array<OneD, const NekDouble> &inarray,
1123 Array<OneD, NekDouble> &outarray,
1130 const Array<OneD, const NekDouble> &inarray,
1131 Array<OneD, NekDouble> &outarray,
1140 const Array<OneD, const NekDouble> &inarray,
1141 Array<OneD, NekDouble> &outarray,
1148 const Array<OneD, const NekDouble> &inarray,
1149 Array<OneD, NekDouble> &outarray,
1156 const Array<OneD, const NekDouble> &inarray,
1157 Array<OneD, NekDouble> &outarray,
1162 if(inarray.get() == outarray.get())
1167 Blas::Dgemv(
'N',
m_ncoeffs,
m_ncoeffs,mat->Scale(),(mat->GetOwnedMatrix())->GetPtr().get(),
1168 m_ncoeffs, tmp.get(), 1, 0.0, outarray.get(), 1);
1172 Blas::Dgemv(
'N',
m_ncoeffs,
m_ncoeffs,mat->Scale(),(mat->GetOwnedMatrix())->GetPtr().get(),
1173 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
1213 return tmp->GetStdMatrix(mkey);
1237 "Geometric information is not set up");
1292 Array<TwoD, const NekDouble> df =
1322 int rows = deriv0.GetRows();
1323 int cols = deriv1.GetColumns();
1328 (*WeakDeriv) = df[3*dir ][0]*deriv0
1329 + df[3*dir+1][0]*deriv1
1330 + df[3*dir+2][0]*deriv2;
1372 Array<TwoD, const NekDouble> gmat
1375 int rows = lap00.GetRows();
1376 int cols = lap00.GetColumns();
1381 (*lap) = gmat[0][0]*lap00
1386 + gmat[7][0]*(lap12 +
Transpose(lap12));
1404 int rows = LapMat.GetRows();
1405 int cols = LapMat.GetColumns();
1410 (*helm) = LapMat + factor*MassMat;
1556 unsigned int nint = (
unsigned int)(
m_ncoeffs - nbdry);
1557 unsigned int exp_size[] = {nbdry, nint};
1558 unsigned int nblks=2;
1568 goto UseLocRegionsMatrix;
1574 goto UseLocRegionsMatrix;
1579 factor = mat->Scale();
1580 goto UseStdRegionsMatrix;
1583 UseStdRegionsMatrix:
1598 UseLocRegionsMatrix:
1609 Array<OneD,unsigned int> bmap(nbdry);
1610 Array<OneD,unsigned int> imap(nint);
1614 for(i = 0; i < nbdry; ++i)
1616 for(j = 0; j < nbdry; ++j)
1618 (*A)(i,j) = mat(bmap[i],bmap[j]);
1621 for(j = 0; j < nint; ++j)
1623 (*B)(i,j) = mat(bmap[i],imap[j]);
1627 for(i = 0; i < nint; ++i)
1629 for(j = 0; j < nbdry; ++j)
1631 (*C)(i,j) = mat(imap[i],bmap[j]);
1634 for(j = 0; j < nint; ++j)
1636 (*D)(i,j) = mat(imap[i],imap[j]);
1645 (*A) = (*A) - (*B)*(*C);
1681 const Array<OneD, const NekDouble> &inarray,
1682 Array<OneD, NekDouble> &outarray,
1683 Array<OneD, NekDouble> &wsp)
1685 int nquad0 =
m_base[0]->GetNumPoints();
1686 int nquad1 =
m_base[1]->GetNumPoints();
1687 int nquad2 =
m_base[2]->GetNumPoints();
1688 int nqtot = nquad0*nquad1*nquad2;
1692 Array<OneD,NekDouble> alloc(11*nqtot,0.0);
1693 Array<OneD,NekDouble> wsp1 (alloc );
1694 Array<OneD,NekDouble> wsp2 (alloc+ 1*nqtot);
1695 Array<OneD,NekDouble> wsp3 (alloc+ 2*nqtot);
1696 Array<OneD,NekDouble> g0 (alloc+ 3*nqtot);
1697 Array<OneD,NekDouble> g1 (alloc+ 4*nqtot);
1698 Array<OneD,NekDouble> g2 (alloc+ 5*nqtot);
1699 Array<OneD,NekDouble> g3 (alloc+ 6*nqtot);
1700 Array<OneD,NekDouble> g4 (alloc+ 7*nqtot);
1701 Array<OneD,NekDouble> g5 (alloc+ 8*nqtot);
1702 Array<OneD,NekDouble> h0 (alloc+ 3*nqtot);
1703 Array<OneD,NekDouble> h1 (alloc+ 6*nqtot);
1704 Array<OneD,NekDouble> wsp4 (alloc+ 4*nqtot);
1705 Array<OneD,NekDouble> wsp5 (alloc+ 5*nqtot);
1706 Array<OneD,NekDouble> wsp6 (alloc+ 8*nqtot);
1707 Array<OneD,NekDouble> wsp7 (alloc+ 3*nqtot);
1708 Array<OneD,NekDouble> wsp8 (alloc+ 9*nqtot);
1709 Array<OneD,NekDouble> wsp9 (alloc+10*nqtot);
1711 const Array<OneD, const NekDouble>& base0 =
m_base[0]->GetBdata();
1712 const Array<OneD, const NekDouble>& base1 =
m_base[1]->GetBdata();
1713 const Array<OneD, const NekDouble>& base2 =
m_base[2]->GetBdata();
1714 const Array<OneD, const NekDouble>& dbase0 =
m_base[0]->GetDbdata();
1715 const Array<OneD, const NekDouble>& dbase1 =
m_base[1]->GetDbdata();
1716 const Array<OneD, const NekDouble>& dbase2 =
m_base[2]->GetDbdata();
1724 const Array<TwoD, const NekDouble>& df =
1726 const Array<OneD, const NekDouble>& z0 =
m_base[0]->GetZ();
1727 const Array<OneD, const NekDouble>& z2 =
m_base[2]->GetZ();
1731 for (i = 0; i < nquad2; ++i)
1733 Vmath::Fill(nquad0*nquad1, 2.0/(1.0-z2[i]), &h0[0]+i*nquad0*nquad1,1);
1734 Vmath::Fill(nquad0*nquad1, 2.0/(1.0-z2[i]), &h1[0]+i*nquad0*nquad1,1);
1736 for (i = 0; i < nquad0; i++)
1738 Blas::Dscal(nquad1*nquad2, 0.5*(1+z0[i]), &h1[0]+i, nquad0);
1747 Vmath::Vvtvvtp(nqtot, &df[0][0], 1, &h0[0], 1, &df[2][0], 1, &h1[0], 1, &wsp4[0], 1);
1749 Vmath::Vvtvvtp(nqtot, &df[3][0], 1, &h0[0], 1, &df[5][0], 1, &h1[0], 1, &wsp5[0], 1);
1751 Vmath::Vvtvvtp(nqtot, &df[6][0], 1, &h0[0], 1, &df[8][0], 1, &h1[0], 1, &wsp6[0], 1);
1754 Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp4[0], 1, &wsp5[0], 1, &wsp5[0], 1, &g0[0], 1);
1755 Vmath::Vvtvp (nqtot, &wsp6[0], 1, &wsp6[0], 1, &g0[0], 1, &g0[0], 1);
1758 Vmath::Vvtvvtp(nqtot, &df[1][0], 1, &wsp4[0], 1, &df[4][0], 1, &wsp5[0], 1, &g3[0], 1);
1759 Vmath::Vvtvp (nqtot, &df[7][0], 1, &wsp6[0], 1, &g3[0], 1, &g3[0], 1);
1762 Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &wsp4[0], 1, &df[5][0], 1, &wsp5[0], 1, &g4[0], 1);
1763 Vmath::Vvtvp (nqtot, &df[8][0], 1, &wsp6[0], 1, &g4[0], 1, &g4[0], 1);
1767 Vmath::Vvtvvtp(nqtot, &df[1][0], 1, &df[1][0], 1, &df[4][0], 1, &df[4][0], 1, &g1[0], 1);
1768 Vmath::Vvtvp (nqtot, &df[7][0], 1, &df[7][0], 1, &g1[0], 1, &g1[0], 1);
1771 Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &df[2][0], 1, &df[5][0], 1, &df[5][0], 1, &g2[0], 1);
1772 Vmath::Vvtvp (nqtot, &df[8][0], 1, &df[8][0], 1, &g2[0], 1, &g2[0], 1);
1775 Vmath::Vvtvvtp(nqtot, &df[1][0], 1, &df[2][0], 1, &df[4][0], 1, &df[5][0], 1, &g5[0], 1);
1776 Vmath::Vvtvp (nqtot, &df[7][0], 1, &df[8][0], 1, &g5[0], 1, &g5[0], 1);
1781 Vmath::Svtsvtp(nqtot, df[0][0], &h0[0], 1, df[2][0], &h1[0], 1, &wsp4[0], 1);
1783 Vmath::Svtsvtp(nqtot, df[3][0], &h0[0], 1, df[5][0], &h1[0], 1, &wsp5[0], 1);
1785 Vmath::Svtsvtp(nqtot, df[6][0], &h0[0], 1, df[8][0], &h1[0], 1, &wsp6[0], 1);
1788 Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp4[0], 1, &wsp5[0], 1, &wsp5[0], 1, &g0[0], 1);
1789 Vmath::Vvtvp (nqtot, &wsp6[0], 1, &wsp6[0], 1, &g0[0], 1, &g0[0], 1);
1792 Vmath::Svtsvtp(nqtot, df[1][0], &wsp4[0], 1, df[4][0], &wsp5[0], 1, &g3[0], 1);
1793 Vmath::Svtvp (nqtot, df[7][0], &wsp6[0], 1, &g3[0], 1, &g3[0], 1);
1796 Vmath::Svtsvtp(nqtot, df[2][0], &wsp4[0], 1, df[5][0], &wsp5[0], 1, &g4[0], 1);
1797 Vmath::Svtvp (nqtot, df[8][0], &wsp6[0], 1, &g4[0], 1, &g4[0], 1);
1801 Vmath::Fill(nqtot, df[1][0]*df[1][0] + df[4][0]*df[4][0] + df[7][0]*df[7][0], &g1[0], 1);
1804 Vmath::Fill(nqtot, df[2][0]*df[2][0] + df[5][0]*df[5][0] + df[8][0]*df[8][0], &g2[0], 1);
1807 Vmath::Fill(nqtot, df[1][0]*df[2][0] + df[4][0]*df[5][0] + df[7][0]*df[8][0], &g5[0], 1);
1811 Vmath::Vvtvvtp(nqtot,&g0[0],1,&wsp1[0],1,&g3[0],1,&wsp2[0],1,&wsp7[0],1);
1812 Vmath::Vvtvp (nqtot,&g4[0],1,&wsp3[0],1,&wsp7[0],1,&wsp7[0],1);
1813 Vmath::Vvtvvtp(nqtot,&g1[0],1,&wsp2[0],1,&g3[0],1,&wsp1[0],1,&wsp8[0],1);
1814 Vmath::Vvtvp (nqtot,&g5[0],1,&wsp3[0],1,&wsp8[0],1,&wsp8[0],1);
1815 Vmath::Vvtvvtp(nqtot,&g2[0],1,&wsp3[0],1,&g4[0],1,&wsp1[0],1,&wsp9[0],1);
1816 Vmath::Vvtvp (nqtot,&g5[0],1,&wsp2[0],1,&wsp9[0],1,&wsp9[0],1);
1837 Array<OneD, int> &conn,
1840 int np0 =
m_base[0]->GetNumPoints();
1841 int np1 =
m_base[1]->GetNumPoints();
1842 int np2 =
m_base[2]->GetNumPoints();
1843 int np = max(np0,max(np1,np2));
1844 Array<OneD, int> prismpt(6);
1845 bool standard =
true;
1847 int vid0 =
m_geom->GetVid(0);
1848 int vid1 =
m_geom->GetVid(1);
1849 int vid2 =
m_geom->GetVid(4);
1853 if((vid2 < vid1)&&(vid2 < vid0))
1861 else if((vid1 < vid2)&&(vid1 < vid0))
1869 else if ((vid0 < vid2)&&(vid0 < vid1))
1878 conn = Array<OneD, int>(12*(np-1)*(np-1)*(np-1));
1889 Array<OneD, int> rot(3);
1891 rot[0] = (0+rotate)%3;
1892 rot[1] = (1+rotate)%3;
1893 rot[2] = (2+rotate)%3;
1896 for(
int i = 0; i < np-1; ++i)
1898 planep1 += (np-i)*np;
1903 if(standard ==
false)
1905 for(
int j = 0; j < np-1; ++j)
1909 for(
int k = 0; k < np-i-2; ++k)
1912 prismpt[rot[0]] = plane + row + k;
1913 prismpt[rot[1]] = plane + row + k+1;
1914 prismpt[rot[2]] = planep1 + row1 + k;
1916 prismpt[3+rot[0]] = plane + rowp1 + k;
1917 prismpt[3+rot[1]] = plane + rowp1 + k+1;
1918 prismpt[3+rot[2]] = planep1 + row1p1 + k;
1920 conn[cnt++] = prismpt[0];
1921 conn[cnt++] = prismpt[1];
1922 conn[cnt++] = prismpt[3];
1923 conn[cnt++] = prismpt[2];
1925 conn[cnt++] = prismpt[5];
1926 conn[cnt++] = prismpt[2];
1927 conn[cnt++] = prismpt[3];
1928 conn[cnt++] = prismpt[4];
1930 conn[cnt++] = prismpt[3];
1931 conn[cnt++] = prismpt[1];
1932 conn[cnt++] = prismpt[4];
1933 conn[cnt++] = prismpt[2];
1936 prismpt[rot[0]] = planep1 + row1 + k+1;
1937 prismpt[rot[1]] = planep1 + row1 + k;
1938 prismpt[rot[2]] = plane + row + k+1;
1940 prismpt[3+rot[0]] = planep1 + row1p1 + k+1;
1941 prismpt[3+rot[1]] = planep1 + row1p1 + k;
1942 prismpt[3+rot[2]] = plane + rowp1 + k+1;
1945 conn[cnt++] = prismpt[0];
1946 conn[cnt++] = prismpt[1];
1947 conn[cnt++] = prismpt[2];
1948 conn[cnt++] = prismpt[5];
1950 conn[cnt++] = prismpt[5];
1951 conn[cnt++] = prismpt[0];
1952 conn[cnt++] = prismpt[4];
1953 conn[cnt++] = prismpt[1];
1955 conn[cnt++] = prismpt[3];
1956 conn[cnt++] = prismpt[4];
1957 conn[cnt++] = prismpt[0];
1958 conn[cnt++] = prismpt[5];
1963 prismpt[rot[0]] = plane + row + np-i-2;
1964 prismpt[rot[1]] = plane + row + np-i-1;
1965 prismpt[rot[2]] = planep1 + row1 + np-i-2;
1967 prismpt[3+rot[0]] = plane + rowp1 + np-i-2;
1968 prismpt[3+rot[1]] = plane + rowp1 + np-i-1;
1969 prismpt[3+rot[2]] = planep1 + row1p1 + np-i-2;
1971 conn[cnt++] = prismpt[0];
1972 conn[cnt++] = prismpt[1];
1973 conn[cnt++] = prismpt[3];
1974 conn[cnt++] = prismpt[2];
1976 conn[cnt++] = prismpt[5];
1977 conn[cnt++] = prismpt[2];
1978 conn[cnt++] = prismpt[3];
1979 conn[cnt++] = prismpt[4];
1981 conn[cnt++] = prismpt[3];
1982 conn[cnt++] = prismpt[1];
1983 conn[cnt++] = prismpt[4];
1984 conn[cnt++] = prismpt[2];
1993 for(
int j = 0; j < np-1; ++j)
1997 for(
int k = 0; k < np-i-2; ++k)
2000 prismpt[rot[0]] = plane + row + k;
2001 prismpt[rot[1]] = plane + row + k+1;
2002 prismpt[rot[2]] = planep1 + row1 + k;
2004 prismpt[3+rot[0]] = plane + rowp1 + k;
2005 prismpt[3+rot[1]] = plane + rowp1 + k+1;
2006 prismpt[3+rot[2]] = planep1 + row1p1 + k;
2008 conn[cnt++] = prismpt[0];
2009 conn[cnt++] = prismpt[1];
2010 conn[cnt++] = prismpt[4];
2011 conn[cnt++] = prismpt[2];
2013 conn[cnt++] = prismpt[4];
2014 conn[cnt++] = prismpt[3];
2015 conn[cnt++] = prismpt[0];
2016 conn[cnt++] = prismpt[2];
2018 conn[cnt++] = prismpt[3];
2019 conn[cnt++] = prismpt[4];
2020 conn[cnt++] = prismpt[5];
2021 conn[cnt++] = prismpt[2];
2024 prismpt[rot[0]] = planep1 + row1 + k+1;
2025 prismpt[rot[1]] = planep1 + row1 + k;
2026 prismpt[rot[2]] = plane + row + k+1;
2028 prismpt[3+rot[0]] = planep1 + row1p1 + k+1;
2029 prismpt[3+rot[1]] = planep1 + row1p1 + k;
2030 prismpt[3+rot[2]] = plane + rowp1 + k+1;
2032 conn[cnt++] = prismpt[0];
2033 conn[cnt++] = prismpt[2];
2034 conn[cnt++] = prismpt[1];
2035 conn[cnt++] = prismpt[5];
2037 conn[cnt++] = prismpt[3];
2038 conn[cnt++] = prismpt[5];
2039 conn[cnt++] = prismpt[0];
2040 conn[cnt++] = prismpt[1];
2042 conn[cnt++] = prismpt[5];
2043 conn[cnt++] = prismpt[3];
2044 conn[cnt++] = prismpt[4];
2045 conn[cnt++] = prismpt[1];
2049 prismpt[rot[0]] = plane + row + np-i-2;
2050 prismpt[rot[1]] = plane + row + np-i-1;
2051 prismpt[rot[2]] = planep1 + row1 + np-i-2;
2053 prismpt[3+rot[0]] = plane + rowp1 + np-i-2;
2054 prismpt[3+rot[1]] = plane + rowp1 + np-i-1;
2055 prismpt[3+rot[2]] = planep1 + row1p1 + np-i-2;
2057 conn[cnt++] = prismpt[0];
2058 conn[cnt++] = prismpt[1];
2059 conn[cnt++] = prismpt[4];
2060 conn[cnt++] = prismpt[2];
2062 conn[cnt++] = prismpt[4];
2063 conn[cnt++] = prismpt[3];
2064 conn[cnt++] = prismpt[0];
2065 conn[cnt++] = prismpt[2];
2067 conn[cnt++] = prismpt[3];
2068 conn[cnt++] = prismpt[4];
2069 conn[cnt++] = prismpt[5];
2070 conn[cnt++] = prismpt[2];