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();
128 return StdPrismExp::v_Integral(tmp);
148 StdPrismExp::v_PhysDeriv(inarray, diff0, diff1, diff2);
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);
218 if(
m_base[0]->Collocation() &&
219 m_base[1]->Collocation() &&
280 bool multiplybyweights)
282 const int nquad0 =
m_base[0]->GetNumPoints();
283 const int nquad1 =
m_base[1]->GetNumPoints();
284 const int nquad2 =
m_base[2]->GetNumPoints();
285 const int order0 =
m_base[0]->GetNumModes();
286 const int order1 =
m_base[1]->GetNumModes();
290 if(multiplybyweights)
307 inarray,outarray,wsp,
355 const int nquad0 =
m_base[0]->GetNumPoints();
356 const int nquad1 =
m_base[1]->GetNumPoints();
357 const int nquad2 =
m_base[2]->GetNumPoints();
358 const int order0 =
m_base[0]->GetNumModes ();
359 const int order1 =
m_base[1]->GetNumModes ();
360 const int nqtot = nquad0*nquad1*nquad2;
383 Vmath::Vmul(nqtot,&df[3*dir][0], 1,tmp1.get(),1,tmp2.get(),1);
384 Vmath::Vmul(nqtot,&df[3*dir+1][0],1,tmp1.get(),1,tmp3.get(),1);
385 Vmath::Vmul(nqtot,&df[3*dir+2][0],1,tmp1.get(),1,tmp4.get(),1);
389 Vmath::Smul(nqtot, df[3*dir][0], tmp1.get(),1,tmp2.get(), 1);
390 Vmath::Smul(nqtot, df[3*dir+1][0],tmp1.get(),1,tmp3.get(), 1);
391 Vmath::Smul(nqtot, df[3*dir+2][0],tmp1.get(),1,tmp4.get(), 1);
395 for (i = 0; i < nquad0; ++i)
397 gfac0[i] = 0.5*(1+z0[i]);
401 for (i = 0; i < nquad2; ++i)
403 gfac2[i] = 2.0/(1-z2[i]);
406 const int nq01 = nquad0*nquad1;
408 for (i = 0; i < nquad2; ++i)
410 Vmath::Smul(nq01,gfac2[i],&tmp2[0]+i*nq01,1,&tmp2[0]+i*nq01,1);
411 Vmath::Smul(nq01,gfac2[i],&tmp4[0]+i*nq01,1,&tmp5[0]+i*nq01,1);
414 for(i = 0; i < nquad1*nquad2; ++i)
416 Vmath::Vmul(nquad0,&gfac0[0],1,&tmp5[0]+i*nquad0,1,
417 &tmp5[0]+i*nquad0,1);
420 Vmath::Vadd(nqtot, &tmp2[0], 1, &tmp5[0], 1, &tmp2[0], 1);
454 m_base[2]->GetBasisKey());
466 ASSERTL1(Lcoords[0] <= -1.0 && Lcoords[0] >= 1.0 &&
467 Lcoords[1] <= -1.0 && Lcoords[1] >= 1.0 &&
468 Lcoords[2] <= -1.0 && Lcoords[2] >= 1.0,
469 "Local coordinates are not in region [-1,1]");
473 for(i = 0; i <
m_geom->GetCoordim(); ++i)
475 coords[i] =
m_geom->GetCoord(i,Lcoords);
497 return StdPrismExp::v_PhysEvaluate(Lcoord,physvals);
507 m_geom->GetLocCoords(coord, Lcoord);
509 return StdPrismExp::v_PhysEvaluate(Lcoord, physvals);
519 return m_geom->GetCoordim();
524 const std::vector<unsigned int >& nummodes,
525 const int mode_offset,
528 int data_order0 = nummodes[mode_offset];
529 int fillorder0 = min(
m_base[0]->GetNumModes(),data_order0);
530 int data_order1 = nummodes[mode_offset+1];
531 int order1 =
m_base[1]->GetNumModes();
532 int fillorder1 = min(order1,data_order1);
533 int data_order2 = nummodes[mode_offset+2];
534 int order2 =
m_base[2]->GetNumModes();
535 int fillorder2 = min(order2,data_order2);
547 "Extraction routine not set up for this basis");
550 "Extraction routine not set up for this basis");
553 for(j = 0; j < fillorder0; ++j)
555 for(i = 0; i < fillorder1; ++i)
559 cnt += data_order2-j;
564 for(i = fillorder1; i < data_order1; ++i)
566 cnt += data_order2-j;
569 for(i = fillorder1; i < order1; ++i)
577 ASSERTL0(
false,
"basis is either not set up or not "
600 int nquad0 =
m_base[0]->GetNumPoints();
601 int nquad1 =
m_base[1]->GetNumPoints();
602 int nquad2 =
m_base[2]->GetNumPoints();
617 Vmath::Vcopy(nquad0*nquad1,&(inarray[0]),1,&(o_tmp[0]),1);
622 for (
int j=0; j<nquad1; j++)
624 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+j*nquad0,-1,&(o_tmp[0])+(j*nquad0),1);
630 for (
int j=0; j<nquad1; j++)
632 Vmath::Vcopy(nquad0,&(inarray[0])+nquad0*(nquad1-1-j),1,&(o_tmp[0])+(j*nquad0),1);
638 for(
int j=0; j<nquad1; j++)
640 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1-j*nquad0),-1,&(o_tmp[0])+(j*nquad0),1);
646 for (
int i=0; i<nquad0; i++)
648 Vmath::Vcopy(nquad1,&(inarray[0])+i,nquad0,&(o_tmp[0])+(i*nquad1),1);
654 for (
int i=0; i<nquad0; i++)
656 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0-1-i),nquad0,&(o_tmp[0])+(i*nquad1),1);
662 for (
int i=0; i<nquad0; i++)
664 Vmath::Vcopy(nquad1,&(inarray[0])+i+nquad0*(nquad1-1),-nquad0,&(o_tmp[0])+(i*nquad1),1);
670 for (
int i=0; i<nquad0; i++)
672 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0*nquad1-1-i),-nquad0,&(o_tmp[0])+(i*nquad1),1);
677 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),outarray);
683 for (
int k=0; k<nquad2; k++)
685 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1*k),1,&(o_tmp[0])+(k*nquad0),1);
691 for (
int k=0; k<nquad2; k++)
693 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+(nquad0*nquad1*k),-1,&(o_tmp[0])+(k*nquad0),1);
699 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),outarray);
706 nquad0,&(o_tmp[0]),1);
711 for (
int k=0; k<nquad2; k++)
713 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(k*nquad0*nquad1),
714 -nquad0,&(o_tmp[0])+(k*nquad0),1);
720 for (
int k=0; k<nquad2; k++)
722 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0-1)+(nquad0*nquad1*(nquad2-1-k)),
723 nquad0,&(o_tmp[0])+(k*nquad0),1);
729 for (
int k=0; k<nquad2; k++)
731 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(nquad0*nquad1*(nquad2-1-k)),
732 -nquad0,&(o_tmp[0])+(k*nquad0),1);
738 for (
int j=0; j<nquad1; j++)
740 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0-1)+(j*nquad0),
741 nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
747 for (
int j=0; j<nquad0; j++)
749 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1-1-j*nquad0),
750 nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
756 for (
int j=0; j<nquad0; j++)
758 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*(nquad2-1)+nquad0+j*nquad0,
759 -nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
765 for (
int j=0; j<nquad0; j++)
767 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*nquad1*nquad2-1-j*nquad0),
768 -nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
773 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),outarray);
779 for (
int k=0; k<nquad2; k++)
781 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*(nquad1-1))+(k*nquad0*nquad1),
782 1,&(o_tmp[0])+(k*nquad0),1);
788 for (
int k=0; k<nquad2; k++)
790 Vmath::Vcopy(nquad0,&(inarray[0])+(nquad0*nquad1-1)+(k*nquad0*nquad1),
791 -1,&(o_tmp[0])+(k*nquad0),1);
796 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),outarray);
803 Vmath::Vcopy(nquad1*nquad2,&(inarray[0]),nquad0,&(o_tmp[0]),1);
808 for (
int k=0; k<nquad2; k++)
810 Vmath::Vcopy(nquad1,&(inarray[0])+nquad0*(nquad1-1)+(k*nquad0*nquad1),
811 -nquad0,&(o_tmp[0])+(k*nquad1),1);
817 for (
int k=0; k<nquad2; k++)
819 Vmath::Vcopy(nquad1,&(inarray[0])+(nquad0*nquad1*(nquad2-1-k)),
820 nquad0,&(o_tmp[0])+(k*nquad1),1);
826 for (
int k=0; k<nquad2; k++)
828 Vmath::Vcopy(nquad1,&(inarray[0])+nquad0*(nquad1-1)+(nquad0*nquad1*(nquad2-1-k)),
829 -nquad0,&(o_tmp[0])+(k*nquad1),1);
835 for (
int j=0; j<nquad1; j++)
837 Vmath::Vcopy(nquad2,&(inarray[0])+j*nquad0,nquad0*nquad1,
838 &(o_tmp[0])+(j*nquad2),1);
844 for (
int j=0; j<nquad1; j++)
846 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*(nquad1-1)-j*nquad0),
847 nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
853 for (
int j=0; j<nquad1; j++)
855 Vmath::Vcopy(nquad2,&(inarray[0])+nquad0*nquad1*(nquad2-1)+j*nquad0,
856 -nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
862 for (
int j=0; j<nquad1; j++)
864 Vmath::Vcopy(nquad2,&(inarray[0])+(nquad0*(nquad1*nquad2-1)-j*nquad0),
865 -nquad0*nquad1,&(o_tmp[0])+(j*nquad2),1);
870 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),outarray);
873 ASSERTL0(
false,
"face value (> 4) is out of range");
891 int nq0 = ptsKeys[0].GetNumPoints();
892 int nq1 = ptsKeys[1].GetNumPoints();
893 int nq2 = ptsKeys[2].GetNumPoints();
909 for (i = 0; i < vCoordDim; ++i)
924 for(i = 0; i < vCoordDim; ++i)
926 normal[i][0] = -df[3*i+2][0];;
932 for(i = 0; i < vCoordDim; ++i)
934 normal[i][0] = -df[3*i+1][0];
940 for(i = 0; i < vCoordDim; ++i)
942 normal[i][0] = df[3*i][0]+df[3*i+2][0];
948 for(i = 0; i < vCoordDim; ++i)
950 normal[i][0] = df[3*i+1][0];
956 for(i = 0; i < vCoordDim; ++i)
958 normal[i][0] = -df[3*i][0];
963 ASSERTL0(
false,
"face is out of range (face < 4)");
968 for(i = 0; i < vCoordDim; ++i)
970 fac += normal[i][0]*normal[i][0];
973 for (i = 0; i < vCoordDim; ++i)
988 else if (face == 1 || face == 3)
1010 for(j = 0; j < nq01; ++j)
1012 normals[j] = -df[2][j]*jac[j];
1013 normals[nqtot+j] = -df[5][j]*jac[j];
1014 normals[2*nqtot+j] = -df[8][j]*jac[j];
1015 faceJac[j] = jac[j];
1018 points0 = ptsKeys[0];
1019 points1 = ptsKeys[1];
1025 for (j = 0; j < nq0; ++j)
1027 for(k = 0; k < nq2; ++k)
1031 -df[1][tmp]*jac[tmp];
1032 normals[nqtot+j+k*nq0] =
1033 -df[4][tmp]*jac[tmp];
1034 normals[2*nqtot+j+k*nq0] =
1035 -df[7][tmp]*jac[tmp];
1036 faceJac[j+k*nq0] = jac[tmp];
1040 points0 = ptsKeys[0];
1041 points1 = ptsKeys[2];
1047 for (j = 0; j < nq1; ++j)
1049 for(k = 0; k < nq2; ++k)
1051 int tmp = nq0-1+nq0*j+nq01*k;
1053 (df[0][tmp]+df[2][tmp])*jac[tmp];
1054 normals[nqtot+j+k*nq1] =
1055 (df[3][tmp]+df[5][tmp])*jac[tmp];
1056 normals[2*nqtot+j+k*nq1] =
1057 (df[6][tmp]+df[8][tmp])*jac[tmp];
1058 faceJac[j+k*nq1] = jac[tmp];
1062 points0 = ptsKeys[1];
1063 points1 = ptsKeys[2];
1069 for (j = 0; j < nq0; ++j)
1071 for(k = 0; k < nq2; ++k)
1073 int tmp = nq0*(nq1-1) + j + nq01*k;
1075 df[1][tmp]*jac[tmp];
1076 normals[nqtot+j+k*nq0] =
1077 df[4][tmp]*jac[tmp];
1078 normals[2*nqtot+j+k*nq0] =
1079 df[7][tmp]*jac[tmp];
1080 faceJac[j+k*nq0] = jac[tmp];
1084 points0 = ptsKeys[0];
1085 points1 = ptsKeys[2];
1091 for (j = 0; j < nq1; ++j)
1093 for(k = 0; k < nq2; ++k)
1095 int tmp = j*nq0+nq01*k;
1097 -df[0][tmp]*jac[tmp];
1098 normals[nqtot+j+k*nq1] =
1099 -df[3][tmp]*jac[tmp];
1100 normals[2*nqtot+j+k*nq1] =
1101 -df[6][tmp]*jac[tmp];
1102 faceJac[j+k*nq1] = jac[tmp];
1106 points0 = ptsKeys[1];
1107 points1 = ptsKeys[2];
1112 ASSERTL0(
false,
"face is out of range (face < 4)");
1122 Vmath::Sdiv(nq_face, 1.0, &work[0], 1, &work[0], 1);
1125 for(i = 0; i < vCoordDim; ++i)
1132 Vmath::Vmul(nq_face,work,1,normal[i],1,normal[i],1);
1139 Vmath::Vvtvp(nq_face,normal[i],1,normal[i],1,work,1,work,1);
1147 Vmath::Vmul(nq_face,normal[i],1,work,1,normal[i],1);
1157 StdExpansion::MassMatrixOp_MatFree(inarray,outarray,mkey);
1175 StdExpansion::LaplacianMatrixOp_MatFree(k1,k2,inarray,outarray,mkey);
1193 if(inarray.get() == outarray.get())
1198 Blas::Dgemv(
'N',
m_ncoeffs,
m_ncoeffs,mat->Scale(),(mat->GetOwnedMatrix())->GetPtr().get(),
1199 m_ncoeffs, tmp.get(), 1, 0.0, outarray.get(), 1);
1203 Blas::Dgemv(
'N',
m_ncoeffs,
m_ncoeffs,mat->Scale(),(mat->GetOwnedMatrix())->GetPtr().get(),
1204 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
1231 StdPrismExp::v_SVVLaplacianFilter( array, mkey);
1258 returnval = StdPrismExp::v_GenMatrix(mkey);
1273 return tmp->GetStdMatrix(mkey);
1297 "Geometric information is not set up");
1382 int rows = deriv0.GetRows();
1383 int cols = deriv1.GetColumns();
1388 (*WeakDeriv) = df[3*dir ][0]*deriv0
1389 + df[3*dir+1][0]*deriv1
1390 + df[3*dir+2][0]*deriv2;
1435 int rows = lap00.GetRows();
1436 int cols = lap00.GetColumns();
1441 (*lap) = gmat[0][0]*lap00
1446 + gmat[7][0]*(lap12 +
Transpose(lap12));
1464 int rows = LapMat.GetRows();
1465 int cols = LapMat.GetColumns();
1470 (*helm) = LapMat + factor*MassMat;
1616 unsigned int nint = (
unsigned int)(
m_ncoeffs - nbdry);
1617 unsigned int exp_size[] = {nbdry, nint};
1618 unsigned int nblks=2;
1628 goto UseLocRegionsMatrix;
1634 goto UseLocRegionsMatrix;
1639 factor = mat->Scale();
1640 goto UseStdRegionsMatrix;
1643 UseStdRegionsMatrix:
1658 UseLocRegionsMatrix:
1674 for(i = 0; i < nbdry; ++i)
1676 for(j = 0; j < nbdry; ++j)
1678 (*A)(i,j) = mat(bmap[i],bmap[j]);
1681 for(j = 0; j < nint; ++j)
1683 (*B)(i,j) = mat(bmap[i],imap[j]);
1687 for(i = 0; i < nint; ++i)
1689 for(j = 0; j < nbdry; ++j)
1691 (*C)(i,j) = mat(imap[i],bmap[j]);
1694 for(j = 0; j < nint; ++j)
1696 (*D)(i,j) = mat(imap[i],imap[j]);
1705 (*A) = (*A) - (*B)*(*C);
1745 int nquad0 =
m_base[0]->GetNumPoints();
1746 int nquad1 =
m_base[1]->GetNumPoints();
1747 int nquad2 =
m_base[2]->GetNumPoints();
1748 int nqtot = nquad0*nquad1*nquad2;
1782 StdExpansion3D::PhysTensorDeriv(inarray,wsp1,wsp2,wsp3);
1791 for (i = 0; i < nquad2; ++i)
1793 Vmath::Fill(nquad0*nquad1, 2.0/(1.0-z2[i]), &h0[0]+i*nquad0*nquad1,1);
1794 Vmath::Fill(nquad0*nquad1, 2.0/(1.0-z2[i]), &h1[0]+i*nquad0*nquad1,1);
1796 for (i = 0; i < nquad0; i++)
1798 Blas::Dscal(nquad1*nquad2, 0.5*(1+z0[i]), &h1[0]+i, nquad0);
1807 Vmath::Vvtvvtp(nqtot, &df[0][0], 1, &h0[0], 1, &df[2][0], 1, &h1[0], 1, &wsp4[0], 1);
1809 Vmath::Vvtvvtp(nqtot, &df[3][0], 1, &h0[0], 1, &df[5][0], 1, &h1[0], 1, &wsp5[0], 1);
1811 Vmath::Vvtvvtp(nqtot, &df[6][0], 1, &h0[0], 1, &df[8][0], 1, &h1[0], 1, &wsp6[0], 1);
1814 Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp4[0], 1, &wsp5[0], 1, &wsp5[0], 1, &g0[0], 1);
1815 Vmath::Vvtvp (nqtot, &wsp6[0], 1, &wsp6[0], 1, &g0[0], 1, &g0[0], 1);
1818 Vmath::Vvtvvtp(nqtot, &df[1][0], 1, &wsp4[0], 1, &df[4][0], 1, &wsp5[0], 1, &g3[0], 1);
1819 Vmath::Vvtvp (nqtot, &df[7][0], 1, &wsp6[0], 1, &g3[0], 1, &g3[0], 1);
1822 Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &wsp4[0], 1, &df[5][0], 1, &wsp5[0], 1, &g4[0], 1);
1823 Vmath::Vvtvp (nqtot, &df[8][0], 1, &wsp6[0], 1, &g4[0], 1, &g4[0], 1);
1827 Vmath::Vvtvvtp(nqtot, &df[1][0], 1, &df[1][0], 1, &df[4][0], 1, &df[4][0], 1, &g1[0], 1);
1828 Vmath::Vvtvp (nqtot, &df[7][0], 1, &df[7][0], 1, &g1[0], 1, &g1[0], 1);
1831 Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &df[2][0], 1, &df[5][0], 1, &df[5][0], 1, &g2[0], 1);
1832 Vmath::Vvtvp (nqtot, &df[8][0], 1, &df[8][0], 1, &g2[0], 1, &g2[0], 1);
1835 Vmath::Vvtvvtp(nqtot, &df[1][0], 1, &df[2][0], 1, &df[4][0], 1, &df[5][0], 1, &g5[0], 1);
1836 Vmath::Vvtvp (nqtot, &df[7][0], 1, &df[8][0], 1, &g5[0], 1, &g5[0], 1);
1841 Vmath::Svtsvtp(nqtot, df[0][0], &h0[0], 1, df[2][0], &h1[0], 1, &wsp4[0], 1);
1843 Vmath::Svtsvtp(nqtot, df[3][0], &h0[0], 1, df[5][0], &h1[0], 1, &wsp5[0], 1);
1845 Vmath::Svtsvtp(nqtot, df[6][0], &h0[0], 1, df[8][0], &h1[0], 1, &wsp6[0], 1);
1848 Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp4[0], 1, &wsp5[0], 1, &wsp5[0], 1, &g0[0], 1);
1849 Vmath::Vvtvp (nqtot, &wsp6[0], 1, &wsp6[0], 1, &g0[0], 1, &g0[0], 1);
1852 Vmath::Svtsvtp(nqtot, df[1][0], &wsp4[0], 1, df[4][0], &wsp5[0], 1, &g3[0], 1);
1853 Vmath::Svtvp (nqtot, df[7][0], &wsp6[0], 1, &g3[0], 1, &g3[0], 1);
1856 Vmath::Svtsvtp(nqtot, df[2][0], &wsp4[0], 1, df[5][0], &wsp5[0], 1, &g4[0], 1);
1857 Vmath::Svtvp (nqtot, df[8][0], &wsp6[0], 1, &g4[0], 1, &g4[0], 1);
1861 Vmath::Fill(nqtot, df[1][0]*df[1][0] + df[4][0]*df[4][0] + df[7][0]*df[7][0], &g1[0], 1);
1864 Vmath::Fill(nqtot, df[2][0]*df[2][0] + df[5][0]*df[5][0] + df[8][0]*df[8][0], &g2[0], 1);
1867 Vmath::Fill(nqtot, df[1][0]*df[2][0] + df[4][0]*df[5][0] + df[7][0]*df[8][0], &g5[0], 1);
1871 Vmath::Vvtvvtp(nqtot,&g0[0],1,&wsp1[0],1,&g3[0],1,&wsp2[0],1,&wsp7[0],1);
1872 Vmath::Vvtvp (nqtot,&g4[0],1,&wsp3[0],1,&wsp7[0],1,&wsp7[0],1);
1873 Vmath::Vvtvvtp(nqtot,&g1[0],1,&wsp2[0],1,&g3[0],1,&wsp1[0],1,&wsp8[0],1);
1874 Vmath::Vvtvp (nqtot,&g5[0],1,&wsp3[0],1,&wsp8[0],1,&wsp8[0],1);
1875 Vmath::Vvtvvtp(nqtot,&g2[0],1,&wsp3[0],1,&g4[0],1,&wsp1[0],1,&wsp9[0],1);
1876 Vmath::Vvtvp (nqtot,&g5[0],1,&wsp2[0],1,&wsp9[0],1,&wsp9[0],1);
1900 int np0 =
m_base[0]->GetNumPoints();
1901 int np1 =
m_base[1]->GetNumPoints();
1902 int np2 =
m_base[2]->GetNumPoints();
1903 int np = max(np0,max(np1,np2));
1905 bool standard =
true;
1907 int vid0 =
m_geom->GetVid(0);
1908 int vid1 =
m_geom->GetVid(1);
1909 int vid2 =
m_geom->GetVid(4);
1913 if((vid2 < vid1)&&(vid2 < vid0))
1921 else if((vid1 < vid2)&&(vid1 < vid0))
1929 else if ((vid0 < vid2)&&(vid0 < vid1))
1951 rot[0] = (0+rotate)%3;
1952 rot[1] = (1+rotate)%3;
1953 rot[2] = (2+rotate)%3;
1956 for(
int i = 0; i < np-1; ++i)
1958 planep1 += (np-i)*np;
1963 if(standard ==
false)
1965 for(
int j = 0; j < np-1; ++j)
1969 for(
int k = 0; k < np-i-2; ++k)
1972 prismpt[rot[0]] = plane + row + k;
1973 prismpt[rot[1]] = plane + row + k+1;
1974 prismpt[rot[2]] = planep1 + row1 + k;
1976 prismpt[3+rot[0]] = plane + rowp1 + k;
1977 prismpt[3+rot[1]] = plane + rowp1 + k+1;
1978 prismpt[3+rot[2]] = planep1 + row1p1 + k;
1980 conn[cnt++] = prismpt[0];
1981 conn[cnt++] = prismpt[1];
1982 conn[cnt++] = prismpt[3];
1983 conn[cnt++] = prismpt[2];
1985 conn[cnt++] = prismpt[5];
1986 conn[cnt++] = prismpt[2];
1987 conn[cnt++] = prismpt[3];
1988 conn[cnt++] = prismpt[4];
1990 conn[cnt++] = prismpt[3];
1991 conn[cnt++] = prismpt[1];
1992 conn[cnt++] = prismpt[4];
1993 conn[cnt++] = prismpt[2];
1996 prismpt[rot[0]] = planep1 + row1 + k+1;
1997 prismpt[rot[1]] = planep1 + row1 + k;
1998 prismpt[rot[2]] = plane + row + k+1;
2000 prismpt[3+rot[0]] = planep1 + row1p1 + k+1;
2001 prismpt[3+rot[1]] = planep1 + row1p1 + k;
2002 prismpt[3+rot[2]] = plane + rowp1 + k+1;
2005 conn[cnt++] = prismpt[0];
2006 conn[cnt++] = prismpt[1];
2007 conn[cnt++] = prismpt[2];
2008 conn[cnt++] = prismpt[5];
2010 conn[cnt++] = prismpt[5];
2011 conn[cnt++] = prismpt[0];
2012 conn[cnt++] = prismpt[4];
2013 conn[cnt++] = prismpt[1];
2015 conn[cnt++] = prismpt[3];
2016 conn[cnt++] = prismpt[4];
2017 conn[cnt++] = prismpt[0];
2018 conn[cnt++] = prismpt[5];
2023 prismpt[rot[0]] = plane + row + np-i-2;
2024 prismpt[rot[1]] = plane + row + np-i-1;
2025 prismpt[rot[2]] = planep1 + row1 + np-i-2;
2027 prismpt[3+rot[0]] = plane + rowp1 + np-i-2;
2028 prismpt[3+rot[1]] = plane + rowp1 + np-i-1;
2029 prismpt[3+rot[2]] = planep1 + row1p1 + np-i-2;
2031 conn[cnt++] = prismpt[0];
2032 conn[cnt++] = prismpt[1];
2033 conn[cnt++] = prismpt[3];
2034 conn[cnt++] = prismpt[2];
2036 conn[cnt++] = prismpt[5];
2037 conn[cnt++] = prismpt[2];
2038 conn[cnt++] = prismpt[3];
2039 conn[cnt++] = prismpt[4];
2041 conn[cnt++] = prismpt[3];
2042 conn[cnt++] = prismpt[1];
2043 conn[cnt++] = prismpt[4];
2044 conn[cnt++] = prismpt[2];
2053 for(
int j = 0; j < np-1; ++j)
2057 for(
int k = 0; k < np-i-2; ++k)
2060 prismpt[rot[0]] = plane + row + k;
2061 prismpt[rot[1]] = plane + row + k+1;
2062 prismpt[rot[2]] = planep1 + row1 + k;
2064 prismpt[3+rot[0]] = plane + rowp1 + k;
2065 prismpt[3+rot[1]] = plane + rowp1 + k+1;
2066 prismpt[3+rot[2]] = planep1 + row1p1 + k;
2068 conn[cnt++] = prismpt[0];
2069 conn[cnt++] = prismpt[1];
2070 conn[cnt++] = prismpt[4];
2071 conn[cnt++] = prismpt[2];
2073 conn[cnt++] = prismpt[4];
2074 conn[cnt++] = prismpt[3];
2075 conn[cnt++] = prismpt[0];
2076 conn[cnt++] = prismpt[2];
2078 conn[cnt++] = prismpt[3];
2079 conn[cnt++] = prismpt[4];
2080 conn[cnt++] = prismpt[5];
2081 conn[cnt++] = prismpt[2];
2084 prismpt[rot[0]] = planep1 + row1 + k+1;
2085 prismpt[rot[1]] = planep1 + row1 + k;
2086 prismpt[rot[2]] = plane + row + k+1;
2088 prismpt[3+rot[0]] = planep1 + row1p1 + k+1;
2089 prismpt[3+rot[1]] = planep1 + row1p1 + k;
2090 prismpt[3+rot[2]] = plane + rowp1 + k+1;
2092 conn[cnt++] = prismpt[0];
2093 conn[cnt++] = prismpt[2];
2094 conn[cnt++] = prismpt[1];
2095 conn[cnt++] = prismpt[5];
2097 conn[cnt++] = prismpt[3];
2098 conn[cnt++] = prismpt[5];
2099 conn[cnt++] = prismpt[0];
2100 conn[cnt++] = prismpt[1];
2102 conn[cnt++] = prismpt[5];
2103 conn[cnt++] = prismpt[3];
2104 conn[cnt++] = prismpt[4];
2105 conn[cnt++] = prismpt[1];
2109 prismpt[rot[0]] = plane + row + np-i-2;
2110 prismpt[rot[1]] = plane + row + np-i-1;
2111 prismpt[rot[2]] = planep1 + row1 + np-i-2;
2113 prismpt[3+rot[0]] = plane + rowp1 + np-i-2;
2114 prismpt[3+rot[1]] = plane + rowp1 + np-i-1;
2115 prismpt[3+rot[2]] = planep1 + row1p1 + np-i-2;
2117 conn[cnt++] = prismpt[0];
2118 conn[cnt++] = prismpt[1];
2119 conn[cnt++] = prismpt[4];
2120 conn[cnt++] = prismpt[2];
2122 conn[cnt++] = prismpt[4];
2123 conn[cnt++] = prismpt[3];
2124 conn[cnt++] = prismpt[0];
2125 conn[cnt++] = prismpt[2];
2127 conn[cnt++] = prismpt[3];
2128 conn[cnt++] = prismpt[4];
2129 conn[cnt++] = prismpt[5];
2130 conn[cnt++] = prismpt[2];
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
const LibUtilities::PointsKeyVector GetPointsKeys() const
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
NekDouble GetConstFactor(const ConstFactorType &factor) const
virtual void v_GetFacePhysVals(const int face, const StdRegions::StdExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient)
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
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
const VarCoeffMap & GetVarCoeffs() const
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
Get the coordinates #coords at the local coordinates #Lcoords.
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculates the inner product .
std::vector< PointsKey > PointsKeyVector
DNekMatSharedPtr BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
MatrixType GetMatrixType() const
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
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 void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculate the inner product of inarray with respect to the basis B=base0*base1*base2 and put into out...
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
boost::shared_ptr< StdPrismExp > StdPrismExpSharedPtr
virtual void v_GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
void LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
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 .
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_GetSimplexEquiSpacedConnectivity(Array< OneD, int > &conn, bool standard=true)
DNekMatSharedPtr BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
LibUtilities::ShapeType GetShapeType() const
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 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)
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
boost::shared_ptr< DNekMat > DNekMatSharedPtr
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.
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...
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
bool ConstFactorExists(const ConstFactorType &factor) const
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
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
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrate the physical point list inarray over prismatic region and return the value.
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
DNekBlkMatSharedPtr GetStdStaticCondMatrix(const StdMatrixKey &mkey)
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
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)
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
Calculate the Laplacian multiplication in a matrix-free manner.
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
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)
int getNumberOfCoefficients(int Na)
Principle Modified Functions .
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
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
PrismExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, const SpatialDomains::PrismGeomSharedPtr &geom)
Constructor using BasisKey class for quadrature points and order definition.
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
virtual void v_GetTracePhysVals(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.
void v_ComputeFaceNormal(const int face)
Get the normals along specficied face Get the face normals interplated to a points0 x points 0 type d...
void GetInteriorMap(Array< OneD, unsigned int > &outarray)
NekMatrix< InnerMatrixType, BlockMatrixTag > Transpose(NekMatrix< InnerMatrixType, BlockMatrixTag > &rhs)
Defines a specification for a set of points.
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 DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
virtual int v_GetCoordim()
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.
boost::shared_ptr< PrismGeom > PrismGeomSharedPtr
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coord, const Array< OneD, const NekDouble > &physvals)
This function evaluates the expansion at a single (arbitrary) point of the domain.
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.
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
void Svtsvtp(int n, const T alpha, const T *x, int incx, const T beta, const T *y, int incy, T *z, int incz)
vvtvvtp (scalar times vector plus scalar times vector):
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
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)
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Geometry is curved or has non-constant factors.
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
Describes the specification for a Basis.
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.