46 namespace LocalRegions
51 StdExpansion (Ba.GetNumModes()*Bb.GetNumModes(),2,Ba,Bb),
52 StdExpansion2D(Ba.GetNumModes()*Bb.GetNumModes(),Ba,Bb),
57 boost::bind(&
QuadExp::CreateMatrix, this, _1),
58 std::string(
"QuadExpMatrix")),
59 m_staticCondMatrixManager(
60 boost::bind(&
QuadExp::CreateStaticCondMatrix, this, _1),
61 std::string(
"QuadExpStaticCondMatrix"))
72 m_matrixManager(T.m_matrixManager),
73 m_staticCondMatrixManager(T.m_staticCondMatrixManager)
87 int nquad0 =
m_base[0]->GetNumPoints();
88 int nquad1 =
m_base[1]->GetNumPoints();
91 Array<OneD,NekDouble> tmp(nquad0*nquad1);
97 Vmath::Vmul(nquad0*nquad1, jac, 1, inarray, 1, tmp, 1);
101 Vmath::Smul(nquad0*nquad1, jac[0], inarray, 1, tmp, 1);
111 const Array<OneD, const NekDouble> & inarray,
112 Array<OneD,NekDouble> &out_d0,
113 Array<OneD,NekDouble> &out_d1,
114 Array<OneD,NekDouble> &out_d2)
116 int nquad0 =
m_base[0]->GetNumPoints();
117 int nquad1 =
m_base[1]->GetNumPoints();
118 int nqtot = nquad0*nquad1;
120 Array<OneD,NekDouble> diff0(2*nqtot);
121 Array<OneD,NekDouble> diff1(diff0+nqtot);
127 if (out_d0.num_elements())
129 Vmath::Vmul (nqtot, df[0], 1, diff0, 1, out_d0, 1);
134 if(out_d1.num_elements())
137 Vmath::Vvtvp (nqtot,df[3],1,diff1,1, out_d1, 1, out_d1,1);
140 if (out_d2.num_elements())
143 Vmath::Vvtvp (nqtot,df[5],1,diff1,1, out_d2, 1, out_d2,1);
148 if (out_d0.num_elements())
150 Vmath::Smul (nqtot, df[0][0], diff0, 1, out_d0, 1);
151 Blas::Daxpy (nqtot, df[1][0], diff1, 1, out_d0, 1);
154 if (out_d1.num_elements())
156 Vmath::Smul (nqtot, df[2][0], diff0, 1, out_d1, 1);
157 Blas::Daxpy (nqtot, df[3][0], diff1, 1, out_d1, 1);
160 if (out_d2.num_elements())
162 Vmath::Smul (nqtot, df[4][0], diff0, 1, out_d2, 1);
163 Blas::Daxpy (nqtot, df[5][0], diff1, 1, out_d2, 1);
171 const Array<OneD, const NekDouble>& inarray,
172 Array<OneD, NekDouble> &outarray)
196 ASSERTL1(
false,
"input dir is out of range");
204 const Array<OneD, const NekDouble> & inarray,
205 const Array<OneD, const NekDouble>& direction,
206 Array<OneD,NekDouble> &out)
208 int nquad0 =
m_base[0]->GetNumPoints();
209 int nquad1 =
m_base[1]->GetNumPoints();
210 int nqtot = nquad0*nquad1;
214 Array<OneD,NekDouble> diff0(2*nqtot);
215 Array<OneD,NekDouble> diff1(diff0+nqtot);
221 Array<OneD, Array<OneD, NekDouble> > tangmat(2);
224 for (
int i=0; i< 2; ++i)
226 tangmat[i] = Array<OneD, NekDouble>(nqtot,0.0);
227 for (
int k=0; k<(
m_geom->GetCoordim()); ++k)
231 &direction[k*nqtot], 1,
238 if (out.num_elements())
261 const Array<OneD, const NekDouble> & inarray,
262 Array<OneD,NekDouble> &outarray)
264 if ((
m_base[0]->Collocation())&&(
m_base[1]->Collocation()))
287 const Array<OneD, const NekDouble>& inarray,
288 Array<OneD, NekDouble> &outarray)
290 if ((
m_base[0]->Collocation())&&(
m_base[1]->Collocation()))
297 int npoints[2] = {
m_base[0]->GetNumPoints(),
298 m_base[1]->GetNumPoints()};
299 int nmodes[2] = {
m_base[0]->GetNumModes(),
300 m_base[1]->GetNumModes()};
302 fill(outarray.get(), outarray.get()+
m_ncoeffs, 0.0 );
304 Array<OneD, NekDouble> physEdge[4];
305 Array<OneD, NekDouble> coeffEdge[4];
307 for (i = 0; i < 4; i++)
309 physEdge[i] = Array<OneD, NekDouble>(npoints[i%2]);
310 coeffEdge[i] = Array<OneD, NekDouble>(nmodes[i%2]);
314 for (i = 0; i < npoints[0]; i++)
316 physEdge[0][i] = inarray[i];
317 physEdge[2][i] = inarray[npoints[0]*npoints[1]-1-i];
320 for (i = 0; i < npoints[1]; i++)
323 inarray[npoints[0]-1+i*npoints[0]];
325 inarray[(npoints[1]-1)*npoints[0]-i*npoints[0]];
328 for (i = 0; i < 4; i++)
332 reverse((physEdge[i]).
get(),
333 (physEdge[i]).
get() + npoints[i%2] );
338 for (i = 0; i < 4; i++)
345 Array<OneD, unsigned int> mapArray;
346 Array<OneD, int> signArray;
349 for (i = 0; i < 4; i++)
351 segexp[i%2]->FwdTrans_BndConstrained(
352 physEdge[i],coeffEdge[i]);
355 for (j=0; j < nmodes[i%2]; j++)
358 outarray[ mapArray[j] ] = sign * coeffEdge[i][j];
363 int nInteriorDofs =
m_ncoeffs - nBoundaryDofs;
365 if (nInteriorDofs > 0) {
384 Array<OneD, NekDouble> rhs(nInteriorDofs);
385 Array<OneD, NekDouble> result(nInteriorDofs);
389 for (i = 0; i < nInteriorDofs; i++)
391 rhs[i] = tmp1[ mapArray[i] ];
394 Blas::Dgemv(
'N', nInteriorDofs, nInteriorDofs,
396 &((matsys->GetOwnedMatrix())->GetPtr())[0],
397 nInteriorDofs,rhs.get(),1,0.0,result.get(),1);
399 for (i = 0; i < nInteriorDofs; i++)
401 outarray[ mapArray[i] ] = result[i];
410 const Array<OneD, const NekDouble>& inarray,
411 Array<OneD, NekDouble> &outarray)
413 if (
m_base[0]->Collocation() &&
m_base[1]->Collocation())
426 const Array<OneD, const NekDouble>& inarray,
427 Array<OneD, NekDouble> & outarray)
434 const Array<OneD, const NekDouble>& inarray,
435 Array<OneD, NekDouble> &outarray)
437 int nquad0 =
m_base[0]->GetNumPoints();
438 int nquad1 =
m_base[1]->GetNumPoints();
439 int order0 =
m_base[0]->GetNumModes();
441 Array<OneD,NekDouble> tmp(nquad0*nquad1+nquad1*order0);
442 Array<OneD,NekDouble> wsp(tmp+nquad0*nquad1);
448 tmp,outarray,wsp,
true,
true);
453 const Array<OneD, const NekDouble>& inarray,
454 Array<OneD, NekDouble> &outarray)
461 Blas::Dgemv(
'N',
m_ncoeffs,nq,iprodmat->Scale(),
462 (iprodmat->GetOwnedMatrix())->GetPtr().get(),
463 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
470 const Array<OneD, const NekDouble>& inarray,
471 Array<OneD, NekDouble> & outarray)
473 ASSERTL1((dir==0) || (dir==1) || (dir==2),
474 "Invalid direction.");
476 "Invalid direction.");
478 int nquad0 =
m_base[0]->GetNumPoints();
479 int nquad1 =
m_base[1]->GetNumPoints();
480 int nqtot = nquad0*nquad1;
481 int nmodes0 =
m_base[0]->GetNumModes();
485 Array<OneD, NekDouble> tmp1(2*nqtot+
m_ncoeffs+nmodes0*nquad1);
486 Array<OneD, NekDouble> tmp2(tmp1 + nqtot);
487 Array<OneD, NekDouble> tmp3(tmp1 + 2*nqtot);
488 Array<OneD, NekDouble> tmp4(tmp1 + 2*nqtot+
m_ncoeffs);
504 df[2*dir][0], inarray.get(), 1,
507 df[2*dir+1][0], inarray.get(), 1,
516 tmp1, tmp3, tmp4,
false,
true);
519 tmp2, outarray, tmp4,
true,
false);
526 const Array<OneD, const NekDouble>& inarray,
527 Array<OneD, NekDouble> &outarray)
551 ASSERTL1(
false,
"input dir is out of range");
559 Blas::Dgemv(
'N',
m_ncoeffs, nq, iprodmat->Scale(),
560 (iprodmat->GetOwnedMatrix())->GetPtr().get(),
561 m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
566 const Array<OneD, const NekDouble> &Fx,
567 const Array<OneD, const NekDouble> &Fy,
568 const Array<OneD, const NekDouble> &Fz,
569 Array<OneD, NekDouble> &outarray)
571 int nq =
m_base[0]->GetNumPoints()*
m_base[1]->GetNumPoints();
572 Array<OneD, NekDouble> Fn(nq);
574 const Array<OneD, const Array<OneD, NekDouble> > &normals =
581 &normals[1][0],1,&Fy[0],1,&Fn[0],1);
582 Vmath::Vvtvp (nq,&normals[2][0],1,&Fz[0],1,&Fn[0],1,&Fn[0],1);
587 normals[1][0],&Fy[0],1,&Fn[0],1);
588 Vmath::Svtvp (nq,normals[2][0],&Fz[0],1,&Fn[0],1,&Fn[0],1);
596 Array<OneD, NekDouble> &coords_0,
597 Array<OneD, NekDouble> &coords_1,
598 Array<OneD, NekDouble> &coords_2)
605 Array<OneD,NekDouble> &coords)
609 ASSERTL1(Lcoords[0] >= -1.0 && Lcoords[1] <= 1.0 &&
610 Lcoords[1] >= -1.0 && Lcoords[1] <=1.0,
611 "Local coordinates are not in region [-1,1]");
614 for (i = 0; i <
m_geom->GetCoordim(); ++i)
616 coords[i] =
m_geom->GetCoord(i,Lcoords);
628 const Array<OneD, const NekDouble> &Lcoord,
629 const Array<OneD, const NekDouble> &physvals)
636 const Array<OneD, const NekDouble> &coord,
637 const Array<OneD, const NekDouble> &physvals)
639 Array<OneD,NekDouble> Lcoord = Array<OneD, NekDouble>(2);
642 m_geom->GetLocCoords(coord,Lcoord);
653 const Array<OneD, const NekDouble> &inarray,
654 Array<OneD,NekDouble> &outarray)
656 int nquad0 =
m_base[0]->GetNumPoints();
657 int nquad1 =
m_base[1]->GetNumPoints();
682 -nquad0, &(outarray[0]),1);
701 -nquad0,&(outarray[0]),1);
710 ASSERTL0(
false,
"edge value (< 3) is out of range");
719 const Array<OneD, const NekDouble> &inarray,
720 Array<OneD,NekDouble> &outarray,
730 const Array<OneD, const NekDouble> &inarray,
731 Array<OneD,NekDouble> &outarray)
733 int nquad0 =
m_base[0]->GetNumPoints();
734 int nquad1 =
m_base[1]->GetNumPoints();
750 nquad0,&(outarray[0]),1);
761 ASSERTL0(
false,
"edge value (< 3) is out of range");
771 if (
m_base[edge%2]->GetPointsKey() !=
772 EdgeExp->GetBasis(0)->GetPointsKey())
774 Array<OneD,NekDouble> outtmp(max(nquad0,nquad1));
779 m_base[edge%2]->GetPointsKey(),outtmp,
780 EdgeExp->GetBasis(0)->GetPointsKey(),outarray);
792 const Array<OneD, const NekDouble> &inarray,
793 Array<OneD,NekDouble> &outarray)
796 int nq0 =
m_base[0]->GetNumPoints();
797 int nq1 =
m_base[1]->GetNumPoints();
812 for (i = 0; i < nq0; i++)
815 nq1, mat_gauss->GetOwnedMatrix()->GetPtr().get(),
816 1, &inarray[i], nq0);
822 for (i = 0; i < nq1; i++)
825 nq0, mat_gauss->GetOwnedMatrix()->GetPtr().get(),
826 1, &inarray[i * nq0], 1);
832 for (i = 0; i < nq0; i++)
835 nq1, mat_gauss->GetOwnedMatrix()->GetPtr().get(),
836 1, &inarray[i], nq0);
842 for (i = 0; i < nq1; i++)
845 nq0, mat_gauss->GetOwnedMatrix()->GetPtr().get(),
846 1, &inarray[i * nq0], 1);
851 ASSERTL0(
false,
"edge value (< 3) is out of range");
858 Array<OneD, NekDouble> &outarray)
861 int nquad0 =
m_base[0]->GetNumPoints();
862 int nquad1 =
m_base[1]->GetNumPoints();
865 const Array<OneD, const NekDouble>& jac =
m_metricinfo->GetJac(ptsKeys);
866 const Array<TwoD, const NekDouble>& df =
m_metricinfo->GetDerivFactors(ptsKeys);
868 Array<OneD, NekDouble> j (max(nquad0, nquad1), 0.0);
869 Array<OneD, NekDouble> g0(max(nquad0, nquad1), 0.0);
870 Array<OneD, NekDouble> g1(max(nquad0, nquad1), 0.0);
871 Array<OneD, NekDouble> g2(max(nquad0, nquad1), 0.0);
872 Array<OneD, NekDouble> g3(max(nquad0, nquad1), 0.0);
879 &&
m_base[1]->GetPointsType() !=
891 for (i = 0; i < nquad0; ++i)
893 outarray[i] = j[i]*sqrt(g1[i]*g1[i]
899 &(df[0][0])+(nquad0-1), nquad0,
903 &(df[2][0])+(nquad0-1), nquad0,
907 &(jac[0])+(nquad0-1), nquad0,
910 for (i = 0; i < nquad0; ++i)
912 outarray[i] = j[i]*sqrt(g0[i]*g0[i] +
919 &(df[1][0])+(nquad0*nquad1-1), -1,
923 &(df[3][0])+(nquad0*nquad1-1), -1,
927 &(jac[0])+(nquad0*nquad1-1), -1,
930 for (i = 0; i < nquad0; ++i)
932 outarray[i] = j[i]*sqrt(g1[i]*g1[i]
939 &(df[0][0])+nquad0*(nquad1-1),
940 -nquad0,&(g0[0]), 1);
943 &(df[2][0])+nquad0*(nquad1-1),
944 -nquad0,&(g2[0]), 1);
947 &(jac[0])+nquad0*(nquad1-1), -nquad0,
950 for (i = 0; i < nquad0; ++i)
952 outarray[i] = j[i]*sqrt(g0[i]*g0[i] +
957 ASSERTL0(
false,
"edge value (< 3) is out of range");
963 int nqtot = nquad0 * nquad1;
964 Array<OneD, NekDouble> tmp_gmat0(nqtot, 0.0);
965 Array<OneD, NekDouble> tmp_gmat1(nqtot, 0.0);
966 Array<OneD, NekDouble> tmp_gmat2(nqtot, 0.0);
967 Array<OneD, NekDouble> tmp_gmat3(nqtot, 0.0);
968 Array<OneD, NekDouble> g0_edge(max(nquad0, nquad1), 0.0);
969 Array<OneD, NekDouble> g1_edge(max(nquad0, nquad1), 0.0);
970 Array<OneD, NekDouble> g2_edge(max(nquad0, nquad1), 0.0);
971 Array<OneD, NekDouble> g3_edge(max(nquad0, nquad1), 0.0);
972 Array<OneD, NekDouble> jac_edge(max(nquad0, nquad1), 0.0);
982 edge, tmp_gmat1, g1_edge);
984 edge, tmp_gmat3, g3_edge);
986 for (i = 0; i < nquad0; ++i)
988 outarray[i] = sqrt(g1_edge[i]*g1_edge[i] +
989 g3_edge[i]*g3_edge[i]);
1004 edge, tmp_gmat0, g0_edge);
1006 edge, tmp_gmat2, g2_edge);
1008 for (i = 0; i < nquad1; ++i)
1010 outarray[i] = sqrt(g0_edge[i]*g0_edge[i]
1011 + g2_edge[i]*g2_edge[i]);
1020 &(tmp_gmat1[0]), 1);
1026 edge, tmp_gmat1, g1_edge);
1028 edge, tmp_gmat3, g3_edge);
1031 for (i = 0; i < nquad0; ++i)
1033 outarray[i] = sqrt(g1_edge[i]*g1_edge[i]
1034 + g3_edge[i]*g3_edge[i]);
1044 &(tmp_gmat0[0]), 1);
1050 edge, tmp_gmat0, g0_edge);
1052 edge, tmp_gmat2, g2_edge);
1055 for (i = 0; i < nquad1; ++i)
1057 outarray[i] = sqrt(g0_edge[i]*g0_edge[i] +
1058 g2_edge[i]*g2_edge[i]);
1067 ASSERTL0(
false,
"edge value (< 3) is out of range");
1081 for (i = 0; i < nquad0; ++i)
1083 outarray[i] = jac[0]*sqrt(df[1][0]*df[1][0] +
1088 for (i = 0; i < nquad1; ++i)
1090 outarray[i] = jac[0]*sqrt(df[0][0]*df[0][0] +
1095 for (i = 0; i < nquad0; ++i)
1097 outarray[i] = jac[0]*sqrt(df[1][0]*df[1][0] +
1102 for (i = 0; i < nquad1; ++i)
1104 outarray[i] = jac[0]*sqrt(df[0][0]*df[0][0] +
1109 ASSERTL0(
false,
"edge value (< 3) is out of range");
1123 const Array<TwoD, const NekDouble> & df = geomFactors->GetDerivFactors(ptsKeys);
1124 const Array<OneD, const NekDouble> & jac = geomFactors->GetJac(ptsKeys);
1125 int nqe =
m_base[0]->GetNumPoints();
1130 Array<OneD, Array<OneD, NekDouble> > &normal =
m_edgeNormals[edge];
1131 for (i = 0; i < vCoordDim; ++i)
1133 normal[i] = Array<OneD, NekDouble>(nqe);
1145 for (i = 0; i < vCoordDim; ++i)
1151 for (i = 0; i < vCoordDim; ++i)
1157 for (i = 0; i < vCoordDim; ++i)
1163 for (i = 0; i < vCoordDim; ++i)
1169 ASSERTL0(
false,
"edge is out of range (edge < 4)");
1174 for (i =0 ; i < vCoordDim; ++i)
1176 fac += normal[i][0]*normal[i][0];
1178 fac = 1.0/sqrt(fac);
1179 for (i = 0; i < vCoordDim; ++i)
1188 int nquad0 = ptsKeys[0].GetNumPoints();
1189 int nquad1 = ptsKeys[1].GetNumPoints();
1193 Array<OneD,NekDouble> normals(vCoordDim*max(nquad0,nquad1),0.0);
1194 Array<OneD,NekDouble> edgejac(vCoordDim*max(nquad0,nquad1),0.0);
1209 for (j = 0; j < nquad0; ++j)
1211 edgejac[j] = jac[j];
1212 for (i = 0; i < vCoordDim; ++i)
1214 normals[i*nquad0+j] =
1215 -df[2*i+1][j]*edgejac[j];
1218 from_key = ptsKeys[0];
1221 for (j = 0; j < nquad1; ++j)
1223 edgejac[j] = jac[nquad0*j+nquad0-1];
1224 for (i = 0; i < vCoordDim; ++i)
1226 normals[i*nquad1+j] =
1227 df[2*i][nquad0*j + nquad0-1]
1231 from_key = ptsKeys[1];
1234 for (j = 0; j < nquad0; ++j)
1236 edgejac[j] = jac[nquad0*(nquad1-1)+j];
1237 for (i = 0; i < vCoordDim; ++i)
1239 normals[i*nquad0+j] =
1240 (df[2*i+1][nquad0*(nquad1-1)+j])
1244 from_key = ptsKeys[0];
1247 for (j = 0; j < nquad1; ++j)
1249 edgejac[j] = jac[nquad0*j];
1250 for (i = 0; i < vCoordDim; ++i)
1252 normals[i*nquad1+j] =
1253 -df[2*i][nquad0*j]*edgejac[j];
1256 from_key = ptsKeys[1];
1259 ASSERTL0(
false,
"edge is out of range (edge < 3)");
1264 int nqtot = nquad0 * nquad1;
1265 Array<OneD, NekDouble> tmp_gmat(nqtot, 0.0);
1266 Array<OneD, NekDouble> tmp_gmat_edge(nqe, 0.0);
1271 for (j = 0; j < nquad0; ++j)
1273 for (i = 0; i < vCoordDim; ++i)
1280 edge, tmp_gmat, tmp_gmat_edge);
1281 normals[i*nquad0+j] = -tmp_gmat_edge[j];
1284 from_key = ptsKeys[0];
1287 for (j = 0; j < nquad1; ++j)
1289 for (i = 0; i < vCoordDim; ++i)
1296 edge, tmp_gmat, tmp_gmat_edge);
1297 normals[i*nquad1+j] = tmp_gmat_edge[j];
1300 from_key = ptsKeys[1];
1303 for (j = 0; j < nquad0; ++j)
1305 for (i = 0; i < vCoordDim; ++i)
1312 edge, tmp_gmat, tmp_gmat_edge);
1313 normals[i*nquad0+j] = tmp_gmat_edge[j];
1316 from_key = ptsKeys[0];
1319 for (j = 0; j < nquad1; ++j)
1321 for (i = 0; i < vCoordDim; ++i)
1328 edge, tmp_gmat, tmp_gmat_edge);
1329 normals[i*nquad1+j] = -tmp_gmat_edge[j];
1332 from_key = ptsKeys[1];
1335 ASSERTL0(
false,
"edge is out of range (edge < 3)");
1340 Array<OneD,NekDouble> work(nqe,0.0);
1344 from_key,jac,
m_base[0]->GetPointsKey(), work);
1351 from_key,&normals[i*nq],
1352 m_base[0]->GetPointsKey(),
1354 Vmath::Vmul(nqe, work, 1, normal[i], 1, normal[i], 1);
1373 Vmath::Vmul(nqe, normal[i], 1, work, 1, normal[i], 1);
1388 for (i = 0; i < vCoordDim; ++i)
1406 return m_geom->GetCoordim();
1412 const std::vector<unsigned int > &nummodes,
1416 int data_order0 = nummodes[mode_offset];
1417 int fillorder0 = std::min(
m_base[0]->GetNumModes(),data_order0);
1419 int data_order1 = nummodes[mode_offset + 1];
1420 int order1 =
m_base[1]->GetNumModes();
1421 int fillorder1 = min(order1,data_order1);
1433 "Extraction routine not set up for this basis");
1436 for (i = 0; i < fillorder0; ++i)
1438 Vmath::Vcopy(fillorder1, data + cnt, 1, coeffs +cnt1, 1);
1452 m_base[0]->GetPointsKey(),
1453 m_base[1]->GetPointsKey(),
1465 m_base[0]->GetPointsKey(),
1466 m_base[1]->GetPointsKey(),
1472 "basis is either not set up or not hierarchicial");
1479 return m_geom->GetEorient(edge);
1485 return GetGeom2D()->GetCartesianEorient(edge);
1491 ASSERTL1(dir >= 0 &&dir <= 1,
"input dir is out of range");
1529 return tmp->GetStdMatrix(mkey);
1539 "Geometric information is not set up");
1601 Array<TwoD, const NekDouble> df =
1628 int rows = deriv0.GetRows();
1629 int cols = deriv1.GetColumns();
1633 (*WeakDeriv) = df[2*dir][0]*deriv0 +
1634 df[2*dir+1][0]*deriv1;
1667 Array<TwoD, const NekDouble>
1670 int rows = lap00.GetRows();
1671 int cols = lap00.GetColumns();
1676 (*lap) = gmat[0][0] * lap00 +
1677 gmat[1][0] * (lap01 +
Transpose(lap01)) +
1702 int rows = LapMat.GetRows();
1703 int cols = LapMat.GetColumns();
1709 (*helm) = LapMat + lambda*MassMat;
1747 const Array<TwoD, const NekDouble>& df =
1776 int rows = stdiprod0.GetRows();
1777 int cols = stdiprod1.GetColumns();
1781 (*mat) = df[2*dir][0]*stdiprod0 +
1782 df[2*dir+1][0]*stdiprod1;
1806 Array<OneD, NekDouble> coords(1, 0.0);
1810 coords[0] = (edge == 0 || edge == 3) ? -1.0 : 1.0;
1812 m_Ix =
m_base[(edge + 1) % 2]->GetI(coords);
1854 "Geometric information is not set up");
1858 unsigned int nint = (
unsigned int)(
m_ncoeffs - nbdry);
1859 unsigned int exp_size[] = {nbdry,nint};
1860 unsigned int nblks = 2;
1875 goto UseLocRegionsMatrix;
1880 goto UseStdRegionsMatrix;
1886 goto UseLocRegionsMatrix;
1888 UseStdRegionsMatrix:
1897 AllocateSharedPtr(factor,Asubmat = mat->GetBlock(0,0)));
1899 AllocateSharedPtr(one,Asubmat = mat->GetBlock(0,1)));
1901 AllocateSharedPtr(factor,Asubmat = mat->GetBlock(1,0)));
1903 AllocateSharedPtr(invfactor,Asubmat = mat->GetBlock(1,1)));
1906 UseLocRegionsMatrix:
1921 Array<OneD,unsigned int> bmap(nbdry);
1922 Array<OneD,unsigned int> imap(nint);
1926 for (i = 0; i < nbdry; ++i)
1928 for(j = 0; j < nbdry; ++j)
1930 (*A)(i,j) = mat(bmap[i],bmap[j]);
1933 for(j = 0; j < nint; ++j)
1935 (*B)(i,j) = mat(bmap[i],imap[j]);
1939 for (i = 0; i < nint; ++i)
1941 for(j = 0; j < nbdry; ++j)
1943 (*C)(i,j) = mat(imap[i],bmap[j]);
1946 for(j = 0; j < nint; ++j)
1948 (*D)(i,j) = mat(imap[i],imap[j]);
1957 (*A) = (*A) - (*B)*(*C);
1963 AllocateSharedPtr(factor, A));
1965 AllocateSharedPtr(one, B));
1967 AllocateSharedPtr(factor, C));
1969 AllocateSharedPtr(invfactor, D));
1996 const Array<OneD, const NekDouble> &inarray,
1997 Array<OneD,NekDouble> &outarray,
2005 const Array<OneD, const NekDouble> &inarray,
2006 Array<OneD,NekDouble> &outarray,
2016 const Array<OneD, const NekDouble> &inarray,
2017 Array<OneD,NekDouble> &outarray,
2021 k1, k2, inarray, outarray, mkey);
2027 const Array<OneD, const NekDouble> &inarray,
2028 Array<OneD,NekDouble> &outarray,
2036 const Array<OneD, const NekDouble> &inarray,
2037 Array<OneD,NekDouble> &outarray,
2041 inarray, outarray, mkey);
2046 const Array<OneD, const NekDouble> &inarray,
2047 Array<OneD,NekDouble> &outarray,
2051 inarray, outarray, mkey);
2056 const Array<OneD, const NekDouble> &inarray,
2057 Array<OneD,NekDouble> &outarray,
2065 const Array<OneD, const NekDouble> &inarray,
2066 Array<OneD,NekDouble> &outarray,
2072 if (inarray.get() == outarray.get())
2078 (mat->GetOwnedMatrix())->GetPtr().get(),
m_ncoeffs,
2079 tmp.get(), 1, 0.0, outarray.get(), 1);
2084 (mat->GetOwnedMatrix())->GetPtr().get(),
m_ncoeffs,
2085 inarray.get(), 1, 0.0, outarray.get(), 1);
2091 const Array<OneD, const NekDouble> &inarray,
2092 Array<OneD, NekDouble> &outarray)
2094 int n_coeffs = inarray.num_elements();
2096 Array<OneD, NekDouble> coeff (n_coeffs);
2097 Array<OneD, NekDouble> coeff_tmp(n_coeffs, 0.0);
2098 Array<OneD, NekDouble> tmp, tmp2;
2100 int nmodes0 =
m_base[0]->GetNumModes();
2101 int nmodes1 =
m_base[1]->GetNumModes();
2102 int numMax = nmodes0;
2120 b0, b1, coeff_tmp, bortho0, bortho1, coeff);
2125 for (
int i = 0; i < numMin+1; ++i)
2129 tmp2 = coeff_tmp+cnt,1);
2135 bortho0, bortho1, coeff_tmp,
2140 const Array<OneD, const NekDouble> &inarray,
2141 Array<OneD, NekDouble> &outarray,
2142 Array<OneD, NekDouble> &wsp)
2149 int nquad0 =
m_base[0]->GetNumPoints();
2150 int nquad1 =
m_base[1]->GetNumPoints();
2151 int nqtot = nquad0*nquad1;
2152 int nmodes0 =
m_base[0]->GetNumModes();
2153 int nmodes1 =
m_base[1]->GetNumModes();
2154 int wspsize = max(max(max(nqtot,
m_ncoeffs),nquad1*nmodes0),nquad0*nmodes1);
2156 ASSERTL1(wsp.num_elements() >= 3*wspsize,
2157 "Workspace is of insufficient size.");
2159 const Array<OneD, const NekDouble>& base0 =
m_base[0]->GetBdata();
2160 const Array<OneD, const NekDouble>& base1 =
m_base[1]->GetBdata();
2161 const Array<OneD, const NekDouble>& dbase0 =
m_base[0]->GetDbdata();
2162 const Array<OneD, const NekDouble>& dbase1 =
m_base[1]->GetDbdata();
2168 Array<OneD,NekDouble> wsp0(wsp);
2169 Array<OneD,NekDouble> wsp1(wsp+wspsize);
2170 Array<OneD,NekDouble> wsp2(wsp+2*wspsize);
2178 Vmath::Vvtvvtp(nqtot,&metric00[0],1,&wsp1[0],1,&metric01[0],1,&wsp2[0],1,&wsp0[0],1);
2179 Vmath::Vvtvvtp(nqtot,&metric01[0],1,&wsp1[0],1,&metric11[0],1,&wsp2[0],1,&wsp2[0],1);
2200 const unsigned int dim = 2;
2206 const Array<TwoD, const NekDouble> gmat =
2208 for (
unsigned int i = 0; i < dim; ++i)
2210 for (
unsigned int j = i; j < dim; ++j)
2212 m_metrics[m[i][j]] = Array<OneD, NekDouble>(nqtot);