66 const vector<bool> &LeftAdjacents)
71 m_expdim = locExpVector[0]->GetShapeDimension();
74 Setup(locExp, trace, elmtToTrace, LeftAdjacents);
93 const vector<bool> &LeftAdjacents)
116 const std::shared_ptr<LocalRegions::ExpansionVector> exp = locExp.
GetExp();
118 int cnt, n, e, phys_offset;
120 int nexp = exp->size();
131 for (cnt = n = 0; n < nexp; ++n)
135 for (
int i = 0; i < elmt->GetNtraces(); ++i, ++cnt)
137 int nLocPts = elmt->GetTraceNumPoints(i);
140 if (LeftAdjacents[cnt])
142 nFwdPts += elmtToTrace[n][i]->GetTotPoints();
143 nFwdCoeffs += elmtToTrace[n][i]->GetNcoeffs();
148 nBwdPts += elmtToTrace[n][i]->GetTotPoints();
149 nBwdCoeffs += elmtToTrace[n][i]->GetNcoeffs();
174 map<TraceInterpPoints, vector<pair<int, int>>,
cmpop> TraceInterpMap;
176 vector<vector<int>> TraceOrder;
177 TraceOrder.resize(nexp);
178 vector<vector<int>> ElmtPhysTraceOffset;
179 ElmtPhysTraceOffset.resize(nexp);
187 for (cnt = n = 0; n < nexp; ++n)
190 ntrace = elmt->GetNtraces();
191 TraceOrder[n].resize(ntrace);
192 ElmtPhysTraceOffset[n].resize(ntrace);
195 for (e = 0; e < ntrace; ++e, ++cnt)
208 fromPointsKey0 = elmt->GetBasis(0)->GetPointsKey();
221 int dir0 = elmt->GetGeom()->GetDir(e, 0);
223 fromPointsKey0 = elmt->GetBasis(dir0)->GetPointsKey();
227 toPointsKey0 = elmttrace->GetBasis(0)->GetPointsKey();
231 P[0] = elmttrace->GetBasisNumModes(0);
236 int dir0 = elmt->GetGeom()->GetDir(e, 0);
237 int dir1 = elmt->GetGeom()->GetDir(e, 1);
239 fromPointsKey0 = elmt->GetBasis(dir0)->GetPointsKey();
240 fromPointsKey1 = elmt->GetBasis(dir1)->GetPointsKey();
244 toPointsKey0 = elmttrace->GetBasis(0)->GetPointsKey();
245 toPointsKey1 = elmttrace->GetBasis(1)->GetPointsKey();
246 P[0] = elmttrace->GetBasisNumModes(0);
247 P[1] = elmttrace->GetBasisNumModes(1);
251 toPointsKey0 = elmttrace->GetBasis(1)->GetPointsKey();
252 toPointsKey1 = elmttrace->GetBasis(0)->GetPointsKey();
253 P[0] = elmttrace->GetBasisNumModes(1);
254 P[1] = elmttrace->GetBasisNumModes(0);
261 toPointsKey0, toPointsKey1);
263 pair<int, int> epf(n, e);
264 TraceInterpMap[fpoint].push_back(epf);
265 TraceOrder[n][e] = cnt;
267 ElmtPhysTraceOffset[n][e] = neoffset;
268 neoffset += elmt->GetTraceNumPoints(e);
277 elmt->GetTraceToElementMap(e, map,
sign, orient,
P[0],
P[1]);
279 int order_t = elmttrace->GetNcoeffs();
280 int t_offset = trace->GetCoeff_Offset(elmttrace->GetElmtId());
284 if (elmt->GetTraceExp(e)->GetRightAdjacentElementExp())
286 if (elmttrace->GetRightAdjacentElementExp()
288 ->GetGlobalID() == elmt->GetGeom()->GetGlobalID())
294 if (LeftAdjacents[cnt])
296 for (
int i = 0; i < order_t; ++i)
305 for (
int i = 0; i < order_t; ++i)
315 int nInterpType = TraceInterpMap.size();
318 for (
int i = 0; i < 2; ++i)
330 for (
int i = 0; i < 2; ++i)
339 int ntracepts, ntracepts1;
351 for (
auto it = TraceInterpMap.begin(); it != TraceInterpMap.end();
362 for (
int f = 0; f < it->second.size(); ++f, ++cnt2)
364 n = it->second[f].first;
365 e = it->second[f].second;
374 elmt->GetTracePhysMap(e, traceids);
376 ntracepts = elmt->GetTraceNumPoints(e);
377 ntracepts1 = elmttrace->GetTotPoints();
385 elmt->ReOrientTracePhysMap(orient, locTraceToTraceMap,
391 elmt->ReOrientTracePhysMap(orient, locTraceToTraceMap,
396 int offset = trace->GetPhys_Offset(elmtToTrace[n][e]->GetElmtId());
398 if (LeftAdjacents[TraceOrder[n][e]])
400 for (
int i = 0; i < ntracepts; ++i)
403 phys_offset + traceids[i];
406 for (
int i = 0; i < ntracepts; ++i)
409 ElmtPhysTraceOffset[n][e] + i;
412 for (
int i = 0; i < ntracepts1; ++i)
415 offset + locTraceToTraceMap[i];
419 cntFwd1 += ntracepts1;
424 for (
int i = 0; i < ntracepts; ++i)
427 phys_offset + traceids[i];
430 for (
int i = 0; i < ntracepts; ++i)
433 ElmtPhysTraceOffset[n][e] + i;
436 for (
int i = 0; i < ntracepts1; ++i)
439 offset + locTraceToTraceMap[i];
443 cntBwd1 += ntracepts1;
449 if ((fwdSet ==
false && set == 0) || (bwdSet ==
false && set == 1))
463 if (fromPointsKey0 == toPointsKey0)
472 ->GetI(toPointsKey0);
475 ->GetI(fromPointsKey0);
479 LibUtilities::eGaussRadauMAlpha1Beta0) &&
509 if (fromPointsKey0 == toPointsKey0)
511 if (fromPointsKey1 == toPointsKey1)
521 ->GetI(toPointsKey1);
524 ->GetI(fromPointsKey1);
529 LibUtilities::eGaussRadauMAlpha1Beta0) &&
557 if (fromPointsKey1 == toPointsKey1)
563 ->GetI(toPointsKey0);
566 ->GetI(fromPointsKey0);
571 LibUtilities::eGaussRadauMAlpha1Beta0) &&
602 ->GetI(toPointsKey0);
605 ->GetI(fromPointsKey0);
609 ->GetI(toPointsKey1);
612 ->GetI(fromPointsKey1);
617 LibUtilities::eGaussRadauMAlpha1Beta0) &&
675 "CalcLocTracePhysToTraceIDMap not coded");
682 std::shared_ptr<LocalRegions::ExpansionVector> traceExp =
684 int ntotTrace = (*traceExp).size();
693 for (
int nt = 0; nt < ntotTrace; nt++)
695 ntPnts = tracelist->GetTotPoints(nt);
696 noffset = tracelist->GetPhys_Offset(nt);
697 for (
int i = 0; i < ntPnts; i++)
708 for (
int dir = 0; dir < 2; dir++)
731 for (
int ne = 0; ne < nedges; ne++)
733 Vmath::Fill(fnp, tmp[cnt1], &loctracePntsLR[dir][cnt], 1);
742 for (
int nlr = 0; nlr < 2; nlr++)
744 for (
int i = 0; i < loctracePntsLR[nlr].size(); i++)
747 std::round(loctracePntsLR[nlr][i]);
748 error +=
abs(loctracePntsLR[nlr][i] -
754 "m_LocTracephysToTraceIDMap may not be integer !!");
760 std::shared_ptr<LocalRegions::ExpansionVector> traceExp =
762 int ntotTrace = (*traceExp).size();
771 for (
int nt = 0; nt < ntotTrace; nt++)
773 ntPnts = tracelist->GetTotPoints(nt);
774 noffset = tracelist->GetPhys_Offset(nt);
775 for (
int i = 0; i < ntPnts; i++)
786 for (
int dir = 0; dir < 2; dir++)
815 int nfttl = fnp0 * fnp1;
819 Vmath::Fill(nfttl, tmp[cnt1], &loctracePntsLR[dir][cnt], 1);
828 for (
int nlr = 0; nlr < 2; nlr++)
830 for (
int i = 0; i < loctracePntsLR[nlr].size(); i++)
833 std::round(loctracePntsLR[nlr][i]);
834 error +=
abs(loctracePntsLR[nlr][i] -
840 "m_LocTracephysToTraceIDMap may not be integer !!");
852 const std::shared_ptr<LocalRegions::ExpansionVector> exptrac =
854 size_t ntrace = exptrac->size();
862 for (
int lr = 0; lr < 2; ++lr)
868 for (
int i = 0; i < ntrace; ++i)
870 size_t ncoeff = trace->GetNcoeffs(i);
879 trace->GetCoeffsToElmt();
881 for (
int lr = 0; lr < 2; ++lr)
884 for (
int i = 0; i < ntotcoeffs; ++i)
890 int ntraceelmt = trace_coeffToElmt[ncoeffTrace].first;
891 int ntracelocN = trace_coeffToElmt[ncoeffTrace].second;
893 int nfieldelmt = field_coeffToElmt[ncoeffField].first;
894 int nfieldlocN = field_coeffToElmt[ncoeffField].second;
896 LRAdjflag[lr][ntraceelmt] =
true;
897 LRAdjExpid[lr][ntraceelmt] = nfieldelmt;
899 elmtLRMap[lr][ntraceelmt][ntracelocN] = nfieldlocN;
900 elmtLRSign[lr][ntraceelmt][ntracelocN] =
sign;
912 const std::shared_ptr<LocalRegions::ExpansionVector> exptrac =
914 int ntrace = exptrac->size();
916 const std::shared_ptr<LocalRegions::ExpansionVector> exp = locExp.
GetExp();
917 int nexp = exp->size();
924 std::set<std::pair<int, int>> neighborSet;
926 for (
int nt = 0; nt < ntrace; nt++)
928 if (LRAdjflag[0][nt] && LRAdjflag[1][nt])
930 ntmp0 = LRAdjExpid[0][nt];
931 ntmp1 = LRAdjExpid[1][nt];
934 " ntmp0==ntmp1, trace inside a element?? ");
936 std::set<std::pair<int, int>>::iterator it = neighborSet.begin();
937 neighborSet.insert(it, std::make_pair(ntmp0, ntmp1));
938 neighborSet.insert(it, std::make_pair(ntmp1, ntmp0));
943 for (std::set<std::pair<int, int>>::iterator it = neighborSet.begin();
944 it != neighborSet.end(); ++it)
946 int ncurrent = it->first;
947 ElemIndex[ncurrent]++;
954 for (
int ne = 0; ne < nexp; ne++)
956 int neighb = ElemNeighbsNumb[ne];
961 for (
int ne = 0; ne < nexp; ne++)
965 for (std::set<std::pair<int, int>>::iterator it = neighborSet.begin();
966 it != neighborSet.end(); ++it)
968 int ncurrent = it->first;
969 int neighbor = it->second;
970 ElemNeighbsId[ncurrent][ElemIndex[ncurrent]] = neighbor;
971 ElemIndex[ncurrent]++;
975 for (
int ne = 0; ne < nexp; ne++)
978 for (
int nb = 0; nb < ElemNeighbsNumb[ne]; nb++)
980 int neighbId = ElemNeighbsId[ne][nb];
982 for (
int nc = 0; nc < ElemIndex[ne]; nc++)
984 if (ElemNeighbsId[ne][nb] == tmpId[ne][nc])
991 tmpId[ne][ElemIndex[ne]] = neighbId;
996 ElemNeighbsNumb = ElemIndex;
997 for (
int ne = 0; ne < nexp; ne++)
999 int neighb = ElemNeighbsNumb[ne];
1003 Vmath::Vcopy(neighb, tmpId[ne], 1, ElemNeighbsId[ne], 1);
1008 for (
int ne = 0; ne < nexp; ne++)
1010 for (
int nb = 0; nb < ElemNeighbsNumb[ne]; nb++)
1012 ASSERTL0((ElemNeighbsId[ne][nb] >= 0) &&
1013 (ElemNeighbsId[ne][nb] <= nexp),
1014 "Element id <0 or >number of total elements")
1051 size_t nfield = field.size();
1083 ASSERTL1(dir < 2,
"option dir out of range, "
1084 " dir=0 is fwd, dir=1 is bwd");
1101 ASSERTL1(dir < 2,
"option dir out of range, "
1102 " dir=0 is fwd, dir=1 is bwd");
1146 ASSERTL1(dir < 2,
"option dir out of range, "
1147 " dir=0 is fwd, dir=1 is bwd");
1176 tmp.get() + cnt1, 1);
1183 I0->GetPtr().get(), tnp, locedges.get() + cnt,
1184 fnp, 0.0, tmp.get() + cnt1, tnp);
1191 for (
int k = 0; k < nedges; ++k)
1194 &tmp[cnt1 + k * tnp], 1);
1197 fnp, locedges.get() + cnt + k * fnp, 1, &I0[0], 1);
1203 "Invalid interpolation type for 2D elements");
1207 cnt += nedges * fnp;
1208 cnt1 += nedges * tnp;
1228 ASSERTL1(dir < 2,
"option dir out of range, "
1229 " dir=0 is fwd, dir=1 is bwd");
1257 int nfromfacepts = nfaces * fnp0 * fnp1;
1265 tmp.get() + cnt1, 1);
1271 Blas::Dgemm(
'N',
'N', tnp0, tnp1 * nfaces, fnp0, 1.0,
1272 I0->GetPtr().get(), tnp0, locfaces.get() + cnt,
1273 fnp0, 0.0, tmp.get() + cnt1, tnp0);
1279 for (
int k = 0; k < fnp0; ++k)
1282 fnp0, tmp.get() + cnt1 + k, tnp0);
1286 Blas::Dgemv(
'T', fnp0, tnp1 * nfaces, 1.0, tmp.get() + cnt1,
1287 tnp0, I0.get(), 1, 0.0,
1288 tmp.get() + cnt1 + tnp0 - 1, tnp0);
1297 locfaces.get() + cnt + j * fnp0 * fnp1,
1298 tnp0, I1->GetPtr().get(), tnp1, 0.0,
1299 tmp.get() + cnt1 + j * tnp0 * tnp1, tnp0);
1310 locfaces.get() + cnt + j * fnp0 * fnp1, 1,
1311 tmp.get() + cnt1 + j * tnp0 * tnp1, 1);
1314 for (
int k = 0; k < tnp0; ++k)
1316 tmp[cnt1 + k + (j + 1) * tnp0 * tnp1 - tnp0] =
1318 locfaces.get() + cnt +
1319 j * fnp0 * fnp1 + k,
1335 locfaces.get() + cnt + j * fnp0 * fnp1,
1336 fnp0, I1->GetPtr().get(), tnp1, 0.0,
1337 wsp.get() + j * fnp0 * tnp1, fnp0);
1340 fnp0, 1.0, I0->GetPtr().get(), tnp0, wsp.get(),
1341 fnp0, 0.0, tmp.get() + cnt1, tnp0);
1352 locfaces.get() + cnt + j * fnp0 * fnp1,
1353 fnp0, I1->GetPtr().get(), tnp1, 0.0,
1354 tmp.get() + cnt1 + j * tnp0 * tnp1, tnp0);
1358 tmp.get() + cnt1, tnp0, I0.get(), 1, 0.0,
1359 tmp.get() + cnt1 + tnp0 - 1, tnp0);
1363 ASSERTL0(
false,
"Interplation case needs implementing");
1366 cnt += nfromfacepts;
1404 ASSERTL1(dir < 2,
"option dir out of range, "
1405 " dir=0 is fwd, dir=1 is bwd");
1436 locedges.get() + cnt, 1);
1443 I0->GetPtr().get(), tnp, tmp.get() + cnt1, tnp,
1444 0.0, locedges.get() + cnt, fnp);
1451 for (
int k = 0; k < nedges; ++k)
1454 &locedges[cnt + k * fnp], 1);
1456 Vmath::Svtvp(fnp, tmp[cnt1 + k * tnp + tnp - 1], &I0[0],
1457 1, locedges.get() + cnt + k * fnp, 1,
1458 locedges.get() + cnt + k * fnp, 1);
1464 "Invalid interpolation type for 2D elements");
1468 cnt += nedges * fnp;
1469 cnt1 += nedges * tnp;
1485 ASSERTL1(dir < 2,
"option dir out of range, "
1486 " dir=0 is fwd, dir=1 is bwd");
1528 loctraces.get() + cnt, 1);
1535 I0->GetPtr().get(), tnp0, tmp.get() + cnt1,
1536 tnp0, 0.0, loctraces.get() + cnt, fnp0);
1542 for (
int k = 0; k < fnp0; ++k)
1544 Vmath::Vcopy(nfaces * fnp1, tmp.get() + cnt1 + k, tnp0,
1545 loctraces.get() + cnt + k, fnp0);
1549 for (
int k = 0; k < tnp1 * nfaces; k++)
1553 loctraces.get() + cnt + k * fnp0, 1,
1554 loctraces.get() + cnt + k * fnp0, 1);
1565 tmp.get() + cnt1 + j * tnp0 * tnp1, tnp0,
1566 I1->GetPtr().get(), tnp1, 0.0,
1567 loctraces.get() + cnt + j * fnp0 * fnp1,
1578 fnp0 * fnp1, tmp.get() + cnt1 + j * tnp0 * tnp1, 1,
1579 loctraces.get() + cnt + j * fnp0 * fnp1, 1);
1581 for (
int k = 0; k < fnp1; k++)
1585 &tmp[cnt1 + (j + 1) * tnp0 * tnp1 - tnp0], 1,
1586 &loctraces[cnt + j * fnp0 * fnp1 + k * fnp0], 1,
1587 &loctraces[cnt + j * fnp0 * fnp1 + k * fnp0],
1602 tnp0, 1.0, I0->GetPtr().get(), tnp0,
1603 tmp.get() + cnt1, tnp0, 0.0, wsp.get(), fnp0);
1608 wsp.get() + j * fnp0 * tnp1, fnp0,
1609 I1->GetPtr().get(), tnp1, 0.0,
1610 loctraces.get() + cnt + j * fnp0 * fnp1,
1626 &I0[0], 1, tmp.get() + cnt1 + k * tnp0, 1,
1627 wsp.get() + k * fnp0, 1);
1633 wsp.get() + j * fnp0 * tnp1, fnp0,
1634 I1->GetPtr().get(), tnp1, 0.0,
1635 loctraces.get() + cnt + j * fnp0 * fnp1,
1641 cnt += nfromfacepts;
1683 ASSERTL1(dir < 2,
"option dir out of range, "
1684 " dir=0 is fwd, dir=1 is bwd");
1716 locedges.get() + cnt1, 1);
1723 I0->GetPtr().get(), tnp, tmp.get() + cnt, fnp,
1724 0.0, locedges.get() + cnt1, tnp);
1730 for (
int k = 0; k < nedges; ++k)
1734 &locedges[cnt1 + k * tnp], 1);
1740 "Invalid interpolation type for 2D elements");
1744 cnt += nedges * fnp;
1745 cnt1 += nedges * tnp;
1762 ASSERTL1(dir < 2,
"option dir out of range, "
1763 " dir=0 is fwd, dir=1 is bwd");
1794 int nfromfacepts = nfaces * fnp0 * fnp1;
1802 locfaces.get() + cnt1, 1);
1808 Blas::Dgemm(
'N',
'N', tnp0, tnp1 * nfaces, fnp0, 1.0,
1809 I0->GetPtr().get(), tnp0, tmp.get() + cnt, fnp0,
1810 0.0, locfaces.get() + cnt1, tnp0);
1816 for (
int j = 0; j < nfaces; ++j)
1819 tmp.get() + cnt + j * fnp0 * fnp1, tnp0,
1820 I1->GetPtr().get(), tnp1, 0.0,
1821 locfaces.get() + cnt1 + j * tnp0 * tnp1,
1828 for (
int j = 0; j < nfaces; ++j)
1832 tnp0 * tnp1, tmp.get() + cnt + j * fnp0 * fnp1, 1,
1833 locfaces.get() + cnt1 + j * tnp0 * tnp1, 1);
1843 for (
int j = 0; j < nfaces; ++j)
1846 tmp.get() + cnt + j * fnp0 * fnp1, fnp0,
1847 I1->GetPtr().get(), tnp1, 0.0,
1848 wsp.get() + j * fnp0 * tnp1, fnp0);
1851 Blas::Dgemm(
'N',
'N', tnp0, tnp1 * nfaces, fnp0, 1.0,
1852 I0->GetPtr().get(), tnp0, wsp.get(), fnp0, 0.0,
1853 locfaces.get() + cnt1, tnp0);
1859 for (
int j = 0; j < nfaces; ++j)
1862 tmp.get() + cnt + j * fnp0 * fnp1, fnp0,
1863 I1->GetPtr().get(), tnp1, 0.0,
1864 locfaces.get() + cnt1 + j * tnp0 * tnp1,
1870 ASSERTL0(
false,
"Interpolation case not implemneted (yet)");
1873 cnt += nfromfacepts;
1890 for (
int i = 0; i < nvals; ++i)
1911 for (
int i = 0; i < nvals; ++i)
#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 sign(a, b)
return the sign(b)*a
Defines a specification for a set of points.
PointsType GetPointsType() const
size_t GetNumPoints() const
Base class for all multi-elemental spectral/hp expansions.
const Array< OneD, const std::pair< int, int > > & GetCoeffsToElmt() const
Get m_coeffs to elemental value map.
int GetCoeff_Offset(int n) const
Get the start offset position for a local contiguous list of coeffs correspoinding to element n.
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
int GetPhys_Offset(int n) const
Get the start offset position for a local contiguous list of quadrature points in a full array corres...
Array< OneD, Array< OneD, Array< OneD, int > > > m_traceCoeffToLeftRightExpCoeffMap
The map of every coeff from current trace to the left & right adjacent expasion coeffs.
Array< OneD, Array< OneD, int > > m_traceCoeffsToElmtSign
Sign array for mapping from forwards/backwards trace coefficients to local trace storage.
Array< OneD, Array< OneD, int > > m_interpNtraces
Number of edges/faces on a 2D/3D element that require interpolation.
Array< OneD, Array< OneD, int > > m_locTraceToElmtTraceMap
A mapping from the local elemental trace points, arranged as all forwards traces followed by backward...
void InterpLocEdgesToTraceTranspose(const int dir, const Array< OneD, const NekDouble > &edges, Array< OneD, NekDouble > &locedges)
Transpose of interp local edges to Trace methods.
void InterpLocTracesToTraceTranspose(const int dir, const Array< OneD, const NekDouble > &traces, Array< OneD, NekDouble > &loctraces)
Array< OneD, Array< OneD, int > > m_traceCoeffsToElmtTrace
Mapping from forwards/backwards trace coefficients to the position of the trace element in global sto...
Array< OneD, Array< OneD, int > > m_leftRightAdjacentExpId
The expansion ID that are the left & right adjacent to current trace.
LocTraceToTraceMap(const ExpList &locExp, const ExpListSharedPtr &trace, const Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > &elmtToTrace, const std::vector< bool > &LeftAdjacents)
Set up trace to trace mapping components.
Array< OneD, Array< OneD, DNekMatSharedPtr > > m_interpFromTraceI1
Interpolation matrices for either 2D edges or first coordinate of 3D face using going "from' to 'to' ...
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_interpEndPtI0
Mapping to hold first coordinate direction endpoint interpolation, which can be more optimal if using...
void LocTracesFromField(const Array< OneD, const NekDouble > &field, Array< OneD, NekDouble > faces)
Gather the local elemental traces in physical space from field using m_locTraceToFieldMap....
void CalcLocTracePhysToTraceIDMap_3D(const ExpListSharedPtr &tracelist)
int m_nLocTracePts
The number of local trace points.
void InterpLocEdgesToTrace(const int dir, const Array< OneD, const NekDouble > &locfaces, Array< OneD, NekDouble > &edges)
Interpolate local trace edges to global trace edge point distributions where required.
int m_nTracePts
The number of global trace points.
void UnshuffleLocTraces(const int dir, const Array< OneD, const NekDouble > &loctraces, Array< OneD, NekDouble > unshuffle)
Unshuffle local elemental traces in physical space from similar faces points are blocked together to ...
void InterpLocTracesToTrace(const int dir, const Array< OneD, const NekDouble > &loctraces, Array< OneD, NekDouble > &traces)
Array< OneD, Array< OneD, bool > > m_leftRightAdjacentExpFlag
Flag indicates whether the expansion that are the left & right adjacent to current trace exists.
void CalcLocTracePhysToTraceIDMap(const ExpListSharedPtr &tracelist, const int ndim)
void AddLocTracesToField(const Array< OneD, const NekDouble > &faces, Array< OneD, NekDouble > &field)
Reverse process of LocTracesFromField() Add the local traces in physical space to field using m_locTr...
int m_nTraceCoeffs[2]
Number of forwards/backwards trace coefficients.
int m_nFwdLocTracePts
The number of forward trace points. A local trace element is ‘forward’ if it is the side selected for...
Array< OneD, Array< OneD, Array< OneD, int > > > m_traceCoeffToLeftRightExpCoeffSign
The sign of every coeff from current trace to the left & right adjacent expasion coeffs.
void InterpTraceToLocFaces(const int dir, const Array< OneD, const NekDouble > &faces, Array< OneD, NekDouble > &locfaces)
Interpolate global trace edge to local trace edges point distributions where required.
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_interpEndPtI1
Mapping to hold second coordinate direction endpoint interpolation, which can be more optimal if usin...
void TraceLocToElmtLocCoeffMap(const ExpList &locExp, const ExpListSharedPtr &trace)
Set up maps between coefficients on trace and in cells.
Array< OneD, Array< OneD, int > > m_traceCoeffsToElmtMap
Mapping from forwards/backwards trace coefficients to elemental coefficient storage.
int m_expdim
Expansion Dimension we have setup for trace mapping.
Array< OneD, Array< OneD, InterpLocTraceToTrace > > m_interpTrace
A mapping holding the type of interpolation needed for each local trace. Dimension 0 holds forward tr...
void InterpTraceToLocEdges(const int dir, const Array< OneD, const NekDouble > &locfaces, Array< OneD, NekDouble > &edges)
Interpolate global trace edge to local trace edges point distributions where required.
void FwdLocTracesFromField(const Array< OneD, const NekDouble > &field, Array< OneD, NekDouble > faces)
Gather the forwards-oriented local traces in physical space from field using m_locTraceToFieldMap.
void Setup(const ExpList &locExp, const ExpListSharedPtr &trace, const Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > &elmtToTrace, const std::vector< bool > &LeftAdjacents)
Set up member variables for a two-dimensional problem.
Array< OneD, Array< OneD, int > > m_locInterpTraceToTraceMap
A mapping from local trace points to the global trace. Dimension 0 holds forward traces,...
Array< OneD, Array< OneD, int > > m_ElemNeighbsId
Array< OneD, Array< OneD, TraceInterpPoints > > m_interpPoints
Interpolation points key distributions to each of the local to global mappings.
Array< OneD, int > m_locTraceToFieldMap
A mapping from the local elemental trace points, arranged as all forwards traces followed by backward...
Array< OneD, Array< OneD, DNekMatSharedPtr > > m_interpFromTraceI0
Interpolation matrices for either 2D edges or first coordinate of 3D face using going "from' to 'to' ...
void AddTraceCoeffsToFieldCoeffs(const Array< OneD, const NekDouble > &trace, Array< OneD, NekDouble > &field)
Add contributions from trace coefficients to the elemental field storage.
void InterpLocFacesToTraceTranspose(const int dir, const Array< OneD, const NekDouble > &traces, Array< OneD, NekDouble > &loctraces)
Transpose of interp local faces to Trace methods.
Array< OneD, Array< OneD, DNekMatSharedPtr > > m_interpTraceI1
Interpolation matrices for the second coordinate of 3D face, not used in 2D.
Array< OneD, Array< OneD, DNekMatSharedPtr > > m_interpTraceI0
Interpolation matrices for either 2D edges or first coordinate of 3D face.
void FindElmtNeighbors(const ExpList &locExp, const ExpListSharedPtr &trace)
void InterpTraceToLocTrace(const int dir, const Array< OneD, NekDouble > &traces, Array< OneD, NekDouble > &loctraces)
Array< OneD, int > m_ElemNeighbsNumb
void ReshuffleLocTracesForInterp(const int dir, const Array< OneD, const NekDouble > &loctraces, Array< OneD, NekDouble > reshuffle)
Reshuffle local elemental traces in physical space so that similar faces points are blocked together ...
void CalcLocTracePhysToTraceIDMap_2D(const ExpListSharedPtr &tracelist)
virtual ~LocTraceToTraceMap()
Array< OneD, Array< OneD, int > > m_LocTracephysToTraceIDMap
void InterpLocFacesToTrace(const int dir, const Array< OneD, const NekDouble > &locfaces, Array< OneD, NekDouble > faces)
Interpolate local faces to trace face point distributions where required.
static void Dgemv(const char &trans, const int &m, const int &n, const double &alpha, const double *a, const int &lda, const double *x, const int &incx, const double &beta, double *y, const int &incy)
BLAS level 2: Matrix vector multiply y = alpha A x plus beta y where A[m x n].
static double Ddot(const int &n, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: output = .
static void Dgemm(const char &transa, const char &transb, const int &m, const int &n, const int &k, const double &alpha, const double *a, const int &lda, const double *b, const int &ldb, const double &beta, double *c, const int &ldc)
BLAS level 3: Matrix-matrix multiply C = A x B where op(A)[m x k], op(B)[k x n], C[m x n] DGEMM perfo...
PointsManagerT & PointsManager(void)
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
@ P
Monomial polynomials .
std::shared_ptr< Expansion > ExpansionSharedPtr
std::vector< ExpansionSharedPtr > ExpansionVector
@ eInterpEndPtDir0InterpDir1
std::tuple< LibUtilities::PointsKey, LibUtilities::PointsKey, LibUtilities::PointsKey, LibUtilities::PointsKey > TraceInterpPoints
Map holding points distributions required for interpolation of local traces onto global trace in two ...
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
static const NekDouble kNekZeroTol
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
@ eDir1FwdDir2_Dir2FwdDir1
The above copyright notice and this permission notice shall be included.
std::shared_ptr< DNekMat > DNekMatSharedPtr
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 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 Assmb(int n, const T *x, const int *y, T *z)
Assemble z[y[i]] += x[i]; z should be zero'd first.
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
void 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 > abs(scalarT< T > in)