43 namespace LocalRegions
63 StdExpansion (LibUtilities::StdTetData::
getNumberOfCoefficients(Ba.GetNumModes(),Bb.GetNumModes(),Bc.GetNumModes()),3,Ba,Bb,Bc),
64 StdExpansion3D(LibUtilities::StdTetData::
getNumberOfCoefficients(Ba.GetNumModes(),Bb.GetNumModes(),Bc.GetNumModes()),Ba,Bb,Bc),
65 StdRegions::StdTetExp(Ba,Bb,Bc),
69 boost::bind(&
TetExp::CreateMatrix, this, _1),
70 std::string(
"TetExpMatrix")),
71 m_staticCondMatrixManager(
72 boost::bind(&
TetExp::CreateStaticCondMatrix, this, _1),
73 std::string(
"TetExpStaticCondMatrix"))
84 StdRegions::StdTetExp(T),
87 m_matrixManager(T.m_matrixManager),
88 m_staticCondMatrixManager(T.m_staticCondMatrixManager)
115 const Array<OneD, const NekDouble> &inarray)
117 int nquad0 =
m_base[0]->GetNumPoints();
118 int nquad1 =
m_base[1]->GetNumPoints();
119 int nquad2 =
m_base[2]->GetNumPoints();
122 Array<OneD,NekDouble> tmp(nquad0*nquad1*nquad2);
156 const Array<OneD, const NekDouble> &inarray,
157 Array<OneD, NekDouble> &out_d0,
158 Array<OneD, NekDouble> &out_d1,
159 Array<OneD, NekDouble> &out_d2)
161 int TotPts =
m_base[0]->GetNumPoints()*
m_base[1]->GetNumPoints()*
162 m_base[2]->GetNumPoints();
164 Array<TwoD, const NekDouble> df =
166 Array<OneD,NekDouble> Diff0 = Array<OneD,NekDouble>(3*TotPts);
167 Array<OneD,NekDouble> Diff1 = Diff0 + TotPts;
168 Array<OneD,NekDouble> Diff2 = Diff1 + TotPts;
174 if(out_d0.num_elements())
176 Vmath::Vmul (TotPts,&df[0][0],1,&Diff0[0],1, &out_d0[0], 1);
177 Vmath::Vvtvp (TotPts,&df[1][0],1,&Diff1[0],1, &out_d0[0], 1,&out_d0[0],1);
178 Vmath::Vvtvp (TotPts,&df[2][0],1,&Diff2[0],1, &out_d0[0], 1,&out_d0[0],1);
181 if(out_d1.num_elements())
183 Vmath::Vmul (TotPts,&df[3][0],1,&Diff0[0],1, &out_d1[0], 1);
184 Vmath::Vvtvp (TotPts,&df[4][0],1,&Diff1[0],1, &out_d1[0], 1,&out_d1[0],1);
185 Vmath::Vvtvp (TotPts,&df[5][0],1,&Diff2[0],1, &out_d1[0], 1,&out_d1[0],1);
188 if(out_d2.num_elements())
190 Vmath::Vmul (TotPts,&df[6][0],1,&Diff0[0],1, &out_d2[0], 1);
191 Vmath::Vvtvp (TotPts,&df[7][0],1,&Diff1[0],1, &out_d2[0], 1, &out_d2[0],1);
192 Vmath::Vvtvp (TotPts,&df[8][0],1,&Diff2[0],1, &out_d2[0], 1, &out_d2[0],1);
197 if(out_d0.num_elements())
199 Vmath::Smul (TotPts,df[0][0],&Diff0[0],1, &out_d0[0], 1);
200 Blas::Daxpy (TotPts,df[1][0],&Diff1[0],1, &out_d0[0], 1);
201 Blas::Daxpy (TotPts,df[2][0],&Diff2[0],1, &out_d0[0], 1);
204 if(out_d1.num_elements())
206 Vmath::Smul (TotPts,df[3][0],&Diff0[0],1, &out_d1[0], 1);
207 Blas::Daxpy (TotPts,df[4][0],&Diff1[0],1, &out_d1[0], 1);
208 Blas::Daxpy (TotPts,df[5][0],&Diff2[0],1, &out_d1[0], 1);
211 if(out_d2.num_elements())
213 Vmath::Smul (TotPts,df[6][0],&Diff0[0],1, &out_d2[0], 1);
214 Blas::Daxpy (TotPts,df[7][0],&Diff1[0],1, &out_d2[0], 1);
215 Blas::Daxpy (TotPts,df[8][0],&Diff2[0],1, &out_d2[0], 1);
234 const Array<OneD, const NekDouble> & inarray,
235 Array<OneD,NekDouble> &outarray)
237 if((
m_base[0]->Collocation())&&(
m_base[1]->Collocation())&&(
m_base[2]->Collocation()))
288 const Array<OneD, const NekDouble> &inarray,
289 Array<OneD, NekDouble> &outarray)
295 const Array<OneD, const NekDouble> &inarray,
296 Array<OneD, NekDouble> &outarray)
298 const int nquad0 =
m_base[0]->GetNumPoints();
299 const int nquad1 =
m_base[1]->GetNumPoints();
300 const int nquad2 =
m_base[2]->GetNumPoints();
301 const int order0 =
m_base[0]->GetNumModes();
302 const int order1 =
m_base[1]->GetNumModes();
303 Array<OneD, NekDouble> wsp(nquad1*nquad2*order0 +
304 nquad2*order0*(order1+1)/2);
305 Array<OneD, NekDouble> tmp(nquad0*nquad1*nquad2);
347 const Array<OneD, const NekDouble> &inarray,
348 Array<OneD, NekDouble> &outarray)
350 const int nquad0 =
m_base[0]->GetNumPoints();
351 const int nquad1 =
m_base[1]->GetNumPoints();
352 const int nquad2 =
m_base[2]->GetNumPoints();
353 const int order0 =
m_base[0]->GetNumModes ();
354 const int order1 =
m_base[1]->GetNumModes ();
355 const int nqtot = nquad0*nquad1*nquad2;
358 const Array<OneD, const NekDouble> &z0 =
m_base[0]->GetZ();
359 const Array<OneD, const NekDouble> &z1 =
m_base[1]->GetZ();
360 const Array<OneD, const NekDouble> &z2 =
m_base[2]->GetZ();
362 Array<OneD, NekDouble> h0 (nqtot);
363 Array<OneD, NekDouble> h1 (nqtot);
364 Array<OneD, NekDouble> h2 (nqtot);
365 Array<OneD, NekDouble> h3 (nqtot);
366 Array<OneD, NekDouble> tmp1 (nqtot);
367 Array<OneD, NekDouble> tmp2 (nqtot);
368 Array<OneD, NekDouble> tmp3 (nqtot);
369 Array<OneD, NekDouble> tmp4 (nqtot);
370 Array<OneD, NekDouble> tmp5 (nqtot);
372 Array<OneD, NekDouble> wsp (nquad1*nquad2*order0 +
373 nquad2*order0*(order1+1)/2);
375 const Array<TwoD, const NekDouble>& df =
382 Vmath::Vmul(nqtot,&df[3*dir][0], 1,tmp1.get(),1,tmp2.get(),1);
383 Vmath::Vmul(nqtot,&df[3*dir+1][0],1,tmp1.get(),1,tmp3.get(),1);
384 Vmath::Vmul(nqtot,&df[3*dir+2][0],1,tmp1.get(),1,tmp4.get(),1);
388 Vmath::Smul(nqtot, df[3*dir ][0],tmp1.get(),1,tmp2.get(), 1);
389 Vmath::Smul(nqtot, df[3*dir+1][0],tmp1.get(),1,tmp3.get(), 1);
390 Vmath::Smul(nqtot, df[3*dir+2][0],tmp1.get(),1,tmp4.get(), 1);
393 const int nq01 = nquad0*nquad1;
394 const int nq12 = nquad1*nquad2;
396 for(j = 0; j < nquad2; ++j)
398 for(i = 0; i < nquad1; ++i)
401 &h0[0]+i*nquad0 + j*nq01,1);
403 &h1[0]+i*nquad0 + j*nq01,1);
405 &h2[0]+i*nquad0 + j*nq01,1);
407 &h3[0]+i*nquad0 + j*nq01,1);
411 for(i = 0; i < nquad0; i++)
413 Blas::Dscal(nq12, 1+z0[i], &h1[0]+i, nquad0);
418 &tmp3[0], 1, &h1[0], 1,
421 &tmp5[0], 1, &tmp5[0], 1);
431 &tmp4[0], 1, &h3[0], 1,
463 const Array<OneD, const NekDouble> &Lcoord,
464 const Array<OneD, const NekDouble> &physvals)
475 const Array<OneD, const NekDouble> &coord,
476 const Array<OneD, const NekDouble> & physvals)
480 Array<OneD,NekDouble> Lcoord = Array<OneD,NekDouble>(3);
483 m_geom->GetLocCoords(coord,Lcoord);
493 const Array<OneD, const NekDouble> &Lcoords,
494 Array<OneD,NekDouble> &coords)
498 ASSERTL1(Lcoords[0] <= -1.0 && Lcoords[0] >= 1.0 &&
499 Lcoords[1] <= -1.0 && Lcoords[1] >= 1.0 &&
500 Lcoords[2] <= -1.0 && Lcoords[2] >= 1.0,
501 "Local coordinates are not in region [-1,1]");
505 for(i = 0; i <
m_geom->GetCoordim(); ++i)
507 coords[i] =
m_geom->GetCoord(i,Lcoords);
512 Array<OneD, NekDouble> &coords_0,
513 Array<OneD, NekDouble> &coords_1,
514 Array<OneD, NekDouble> &coords_2)
534 return m_geom->GetCoordim();
541 const std::vector<unsigned int > &nummodes,
542 const int mode_offset,
545 int data_order0 = nummodes[mode_offset];
546 int fillorder0 = min(
m_base[0]->GetNumModes(),data_order0);
547 int data_order1 = nummodes[mode_offset+1];
548 int order1 =
m_base[1]->GetNumModes();
549 int fillorder1 = min(order1,data_order1);
550 int data_order2 = nummodes[mode_offset+2];
551 int order2 =
m_base[2]->GetNumModes();
552 int fillorder2 = min(order2,data_order2);
564 "Extraction routine not set up for this basis");
567 "Extraction routine not set up for this basis");
570 for(j = 0; j < fillorder0; ++j)
572 for(i = 0; i < fillorder1-j; ++i)
576 cnt += data_order2-j-i;
581 for(i = fillorder1-j; i < data_order1-j; ++i)
583 cnt += data_order2-j-i;
586 for(i = fillorder1-j; i < order1-j; ++i)
595 ASSERTL0(
false,
"basis is either not set up or not "
614 const Array<OneD, const NekDouble> &inarray,
615 Array<OneD, NekDouble> &outarray,
627 const Array<OneD, const NekDouble> &inarray,
628 Array<OneD, NekDouble> &outarray,
631 int nquad0 =
m_base[0]->GetNumPoints();
632 int nquad1 =
m_base[1]->GetNumPoints();
633 int nquad2 =
m_base[2]->GetNumPoints();
636 Array<OneD,NekDouble> o_tmp2(FaceExp->GetTotPoints());
637 Array<OneD,NekDouble> o_tmp3;
649 Vmath::Vcopy(nquad0*nquad1,inarray.get(),1,o_tmp.get(),1);
652 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),o_tmp2.get());
658 for (
int k=0; k<nquad2; k++)
660 Vmath::Vcopy(nquad0,inarray.get()+(nquad0*nquad1*k),1,o_tmp.get()+(k*nquad0),1);
664 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),o_tmp2.get());
670 Vmath::Vcopy(nquad1*nquad2,inarray.get()+(nquad0-1),nquad0,o_tmp.get(),1);
673 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),o_tmp2.get());
679 Vmath::Vcopy(nquad1*nquad2,inarray.get(),nquad0,o_tmp.get(),1);
682 FaceExp->GetBasis(0)->GetPointsKey(),FaceExp->GetBasis(1)->GetPointsKey(),o_tmp2.get());
686 ASSERTL0(
false,
"face value (> 3) is out of range");
690 int nq1 = FaceExp->GetNumPoints(0);
691 int nq2 = FaceExp->GetNumPoints(1);
693 if ((
int)orient == 7)
695 for (
int j = 0; j < nq2; ++j)
697 Vmath::Vcopy(nq1, o_tmp2.get()+((j+1)*nq1-1), -1, outarray.get()+j*nq1, 1);
702 Vmath::Vcopy(nq1*nq2, o_tmp2.get(), 1, outarray.get(), 1);
717 const Array<TwoD, const NekDouble> &df = geomFactors->GetDerivFactors(ptsKeys);
718 const Array<OneD, const NekDouble> &jac = geomFactors->GetJac(ptsKeys);
720 int nq =
m_base[0]->GetNumPoints()*
m_base[0]->GetNumPoints();
723 m_faceNormals[face] = Array<OneD, Array<OneD, NekDouble> >(vCoordDim);
724 Array<OneD, Array<OneD, NekDouble> > &normal =
m_faceNormals[face];
725 for (i = 0; i < vCoordDim; ++i)
727 normal[i] = Array<OneD, NekDouble>(nq);
741 for (i = 0; i < vCoordDim; ++i)
750 for (i = 0; i < vCoordDim; ++i)
759 for (i = 0; i < vCoordDim; ++i)
762 df[3*i+2][0],normal[i],1);
769 for(i = 0; i < vCoordDim; ++i)
776 ASSERTL0(
false,
"face is out of range (edge < 3)");
781 for (i = 0; i < vCoordDim; ++i)
783 fac += normal[i][0]*normal[i][0];
786 for (i = 0; i < vCoordDim; ++i)
796 int nq0 = ptsKeys[0].GetNumPoints();
797 int nq1 = ptsKeys[1].GetNumPoints();
798 int nq2 = ptsKeys[2].GetNumPoints();
818 Array<OneD,NekDouble> work (nq, 0.0);
819 Array<OneD,NekDouble> normals(vCoordDim*nqtot, 0.0);
828 for(j = 0; j < nq01; ++j)
830 normals[j] = -df[2][j]*jac[j];
831 normals[nqtot+j] = -df[5][j]*jac[j];
832 normals[2*nqtot+j] = -df[8][j]*jac[j];
835 points0 = ptsKeys[0];
836 points1 = ptsKeys[1];
842 for (j = 0; j < nq0; ++j)
844 for(k = 0; k < nq2; ++k)
848 -df[1][tmp]*jac[tmp];
849 normals[nqtot+j+k*nq0] =
850 -df[4][tmp]*jac[tmp];
851 normals[2*nqtot+j+k*nq0] =
852 -df[7][tmp]*jac[tmp];
856 points0 = ptsKeys[0];
857 points1 = ptsKeys[2];
863 for (j = 0; j < nq1; ++j)
865 for(k = 0; k < nq2; ++k)
867 int tmp = nq0-1+nq0*j+nq01*k;
869 (df[0][tmp]+df[1][tmp]+df[2][tmp])*
871 normals[nqtot+j+k*nq1] =
872 (df[3][tmp]+df[4][tmp]+df[5][tmp])*
874 normals[2*nqtot+j+k*nq1] =
875 (df[6][tmp]+df[7][tmp]+df[8][tmp])*
880 points0 = ptsKeys[1];
881 points1 = ptsKeys[2];
887 for (j = 0; j < nq1; ++j)
889 for(k = 0; k < nq2; ++k)
891 int tmp = j*nq0+nq01*k;
893 -df[0][tmp]*jac[tmp];
894 normals[nqtot+j+k*nq1] =
895 -df[3][tmp]*jac[tmp];
896 normals[2*nqtot+j+k*nq1] =
897 -df[6][tmp]*jac[tmp];
901 points0 = ptsKeys[1];
902 points1 = ptsKeys[2];
907 ASSERTL0(
false,
"face is out of range (face < 3)");
912 m_base[0]->GetPointsKey(),
913 m_base[0]->GetPointsKey(),
918 for(i = 0; i < vCoordDim; ++i)
922 m_base[0]->GetPointsKey(),
923 m_base[0]->GetPointsKey(),
949 const Array<OneD, const NekDouble> &inarray,
950 Array<OneD,NekDouble> &outarray,
958 const Array<OneD, const NekDouble> &inarray,
959 Array<OneD,NekDouble> &outarray,
968 const Array<OneD, const NekDouble> &inarray,
969 Array<OneD,NekDouble> &outarray,
1065 Array<TwoD, const NekDouble> df
1095 int rows = deriv0.GetRows();
1096 int cols = deriv1.GetColumns();
1100 (*WeakDeriv) = df[3*dir][0]*deriv0
1101 + df[3*dir+1][0]*deriv1
1102 + df[3*dir+2][0]*deriv2;
1143 Array<TwoD, const NekDouble> gmat
1146 int rows = lap00.GetRows();
1147 int cols = lap00.GetColumns();
1152 (*lap) = gmat[0][0]*lap00
1157 + gmat[7][0]*(lap12 +
Transpose(lap12));
1172 int rows = LapMat.GetRows();
1173 int cols = LapMat.GetColumns();
1178 (*helm) = LapMat + factor*MassMat;
1322 unsigned int nint = (
unsigned int)(
m_ncoeffs - nbdry);
1323 unsigned int exp_size[] = {nbdry, nint};
1324 unsigned int nblks = 2;
1336 goto UseLocRegionsMatrix;
1343 goto UseLocRegionsMatrix;
1348 factor = mat->Scale();
1349 goto UseStdRegionsMatrix;
1352 UseStdRegionsMatrix:
1367 UseLocRegionsMatrix:
1378 Array<OneD,unsigned int> bmap(nbdry);
1379 Array<OneD,unsigned int> imap(nint);
1383 for(i = 0; i < nbdry; ++i)
1385 for(j = 0; j < nbdry; ++j)
1387 (*A)(i,j) = mat(bmap[i],bmap[j]);
1390 for(j = 0; j < nint; ++j)
1392 (*B)(i,j) = mat(bmap[i],imap[j]);
1396 for(i = 0; i < nint; ++i)
1398 for(j = 0; j < nbdry; ++j)
1400 (*C)(i,j) = mat(imap[i],bmap[j]);
1403 for(j = 0; j < nint; ++j)
1405 (*D)(i,j) = mat(imap[i],imap[j]);
1414 (*A) = (*A) - (*B)*(*C);
1439 return tmp->GetStdMatrix(mkey);
1458 const Array<OneD, const NekDouble> &inarray,
1459 Array<OneD,NekDouble> &outarray,
1464 if(inarray.get() == outarray.get())
1469 Blas::Dgemv(
'N',
m_ncoeffs,
m_ncoeffs,mat->Scale(),(mat->GetOwnedMatrix())->GetPtr().get(),
1470 m_ncoeffs, tmp.get(), 1, 0.0, outarray.get(), 1);
1474 Blas::Dgemv(
'N',
m_ncoeffs,
m_ncoeffs,mat->Scale(),(mat->GetOwnedMatrix())->GetPtr().get(),
1475 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
1481 const Array<OneD, const NekDouble> &inarray,
1482 Array<OneD, NekDouble> &outarray)
1484 int n_coeffs = inarray.num_elements();
1485 int nquad0 =
m_base[0]->GetNumPoints();
1486 int nquad1 =
m_base[1]->GetNumPoints();
1487 int nquad2 =
m_base[2]->GetNumPoints();
1488 int nqtot = nquad0*nquad1*nquad2;
1489 int nmodes0 =
m_base[0]->GetNumModes();
1490 int nmodes1 =
m_base[1]->GetNumModes();
1491 int nmodes2 =
m_base[2]->GetNumModes();
1492 int numMax = nmodes0;
1494 Array<OneD, NekDouble> coeff (n_coeffs);
1495 Array<OneD, NekDouble> coeff_tmp1(n_coeffs, 0.0);
1496 Array<OneD, NekDouble> coeff_tmp2(n_coeffs, 0.0);
1497 Array<OneD, NekDouble> phys_tmp(nqtot,0.0);
1498 Array<OneD, NekDouble> tmp, tmp2, tmp3, tmp4;
1528 m_TetExp ->BwdTrans(inarray,phys_tmp);
1529 m_OrthoTetExp->FwdTrans(phys_tmp, coeff);
1537 for (
int u = 0; u < numMax; ++u)
1539 for (
int i = 0; i < numMax-u; ++i)
1543 tmp2 = coeff_tmp1+cnt,1);
1545 cnt += numMax - u - i;
1549 m_OrthoTetExp->BwdTrans(coeff_tmp1,phys_tmp);
1550 m_TetExp ->FwdTrans(phys_tmp, outarray);
1554 const Array<OneD, const NekDouble> &inarray,
1555 Array<OneD, NekDouble> &outarray,
1556 Array<OneD, NekDouble> &wsp)
1565 int nquad0 =
m_base[0]->GetNumPoints();
1566 int nquad1 =
m_base[1]->GetNumPoints();
1567 int nquad2 =
m_base[2]->GetNumPoints();
1568 int nqtot = nquad0*nquad1*nquad2;
1570 ASSERTL1(wsp.num_elements() >= 6*nqtot,
1571 "Insufficient workspace size.");
1573 "Workspace not set up for ncoeffs > nqtot");
1575 const Array<OneD, const NekDouble>& base0 =
m_base[0]->GetBdata();
1576 const Array<OneD, const NekDouble>& base1 =
m_base[1]->GetBdata();
1577 const Array<OneD, const NekDouble>& base2 =
m_base[2]->GetBdata();
1578 const Array<OneD, const NekDouble>& dbase0 =
m_base[0]->GetDbdata();
1579 const Array<OneD, const NekDouble>& dbase1 =
m_base[1]->GetDbdata();
1580 const Array<OneD, const NekDouble>& dbase2 =
m_base[2]->GetDbdata();
1589 Array<OneD,NekDouble> wsp0 (2*nqtot, wsp);
1590 Array<OneD,NekDouble> wsp1 ( nqtot, wsp+1*nqtot);
1591 Array<OneD,NekDouble> wsp2 ( nqtot, wsp+2*nqtot);
1592 Array<OneD,NekDouble> wsp3 ( nqtot, wsp+3*nqtot);
1593 Array<OneD,NekDouble> wsp4 ( nqtot, wsp+4*nqtot);
1594 Array<OneD,NekDouble> wsp5 ( nqtot, wsp+5*nqtot);
1606 Vmath::Vvtvvtp(nqtot,&metric00[0],1,&wsp0[0],1,&metric01[0],1,&wsp1[0],1,&wsp3[0],1);
1607 Vmath::Vvtvp (nqtot,&metric02[0],1,&wsp2[0],1,&wsp3[0],1,&wsp3[0],1);
1608 Vmath::Vvtvvtp(nqtot,&metric01[0],1,&wsp0[0],1,&metric11[0],1,&wsp1[0],1,&wsp4[0],1);
1609 Vmath::Vvtvp (nqtot,&metric12[0],1,&wsp2[0],1,&wsp4[0],1,&wsp4[0],1);
1610 Vmath::Vvtvvtp(nqtot,&metric02[0],1,&wsp0[0],1,&metric12[0],1,&wsp1[0],1,&wsp5[0],1);
1611 Vmath::Vvtvp (nqtot,&metric22[0],1,&wsp2[0],1,&wsp5[0],1,&wsp5[0],1);
1632 const unsigned int dim = 3;
1638 for (
unsigned int i = 0; i < dim; ++i)
1640 for (
unsigned int j = i; j < dim; ++j)
1642 m_metrics[m[i][j]] = Array<OneD, NekDouble>(nqtot);
1647 Array<OneD,NekDouble> g0 (
m_metrics[m[0][0]]);
1648 Array<OneD,NekDouble> g1 (
m_metrics[m[1][1]]);
1649 Array<OneD,NekDouble> g2 (
m_metrics[m[2][2]]);
1650 Array<OneD,NekDouble> g3 (
m_metrics[m[0][1]]);
1651 Array<OneD,NekDouble> g4 (
m_metrics[m[0][2]]);
1652 Array<OneD,NekDouble> g5 (
m_metrics[m[1][2]]);
1655 Array<OneD,NekDouble> alloc(7*nqtot,0.0);
1656 Array<OneD,NekDouble> h0 (alloc);
1657 Array<OneD,NekDouble> h1 (alloc+ 1*nqtot);
1658 Array<OneD,NekDouble> h2 (alloc+ 2*nqtot);
1659 Array<OneD,NekDouble> h3 (alloc+ 3*nqtot);
1660 Array<OneD,NekDouble> wsp4 (alloc+ 4*nqtot);
1661 Array<OneD,NekDouble> wsp5 (alloc+ 5*nqtot);
1662 Array<OneD,NekDouble> wsp6 (alloc+ 6*nqtot);
1664 Array<OneD,NekDouble> wsp7 (alloc);
1665 Array<OneD,NekDouble> wsp8 (alloc+ 1*nqtot);
1666 Array<OneD,NekDouble> wsp9 (alloc+ 2*nqtot);
1668 const Array<TwoD, const NekDouble>& df =
1670 const Array<OneD, const NekDouble>& z0 =
m_base[0]->GetZ();
1671 const Array<OneD, const NekDouble>& z1 =
m_base[1]->GetZ();
1672 const Array<OneD, const NekDouble>& z2 =
m_base[2]->GetZ();
1673 const unsigned int nquad0 =
m_base[0]->GetNumPoints();
1674 const unsigned int nquad1 =
m_base[1]->GetNumPoints();
1675 const unsigned int nquad2 =
m_base[2]->GetNumPoints();
1677 for(j = 0; j < nquad2; ++j)
1679 for(i = 0; i < nquad1; ++i)
1681 Vmath::Fill(nquad0, 4.0/(1.0-z1[i])/(1.0-z2[j]), &h0[0]+i*nquad0 + j*nquad0*nquad1,1);
1682 Vmath::Fill(nquad0, 2.0/(1.0-z1[i])/(1.0-z2[j]), &h1[0]+i*nquad0 + j*nquad0*nquad1,1);
1683 Vmath::Fill(nquad0, 2.0/(1.0-z2[j]), &h2[0]+i*nquad0 + j*nquad0*nquad1,1);
1684 Vmath::Fill(nquad0, (1.0+z1[i])/(1.0-z2[j]), &h3[0]+i*nquad0 + j*nquad0*nquad1,1);
1687 for(i = 0; i < nquad0; i++)
1689 Blas::Dscal(nquad1*nquad2, 1+z0[i], &h1[0]+i, nquad0);
1698 Vmath::Vadd(nqtot, &df[1][0], 1, &df[2][0], 1, &wsp4[0], 1);
1699 Vmath::Vvtvvtp(nqtot, &df[0][0], 1, &h0[0], 1, &wsp4[0], 1, &h1[0], 1, &wsp4[0], 1);
1701 Vmath::Vadd(nqtot, &df[4][0], 1, &df[5][0], 1, &wsp5[0], 1);
1702 Vmath::Vvtvvtp(nqtot, &df[3][0], 1, &h0[0], 1, &wsp5[0], 1, &h1[0], 1, &wsp5[0], 1);
1704 Vmath::Vadd(nqtot, &df[7][0], 1, &df[8][0], 1, &wsp6[0], 1);
1705 Vmath::Vvtvvtp(nqtot, &df[6][0], 1, &h0[0], 1, &wsp6[0], 1, &h1[0], 1, &wsp6[0], 1);
1708 Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp4[0], 1, &wsp5[0], 1, &wsp5[0], 1, &g0[0], 1);
1709 Vmath::Vvtvp (nqtot, &wsp6[0], 1, &wsp6[0], 1, &g0[0], 1, &g0[0], 1);
1712 Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &wsp4[0], 1, &df[5][0], 1, &wsp5[0], 1, &g4[0], 1);
1713 Vmath::Vvtvp (nqtot, &df[8][0], 1, &wsp6[0], 1, &g4[0], 1, &g4[0], 1);
1717 Vmath::Vvtvvtp(nqtot, &df[1][0], 1, &h2[0], 1, &df[2][0], 1, &h3[0], 1, &wsp7[0], 1);
1719 Vmath::Vvtvvtp(nqtot, &df[4][0], 1, &h2[0], 1, &df[5][0], 1, &h3[0], 1, &wsp8[0], 1);
1721 Vmath::Vvtvvtp(nqtot, &df[7][0], 1, &h2[0], 1, &df[8][0], 1, &h3[0], 1, &wsp9[0], 1);
1724 Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp7[0], 1, &wsp5[0], 1, &wsp8[0], 1, &g3[0], 1);
1725 Vmath::Vvtvp (nqtot, &wsp6[0], 1, &wsp9[0], 1, &g3[0], 1, &g3[0], 1);
1729 Vmath::Vvtvvtp(nqtot, &wsp7[0], 1, &wsp7[0], 1, &wsp8[0], 1, &wsp8[0], 1, &g1[0], 1);
1730 Vmath::Vvtvp (nqtot, &wsp9[0], 1, &wsp9[0], 1, &g1[0], 1, &g1[0], 1);
1733 Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &wsp7[0], 1, &df[5][0], 1, &wsp8[0], 1, &g5[0], 1);
1734 Vmath::Vvtvp (nqtot, &df[8][0], 1, &wsp9[0], 1, &g5[0], 1, &g5[0], 1);
1737 Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &df[2][0], 1, &df[5][0], 1, &df[5][0], 1, &g2[0], 1);
1738 Vmath::Vvtvp (nqtot, &df[8][0], 1, &df[8][0], 1, &g2[0], 1, &g2[0], 1);
1743 Vmath::Svtsvtp(nqtot, df[0][0], &h0[0], 1, df[1][0] + df[2][0], &h1[0], 1, &wsp4[0], 1);
1745 Vmath::Svtsvtp(nqtot, df[3][0], &h0[0], 1, df[4][0] + df[5][0], &h1[0], 1, &wsp5[0], 1);
1747 Vmath::Svtsvtp(nqtot, df[6][0], &h0[0], 1, df[7][0] + df[8][0], &h1[0], 1, &wsp6[0], 1);
1750 Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp4[0], 1, &wsp5[0], 1, &wsp5[0], 1, &g0[0], 1);
1751 Vmath::Vvtvp (nqtot, &wsp6[0], 1, &wsp6[0], 1, &g0[0], 1, &g0[0], 1);
1754 Vmath::Svtsvtp(nqtot, df[2][0], &wsp4[0], 1, df[5][0], &wsp5[0], 1, &g4[0], 1);
1755 Vmath::Svtvp (nqtot, df[8][0], &wsp6[0], 1, &g4[0], 1, &g4[0], 1);
1759 Vmath::Svtsvtp(nqtot, df[1][0], &h2[0], 1, df[2][0], &h3[0], 1, &wsp7[0], 1);
1761 Vmath::Svtsvtp(nqtot, df[4][0], &h2[0], 1, df[5][0], &h3[0], 1, &wsp8[0], 1);
1763 Vmath::Svtsvtp(nqtot, df[7][0], &h2[0], 1, df[8][0], &h3[0], 1, &wsp9[0], 1);
1766 Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp7[0], 1, &wsp5[0], 1, &wsp8[0], 1, &g3[0], 1);
1767 Vmath::Vvtvp (nqtot, &wsp6[0], 1, &wsp9[0], 1, &g3[0], 1, &g3[0], 1);
1771 Vmath::Vvtvvtp(nqtot, &wsp7[0], 1, &wsp7[0], 1, &wsp8[0], 1, &wsp8[0], 1, &g1[0], 1);
1772 Vmath::Vvtvp (nqtot, &wsp9[0], 1, &wsp9[0], 1, &g1[0], 1, &g1[0], 1);
1775 Vmath::Svtsvtp(nqtot, df[2][0], &wsp7[0], 1, df[5][0], &wsp8[0], 1, &g5[0], 1);
1776 Vmath::Svtvp (nqtot, df[8][0], &wsp9[0], 1, &g5[0], 1, &g5[0], 1);
1779 Vmath::Fill(nqtot, df[2][0]*df[2][0] + df[5][0]*df[5][0] + df[8][0]*df[8][0], &g2[0], 1);
1782 for (
unsigned int i = 0; i < dim; ++i)
1784 for (
unsigned int j = i; j < dim; ++j)