35#include <boost/core/ignore_unused.hpp>
60 int nquad_f = FaceExp->GetNumPoints(0) * FaceExp->GetNumPoints(1);
61 int order_f = FaceExp->GetNcoeffs();
95 if ((x = varcoeffs.find(VarCoeff[0])) != varcoeffs.end())
97 GetPhysFaceVarCoeffsFromElement(face,FaceExp,x->second,varcoeff_work);
98 Vmath::Vmul(nquad_f,varcoeff_work,1,FaceExp->GetPhys(),1,FaceExp->UpdatePhys(),1);
105 FaceExp->IProductWRTBase(facePhys, outcoeff);
107 for (i = 0; i < order_f; ++i)
109 outarray[(*map)[i].index] += (*map)[i].sign * tau * outcoeff[i];
118 for (n = 0; n < coordim; ++n)
133 Vmath::Vmul(nquad_f, ncdotMF_f, 1, facePhys, 1, inval, 1);
137 Vmath::Vmul(nquad_f, normals[n], 1, facePhys, 1, inval, 1);
141 const NekDouble *data = invMass.GetRawPtr();
154 FaceExp->IProductWRTBase(inval, outcoeff);
157 for (i = 0; i < ncoeffs; ++i)
160 for (j = 0; j < order_f; ++j)
162 tmpcoeff[i] += scale * data[i + (*map)[j].index * ncoeffs] *
163 (*map)[j].sign * outcoeff[j];
171 GetMF(n, coordim, varcoeffs);
181 Coeffs = Coeffs + Dmat * Tmpcoeff;
186 Coeffs = Coeffs + Dmat * Tmpcoeff;
223 for (
unsigned int i = 0; i < FaceExp->GetNcoeffs(); ++i)
225 facetmp[i] = tmp[emap[i]];
229 FaceExp->BwdTrans(facetmp, outarray);
243 int order_f, nquad_f;
247 for (f = 0; f < nfaces; ++f)
249 order_f = FaceExp[f]->GetNcoeffs();
250 nquad_f = FaceExp[f]->GetNumPoints(0) * FaceExp[f]->GetNumPoints(1);
257 for (i = 0; i < order_f; ++i)
259 faceCoeffs[i] = inarray[i + cnt];
263 FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
280 StdRegions::VarCoeffMap::const_iterator x;
286 Vmath::Vmul(nquad_f, ncdotMF_f, 1, facePhys, 1, facePhys, 1);
290 Vmath::Vmul(nquad_f, normals[dir], 1, facePhys, 1, facePhys, 1);
307 for (f = 0; f < nfaces; ++f)
309 nquad_f = FaceExp[f]->GetNumPoints(0) * FaceExp[f]->GetNumPoints(1);
315 FaceExp[f]->BwdTrans(faceCoeffs[f], facePhys);
317 Vmath::Vmul(nquad_f, normals[dir], 1, facePhys, 1, facePhys, 1);
332 boost::ignore_unused(varcoeffs);
335 int order_f = FaceExp->GetNcoeffs();
357 FaceExp->IProductWRTBase(facePhys, coeff);
360 for (i = 0; i < order_f; ++i)
362 outarray[(*map)[i].index] += (*map)[i].sign * coeff[i];
388 ASSERTL1((*map1).size() == (*map2).size(),
389 "There is an error with the GetTraceToElementMap");
391 for (j = 0; j < (*map1).size(); ++j)
394 for (k = 0; k < (*map2).size(); ++k)
397 if ((*map1)[j].index == (*map2)[k].index && k != j)
401 if ((*map1)[j].
sign != (*map2)[k].
sign)
419 for (i = 0; i < nfaces; ++i)
432 "Geometric information is not set up");
513 int rows = deriv0.GetRows();
514 int cols = deriv1.GetColumns();
518 (*WeakDeriv) = df[3 * dir][0] * deriv0 +
519 df[3 * dir + 1][0] * deriv1 +
520 df[3 * dir + 2][0] * deriv2;
574 int rows = lap00.GetRows();
575 int cols = lap00.GetColumns();
580 (*lap) = gmat[0][0] * lap00 + gmat[4][0] * lap11 +
582 gmat[3][0] * (lap01 +
Transpose(lap01)) +
583 gmat[6][0] * (lap02 +
Transpose(lap02)) +
600 int rows = LapMat.GetRows();
601 int cols = LapMat.GetColumns();
607 (*helm) = LapMat + factor * MassMat;
623 "Need to specify eFactorGJP to construct "
624 "a HelmholtzGJP matrix");
628 factor /= HelmMat.Scale();
630 int ntot = HelmMat.GetRows() * HelmMat.GetColumns();
633 HelmMat.GetRawPtr(), 1, &NDTraceMat->GetPtr()[0], 1);
636 HelmMat.Scale(), NDTraceMat);
675 int rows = LapMat.GetRows();
676 int cols = LapMat.GetColumns();
682 (*adr) = LapMat - lambda * MassMat + AdvMat;
752 "Need to specify eFactorGJP to construct "
753 "a LinearAdvectionDiffusionReactionGJP matrix");
755 int rows = LapMat.GetRows();
756 int cols = LapMat.GetColumns();
763 LapMat - lambda * MassMat + AdvMat + gjpfactor * NDTraceMat;
909 "Matrix construction is not implemented for variable "
910 "coefficients at the moment");
921 "HybridDGHelmholtz matrix not set up "
922 "for non boundary-interior expansions");
950 StdRegions::VarCoeffMap::const_iterator x;
953 for (i = 0; i < coordim; ++i)
960 GetMF(i, coordim, varcoeffs);
981 Mat = Mat + Dmat * invMass *
Transpose(Dmat);
986 Mat = Mat + Dmat * invMass *
Transpose(Dmat);
1011 Mat = Mat + lambdaval * Mass;
1014 for (i = 0; i < nfaces; ++i)
1017 order_f = FaceExp->GetNcoeffs();
1042 for (j = 0; j < order_f; ++j)
1044 for (k = 0; k < order_f; ++k)
1046 Mat((*map)[j].index, (*map)[k].index) +=
1047 tau * (*map)[j].sign * (*map)[k].sign *
eMass(j, k);
1087 for (i = 0; i < nfaces; ++i)
1097 for (j = 0; j < nface; ++j)
1101 face_lambda[j] = 1.0;
1106 FaceExp->BwdTrans(face_lambda, tmp);
1113 for (k = 0; k < ncoeffs; ++k)
1115 Umat(k, bndry_cnt) = Ulam[k];
1198 for (i = 0; i < nfaces; ++i)
1220 ASSERTL0(
false,
"Direction not known");
1226 StdRegions::VarCoeffMap::const_iterator x;
1233 GetMF(dir, coordim, varcoeffs);
1262 for (j = 0; j < nbndry; ++j)
1268 for (k = 0; k < ncoeffs; ++k)
1270 Ulam[k] = lamToU(k, j);
1288 &(Qmat.GetPtr())[0] + j * ncoeffs, 1);
1296 int order_f, nquad_f;
1342 for (i = 0; i < nfaces; ++i)
1348 for (i = 0; i < nbndry; ++i)
1356 for (f = 0; f < nfaces; ++f)
1358 order_f = FaceExp[f]->GetNcoeffs();
1359 nquad_f = FaceExp[f]->GetNumPoints(0) *
1360 FaceExp[f]->GetNumPoints(1);
1384 for (j = 0; j < order_f; ++j)
1387 (*map)[j].sign * (*LamToQ[0])((*map)[j].index, i);
1390 FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
1406 0, f, FaceExp[f], normals, varcoeffs);
1408 Vmath::Vmul(nquad_f, ncdotMF, 1, facePhys, 1, work, 1);
1412 Vmath::Vmul(nquad_f, normals[0], 1, facePhys, 1, work,
1417 for (j = 0; j < order_f; ++j)
1420 (*map)[j].sign * (*LamToQ[1])((*map)[j].index, i);
1423 FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
1439 1, f, FaceExp[f], normals, varcoeffs);
1441 Vmath::Vvtvp(nquad_f, ncdotMF, 1, facePhys, 1, work, 1,
1446 Vmath::Vvtvp(nquad_f, normals[1], 1, facePhys, 1, work,
1451 for (j = 0; j < order_f; ++j)
1454 (*map)[j].sign * (*LamToQ[2])((*map)[j].index, i);
1457 FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
1473 2, f, FaceExp[f], normals, varcoeffs);
1475 Vmath::Vvtvp(nquad_f, ncdotMF, 1, facePhys, 1, work, 1,
1480 Vmath::Vvtvp(nquad_f, normals[2], 1, facePhys, 1, work,
1486 for (j = 0; j < order_f; ++j)
1489 (*map)[j].sign * LamToU((*map)[j].index, i) -
1493 FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
1505 Vmath::Svtvp(nquad_f, -tau, facePhys, 1, work, 1, work, 1);
1508 FaceExp[f]->IProductWRTBase(work, faceCoeffs);
1512 for (j = 0; j < order_f; ++j)
1514 BndMat(cnt + j, i) = faceCoeffs[j];
1530 LapMat.GetRows(), LapMat.GetColumns());
1561 for (
int d = 0;
d < ncoords; ++
d)
1569 for (
int t = 0; t < ntraces; ++t)
1572 tracepts[t] = traceExp[t]->GetTotPoints();
1573 maxtpts = (maxtpts > tracepts[t]) ? maxtpts : tracepts[t];
1579 for (
int t = 0; t < ntraces; ++t)
1588 PhysDeriv(phys, Deriv[0], Deriv[1], Deriv[2]);
1590 for (
int t = 0; t < ntraces; ++t)
1597 traceExp[t]->GetBasis(0)->GetBasisKey();
1599 traceExp[t]->GetBasis(1)->GetBasisKey();
1601 (fromkey0 != tokey0) || (fromkey1 != tokey1);
1608 for (
int d = 0;
d < ncoords; ++
d)
1625 tmp = dphidn[t] + i * tracepts[t], 1,
1626 tmp1 = dphidn[t] + i * tracepts[t], 1);
1631 for (
int t = 0; t < ntraces; ++t)
1633 int nt = tracepts[t];
1639 (
p == 1) ? 0.02 * h * h : 0.8 * pow(
p + 1, -4.0) * h * h;
1646 dphidn[t] + j * nt, 1, val, 1);
1648 Mat(i, j) + scale * traceExp[t]->Integral(val);
1656 for (
int j = 0; j < i; ++j)
1658 Mat(i, j) = Mat(j, i);
1665 "This matrix type cannot be generated from this class");
1697 if (faceExp->GetRightAdjacentElementExp())
1699 if (faceExp->GetRightAdjacentElementExp()
1701 ->GetGlobalID() ==
GetGeom()->GetGlobalID())
1714 int order_e = (*map).size();
1715 int n_coeffs = FaceExp->GetNcoeffs();
1719 if (n_coeffs != order_e)
1721 FaceExp->FwdTrans(Fn, faceCoeffs);
1723 int NumModesElementMax = FaceExp->GetBasis(0)->GetNumModes();
1724 int NumModesElementMin =
m_base[0]->GetNumModes();
1726 FaceExp->ReduceOrderCoeffs(NumModesElementMin, faceCoeffs, faceCoeffs);
1729 FaceExp->DetShapeType(), *FaceExp);
1730 FaceExp->MassMatrixOp(faceCoeffs, faceCoeffs, masskey);
1733 int offset1 = 0, offset2 = 0;
1737 for (i = 0; i < NumModesElementMin; ++i)
1739 for (j = 0; j < NumModesElementMin; ++j)
1741 faceCoeffs[offset1 + j] = faceCoeffs[offset2 + j];
1743 offset1 += NumModesElementMin;
1744 offset2 += NumModesElementMax;
1748 for (i = NumModesElementMin; i < NumModesElementMax; ++i)
1750 for (j = NumModesElementMin; j < NumModesElementMax; ++j)
1752 faceCoeffs[i * NumModesElementMax + j] = 0.0;
1761 int offset1 = 0, offset2 = 0;
1763 for (i = 0; i < NumModesElementMin; ++i)
1765 for (j = 0; j < NumModesElementMin - i; ++j)
1767 faceCoeffs[offset1 + j] = faceCoeffs[offset2 + j];
1769 offset1 += NumModesElementMin - i;
1770 offset2 += NumModesElementMax - i;
1776 FaceExp->IProductWRTBase(Fn, faceCoeffs);
1781 for (i = 0; i < order_e; ++i)
1783 outarray[(*map)[i].index] -= (*map)[i].sign * faceCoeffs[i];
1788 for (i = 0; i < order_e; ++i)
1790 outarray[(*map)[i].index] += (*map)[i].sign * faceCoeffs[i];
1826 Out_d = InvMass * Coeffs;
1834 "Not set up for non boundary-interior expansions");
1835 ASSERTL1(inoutmat->GetRows() == inoutmat->GetColumns(),
1836 "Assuming that input matrix was square");
1841 int order_f = faceExp->GetNcoeffs();
1854 DNekScalMat &facemat = *faceExp->GetLocMatrix(mkey);
1871 int rows = inoutmat->GetRows();
1879 int nfvert = faceExp->GetNverts();
1886 GetLinStdExp()->GetTraceToElementMap(face, linmap, linsign,
1895 for (i = 0; i < nfvert; ++i)
1897 fmap = faceExp->GetVertexMap(i,
true);
1901 map[fmap] = linmap[i];
1912 for (i = 0; i < order_f; ++i)
1914 for (j = 0; j < nbndry; ++j)
1916 if (map[i] == bmap[j])
1922 ASSERTL1(j != nbndry,
"Did not find number in map");
1941 ASSERTL1((*map1).size() == (*map2).size(),
1942 "There is an error with the GetTraceToElementMap");
1944 for (i = 0; i < face; ++i)
1949 for (i = 0; i < (*map1).size(); ++i)
1953 for (j = 0; j < (*map2).size(); ++j)
1955 if ((*map1)[i].index == (*map2)[j].index)
1962 ASSERTL2(idx >= 0,
"Index not found");
1964 sign[i] = (*map2)[idx].sign;
1969 ASSERTL0(
false,
"Could not identify matrix type from dimension");
1972 for (i = 0; i < order_f; ++i)
1975 for (j = 0; j < order_f; ++j)
1978 (*inoutmat)(id1, id2) += facemat(i, j) *
sign[i] *
sign[j];
1989 int nVerts, vid1, vid2, vMap1, vMap2;
1996 DNekMat &VertexMat = (*vertexmatrix);
1998 for (vid1 = 0; vid1 < nVerts; ++vid1)
2002 for (vid2 = 0; vid2 < nVerts; ++vid2)
2005 VertexValue = (*r_bnd)(vMap1, vMap2);
2006 VertexMat.SetValue(vid1, vid2, VertexValue);
2010 return vertexmatrix;
2017 int eid, fid, vid, n, i;
2050 int nConnectedEdges = 3;
2051 int nConnectedFaces = 3;
2062 nBndCoeffs, nBndCoeffs, 0.0, storage);
2064 DNekMat &R = (*transformationmatrix);
2069 for (vid = 0; vid < nVerts; ++vid)
2079 int nedgemodesconnected =
2085 int nfacemodesconnected =
2094 for (eid = 0; eid < nConnectedEdges; ++eid)
2096 MatEdgeLocation[eid] =
2098 nmodes = MatEdgeLocation[eid].size();
2103 &edgemodearray[offset], 1);
2112 for (fid = 0; fid < nConnectedFaces; ++fid)
2114 MatFaceLocation[fid] =
2116 nmodes = MatFaceLocation[fid].size();
2121 &facemodearray[offset], 1);
2128 DNekMat &Sveft = (*vertexedgefacetransformmatrix);
2132 DNekMat &Svef = (*vertexedgefacecoupling);
2135 for (n = 0; n < nedgemodesconnected; ++n)
2138 VertexEdgeFaceValue = (*r_bnd)(
GetVertexMap(vid), edgemodearray[n]);
2141 Svef.SetValue(0, n, VertexEdgeFaceValue);
2145 for (n = 0; n < nfacemodesconnected; ++n)
2148 VertexEdgeFaceValue = (*r_bnd)(
GetVertexMap(vid), facemodearray[n]);
2151 Svef.SetValue(0, n + nedgemodesconnected, VertexEdgeFaceValue);
2165 DNekMat &Sefef = (*edgefacecoupling);
2170 for (m = 0; m < nedgemodesconnected; ++m)
2172 for (n = 0; n < nedgemodesconnected; ++n)
2175 EdgeEdgeValue = (*r_bnd)(edgemodearray[n], edgemodearray[m]);
2178 Sefef.SetValue(n, m, EdgeEdgeValue);
2183 for (n = 0; n < nfacemodesconnected; ++n)
2185 for (m = 0; m < nfacemodesconnected; ++m)
2188 FaceFaceValue = (*r_bnd)(facemodearray[n], facemodearray[m]);
2190 Sefef.SetValue(nedgemodesconnected + n, nedgemodesconnected + m,
2196 for (n = 0; n < nedgemodesconnected; ++n)
2198 for (m = 0; m < nfacemodesconnected; ++m)
2201 FaceFaceValue = (*r_bnd)(edgemodearray[n], facemodearray[m]);
2204 Sefef.SetValue(n, nedgemodesconnected + m, FaceFaceValue);
2206 FaceFaceValue = (*r_bnd)(facemodearray[m], edgemodearray[n]);
2209 Sefef.SetValue(nedgemodesconnected + m, n, FaceFaceValue);
2219 Sveft = -Svef * Sefef;
2223 for (n = 0; n < edgemodearray.size(); ++n)
2225 R.SetValue(
GetVertexMap(vid), edgemodearray[n], Sveft(0, n));
2229 for (n = 0; n < facemodearray.size(); ++n)
2232 Sveft(0, n + nedgemodesconnected));
2255 int efCol, efRow, nedgemodes;
2258 nConnectedFaces = 2;
2267 for (eid = 0; eid < nEdges; ++eid)
2278 DNekMat &Mef = (*efedgefacecoupling);
2284 DNekMat &Meff = (*effacefacecoupling);
2290 DNekMat &Meft = (*edgefacetransformmatrix);
2292 int nfacemodesconnected =
2304 Vmath::Vcopy(nedgemodes, &inedgearray[0], 1, &edgemodearray[0], 1);
2310 for (fid = 0; fid < nConnectedFaces; ++fid)
2312 MatFaceLocation[fid] =
2314 nmodes = MatFaceLocation[fid].size();
2319 &facemodearray[offset], 1);
2325 for (n = 0; n < nedgemodes; ++n)
2327 for (m = 0; m < nfacemodesconnected; ++m)
2330 EdgeFaceValue = (*r_bnd)(edgemodearray[n], facemodearray[m]);
2333 Mef.SetValue(n, m, EdgeFaceValue);
2338 for (n = 0; n < nfacemodesconnected; ++n)
2340 for (m = 0; m < nfacemodesconnected; ++m)
2343 FaceFaceValue = (*r_bnd)(facemodearray[n], facemodearray[m]);
2346 Meff.SetValue(n, m, FaceFaceValue);
2360 for (n = 0; n < Meft.GetRows(); ++n)
2362 for (m = 0; m < Meft.GetColumns(); ++m)
2364 R.SetValue(edgemodearray[n], facemodearray[m], Meft(n, m));
2369 for (i = 0; i < R.GetRows(); ++i)
2371 R.SetValue(i, i, 1.0);
2377 return transformationmatrix;
2398 int i, j, n, eid = 0, fid = 0;
2410 DNekMat &InvR = (*inversetransformationmatrix);
2418 int nedgemodestotal = 0;
2419 int nfacemodestotal = 0;
2421 for (eid = 0; eid < nEdges; ++eid)
2424 nedgemodestotal += nedgemodes;
2427 for (fid = 0; fid < nFaces; ++fid)
2430 nfacemodestotal += nfacemodes;
2439 for (eid = 0; eid < nEdges; ++eid)
2447 Vmath::Vcopy(nedgemodes, &edgearray[0], 1, &edgemodearray[offset],
2451 offset += nedgemodes;
2457 for (fid = 0; fid < nFaces; ++fid)
2465 Vmath::Vcopy(nfacemodes, &facearray[0], 1, &facemodearray[offset],
2469 offset += nfacemodes;
2473 for (i = 0; i < nVerts; ++i)
2475 for (j = 0; j < nedgemodestotal; ++j)
2480 for (j = 0; j < nfacemodestotal; ++j)
2484 for (n = 0; n < nedgemodestotal; ++n)
2486 MatrixValue = InvR.GetValue(
GetVertexMap(i), facemodearray[j]) +
2488 R(edgemodearray[n], facemodearray[j]);
2489 InvR.SetValue(
GetVertexMap(i), facemodearray[j], MatrixValue);
2495 for (i = 0; i < nedgemodestotal; ++i)
2497 for (j = 0; j < nfacemodestotal; ++j)
2499 InvR.SetValue(edgemodearray[i], facemodearray[j],
2500 -R(edgemodearray[i], facemodearray[j]));
2504 for (i = 0; i < nCoeffs; ++i)
2506 InvR.SetValue(i, i, 1.0);
2509 return inversetransformationmatrix;
2523 map<int, int> invmap;
2524 for (j = 0; j < nBndCoeffs; ++j)
2526 invmap[bmap[j]] = j;
2542 for (n = 0; n < nEdgeCoeffs; ++n)
2544 edgemaparray[n] = invmap[maparray[n]];
2547 return edgemaparray;
2563 map<int, int> reversemap;
2564 for (j = 0; j < bmap.size(); ++j)
2566 reversemap[bmap[j]] = j;
2582 fOrient = faceOrient;
2598 ASSERTL1(P1 <= locP1,
"Expect value of passed P1 to "
2599 "be lower or equal to face num modes");
2608 ASSERTL1(P2 <= locP2,
"Expect value of passed P2 to "
2609 "be lower or equal to face num modes");
2612 switch (
GetGeom3D()->GetFace(fid)->GetShapeType())
2616 if (((P1 - 3) > 0) && ((P2 - 3) > 0))
2623 for (n = 0; n < P1 - 3; ++n)
2625 for (
int m = 0; m < P2 - 3 - n; ++m, ++cnt)
2627 facemaparray[cnt] = reversemap[maparray[cnt1 + m]];
2629 cnt1 += locP2 - 3 - n;
2636 if (((P1 - 2) > 0) && ((P2 - 2) > 0))
2643 for (n = 0; n < P2 - 2; ++n)
2645 for (
int m = 0; m < P1 - 2; ++m, ++cnt)
2647 facemaparray[cnt] = reversemap[maparray[cnt1 + m]];
2656 ASSERTL0(
false,
"Invalid shape type.");
2661 return facemaparray;
2680 map<int, int> reversemap;
2681 for (j = 0; j < bmap.size(); ++j)
2683 reversemap[bmap[j]] = j;
2688 for (n = 0; n < nverts; ++n)
2691 vmap[n] = reversemap[id];
2697 for (
int eid = 0; eid < nedges; ++eid)
2711 for (n = 0; n < nEdgeCoeffs; ++n)
2713 edgemaparray[n] = reversemap[maparray[n]];
2715 emap[eid] = edgemaparray;
2721 for (
int fid = 0; fid < nfaces; ++fid)
2735 for (n = 0; n < nFaceCoeffs; ++n)
2737 facemaparray[n] = reversemap[maparray[n]];
2740 fmap[fid] = facemaparray;
2746 return m_geom->GetForient(face);
2764 int nq0 = FaceExp->GetNumPoints(0);
2765 int nq1 = FaceExp->GetNumPoints(1);
2768 int dir0 =
GetGeom3D()->GetDir(face, 0);
2769 int dir1 =
GetGeom3D()->GetDir(face, 1);
2780 Vmath::Gathr(
static_cast<int>(faceids.size()), inarray, faceids, o_tmp);
2797 m_base[dir0]->GetPointsKey(),
m_base[dir1]->GetPointsKey(), o_tmp.get(),
2798 FaceExp->GetBasis(to_id0)->GetPointsKey(),
2799 FaceExp->GetBasis(to_id1)->GetPointsKey(), o_tmp2.get());
2809 if (faceGeom->GetNumVerts() == 3)
2813 m_geom->GetFace(traceid));
2819 m_geom->GetFace(traceid));
2828 if (idmap.size() != nq0 * nq1)
2839 for (
int i = 0; i < nq0 * nq1; ++i)
2846 for (
int j = 0; j < nq1; ++j)
2848 for (
int i = 0; i < nq0; ++i)
2850 idmap[j * nq0 + i] = nq0 - 1 - i + j * nq0;
2856 "Case not supposed to be used in this function");
2865 for (
int i = 0; i < nq0 * nq1; ++i)
2873 for (
int j = 0; j < nq1; j++)
2875 for (
int i = 0; i < nq0; ++i)
2877 idmap[j * nq0 + i] = nq0 - 1 - i + j * nq0;
2885 for (
int j = 0; j < nq1; j++)
2887 for (
int i = 0; i < nq0; ++i)
2889 idmap[j * nq0 + i] = nq0 * (nq1 - 1 - j) + i;
2897 for (
int j = 0; j < nq1; j++)
2899 for (
int i = 0; i < nq0; ++i)
2901 idmap[j * nq0 + i] = nq0 * nq1 - 1 - j * nq0 - i;
2909 for (
int i = 0; i < nq0; ++i)
2911 for (
int j = 0; j < nq1; ++j)
2913 idmap[i * nq1 + j] = i + j * nq0;
2921 for (
int i = 0; i < nq0; ++i)
2923 for (
int j = 0; j < nq1; ++j)
2925 idmap[i * nq1 + j] = nq0 - 1 - i + j * nq0;
2933 for (
int i = 0; i < nq0; ++i)
2935 for (
int j = 0; j < nq1; ++j)
2937 idmap[i * nq1 + j] = i + nq0 * (nq1 - 1) - j * nq0;
2945 for (
int i = 0; i < nq0; ++i)
2947 for (
int j = 0; j < nq1; ++j)
2949 idmap[i * nq1 + j] = nq0 * nq1 - 1 - i - j * nq0;
2955 ASSERTL0(
false,
"Unknow orientation");
2974 int nquad_f = FaceExp_f->GetNumPoints(0) * FaceExp_f->GetNumPoints(1);
2977 int nquad0 =
m_base[0]->GetNumPoints();
2978 int nquad1 =
m_base[1]->GetNumPoints();
2979 int nquad2 =
m_base[2]->GetNumPoints();
2980 int nqtot = nquad0 * nquad1 * nquad2;
2992 StdRegions::VarCoeffMap::const_iterator MFdir;
2997 for (
int k = 0; k < coordim; k++)
2999 MFdir = varcoeffs.find(MMFCoeffs[dir * 5 + k]);
3000 tmp = MFdir->second.GetValue();
3004 Vmath::Vvtvp(nquad_f, &tmp_f[0], 1, &normals[k][0], 1, &nFacecdotMF[0],
3005 1, &nFacecdotMF[0], 1);
3015 int nverts = geom->GetFace(traceid)->GetNumVerts();
3018 tn1.
Sub(*(geom->GetFace(traceid)->GetVertex(1)),
3019 *(geom->GetFace(traceid)->GetVertex(0)));
3021 tn2.
Sub(*(geom->GetFace(traceid)->GetVertex(nverts - 1)),
3022 *(geom->GetFace(traceid)->GetVertex(0)));
3024 normal.
Mult(tn1, tn2);
3028 mag = 1.0 /
sqrt(mag);
3034 for (
int i = 0; i < nverts; ++i)
3037 int edgid = geom->GetEdgeNormalToFaceVert(traceid, i);
3040 Dx.
Sub(*(geom->GetEdge(edgid)->GetVertex(0)),
3041 *(geom->GetEdge(edgid)->GetVertex(1)));
3045 h += fabs(normal.
dot(Dx));
3051 int dir0 = geom->GetDir(traceid, 0);
3052 int dir1 = geom->GetDir(traceid, 1);
3054 for (dirn = 0; dirn < 3; ++dirn)
3056 if ((dirn != dir0) && (dirn != dir1))
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
#define sign(a, b)
return the sign(b)*a
Describes the specification for a Basis.
virtual DNekMatSharedPtr v_BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType) override
virtual void v_AddRobinMassMatrix(const int face, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat) override
void SetTraceToGeomOrientation(Array< OneD, NekDouble > &inout)
Align trace orientation with the geometry orientation.
virtual void v_DGDeriv(const int dir, const Array< OneD, const NekDouble > &incoeffs, Array< OneD, ExpansionSharedPtr > &FaceExp, Array< OneD, Array< OneD, NekDouble > > &faceCoeffs, Array< OneD, NekDouble > &out_d) override
Evaluate coefficients of weak deriviative in the direction dir given the input coefficicents incoeffs...
virtual StdRegions::Orientation v_GetTraceOrient(int face) override
void AddNormTraceInt(const int dir, Array< OneD, ExpansionSharedPtr > &FaceExp, Array< OneD, Array< OneD, NekDouble > > &faceCoeffs, Array< OneD, NekDouble > &outarray)
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Array< OneD, unsigned int > GetTraceInverseBoundaryMap(int fid, StdRegions::Orientation faceOrient=StdRegions::eNoOrientation, int P1=-1, int P2=-1)
std::vector< bool > m_requireNeg
void GetInverseBoundaryMaps(Array< OneD, unsigned int > &vmap, Array< OneD, Array< OneD, unsigned int > > &emap, Array< OneD, Array< OneD, unsigned int > > &fmap)
Array< OneD, NekDouble > GetnFacecdotMF(const int dir, const int face, ExpansionSharedPtr &FaceExp_f, const Array< OneD, const Array< OneD, NekDouble > > &normals, const StdRegions::VarCoeffMap &varcoeffs)
virtual DNekMatSharedPtr v_BuildInverseTransformationMatrix(const DNekScalMatSharedPtr &transformationmatrix) override
Build inverse and inverse transposed transformation matrix: and .
void AddFaceBoundaryInt(const int face, ExpansionSharedPtr &FaceExp, Array< OneD, NekDouble > &facePhys, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs=StdRegions::NullVarCoeffMap)
void GetPhysFaceVarCoeffsFromElement(const int face, ExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &varcoeff, Array< OneD, NekDouble > &outarray)
virtual void v_TraceNormLen(const int traceid, NekDouble &h, NekDouble &p) override
void v_ReOrientTracePhysMap(const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1) override
void v_NormVectorIProductWRTBase(const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray) override
Array< OneD, unsigned int > GetEdgeInverseBoundaryMap(int eid)
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
SpatialDomains::Geometry3DSharedPtr GetGeom3D() const
virtual void v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp) override
virtual void v_AddFaceNormBoundaryInt(const int face, const ExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray) override
void AddHDGHelmholtzFaceTerms(const NekDouble tau, const int edge, Array< OneD, NekDouble > &facePhys, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
virtual DNekMatSharedPtr v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd) override
virtual void v_GetTracePhysVals(const int face, const StdRegions::StdExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient) override
Extract the physical values along face face from inarray into outarray following the local face orien...
void SetFaceToGeomOrientation(const int face, Array< OneD, NekDouble > &inout)
Align face orientation with the geometry orientation.
SpatialDomains::GeometrySharedPtr GetGeom() const
SpatialDomains::GeometrySharedPtr m_geom
void GetTracePhysMap(const int edge, Array< OneD, int > &outarray)
void DropLocMatrix(const LocalRegions::MatrixKey &mkey)
DNekMatSharedPtr BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
Array< OneD, NekDouble > GetMFMag(const int dir, const StdRegions::VarCoeffMap &varcoeffs)
void GetTracePhysVals(const int trace, const StdRegions::StdExpansionSharedPtr &TraceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient=StdRegions::eNoOrientation)
std::map< int, ExpansionWeakPtr > m_traceExp
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
ExpansionSharedPtr GetTraceExp(const int traceid)
StdRegions::Orientation GetTraceOrient(int trace)
IndexMapValuesSharedPtr GetIndexMap(const IndexMapKey &ikey)
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
Array< OneD, NekDouble > GetMFDiv(const int dir, const StdRegions::VarCoeffMap &varcoeffs)
void TraceNormLen(const int traceid, NekDouble &h, NekDouble &p)
const NormalVector & GetTraceNormal(const int id)
Array< OneD, NekDouble > GetMF(const int dir, const int shapedim, const StdRegions::VarCoeffMap &varcoeffs)
DNekMatSharedPtr BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
boost::call_traits< DataType >::const_reference x() const
boost::call_traits< DataType >::const_reference z() const
boost::call_traits< DataType >::const_reference y() const
void Sub(PointGeom &a, PointGeom &b)
void Mult(PointGeom &a, PointGeom &b)
_this = a x b
NekDouble dot(PointGeom &a)
retun the dot product between this and input a
void UpdatePosition(NekDouble x, NekDouble y, NekDouble z)
int GetEdgeNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th edge.
int GetNedges() const
return the number of edges in 3D expansion
void GetEdgeInteriorToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards)
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
void FillMode(const int mode, Array< OneD, NekDouble > &outarray)
This function fills the array outarray with the mode-th mode of the expansion.
int GetTraceNumPoints(const int i) const
This function returns the number of quadrature points belonging to the i-th trace.
int NumBndryCoeffs(void) const
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
const LibUtilities::PointsKeyVector GetPointsKeys() const
int GetTraceIntNcoeffs(const int i) const
int NumDGBndryCoeffs(void) const
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
const LibUtilities::BasisKey GetTraceBasisKey(const int i, int k=-1) const
This function returns the basis key belonging to the i-th trace.
int GetVertexMap(const int localVertexId, bool useCoeffPacking=false)
void NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
std::shared_ptr< StdExpansion > GetLinStdExp(void) const
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
this function calculates the inner product of a given function f with the different modes of the expa...
int GetNtraces() const
Returns the number of trace elements connected to this element.
int GetNverts() const
This function returns the number of vertices of the expansion domain.
void GetTraceToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
void GetTraceInteriorToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eForwards)
int GetTraceNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th trace.
DNekMatSharedPtr GenMatrix(const StdMatrixKey &mkey)
void GetTraceNumModes(const int tid, int &numModes0, int &numModes1, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
void FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Forward transformation from physical space to coefficient space.
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
void PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
Array< OneD, LibUtilities::BasisSharedPtr > m_base
bool IsBoundaryInteriorExpansion() const
LibUtilities::ShapeType GetShapeType() const
const VarCoeffMap & GetVarCoeffs() const
MatrixType GetMatrixType() const
bool HasVarCoeff(const StdRegions::VarCoeffType &coeff) const
const ConstFactorMap & GetConstFactors() const
NekDouble GetConstFactor(const ConstFactorType &factor) const
bool ConstFactorExists(const ConstFactorType &factor) const
int getNumberOfCoefficients(int Na, int Nb)
int getNumberOfCoefficients(int Na, int Nb)
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,...
std::vector< PointsKey > PointsKeyVector
std::shared_ptr< Expansion > ExpansionSharedPtr
std::shared_ptr< IndexMapValues > IndexMapValuesSharedPtr
@ eNoGeomType
No type defined.
@ eDeformed
Geometry is curved or has non-constant factors.
std::shared_ptr< Geometry > GeometrySharedPtr
std::shared_ptr< Geometry3D > Geometry3DSharedPtr
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
@ eLinearAdvectionDiffusionReaction
@ eLinearAdvectionDiffusionReactionGJP
@ eInvLaplacianWithUnityMean
static ConstFactorMap NullConstFactorMap
@ eDir1BwdDir2_Dir2BwdDir1
@ eDir1FwdDir1_Dir2FwdDir2
@ eDir1BwdDir1_Dir2BwdDir2
@ eDir1BwdDir2_Dir2FwdDir1
@ eDir1FwdDir1_Dir2BwdDir2
@ eDir1BwdDir1_Dir2FwdDir2
@ eDir1FwdDir2_Dir2FwdDir1
@ eDir1FwdDir2_Dir2BwdDir1
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
std::vector< double > d(NPUPPER *NPUPPER)
The above copyright notice and this permission notice shall be included.
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
static DNekMatSharedPtr NullDNekMatSharedPtr
static Array< OneD, NekDouble > NullNekDouble1DArray
NekMatrix< InnerMatrixType, BlockMatrixTag > Transpose(NekMatrix< InnerMatrixType, BlockMatrixTag > &rhs)
std::shared_ptr< DNekMat > DNekMatSharedPtr
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.
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 Neg(int n, T *x, const int incx)
Negate x = -x.
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
void Scatr(int n, const T *x, const int *y, T *z)
Scatter vector z[y[i]] = x[i].
void Gathr(int n, const T *sign, const T *x, const int *y, T *z)
Gather vector z[i] = sign[i]*x[y[i]].
void Zero(int n, T *x, const int incx)
Zero vector.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
scalarT< T > sqrt(scalarT< T > in)