56 int nquad_f = FaceExp->GetNumPoints(0) * FaceExp->GetNumPoints(1);
57 int order_f = FaceExp->GetNcoeffs();
91 if ((x = varcoeffs.find(VarCoeff[0])) != varcoeffs.end())
93 GetPhysFaceVarCoeffsFromElement(face,FaceExp,x->second,varcoeff_work);
94 Vmath::Vmul(nquad_f,varcoeff_work,1,FaceExp->GetPhys(),1,FaceExp->UpdatePhys(),1);
101 FaceExp->IProductWRTBase(facePhys, outcoeff);
103 for (i = 0; i < order_f; ++i)
105 outarray[(*map)[i].index] += (*map)[i].sign * tau * outcoeff[i];
114 for (n = 0; n < coordim; ++n)
129 Vmath::Vmul(nquad_f, ncdotMF_f, 1, facePhys, 1, inval, 1);
133 Vmath::Vmul(nquad_f, normals[n], 1, facePhys, 1, inval, 1);
137 const NekDouble *data = invMass.GetRawPtr();
150 FaceExp->IProductWRTBase(inval, outcoeff);
153 for (i = 0; i < ncoeffs; ++i)
156 for (j = 0; j < order_f; ++j)
158 tmpcoeff[i] += scale * data[i + (*map)[j].index * ncoeffs] *
159 (*map)[j].sign * outcoeff[j];
167 GetMF(n, coordim, varcoeffs);
177 Coeffs = Coeffs + Dmat * Tmpcoeff;
182 Coeffs = Coeffs + Dmat * Tmpcoeff;
219 for (
unsigned int i = 0; i < FaceExp->GetNcoeffs(); ++i)
221 facetmp[i] = tmp[emap[i]];
225 FaceExp->BwdTrans(facetmp, outarray);
239 int order_f, nquad_f;
243 for (f = 0; f < nfaces; ++f)
245 order_f = FaceExp[f]->GetNcoeffs();
246 nquad_f = FaceExp[f]->GetNumPoints(0) * FaceExp[f]->GetNumPoints(1);
253 for (i = 0; i < order_f; ++i)
255 faceCoeffs[i] = inarray[i + cnt];
259 FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
276 StdRegions::VarCoeffMap::const_iterator x;
282 Vmath::Vmul(nquad_f, ncdotMF_f, 1, facePhys, 1, facePhys, 1);
286 Vmath::Vmul(nquad_f, normals[dir], 1, facePhys, 1, facePhys, 1);
303 for (f = 0; f < nfaces; ++f)
305 nquad_f = FaceExp[f]->GetNumPoints(0) * FaceExp[f]->GetNumPoints(1);
311 FaceExp[f]->BwdTrans(faceCoeffs[f], facePhys);
313 Vmath::Vmul(nquad_f, normals[dir], 1, facePhys, 1, facePhys, 1);
328 int order_f = FaceExp->GetNcoeffs();
336 FaceExp->IProductWRTBase(facePhys, coeff);
339 for (i = 0; i < order_f; ++i)
341 outarray[(*map)[i].index] += (*map)[i].sign * coeff[i];
367 ASSERTL1((*map1).size() == (*map2).size(),
368 "There is an error with the GetTraceToElementMap");
370 for (j = 0; j < (*map1).size(); ++j)
373 for (k = 0; k < (*map2).size(); ++k)
376 if ((*map1)[j].index == (*map2)[k].index && k != j)
380 if ((*map1)[j].
sign != (*map2)[k].
sign)
400 for (i = 0; i < nfaces; ++i)
413 "Geometric information is not set up");
500 int rows = deriv0.GetRows();
501 int cols = deriv1.GetColumns();
505 (*WeakDeriv) = df[3 * dir][0] * deriv0 +
506 df[3 * dir + 1][0] * deriv1 +
507 df[3 * dir + 2][0] * deriv2;
561 int rows = lap00.GetRows();
562 int cols = lap00.GetColumns();
567 (*lap) = gmat[0][0] * lap00 + gmat[4][0] * lap11 +
569 gmat[3][0] * (lap01 +
Transpose(lap01)) +
570 gmat[6][0] * (lap02 +
Transpose(lap02)) +
587 int rows = LapMat.GetRows();
588 int cols = LapMat.GetColumns();
594 (*helm) = LapMat + factor * MassMat;
610 "Need to specify eFactorGJP to construct "
611 "a HelmholtzGJP matrix");
615 factor /= HelmMat.Scale();
617 int ntot = HelmMat.GetRows() * HelmMat.GetColumns();
620 HelmMat.GetRawPtr(), 1, &NDTraceMat->GetPtr()[0], 1);
623 HelmMat.Scale(), NDTraceMat);
671 int rows = LapMat.GetRows();
672 int cols = LapMat.GetColumns();
678 (*adr) = LapMat - lambda * MassMat + AdvMat;
684 if (!massVarcoeffs.empty())
688 if (!lapVarcoeffs.empty())
743 "Need to specify eFactorGJP to construct "
744 "a LinearAdvectionDiffusionReactionGJP matrix");
746 int rows = LapMat.GetRows();
747 int cols = LapMat.GetColumns();
754 LapMat - lambda * MassMat + AdvMat + gjpfactor * NDTraceMat;
898 "Matrix construction is not implemented for variable "
899 "coefficients at the moment");
910 "HybridDGHelmholtz matrix not set up "
911 "for non boundary-interior expansions");
939 StdRegions::VarCoeffMap::const_iterator x;
942 for (i = 0; i < coordim; ++i)
949 GetMF(i, coordim, varcoeffs);
970 Mat = Mat + Dmat * invMass *
Transpose(Dmat);
975 Mat = Mat + Dmat * invMass *
Transpose(Dmat);
1000 Mat = Mat + lambdaval * Mass;
1003 for (i = 0; i < nfaces; ++i)
1006 order_f = FaceExp->GetNcoeffs();
1031 for (j = 0; j < order_f; ++j)
1033 for (k = 0; k < order_f; ++k)
1035 Mat((*map)[j].index, (*map)[k].index) +=
1036 tau * (*map)[j].sign * (*map)[k].sign *
eMass(j, k);
1076 for (i = 0; i < nfaces; ++i)
1086 for (j = 0; j < nface; ++j)
1090 face_lambda[j] = 1.0;
1095 FaceExp->BwdTrans(face_lambda, tmp);
1102 for (k = 0; k < ncoeffs; ++k)
1104 Umat(k, bndry_cnt) = Ulam[k];
1187 for (i = 0; i < nfaces; ++i)
1209 ASSERTL0(
false,
"Direction not known");
1215 StdRegions::VarCoeffMap::const_iterator x;
1222 GetMF(dir, coordim, varcoeffs);
1251 for (j = 0; j < nbndry; ++j)
1257 for (k = 0; k < ncoeffs; ++k)
1259 Ulam[k] = lamToU(k, j);
1277 &(Qmat.GetPtr())[0] + j * ncoeffs, 1);
1285 int order_f, nquad_f;
1331 for (i = 0; i < nfaces; ++i)
1337 for (i = 0; i < nbndry; ++i)
1345 for (f = 0; f < nfaces; ++f)
1347 order_f = FaceExp[f]->GetNcoeffs();
1348 nquad_f = FaceExp[f]->GetNumPoints(0) *
1349 FaceExp[f]->GetNumPoints(1);
1373 for (j = 0; j < order_f; ++j)
1376 (*map)[j].sign * (*LamToQ[0])((*map)[j].index, i);
1379 FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
1395 0, f, FaceExp[f], normals, varcoeffs);
1397 Vmath::Vmul(nquad_f, ncdotMF, 1, facePhys, 1, work, 1);
1401 Vmath::Vmul(nquad_f, normals[0], 1, facePhys, 1, work,
1406 for (j = 0; j < order_f; ++j)
1409 (*map)[j].sign * (*LamToQ[1])((*map)[j].index, i);
1412 FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
1428 1, f, FaceExp[f], normals, varcoeffs);
1430 Vmath::Vvtvp(nquad_f, ncdotMF, 1, facePhys, 1, work, 1,
1435 Vmath::Vvtvp(nquad_f, normals[1], 1, facePhys, 1, work,
1440 for (j = 0; j < order_f; ++j)
1443 (*map)[j].sign * (*LamToQ[2])((*map)[j].index, i);
1446 FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
1462 2, f, FaceExp[f], normals, varcoeffs);
1464 Vmath::Vvtvp(nquad_f, ncdotMF, 1, facePhys, 1, work, 1,
1469 Vmath::Vvtvp(nquad_f, normals[2], 1, facePhys, 1, work,
1475 for (j = 0; j < order_f; ++j)
1478 (*map)[j].sign * LamToU((*map)[j].index, i) -
1482 FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
1494 Vmath::Svtvp(nquad_f, -tau, facePhys, 1, work, 1, work, 1);
1497 FaceExp[f]->IProductWRTBase(work, faceCoeffs);
1501 for (j = 0; j < order_f; ++j)
1503 BndMat(cnt + j, i) = faceCoeffs[j];
1519 LapMat.GetRows(), LapMat.GetColumns());
1550 for (
int d = 0;
d < ncoords; ++
d)
1558 for (
int t = 0; t < ntraces; ++t)
1561 tracepts[t] = traceExp[t]->GetTotPoints();
1562 maxtpts = (maxtpts > tracepts[t]) ? maxtpts : tracepts[t];
1568 for (
int t = 0; t < ntraces; ++t)
1577 PhysDeriv(phys, Deriv[0], Deriv[1], Deriv[2]);
1579 for (
int t = 0; t < ntraces; ++t)
1586 traceExp[t]->GetBasis(0)->GetBasisKey();
1588 traceExp[t]->GetBasis(1)->GetBasisKey();
1590 (fromkey0 != tokey0) || (fromkey1 != tokey1);
1597 for (
int d = 0;
d < ncoords; ++
d)
1614 tmp = dphidn[t] + i * tracepts[t], 1,
1615 tmp1 = dphidn[t] + i * tracepts[t], 1);
1620 for (
int t = 0; t < ntraces; ++t)
1622 int nt = tracepts[t];
1628 (
p == 1) ? 0.02 * h * h : 0.8 * pow(
p + 1, -4.0) * h * h;
1635 dphidn[t] + j * nt, 1, val, 1);
1637 Mat(i, j) + scale * traceExp[t]->Integral(val);
1645 for (
int j = 0; j < i; ++j)
1647 Mat(i, j) = Mat(j, i);
1654 "This matrix type cannot be generated from this class");
1686 if (faceExp->GetRightAdjacentElementExp())
1688 if (faceExp->GetRightAdjacentElementExp()
1690 ->GetGlobalID() ==
GetGeom()->GetGlobalID())
1703 int order_e = (*map).size();
1704 int n_coeffs = FaceExp->GetNcoeffs();
1708 if (n_coeffs != order_e)
1710 FaceExp->FwdTrans(Fn, faceCoeffs);
1712 int NumModesElementMax = FaceExp->GetBasis(0)->GetNumModes();
1713 int NumModesElementMin =
m_base[0]->GetNumModes();
1715 FaceExp->ReduceOrderCoeffs(NumModesElementMin, faceCoeffs, faceCoeffs);
1718 FaceExp->DetShapeType(), *FaceExp);
1719 FaceExp->MassMatrixOp(faceCoeffs, faceCoeffs, masskey);
1722 int offset1 = 0, offset2 = 0;
1726 for (i = 0; i < NumModesElementMin; ++i)
1728 for (j = 0; j < NumModesElementMin; ++j)
1730 faceCoeffs[offset1 + j] = faceCoeffs[offset2 + j];
1732 offset1 += NumModesElementMin;
1733 offset2 += NumModesElementMax;
1737 for (i = NumModesElementMin; i < NumModesElementMax; ++i)
1739 for (j = NumModesElementMin; j < NumModesElementMax; ++j)
1741 faceCoeffs[i * NumModesElementMax + j] = 0.0;
1750 int offset1 = 0, offset2 = 0;
1752 for (i = 0; i < NumModesElementMin; ++i)
1754 for (j = 0; j < NumModesElementMin - i; ++j)
1756 faceCoeffs[offset1 + j] = faceCoeffs[offset2 + j];
1758 offset1 += NumModesElementMin - i;
1759 offset2 += NumModesElementMax - i;
1765 FaceExp->IProductWRTBase(Fn, faceCoeffs);
1770 for (i = 0; i < order_e; ++i)
1772 outarray[(*map)[i].index] -= (*map)[i].sign * faceCoeffs[i];
1777 for (i = 0; i < order_e; ++i)
1779 outarray[(*map)[i].index] += (*map)[i].sign * faceCoeffs[i];
1815 Out_d = InvMass * Coeffs;
1823 "Not set up for non boundary-interior expansions");
1824 ASSERTL1(inoutmat->GetRows() == inoutmat->GetColumns(),
1825 "Assuming that input matrix was square");
1830 int order_f = faceExp->GetNcoeffs();
1843 DNekScalMat &facemat = *faceExp->GetLocMatrix(mkey);
1860 int rows = inoutmat->GetRows();
1868 int nfvert = faceExp->GetNverts();
1875 GetLinStdExp()->GetTraceToElementMap(face, linmap, linsign,
1884 for (i = 0; i < nfvert; ++i)
1886 fmap = faceExp->GetVertexMap(i,
true);
1890 map[fmap] = linmap[i];
1901 for (i = 0; i < order_f; ++i)
1903 for (j = 0; j < nbndry; ++j)
1905 if (map[i] == bmap[j])
1911 ASSERTL1(j != nbndry,
"Did not find number in map");
1930 ASSERTL1((*map1).size() == (*map2).size(),
1931 "There is an error with the GetTraceToElementMap");
1933 for (i = 0; i < face; ++i)
1938 for (i = 0; i < (*map1).size(); ++i)
1942 for (j = 0; j < (*map2).size(); ++j)
1944 if ((*map1)[i].index == (*map2)[j].index)
1951 ASSERTL2(idx >= 0,
"Index not found");
1953 sign[i] = (*map2)[idx].sign;
1958 ASSERTL0(
false,
"Could not identify matrix type from dimension");
1961 for (i = 0; i < order_f; ++i)
1964 for (j = 0; j < order_f; ++j)
1967 (*inoutmat)(id1, id2) += facemat(i, j) *
sign[i] *
sign[j];
1978 int nVerts, vid1, vid2, vMap1, vMap2;
1985 DNekMat &VertexMat = (*vertexmatrix);
1987 for (vid1 = 0; vid1 < nVerts; ++vid1)
1991 for (vid2 = 0; vid2 < nVerts; ++vid2)
1994 VertexValue = (*r_bnd)(vMap1, vMap2);
1995 VertexMat.SetValue(vid1, vid2, VertexValue);
1999 return vertexmatrix;
2006 int eid, fid, vid, n, i;
2039 int nConnectedEdges = 3;
2040 int nConnectedFaces = 3;
2051 nBndCoeffs, nBndCoeffs, 0.0, storage);
2053 DNekMat &R = (*transformationmatrix);
2058 for (vid = 0; vid < nVerts; ++vid)
2068 int nedgemodesconnected =
2074 int nfacemodesconnected =
2083 for (eid = 0; eid < nConnectedEdges; ++eid)
2085 MatEdgeLocation[eid] =
2087 nmodes = MatEdgeLocation[eid].size();
2092 &edgemodearray[offset], 1);
2101 for (fid = 0; fid < nConnectedFaces; ++fid)
2103 MatFaceLocation[fid] =
2105 nmodes = MatFaceLocation[fid].size();
2110 &facemodearray[offset], 1);
2117 DNekMat &Sveft = (*vertexedgefacetransformmatrix);
2121 DNekMat &Svef = (*vertexedgefacecoupling);
2124 for (n = 0; n < nedgemodesconnected; ++n)
2127 VertexEdgeFaceValue = (*r_bnd)(
GetVertexMap(vid), edgemodearray[n]);
2130 Svef.SetValue(0, n, VertexEdgeFaceValue);
2134 for (n = 0; n < nfacemodesconnected; ++n)
2137 VertexEdgeFaceValue = (*r_bnd)(
GetVertexMap(vid), facemodearray[n]);
2140 Svef.SetValue(0, n + nedgemodesconnected, VertexEdgeFaceValue);
2154 DNekMat &Sefef = (*edgefacecoupling);
2159 for (m = 0; m < nedgemodesconnected; ++m)
2161 for (n = 0; n < nedgemodesconnected; ++n)
2164 EdgeEdgeValue = (*r_bnd)(edgemodearray[n], edgemodearray[m]);
2167 Sefef.SetValue(n, m, EdgeEdgeValue);
2172 for (n = 0; n < nfacemodesconnected; ++n)
2174 for (m = 0; m < nfacemodesconnected; ++m)
2177 FaceFaceValue = (*r_bnd)(facemodearray[n], facemodearray[m]);
2179 Sefef.SetValue(nedgemodesconnected + n, nedgemodesconnected + m,
2185 for (n = 0; n < nedgemodesconnected; ++n)
2187 for (m = 0; m < nfacemodesconnected; ++m)
2190 FaceFaceValue = (*r_bnd)(edgemodearray[n], facemodearray[m]);
2193 Sefef.SetValue(n, nedgemodesconnected + m, FaceFaceValue);
2195 FaceFaceValue = (*r_bnd)(facemodearray[m], edgemodearray[n]);
2198 Sefef.SetValue(nedgemodesconnected + m, n, FaceFaceValue);
2208 Sveft = -Svef * Sefef;
2212 for (n = 0; n < edgemodearray.size(); ++n)
2214 R.SetValue(
GetVertexMap(vid), edgemodearray[n], Sveft(0, n));
2218 for (n = 0; n < facemodearray.size(); ++n)
2221 Sveft(0, n + nedgemodesconnected));
2244 int efCol, efRow, nedgemodes;
2247 nConnectedFaces = 2;
2256 for (eid = 0; eid < nEdges; ++eid)
2267 DNekMat &Mef = (*efedgefacecoupling);
2273 DNekMat &Meff = (*effacefacecoupling);
2279 DNekMat &Meft = (*edgefacetransformmatrix);
2281 int nfacemodesconnected =
2293 Vmath::Vcopy(nedgemodes, &inedgearray[0], 1, &edgemodearray[0], 1);
2299 for (fid = 0; fid < nConnectedFaces; ++fid)
2301 MatFaceLocation[fid] =
2303 nmodes = MatFaceLocation[fid].size();
2308 &facemodearray[offset], 1);
2314 for (n = 0; n < nedgemodes; ++n)
2316 for (m = 0; m < nfacemodesconnected; ++m)
2319 EdgeFaceValue = (*r_bnd)(edgemodearray[n], facemodearray[m]);
2322 Mef.SetValue(n, m, EdgeFaceValue);
2327 for (n = 0; n < nfacemodesconnected; ++n)
2329 for (m = 0; m < nfacemodesconnected; ++m)
2332 FaceFaceValue = (*r_bnd)(facemodearray[n], facemodearray[m]);
2335 Meff.SetValue(n, m, FaceFaceValue);
2349 for (n = 0; n < Meft.GetRows(); ++n)
2351 for (m = 0; m < Meft.GetColumns(); ++m)
2353 R.SetValue(edgemodearray[n], facemodearray[m], Meft(n, m));
2358 for (i = 0; i < R.GetRows(); ++i)
2360 R.SetValue(i, i, 1.0);
2366 return transformationmatrix;
2387 int i, j, n, eid = 0, fid = 0;
2399 DNekMat &InvR = (*inversetransformationmatrix);
2407 int nedgemodestotal = 0;
2408 int nfacemodestotal = 0;
2410 for (eid = 0; eid < nEdges; ++eid)
2413 nedgemodestotal += nedgemodes;
2416 for (fid = 0; fid < nFaces; ++fid)
2419 nfacemodestotal += nfacemodes;
2428 for (eid = 0; eid < nEdges; ++eid)
2436 Vmath::Vcopy(nedgemodes, &edgearray[0], 1, &edgemodearray[offset],
2440 offset += nedgemodes;
2446 for (fid = 0; fid < nFaces; ++fid)
2454 Vmath::Vcopy(nfacemodes, &facearray[0], 1, &facemodearray[offset],
2458 offset += nfacemodes;
2462 for (i = 0; i < nVerts; ++i)
2464 for (j = 0; j < nedgemodestotal; ++j)
2469 for (j = 0; j < nfacemodestotal; ++j)
2473 for (n = 0; n < nedgemodestotal; ++n)
2475 MatrixValue = InvR.GetValue(
GetVertexMap(i), facemodearray[j]) +
2477 R(edgemodearray[n], facemodearray[j]);
2478 InvR.SetValue(
GetVertexMap(i), facemodearray[j], MatrixValue);
2484 for (i = 0; i < nedgemodestotal; ++i)
2486 for (j = 0; j < nfacemodestotal; ++j)
2488 InvR.SetValue(edgemodearray[i], facemodearray[j],
2489 -R(edgemodearray[i], facemodearray[j]));
2493 for (i = 0; i < nCoeffs; ++i)
2495 InvR.SetValue(i, i, 1.0);
2498 return inversetransformationmatrix;
2512 map<int, int> invmap;
2513 for (j = 0; j < nBndCoeffs; ++j)
2515 invmap[bmap[j]] = j;
2531 for (n = 0; n < nEdgeCoeffs; ++n)
2533 edgemaparray[n] = invmap[maparray[n]];
2536 return edgemaparray;
2552 map<int, int> reversemap;
2553 for (j = 0; j < bmap.size(); ++j)
2555 reversemap[bmap[j]] = j;
2571 fOrient = faceOrient;
2587 ASSERTL1(P1 <= locP1,
"Expect value of passed P1 to "
2588 "be lower or equal to face num modes");
2597 ASSERTL1(P2 <= locP2,
"Expect value of passed P2 to "
2598 "be lower or equal to face num modes");
2601 switch (
GetGeom3D()->GetFace(fid)->GetShapeType())
2605 if (((P1 - 3) > 0) && ((P2 - 3) > 0))
2612 for (n = 0; n < P1 - 3; ++n)
2614 for (
int m = 0; m < P2 - 3 - n; ++m, ++cnt)
2616 facemaparray[cnt] = reversemap[maparray[cnt1 + m]];
2618 cnt1 += locP2 - 3 - n;
2625 if (((P1 - 2) > 0) && ((P2 - 2) > 0))
2632 for (n = 0; n < P2 - 2; ++n)
2634 for (
int m = 0; m < P1 - 2; ++m, ++cnt)
2636 facemaparray[cnt] = reversemap[maparray[cnt1 + m]];
2645 ASSERTL0(
false,
"Invalid shape type.");
2650 return facemaparray;
2669 map<int, int> reversemap;
2670 for (j = 0; j < bmap.size(); ++j)
2672 reversemap[bmap[j]] = j;
2677 for (n = 0; n < nverts; ++n)
2680 vmap[n] = reversemap[id];
2686 for (
int eid = 0; eid < nedges; ++eid)
2700 for (n = 0; n < nEdgeCoeffs; ++n)
2702 edgemaparray[n] = reversemap[maparray[n]];
2704 emap[eid] = edgemaparray;
2710 for (
int fid = 0; fid < nfaces; ++fid)
2724 for (n = 0; n < nFaceCoeffs; ++n)
2726 facemaparray[n] = reversemap[maparray[n]];
2729 fmap[fid] = facemaparray;
2735 return m_geom->GetForient(face);
2753 int nq0 = FaceExp->GetNumPoints(0);
2754 int nq1 = FaceExp->GetNumPoints(1);
2757 int dir0 =
GetGeom3D()->GetDir(face, 0);
2758 int dir1 =
GetGeom3D()->GetDir(face, 1);
2769 Vmath::Gathr(
static_cast<int>(faceids.size()), inarray, faceids, o_tmp);
2786 m_base[dir0]->GetPointsKey(),
m_base[dir1]->GetPointsKey(), o_tmp.get(),
2787 FaceExp->GetBasis(to_id0)->GetPointsKey(),
2788 FaceExp->GetBasis(to_id1)->GetPointsKey(), o_tmp2.get());
2798 if (faceGeom->GetNumVerts() == 3)
2802 m_geom->GetFace(traceid));
2808 m_geom->GetFace(traceid));
2817 if (idmap.size() != nq0 * nq1)
2828 for (
int i = 0; i < nq0 * nq1; ++i)
2835 for (
int j = 0; j < nq1; ++j)
2837 for (
int i = 0; i < nq0; ++i)
2839 idmap[j * nq0 + i] = nq0 - 1 - i + j * nq0;
2845 "Case not supposed to be used in this function");
2854 for (
int i = 0; i < nq0 * nq1; ++i)
2862 for (
int j = 0; j < nq1; j++)
2864 for (
int i = 0; i < nq0; ++i)
2866 idmap[j * nq0 + i] = nq0 - 1 - i + j * nq0;
2874 for (
int j = 0; j < nq1; j++)
2876 for (
int i = 0; i < nq0; ++i)
2878 idmap[j * nq0 + i] = nq0 * (nq1 - 1 - j) + i;
2886 for (
int j = 0; j < nq1; j++)
2888 for (
int i = 0; i < nq0; ++i)
2890 idmap[j * nq0 + i] = nq0 * nq1 - 1 - j * nq0 - i;
2898 for (
int i = 0; i < nq0; ++i)
2900 for (
int j = 0; j < nq1; ++j)
2902 idmap[i * nq1 + j] = i + j * nq0;
2910 for (
int i = 0; i < nq0; ++i)
2912 for (
int j = 0; j < nq1; ++j)
2914 idmap[i * nq1 + j] = nq0 - 1 - i + j * nq0;
2922 for (
int i = 0; i < nq0; ++i)
2924 for (
int j = 0; j < nq1; ++j)
2926 idmap[i * nq1 + j] = i + nq0 * (nq1 - 1) - j * nq0;
2934 for (
int i = 0; i < nq0; ++i)
2936 for (
int j = 0; j < nq1; ++j)
2938 idmap[i * nq1 + j] = nq0 * nq1 - 1 - i - j * nq0;
2944 ASSERTL0(
false,
"Unknow orientation");
2963 int nquad_f = FaceExp_f->GetNumPoints(0) * FaceExp_f->GetNumPoints(1);
2966 int nquad0 =
m_base[0]->GetNumPoints();
2967 int nquad1 =
m_base[1]->GetNumPoints();
2968 int nquad2 =
m_base[2]->GetNumPoints();
2969 int nqtot = nquad0 * nquad1 * nquad2;
2981 StdRegions::VarCoeffMap::const_iterator MFdir;
2986 for (
int k = 0; k < coordim; k++)
2988 MFdir = varcoeffs.find(MMFCoeffs[dir * 5 + k]);
2989 tmp = MFdir->second.GetValue();
2993 Vmath::Vvtvp(nquad_f, &tmp_f[0], 1, &normals[k][0], 1, &nFacecdotMF[0],
2994 1, &nFacecdotMF[0], 1);
3004 int nverts = geom->GetFace(traceid)->GetNumVerts();
3007 tn1.
Sub(*(geom->GetFace(traceid)->GetVertex(1)),
3008 *(geom->GetFace(traceid)->GetVertex(0)));
3010 tn2.
Sub(*(geom->GetFace(traceid)->GetVertex(nverts - 1)),
3011 *(geom->GetFace(traceid)->GetVertex(0)));
3013 normal.
Mult(tn1, tn2);
3017 mag = 1.0 /
sqrt(mag);
3023 for (
int i = 0; i < nverts; ++i)
3026 int edgid = geom->GetEdgeNormalToFaceVert(traceid, i);
3029 Dx.
Sub(*(geom->GetEdge(edgid)->GetVertex(0)),
3030 *(geom->GetEdge(edgid)->GetVertex(1)));
3034 h += fabs(normal.
dot(Dx));
3040 int dir0 = geom->GetDir(traceid, 0);
3041 int dir1 = geom->GetDir(traceid, 1);
3043 for (dirn = 0; dirn < 3; ++dirn)
3045 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.
DNekMatSharedPtr v_BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType) override
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.
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...
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)
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)
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)
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
SpatialDomains::Geometry3DSharedPtr GetGeom3D() const
void v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp) override
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)
DNekMatSharedPtr v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd) override
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.
void DropLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
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
const Array< OneD, const NekDouble > & GetVarCoeff(const StdRegions::VarCoeffType &coeff) 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
static VarCoeffMap NullVarCoeffMap
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
std::vector< double > d(NPUPPER *NPUPPER)
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 Gathr(I n, const T *x, const I *y, T *z)
Gather vector z[i] = x[y[i]].
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 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)