37 #include <boost/core/ignore_unused.hpp>
80 namespace MultiRegions
103 : m_expType(type), m_ncoeffs(0), m_npoints(0), m_physState(false),
119 : std::enable_shared_from_this<
ExpList>(in), m_expType(in.m_expType),
121 m_comm(in.m_comm), m_session(in.m_session), m_graph(in.m_graph),
122 m_ncoeffs(in.m_ncoeffs), m_npoints(in.m_npoints), m_physState(false),
123 m_exp(in.m_exp), m_collections(in.m_collections),
124 m_collectionsDoInit(in.m_collectionsDoInit),
125 m_coll_coeff_offset(in.m_coll_coeff_offset),
126 m_coll_phys_offset(in.m_coll_phys_offset),
127 m_coeff_offset(in.m_coeff_offset), m_phys_offset(in.m_phys_offset),
128 m_blockMat(in.m_blockMat), m_WaveSpace(false),
129 m_elmtToExpId(in.m_elmtToExpId)
143 const bool DeclareCoeffPhysArrays,
145 : m_expType(in.m_expType), m_comm(in.m_comm), m_session(in.m_session),
146 m_graph(in.m_graph), m_physState(false),
151 for (
int i = 0; i < eIDs.size(); ++i)
153 (*m_exp).push_back((*(in.
m_exp))[eIDs[i]]);
184 const bool DeclareCoeffPhysArrays,
const std::string &var,
186 : m_comm(pSession->GetComm()), m_session(pSession), m_graph(graph),
194 graph->GetExpansionInfo(var);
226 const bool DeclareCoeffPhysArrays,
228 : m_comm(pSession->GetComm()), m_session(pSession), m_physState(false),
248 : m_expType(
e0D), m_ncoeffs(1), m_npoints(1), m_physState(false),
255 (*m_exp).push_back(
Point);
287 : m_comm(comm), m_session(pSession), m_graph(graph), m_physState(false),
292 boost::ignore_unused(variable, ImpType);
293 int i, j, id, elmtid = 0;
311 for (i = 0; i < bndCond.size(); ++i)
313 if (bndCond[i]->GetBoundaryConditionType() ==
316 for (j = 0; j < bndConstraint[i]->GetExpSize(); ++j)
319 std::dynamic_pointer_cast<LocalRegions::Expansion0D>(
320 bndConstraint[i]->
GetExp(j))))
324 PointGeom = exp0D->GetGeom()->GetVertex(0);
327 tracesDone.insert(PointGeom->GetVid());
329 else if ((exp1D = std::dynamic_pointer_cast<
331 bndConstraint[i]->
GetExp(j))))
336 exp1D->GetBasis(0)->GetBasisKey();
337 segGeom = exp1D->GetGeom1D();
341 tracesDone.insert(segGeom->GetGlobalID());
343 else if ((exp2D = std::dynamic_pointer_cast<
344 LocalRegions::Expansion2D>(
345 bndConstraint[i]->
GetExp(j))))
349 LibUtilities::BasisKey bkey0 =
350 exp2D->GetBasis(0)->GetBasisKey();
351 LibUtilities::BasisKey bkey1 =
352 exp2D->GetBasis(1)->GetBasisKey();
353 FaceGeom = exp2D->GetGeom2D();
356 if ((QuadGeom = std::dynamic_pointer_cast<
357 SpatialDomains::QuadGeom>(FaceGeom)))
360 LocalRegions::QuadExp>::AllocateSharedPtr(bkey0,
363 tracesDone.insert(QuadGeom->GetGlobalID());
366 else if ((TriGeom = std::dynamic_pointer_cast<
367 SpatialDomains::TriGeom>(FaceGeom)))
370 LocalRegions::TriExp>::AllocateSharedPtr(bkey0,
373 tracesDone.insert(TriGeom->GetGlobalID());
379 "proper face geometry failed");
383 exp->SetElmtId(elmtid++);
386 (*m_exp).push_back(exp);
391 map<int, pair<SpatialDomains::Geometry1DSharedPtr, LibUtilities::BasisKey>>
395 pair<LibUtilities::BasisKey, LibUtilities::BasisKey>>>
398 for (i = 0; i < locexp.size(); ++i)
400 if ((exp1D = std::dynamic_pointer_cast<LocalRegions::Expansion1D>(
405 for (j = 0; j < 2; ++j)
407 PointGeom = (exp1D->GetGeom1D())->GetVertex(j);
408 id = PointGeom->GetVid();
411 if (tracesDone.count(
id) != 0)
418 tracesDone.insert(
id);
419 exp->SetElmtId(elmtid++);
420 (*m_exp).push_back(exp);
423 else if ((exp2D = std::dynamic_pointer_cast<LocalRegions::Expansion2D>(
427 for (j = 0; j < locexp[i]->GetNtraces(); ++j)
429 segGeom = exp2D->GetGeom2D()->GetEdge(j);
430 id = segGeom->GetGlobalID();
432 if (tracesDone.count(
id) != 0)
437 auto it = edgeOrders.find(
id);
439 if (it == edgeOrders.end())
441 edgeOrders.insert(std::make_pair(
442 id, std::make_pair(segGeom,
443 locexp[i]->GetTraceBasisKey(j))));
447 LibUtilities::BasisKey edge =
448 locexp[i]->GetTraceBasisKey(j);
449 LibUtilities::BasisKey existing = it->second.second;
451 int np1 = edge.GetNumPoints();
452 int np2 = existing.GetNumPoints();
453 int nm1 = edge.GetNumModes();
454 int nm2 = existing.GetNumModes();
456 if (np2 >= np1 && nm2 >= nm1)
460 else if (np2 < np1 && nm2 < nm1)
462 it->second.second = edge;
467 "inappropriate number of points/modes (max"
468 "num of points is not set with max order)");
473 else if ((exp3D = dynamic_pointer_cast<LocalRegions::Expansion3D>(
477 for (j = 0; j < exp3D->GetNtraces(); ++j)
479 FaceGeom = exp3D->GetGeom3D()->GetFace(j);
480 id = FaceGeom->GetGlobalID();
482 if (tracesDone.count(
id) != 0)
486 auto it = faceOrders.find(
id);
488 if (it == faceOrders.end())
490 LibUtilities::BasisKey face_dir0 =
491 locexp[i]->GetTraceBasisKey(j, 0);
492 LibUtilities::BasisKey face_dir1 =
493 locexp[i]->GetTraceBasisKey(j, 1);
495 faceOrders.insert(std::make_pair(
497 std::make_pair(FaceGeom,
498 std::make_pair(face_dir0, face_dir1))));
502 LibUtilities::BasisKey face0 =
503 locexp[i]->GetTraceBasisKey(j, 0);
504 LibUtilities::BasisKey face1 =
505 locexp[i]->GetTraceBasisKey(j, 1);
506 LibUtilities::BasisKey existing0 = it->second.second.first;
507 LibUtilities::BasisKey existing1 = it->second.second.second;
509 int np11 = face0.GetNumPoints();
510 int np12 = face1.GetNumPoints();
511 int np21 = existing0.GetNumPoints();
512 int np22 = existing1.GetNumPoints();
513 int nm11 = face0.GetNumModes();
514 int nm12 = face1.GetNumModes();
515 int nm21 = existing0.GetNumModes();
516 int nm22 = existing1.GetNumModes();
518 if ((np22 >= np12 || np21 >= np11) &&
519 (nm22 >= nm12 || nm21 >= nm11))
523 else if ((np22 < np12 || np21 < np11) &&
524 (nm22 < nm12 || nm21 < nm11))
526 it->second.second.first = face0;
527 it->second.second.second = face1;
532 "inappropriate number of points/modes (max"
533 "num of points is not set with max order)");
540 int nproc =
m_comm->GetRowComm()->GetSize();
541 int tracepr =
m_comm->GetRowComm()->GetRank();
548 for (i = 0; i < locexp.size(); ++i)
550 tCnt += locexp[i]->GetNtraces();
555 Array<OneD, int> tracesCnt(nproc, 0);
556 tracesCnt[tracepr] = tCnt;
560 int totTraceCnt =
Vmath::Vsum(nproc, tracesCnt, 1);
561 Array<OneD, int> tTotOffsets(nproc, 0);
563 for (i = 1; i < nproc; ++i)
565 tTotOffsets[i] = tTotOffsets[i - 1] + tracesCnt[i - 1];
569 Array<OneD, int> TracesTotID(totTraceCnt, 0);
570 Array<OneD, int> TracesTotNm0(totTraceCnt, 0);
571 Array<OneD, int> TracesTotNm1(totTraceCnt, 0);
572 Array<OneD, int> TracesTotPnts0(totTraceCnt, 0);
573 Array<OneD, int> TracesTotPnts1(totTraceCnt, 0);
575 int cntr = tTotOffsets[tracepr];
577 for (i = 0; i < locexp.size(); ++i)
579 if ((exp2D = locexp[i]->as<LocalRegions::Expansion2D>()))
582 int nedges = locexp[i]->GetNtraces();
584 for (j = 0; j < nedges; ++j, ++cntr)
586 LibUtilities::BasisKey bkeyEdge =
587 locexp[i]->GetTraceBasisKey(j);
588 TracesTotID[cntr] = exp2D->GetGeom2D()->GetEid(j);
589 TracesTotNm0[cntr] = bkeyEdge.GetNumModes();
590 TracesTotPnts0[cntr] = bkeyEdge.GetNumPoints();
593 else if ((exp3D = locexp[i]->as<LocalRegions::Expansion3D>()))
595 int nfaces = locexp[i]->GetNtraces();
597 for (j = 0; j < nfaces; ++j, ++cntr)
599 LibUtilities::BasisKey face_dir0 =
600 locexp[i]->GetTraceBasisKey(j, 0);
601 LibUtilities::BasisKey face_dir1 =
602 locexp[i]->GetTraceBasisKey(j, 1);
604 TracesTotID[cntr] = exp3D->GetGeom3D()->GetFid(j);
605 TracesTotNm0[cntr] = face_dir0.GetNumModes();
606 TracesTotNm1[cntr] = face_dir1.GetNumModes();
607 TracesTotPnts0[cntr] = face_dir0.GetNumPoints();
608 TracesTotPnts1[cntr] = face_dir1.GetNumPoints();
615 m_comm->GetRowComm()->AllReduce(TracesTotPnts0,
623 if (edgeOrders.size())
625 for (i = 0; i < totTraceCnt; ++i)
627 auto it = edgeOrders.find(TracesTotID[i]);
629 if (it == edgeOrders.end())
634 LibUtilities::BasisKey existing = it->second.second;
635 LibUtilities::BasisKey edge(
636 existing.GetBasisType(), TracesTotNm0[i],
637 LibUtilities::PointsKey(TracesTotPnts0[i],
638 existing.GetPointsType()));
640 int np1 = edge.GetNumPoints();
641 int np2 = existing.GetNumPoints();
642 int nm1 = edge.GetNumModes();
643 int nm2 = existing.GetNumModes();
645 if (np2 >= np1 && nm2 >= nm1)
649 else if (np2 < np1 && nm2 < nm1)
651 it->second.second = edge;
656 "inappropriate number of points/modes (max "
657 "num of points is not set with max order)");
661 else if (faceOrders.size())
663 for (i = 0; i < totTraceCnt; ++i)
665 auto it = faceOrders.find(TracesTotID[i]);
667 if (it == faceOrders.end())
672 LibUtilities::BasisKey existing0 = it->second.second.first;
673 LibUtilities::BasisKey existing1 = it->second.second.second;
674 LibUtilities::BasisKey face0(
675 existing0.GetBasisType(), TracesTotNm0[i],
676 LibUtilities::PointsKey(TracesTotPnts0[i],
677 existing0.GetPointsType()));
678 LibUtilities::BasisKey face1(
679 existing1.GetBasisType(), TracesTotNm1[i],
680 LibUtilities::PointsKey(TracesTotPnts1[i],
681 existing1.GetPointsType()));
683 int np11 = face0.GetNumPoints();
684 int np12 = face1.GetNumPoints();
685 int np21 = existing0.GetNumPoints();
686 int np22 = existing1.GetNumPoints();
687 int nm11 = face0.GetNumModes();
688 int nm12 = face1.GetNumModes();
689 int nm21 = existing0.GetNumModes();
690 int nm22 = existing1.GetNumModes();
692 if ((np22 >= np12 || np21 >= np11) &&
693 (nm22 >= nm12 || nm21 >= nm11))
697 else if ((np22 < np12 || np21 < np11) &&
698 (nm22 < nm12 || nm21 < nm11))
700 it->second.second.first = face0;
701 it->second.second.second = face1;
706 "inappropriate number of points/modes (max "
707 "num of points is not set with max order)");
713 if (edgeOrders.size())
715 for (
auto &it : edgeOrders)
718 it.second.second, it.second.first);
719 exp->SetElmtId(elmtid++);
720 (*m_exp).push_back(exp);
725 for (
auto &it : faceOrders)
727 FaceGeom = it.second.first;
729 if ((QuadGeom = std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
733 it.second.second.first, it.second.second.second, QuadGeom);
736 std::dynamic_pointer_cast<SpatialDomains::TriGeom>(
740 it.second.second.first, it.second.second.second, TriGeom);
742 exp->SetElmtId(elmtid++);
743 (*m_exp).push_back(exp);
760 for (
int i = (*m_exp).size() - 1; i >= 0; --i)
782 const bool DeclareCoeffPhysArrays,
const std::string variable,
784 : m_comm(pSession->GetComm()), m_session(pSession), m_graph(graph),
790 boost::ignore_unused(variable, ImpType);
791 int i, j, elmtid = 0;
806 for (i = 0; i < locexp.size(); ++i)
808 if ((exp1D = std::dynamic_pointer_cast<LocalRegions::Expansion1D>(
813 for (j = 0; j < 2; ++j)
815 PointGeom = (exp1D->GetGeom1D())->GetVertex(j);
819 exp->SetElmtId(elmtid++);
820 (*m_exp).push_back(exp);
823 else if ((exp2D = std::dynamic_pointer_cast<LocalRegions::Expansion2D>(
828 locexp[i]->GetBasis(0)->GetBasisKey();
830 for (j = 0; j < locexp[i]->GetNtraces(); ++j)
832 segGeom = exp2D->GetGeom2D()->GetEdge(j);
834 int dir = exp2D->GetGeom2D()->GetDir(j);
836 if (locexp[i]->GetNtraces() == 3)
839 locexp[i]->GetBasis(dir)->GetBasisKey();
853 locexp[i]->GetBasis(dir)->GetBasisKey(), segGeom);
856 exp->SetElmtId(elmtid++);
857 (*m_exp).push_back(exp);
860 else if ((exp3D = dynamic_pointer_cast<LocalRegions::Expansion3D>(
866 locexp[i]->GetBasis(0)->GetBasisKey();
868 locexp[i]->GetBasis(1)->GetBasisKey();
870 for (j = 0; j < exp3D->GetNtraces(); ++j)
872 FaceGeom = exp3D->GetGeom3D()->GetFace(j);
874 int dir0 = exp3D->GetGeom3D()->GetDir(j, 0);
875 int dir1 = exp3D->GetGeom3D()->GetDir(j, 1);
878 locexp[i]->GetBasis(dir0)->GetBasisKey();
880 locexp[i]->GetBasis(dir1)->GetBasisKey();
883 std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
888 face_dir0, face_dir1, QuadGeom);
890 else if ((TriGeom = std::dynamic_pointer_cast<
902 nface_dir0, nface_dir1, TriGeom);
904 exp->SetElmtId(elmtid++);
905 (*m_exp).push_back(exp);
945 const bool DeclareCoeffPhysArrays,
const std::string variable,
946 bool SetToOneSpaceDimension,
949 : m_comm(comm), m_session(pSession), m_graph(graph), m_physState(false),
964 int meshdim = graph->GetMeshDimension();
968 graph->GetExpansionInfo(variable);
972 for (
auto &compIt : domain)
975 for (j = 0; j < compIt.second->m_geomVec.size(); ++j)
977 if ((PtGeom = std::dynamic_pointer_cast<SpatialDomains::PointGeom>(
978 compIt.second->m_geomVec[j])))
986 std::dynamic_pointer_cast<SpatialDomains::SegGeom>(
987 compIt.second->m_geomVec[j])))
996 auto expIt = expansions.find(SegGeom->GetGlobalID());
998 "Failed to find basis key");
999 bkey = expIt->second->m_basisKeyVector[0];
1003 bkey = graph->GetEdgeBasisKey(SegGeom, variable);
1006 if (SetToOneSpaceDimension)
1009 SegGeom->GenerateOneSpaceDimGeom();
1013 bkey, OneDSegmentGeom);
1024 std::dynamic_pointer_cast<SpatialDomains::TriGeom>(
1025 compIt.second->m_geomVec[j])))
1030 graph->GetFaceBasisKey(TriGeom, 0, variable);
1032 graph->GetFaceBasisKey(TriGeom, 1, variable);
1034 if (graph->GetExpansionInfo()
1036 ->second->m_basisKeyVector[0]
1052 TriBa, TriBb, TriGeom);
1055 else if ((QuadGeom =
1056 std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
1057 compIt.second->m_geomVec[j])))
1062 graph->GetFaceBasisKey(QuadGeom, 0, variable);
1064 graph->GetFaceBasisKey(QuadGeom, 1, variable);
1067 QuadBa, QuadBb, QuadGeom);
1072 "dynamic cast to a Geom (possibly 3D) failed");
1075 exp->SetElmtId(elmtid++);
1076 (*m_exp).push_back(exp);
1111 for (i = 0; i <
m_exp->size(); ++i)
1116 m_npoints += (*m_exp)[i]->GetTotPoints();
1120 if (DeclareCoeffPhysArrays)
1128 for (
int i = 0; i <
m_exp->size(); ++i)
1132 int loccoeffs = (*m_exp)[i]->GetNcoeffs();
1134 for (
int j = 0; j < loccoeffs; ++j)
1159 for (
auto &expIt : expmap)
1163 switch (expInfo->m_basisKeyVector.size())
1168 "Cannot mix expansion dimensions in one vector");
1172 std::dynamic_pointer_cast<SpatialDomains::SegGeom>(
1173 expInfo->m_geomShPtr)))
1185 "dynamic cast to a 1D Geom failed");
1192 "Cannot mix expansion dimensions in one vector");
1199 std::dynamic_pointer_cast<SpatialDomains ::TriGeom>(
1200 expInfo->m_geomShPtr)))
1221 else if ((QuadrilateralGeom = std::dynamic_pointer_cast<
1226 Ba, Bb, QuadrilateralGeom);
1231 "dynamic cast to a 2D Geom failed");
1238 "Cannot mix expansion dimensions in one vector");
1246 std::dynamic_pointer_cast<SpatialDomains::TetGeom>(
1247 expInfo->m_geomShPtr)))
1254 "LocalRegions::NodalTetExp is not implemented "
1264 else if ((PrismGeom = std::dynamic_pointer_cast<
1265 SpatialDomains ::PrismGeom>(
1266 expInfo->m_geomShPtr)))
1272 else if ((PyrGeom = std::dynamic_pointer_cast<
1278 Ba, Bb, Bc, PyrGeom);
1280 else if ((HexGeom = std::dynamic_pointer_cast<
1285 Ba, Bb, Bc, HexGeom);
1290 "dynamic cast to a Geom failed");
1296 "Dimension of basis key is greater than 3");
1300 exp->SetElmtId(
id++);
1303 (*m_exp).push_back(exp);
1333 int nrows = blockmat->GetRows();
1334 int ncols = blockmat->GetColumns();
1341 out = (*blockmat) * in;
1353 for (
int i = 0; i < (*m_exp).size(); ++i)
1355 (*m_exp)[i]->MultiplyByQuadratureMetric(inarray +
m_phys_offset[i],
1356 e_outarray = outarray +
1370 for (
int i = 0; i < (*m_exp).size(); ++i)
1372 (*m_exp)[i]->DivideByQuadratureMetric(inarray +
m_phys_offset[i],
1399 for (i = 0; i < (*m_exp).size(); ++i)
1401 (*m_exp)[i]->IProductWRTDerivBase(dir, inarray +
m_phys_offset[i],
1417 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
1418 int nq = direction.size() / coordim;
1425 for (
int i = 0; i < (*m_exp).size(); ++i)
1427 npts_e = (*m_exp)[i]->GetTotPoints();
1430 for (
int k = 0; k < coordim; ++k)
1433 &locdir[k * npts_e], 1);
1436 (*m_exp)[i]->IProductWRTDirectionalDerivBase(
1461 ASSERTL1(inarray.size() >= dim,
"inarray is not of sufficient dimension");
1580 e_out_d0 = out_d0 + offset;
1581 e_out_d1 = out_d1 + offset;
1582 e_out_d2 = out_d2 + offset;
1585 inarray + offset, e_out_d0, e_out_d1,
1609 for (i = 0; i < (*m_exp).size(); ++i)
1612 (*m_exp)[i]->PhysDeriv_s(inarray +
m_phys_offset[i], e_out_ds);
1618 for (i = 0; i < (*m_exp).size(); i++)
1621 (*m_exp)[i]->PhysDeriv_n(inarray +
m_phys_offset[i], e_out_dn);
1638 int intdir = (int)edir;
1644 e_out_d = out_d + offset;
1647 inarray + offset, e_out_d);
1660 bool halfMode =
false;
1663 m_session->MatchSolverInfo(
"ModeType",
"HalfMode", halfMode,
false);
1715 ASSERTL0(0,
"Dimension not supported");
1726 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
1727 int nq = direction.size() / coordim;
1733 for (
int i = 0; i < (*m_exp).size(); ++i)
1735 npts_e = (*m_exp)[i]->GetTotPoints();
1738 for (
int k = 0; k < coordim; ++k)
1741 &locdir[k * npts_e], 1);
1744 (*m_exp)[i]->PhysDirectionalDeriv(inarray +
m_phys_offset[i], locdir,
1756 for (
int i = 0; i < (*m_exp).size(); ++i)
1758 (*m_exp)[i]->ExponentialFilter(e_array = array +
m_phys_offset[i],
1759 alpha, exponent, cutoff);
1779 if (inarray.get() == outarray.get())
1782 out = (*InvMass) * in;
1787 out = (*InvMass) * in;
1826 for (i = 0; i < (*m_exp).size(); ++i)
1828 (*m_exp)[i]->FwdTransBndConstrained(inarray +
m_phys_offset[i],
1843 boost::ignore_unused(field);
1856 "Smoothing is currently not allowed unless you are using "
1857 "a nodal base for efficiency reasons. The implemented "
1858 "smoothing technique requires the mass matrix inversion "
1859 "which is trivial just for GLL_LAGRANGE_SEM and "
1860 "GAUSS_LAGRANGE_SEMexpansions.");
1888 map<int, int> elmt_id;
1893 for (i = 0; i < (*m_exp).size(); ++i)
1897 elmt_id[n_exp++] = i;
1903 n_exp = (*m_exp).size();
1904 for (i = 0; i < n_exp; ++i)
1918 for (i = 0; i < n_exp; ++i)
1920 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
1921 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1928 for (i = 0; i < n_exp; ++i)
1930 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1931 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
1942 for (i = 0; i < n_exp; ++i)
1944 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1945 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1953 for (i = 0; i < n_exp; ++i)
1955 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1957 (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
1964 for (i = 0; i < n_exp; ++i)
1967 (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
1969 (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
1976 "Global Matrix creation not defined for this "
1989 for (i = cnt1 = 0; i < n_exp; ++i)
2000 (*
m_exp)[i]->GetTotPoints());
2007 loc_mat = std::dynamic_pointer_cast<LocalRegions::Expansion>(
2008 (*
m_exp)[elmt_id.find(i)->second])
2009 ->GetLocMatrix(matkey);
2010 BlkMatrix->SetBlock(i, i, loc_mat);
2027 return matrixIter->second;
2100 for (
int i = 0; i < (*m_exp).size(); ++i)
2110 (*
m_exp)[i]->GetTotPoints());
2117 (*m_exp)[i]->GeneralMatrixOp(
2134 int i, j, n, gid1, gid2, cntdim1, cntdim2;
2138 unsigned int glob_rows = 0;
2139 unsigned int glob_cols = 0;
2140 unsigned int loc_rows = 0;
2141 unsigned int loc_cols = 0;
2143 bool assembleFirstDim =
false;
2144 bool assembleSecondDim =
false;
2151 glob_cols = locToGloMap->GetNumGlobalCoeffs();
2153 assembleFirstDim =
false;
2154 assembleSecondDim =
true;
2159 glob_rows = locToGloMap->GetNumGlobalCoeffs();
2162 assembleFirstDim =
true;
2163 assembleSecondDim =
false;
2171 glob_rows = locToGloMap->GetNumGlobalCoeffs();
2172 glob_cols = locToGloMap->GetNumGlobalCoeffs();
2174 assembleFirstDim =
true;
2175 assembleSecondDim =
true;
2181 "Global Matrix creation not defined for this "
2193 for (n = cntdim1 = cntdim2 = 0; n < (*m_exp).size(); ++n)
2204 (*
m_exp)[eid]->GetTotPoints());
2212 std::dynamic_pointer_cast<LocalRegions::Expansion>((*
m_exp)[n])
2213 ->GetLocMatrix(matkey);
2215 loc_rows = loc_mat->GetRows();
2216 loc_cols = loc_mat->GetColumns();
2218 for (i = 0; i < loc_rows; ++i)
2220 if (assembleFirstDim)
2222 gid1 = locToGloMap->GetLocalToGlobalMap(cntdim1 + i);
2223 sign1 = locToGloMap->GetLocalToGlobalSign(cntdim1 + i);
2231 for (j = 0; j < loc_cols; ++j)
2233 if (assembleSecondDim)
2235 gid2 = locToGloMap->GetLocalToGlobalMap(cntdim2 + j);
2236 sign2 = locToGloMap->GetLocalToGlobalSign(cntdim2 + j);
2245 coord = make_pair(gid1, gid2);
2246 if (spcoomat.count(coord) == 0)
2248 spcoomat[coord] = sign1 * sign2 * (*loc_mat)(i, j);
2252 spcoomat[coord] += sign1 * sign2 * (*loc_mat)(i, j);
2256 cntdim1 += loc_rows;
2257 cntdim2 += loc_cols;
2261 glob_cols, spcoomat);
2267 int i, j, n, gid1, gid2, loc_lda, eid;
2271 int totDofs = locToGloMap->GetNumGlobalCoeffs();
2272 int NumDirBCs = locToGloMap->GetNumGlobalDirBndCoeffs();
2274 unsigned int rows = totDofs - NumDirBCs;
2275 unsigned int cols = totDofs - NumDirBCs;
2279 int bwidth = locToGloMap->GetFullSystemBandWidth();
2291 if ((2 * (bwidth + 1)) < rows)
2295 rows, cols, zero, matStorage, bwidth, bwidth);
2301 rows, cols, zero, matStorage);
2310 rows, cols, zero, matStorage);
2315 for (n = 0; n < (*m_exp).size(); ++n)
2326 (*
m_exp)[eid]->GetTotPoints());
2334 std::dynamic_pointer_cast<LocalRegions::Expansion>((*
m_exp)[n])
2335 ->GetLocMatrix(matkey);
2342 int rows = loc_mat->GetRows();
2343 int cols = loc_mat->GetColumns();
2344 const NekDouble *dat = loc_mat->GetRawPtr();
2347 Blas::Dscal(rows * cols, loc_mat->Scale(), new_mat->GetRawPtr(), 1);
2352 (*m_exp)[n]->AddRobinMassMatrix(
2353 rBC->m_robinID, rBC->m_robinPrimitiveCoeffs, new_mat);
2362 loc_lda = loc_mat->GetColumns();
2364 for (i = 0; i < loc_lda; ++i)
2368 sign1 = locToGloMap->GetLocalToGlobalSign(
m_coeff_offset[n] + i);
2371 for (j = 0; j < loc_lda; ++j)
2376 sign2 = locToGloMap->GetLocalToGlobalSign(
2384 if ((matStorage ==
eFULL) || (gid2 >= gid1))
2386 value = Gmat->GetValue(gid1, gid2) +
2387 sign1 * sign2 * (*loc_mat)(i, j);
2388 Gmat->SetValue(gid1, gid2, value);
2438 const map<int, RobinBCInfoSharedPtr> vRobinBCInfo =
GetRobinBCInfo();
2522 NekDouble tol,
bool returnNearestElmt,
int cachedId,
2527 return GetExpIndex(gloCoord, Lcoords, tol, returnNearestElmt, cachedId,
2533 bool returnNearestElmt,
int cachedId,
2546 for (
int i = (*m_exp).size() - 1; i >= 0; --i)
2557 if (cachedId >= 0 && cachedId < (*m_exp).size())
2560 if ((*
m_exp)[cachedId]->GetGeom()->MinMaxCheck(gloCoords) &&
2561 (*
m_exp)[cachedId]->GetGeom()->ContainsPoint(gloCoords, locCoords,
2566 else if (returnNearestElmt && (nearpt < nearpt_min))
2571 nearpt_min = nearpt;
2572 Vmath::Vcopy(locCoords.size(), locCoords, 1, savLocCoords, 1);
2576 NekDouble x = (gloCoords.size() > 0 ? gloCoords[0] : 0.0);
2577 NekDouble y = (gloCoords.size() > 1 ? gloCoords[1] : 0.0);
2578 NekDouble z = (gloCoords.size() > 2 ? gloCoords[2] : 0.0);
2585 std::vector<int> elmts =
m_graph->GetElementsContainingPoint(
p);
2588 for (
int i = 0; i < elmts.size(); ++i)
2595 if ((*
m_exp)[
id]->GetGeom()->ContainsPoint(gloCoords, locCoords, tol,
2600 else if (returnNearestElmt && (nearpt < nearpt_min))
2605 nearpt_min = nearpt;
2606 Vmath::Vcopy(locCoords.size(), locCoords, 1, savLocCoords, 1);
2612 if (returnNearestElmt && nearpt_min <= maxDistance)
2616 "Failed to find point within element to "
2618 boost::lexical_cast<std::string>(tol) +
" using local point (" +
2619 boost::lexical_cast<std::string>(locCoords[0]) +
"," +
2620 boost::lexical_cast<std::string>(locCoords[1]) +
"," +
2621 boost::lexical_cast<std::string>(locCoords[1]) +
2622 ") in element: " + boost::lexical_cast<std::string>(min_id);
2625 Vmath::Vcopy(locCoords.size(), savLocCoords, 1, locCoords, 1);
2642 ASSERTL0(dim == coords.size(),
"Invalid coordinate dimension.");
2647 ASSERTL0(elmtIdx > 0,
"Unable to find element containing point.");
2653 return (*
m_exp)[elmtIdx]->StdPhysEvaluate(xi, elmtPhys);
2682 for (
int i = 0; i <
m_exp->size(); ++i)
2684 (*m_exp)[i]->GetGeom()->Reset(
m_graph->GetCurvedEdges(),
2689 for (
int i = 0; i <
m_exp->size(); ++i)
2691 (*m_exp)[i]->Reset();
2707 int coordim =
GetExp(0)->GetCoordim();
2708 char vars[3] = {
'x',
'y',
'z'};
2719 outfile <<
"Variables = x";
2720 for (
int i = 1; i < coordim; ++i)
2722 outfile <<
", " << vars[i];
2727 outfile <<
", " << var;
2730 outfile << std::endl << std::endl;
2743 int nBases = (*m_exp)[0]->GetNumBases();
2748 if (expansion == -1)
2756 GetCoords(coords[0], coords[1], coords[2]);
2758 for (i = 0; i <
m_exp->size(); ++i)
2762 for (j = 0; j < nBases; ++j)
2764 numInt *= (*m_exp)[i]->GetNumPoints(j) - 1;
2767 numBlocks += numInt;
2772 nPoints = (*m_exp)[expansion]->GetTotPoints();
2778 (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
2781 for (j = 0; j < nBases; ++j)
2783 numBlocks *= (*m_exp)[expansion]->GetNumPoints(j) - 1;
2791 int nPlanes =
GetZIDs().size();
2792 NekDouble tmp = numBlocks * (nPlanes - 1.0) / nPlanes;
2793 numBlocks = (int)tmp;
2801 outfile <<
"Zone, N=" << nPoints <<
", E=" << numBlocks <<
", F=FEBlock";
2806 outfile <<
", ET=QUADRILATERAL" << std::endl;
2809 outfile <<
", ET=BRICK" << std::endl;
2817 for (j = 0; j < coordim; ++j)
2819 for (i = 0; i < nPoints; ++i)
2821 outfile << coords[j][i] <<
" ";
2822 if (i % 1000 == 0 && i)
2824 outfile << std::endl;
2827 outfile << std::endl;
2834 int nbase = (*m_exp)[0]->GetNumBases();
2837 std::shared_ptr<LocalRegions::ExpansionVector> exp =
m_exp;
2839 if (expansion != -1)
2841 exp = std::shared_ptr<LocalRegions::ExpansionVector>(
2843 (*exp)[0] = (*m_exp)[expansion];
2848 for (i = 0; i < (*exp).size(); ++i)
2850 const int np0 = (*exp)[i]->GetNumPoints(0);
2851 const int np1 = (*exp)[i]->GetNumPoints(1);
2853 for (j = 1; j < np1; ++j)
2855 for (k = 1; k < np0; ++k)
2857 outfile << cnt + (j - 1) * np0 + k <<
" ";
2858 outfile << cnt + (j - 1) * np0 + k + 1 <<
" ";
2859 outfile << cnt + j * np0 + k + 1 <<
" ";
2860 outfile << cnt + j * np0 + k << endl;
2867 else if (nbase == 3)
2869 for (i = 0; i < (*exp).size(); ++i)
2871 const int np0 = (*exp)[i]->GetNumPoints(0);
2872 const int np1 = (*exp)[i]->GetNumPoints(1);
2873 const int np2 = (*exp)[i]->GetNumPoints(2);
2874 const int np01 = np0 * np1;
2876 for (j = 1; j < np2; ++j)
2878 for (k = 1; k < np1; ++k)
2880 for (l = 1; l < np0; ++l)
2882 outfile << cnt + (j - 1) * np01 + (k - 1) * np0 + l
2884 outfile << cnt + (j - 1) * np01 + (k - 1) * np0 + l + 1
2886 outfile << cnt + (j - 1) * np01 + k * np0 + l + 1
2888 outfile << cnt + (j - 1) * np01 + k * np0 + l <<
" ";
2889 outfile << cnt + j * np01 + (k - 1) * np0 + l <<
" ";
2890 outfile << cnt + j * np01 + (k - 1) * np0 + l + 1
2892 outfile << cnt + j * np01 + k * np0 + l + 1 <<
" ";
2893 outfile << cnt + j * np01 + k * np0 + l << endl;
2897 cnt += np0 * np1 * np2;
2913 if (expansion == -1)
2921 for (
int i = 0; i < totpoints; ++i)
2923 outfile <<
m_phys[i] <<
" ";
2924 if (i % 1000 == 0 && i)
2926 outfile << std::endl;
2929 outfile << std::endl;
2933 int nPoints = (*m_exp)[expansion]->GetTotPoints();
2935 for (
int i = 0; i < nPoints; ++i)
2940 outfile << std::endl;
2946 outfile <<
"<?xml version=\"1.0\"?>" << endl;
2947 outfile <<
"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" "
2948 <<
"byte_order=\"LittleEndian\">" << endl;
2949 outfile <<
" <UnstructuredGrid>" << endl;
2954 outfile <<
" </UnstructuredGrid>" << endl;
2955 outfile <<
"</VTKFile>" << endl;
2961 boost::ignore_unused(istrip);
2963 int nbase = (*m_exp)[expansion]->GetNumBases();
2964 int ntot = (*m_exp)[expansion]->GetTotPoints();
2968 for (i = 0; i < nbase; ++i)
2970 nquad[i] = (*m_exp)[expansion]->GetNumPoints(i);
2971 ntotminus *= (nquad[i] - 1);
2978 (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
2980 outfile <<
" <Piece NumberOfPoints=\"" << ntot <<
"\" NumberOfCells=\""
2981 << ntotminus <<
"\">" << endl;
2982 outfile <<
" <Points>" << endl;
2983 outfile <<
" <DataArray type=\"Float64\" "
2984 <<
"NumberOfComponents=\"3\" format=\"ascii\">" << endl;
2986 for (i = 0; i < ntot; ++i)
2988 for (j = 0; j < 3; ++j)
2990 outfile << setprecision(8) << scientific << (float)coords[j][i]
2996 outfile <<
" </DataArray>" << endl;
2997 outfile <<
" </Points>" << endl;
2998 outfile <<
" <Cells>" << endl;
2999 outfile <<
" <DataArray type=\"Int32\" "
3000 <<
"Name=\"connectivity\" format=\"ascii\">" << endl;
3010 for (i = 0; i < nquad[0] - 1; ++i)
3012 outfile << i <<
" " << i + 1 << endl;
3020 for (i = 0; i < nquad[0] - 1; ++i)
3022 for (j = 0; j < nquad[1] - 1; ++j)
3024 outfile << j * nquad[0] + i <<
" " << j * nquad[0] + i + 1
3025 <<
" " << (j + 1) * nquad[0] + i + 1 <<
" "
3026 << (j + 1) * nquad[0] + i << endl;
3035 for (i = 0; i < nquad[0] - 1; ++i)
3037 for (j = 0; j < nquad[1] - 1; ++j)
3039 for (k = 0; k < nquad[2] - 1; ++k)
3042 << k * nquad[0] * nquad[1] + j * nquad[0] + i <<
" "
3043 << k * nquad[0] * nquad[1] + j * nquad[0] + i + 1
3045 << k * nquad[0] * nquad[1] + (j + 1) * nquad[0] +
3048 << k * nquad[0] * nquad[1] + (j + 1) * nquad[0] + i
3050 << (k + 1) * nquad[0] * nquad[1] + j * nquad[0] + i
3052 << (k + 1) * nquad[0] * nquad[1] + j * nquad[0] +
3055 << (k + 1) * nquad[0] * nquad[1] +
3056 (j + 1) * nquad[0] + i + 1
3058 << (k + 1) * nquad[0] * nquad[1] +
3059 (j + 1) * nquad[0] + i
3071 outfile <<
" </DataArray>" << endl;
3072 outfile <<
" <DataArray type=\"Int32\" "
3073 <<
"Name=\"offsets\" format=\"ascii\">" << endl;
3074 for (i = 0; i < ntotminus; ++i)
3076 outfile << i * ns + ns <<
" ";
3079 outfile <<
" </DataArray>" << endl;
3080 outfile <<
" <DataArray type=\"UInt8\" "
3081 <<
"Name=\"types\" format=\"ascii\">" << endl;
3082 for (i = 0; i < ntotminus; ++i)
3087 outfile <<
" </DataArray>" << endl;
3088 outfile <<
" </Cells>" << endl;
3089 outfile <<
" <PointData>" << endl;
3094 boost::ignore_unused(expansion);
3095 outfile <<
" </PointData>" << endl;
3096 outfile <<
" </Piece>" << endl;
3103 int nq = (*m_exp)[expansion]->GetTotPoints();
3106 outfile <<
" <DataArray type=\"Float64\" Name=\"" << var <<
"\">"
3112 for (i = 0; i < nq; ++i)
3118 outfile <<
" </DataArray>" << endl;
3152 err = max(err,
abs(inarray[i] - soln[i]));
3185 for (i = 0; i < (*m_exp).size(); ++i)
3188 err += errl2 * errl2;
3193 for (i = 0; i < (*m_exp).size(); ++i)
3197 err += errl2 * errl2;
3227 for (i = 0; i < (*m_exp).size(); ++i)
3243 for (i = 0; i < (*m_exp).size(); ++i)
3246 for (j = 0; j < inarray.size(); ++j)
3250 flux += (*m_exp)[i]->VectorFlux(tmp);
3259 "This method is not defined or valid for this class type");
3267 "This method is not defined or valid for this class type");
3275 "This method is not defined or valid for this class type");
3282 boost::ignore_unused(lhom);
3284 "This method is not defined or valid for this class type");
3290 "This method is not defined or valid for this class type");
3298 "This method is not defined or valid for this class type");
3306 "ClearGlobalLinSysManager not implemented for ExpList.");
3311 boost::ignore_unused(poolName);
3318 boost::ignore_unused(key, clearLocalMatrices);
3320 "UnsetGlobalLinSys not implemented for ExpList.");
3327 "GetGlobalLinSysManager not implemented for ExpList.");
3333 const std::string &varName,
3336 string varString = fileName.substr(0, fileName.find_last_of(
"."));
3337 int j, k, len = varString.length();
3338 varString = varString.substr(len - 1, len);
3340 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
3341 std::vector<std::vector<NekDouble>> FieldData;
3346 ft, comm,
m_session->GetSharedFilesystem());
3348 f->Import(fileName, FieldDef, FieldData);
3351 for (j = 0; j < FieldDef.size(); ++j)
3353 for (k = 0; k < FieldDef[j]->m_fields.size(); ++k)
3355 if (FieldDef[j]->m_fields[k] == varName)
3359 FieldDef[j]->m_fields[k], coeffs);
3365 ASSERTL0(found,
"Could not find variable '" + varName +
3366 "' in file boundary condition " + fileName);
3392 for (i = 0; i < (*m_exp).size(); ++i)
3396 err += errh1 * errh1;
3405 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef,
3407 std::vector<NekDouble> &HomoLen,
bool homoStrips,
3408 std::vector<unsigned int> &HomoSIDs, std::vector<unsigned int> &HomoZIDs,
3409 std::vector<unsigned int> &HomoYIDs)
3416 ASSERTL1(NumHomoDir == HomoBasis.size(),
3417 "Homogeneous basis is not the same length as NumHomoDir");
3418 ASSERTL1(NumHomoDir == HomoLen.size(),
3419 "Homogeneous length vector is not the same length as NumHomDir");
3438 for (s = startenum; s <= endenum; ++s)
3440 std::vector<unsigned int> elementIDs;
3441 std::vector<LibUtilities::BasisType> basis;
3442 std::vector<unsigned int> numModes;
3443 std::vector<std::string> fields;
3446 bool UniOrder =
true;
3451 for (
int i = 0; i < (*m_exp).size(); ++i)
3453 if ((*
m_exp)[i]->GetGeom()->GetShapeType() == shape)
3455 elementIDs.push_back((*
m_exp)[i]->GetGeom()->GetGlobalID());
3458 for (
int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
3461 (*
m_exp)[i]->GetBasis(j)->GetBasisType());
3463 (*
m_exp)[i]->GetBasis(j)->GetNumModes());
3467 for (n = 0; n < NumHomoDir; ++n)
3469 basis.push_back(HomoBasis[n]->GetBasisType());
3470 numModes.push_back(HomoBasis[n]->GetNumModes());
3478 (*
m_exp)[i]->GetBasis(0)->GetBasisType() == basis[0],
3479 "Routine is not set up for multiple bases definitions");
3481 for (
int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
3484 (*
m_exp)[i]->GetBasis(j)->GetNumModes());
3486 (*
m_exp)[i]->GetBasis(j)->GetNumModes())
3492 for (n = 0; n < NumHomoDir; ++n)
3494 numModes.push_back(HomoBasis[n]->GetNumModes());
3500 if (elementIDs.size() > 0)
3505 numModes, fields, NumHomoDir, HomoLen,
3506 homoStrips, HomoSIDs, HomoZIDs, HomoYIDs);
3507 fielddef.push_back(fdef);
3515 std::vector<LibUtilities::FieldDefinitionsSharedPtr>
ExpList::
3518 std::vector<LibUtilities::FieldDefinitionsSharedPtr> returnval;
3524 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef)
3533 std::vector<NekDouble> &fielddata)
3547 map<int, int> ElmtID_to_ExpID;
3548 for (i = 0; i < (*m_exp).size(); ++i)
3550 ElmtID_to_ExpID[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
3553 for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
3555 int eid = ElmtID_to_ExpID[fielddef->m_elementIDs[i]];
3556 int datalen = (*m_exp)[eid]->GetNcoeffs();
3565 std::vector<NekDouble> &fielddata, std::string &field,
3572 const std::shared_ptr<ExpList> &fromExpList,
3589 std::vector<NekDouble> &fielddata, std::string &field,
3592 boost::ignore_unused(zIdToPlane);
3595 int modes_offset = 0;
3596 int datalen = fielddata.size() / fielddef->m_fields.size();
3599 for (i = 0; i < fielddef->m_fields.size(); ++i)
3601 if (fielddef->m_fields[i] == field)
3608 ASSERTL0(i != fielddef->m_fields.size(),
3609 "Field (" + field +
") not found in file.");
3616 for (i = (*m_exp).size() - 1; i >= 0; --i)
3622 for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
3626 if (fielddef->m_uniOrder ==
true)
3632 fielddef->m_shapeType, fielddef->m_numModes, modes_offset);
3634 const int elmtId = fielddef->m_elementIDs[i];
3640 modes_offset += (*m_exp)[0]->GetNumBases();
3644 expId = eIt->second;
3646 bool sameBasis =
true;
3647 for (
int j = 0; j < fielddef->m_basis.size(); ++j)
3649 if (fielddef->m_basis[j] != (*
m_exp)[expId]->GetBasisType(j))
3663 (*m_exp)[expId]->ExtractDataToCoeffs(
3664 &fielddata[offset], fielddef->m_numModes, modes_offset,
3669 modes_offset += (*m_exp)[0]->GetNumBases();
3676 const std::shared_ptr<ExpList> &fromExpList,
3683 for (i = 0; i < (*m_exp).size(); ++i)
3685 std::vector<unsigned int> nummodes;
3686 vector<LibUtilities::BasisType> basisTypes;
3687 for (
int j = 0; j < fromExpList->GetExp(i)->GetNumBases(); ++j)
3689 nummodes.push_back(fromExpList->GetExp(i)->GetBasisNumModes(j));
3690 basisTypes.push_back(fromExpList->GetExp(i)->GetBasisType(j));
3693 (*m_exp)[i]->ExtractDataToCoeffs(&fromCoeffs[offset], nummodes, 0,
3697 offset += fromExpList->GetExp(i)->GetNcoeffs();
3707 size_t nTracePts = weightAver.size();
3709 for (
int i = 0; i < nTracePts; ++i)
3711 weightAver[i] = 0.5;
3712 weightJump[i] = 1.0;
3724 int nq = outarray[0].size() / MFdim;
3727 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
3731 for (
int i = 0; i <
m_exp->size(); ++i)
3733 npts = (*m_exp)[i]->GetTotPoints();
3735 for (
int j = 0; j < MFdim * coordim; ++j)
3741 (*m_exp)[i]->GetMetricInfo()->GetMovingFrames(
3742 (*
m_exp)[i]->GetPointsKeys(), MMFdir, CircCentre, MFloc);
3745 for (
int j = 0; j < MFdim; ++j)
3747 for (
int k = 0; k < coordim; ++k)
3771 for (
int i = 0; i < (*m_exp).size(); ++i)
3773 npoints_e = (*m_exp)[i]->GetTotPoints();
3794 "This method is not defined or valid for this class type");
3801 boost::ignore_unused(i);
3803 "This method is not defined or valid for this class type");
3804 static std::shared_ptr<ExpList> result;
3827 int i, j, k, e_npoints, offset;
3835 "Input vector does not have sufficient dimensions to "
3839 for (i = 0; i <
m_exp->size(); ++i)
3842 e_npoints = (*m_exp)[i]->GetNumPoints(0);
3843 normals = (*m_exp)[i]->GetPhysNormals();
3849 for (j = 0; j < e_npoints; ++j)
3853 for (k = 0; k < coordim; ++k)
3855 Vn += Vec[k][offset + j] * normals[k * e_npoints + j];
3861 Upwind[offset + j] = Fwd[offset + j];
3865 Upwind[offset + j] = Bwd[offset + j];
3873 "This method is not defined or valid for this class type");
3919 "This method is not defined or valid for this class type");
3920 static std::shared_ptr<ExpList> returnVal;
3927 "This method is not defined or valid for this class type");
3928 static std::shared_ptr<AssemblyMapDG> result;
3934 return GetTraceMap()->GetBndCondIDToGlobalTraceID();
3940 "This method is not defined or valid for this class type");
3941 static std::vector<bool> result;
3958 for (
int i = 0; i < nquad2; ++i)
3960 for (
int j = 0; j < nquad1; ++j)
3962 out[i * nquad1 + j] = in[j * nquad2 + i];
3968 for (
int i = 0; i < nquad2; ++i)
3970 for (
int j = 0; j < nquad1; ++j)
3972 out[i * nquad1 + j] = in[i * nquad1 + j];
3983 for (
int i = 0; i < nquad2; ++i)
3985 for (
int j = 0; j < nquad1 / 2; ++j)
3987 swap(out[i * nquad1 + j], out[i * nquad1 + nquad1 - j - 1]);
3998 for (
int j = 0; j < nquad1; ++j)
4000 for (
int i = 0; i < nquad2 / 2; ++i)
4002 swap(out[i * nquad1 + j], out[(nquad2 - i - 1) * nquad1 + j]);
4017 int i, j, k, e_npoints, offset;
4023 ASSERTL1(normals.size() >= coordim,
4024 "Output vector does not have sufficient dimensions to "
4032 for (i = 0; i <
m_exp->size(); ++i)
4037 loc_exp->GetLeftAdjacentElementExp();
4041 locnormals = loc_elmt->GetTraceNormal(
4042 loc_exp->GetLeftAdjacentElementTrace());
4048 for (j = 0; j < e_npoints; ++j)
4052 for (k = 0; k < coordim; ++k)
4054 normals[k][offset] = locnormals[k][0];
4066 for (i = 0; i <
m_exp->size(); ++i)
4071 loc_exp->GetLeftAdjacentElementExp();
4073 int edgeNumber = loc_exp->GetLeftAdjacentElementTrace();
4076 e_npoints = (*m_exp)[i]->GetNumPoints(0);
4078 locnormals = loc_elmt->GetTraceNormal(edgeNumber);
4079 int e_nmodes = loc_exp->GetBasis(0)->GetNumModes();
4080 int loc_nmodes = loc_elmt->GetBasis(0)->GetNumModes();
4082 if (e_nmodes != loc_nmodes)
4084 if (loc_exp->GetRightAdjacentElementTrace() >= 0)
4087 loc_exp->GetRightAdjacentElementExp();
4090 loc_exp->GetRightAdjacentElementTrace();
4094 locnormals = loc_elmt->GetTraceNormal(EdgeNumber);
4099 for (j = 0; j < e_npoints; ++j)
4104 for (k = 0; k < coordim; ++k)
4106 normals[k][offset + j] = -locnormals[k][j];
4115 for (
int p = 0;
p < coordim; ++
p)
4119 loc_exp->GetBasis(0)->GetPointsKey();
4121 loc_elmt->GetBasis(0)->GetPointsKey();
4129 for (j = 0; j < e_npoints; ++j)
4133 for (k = 0; k < coordim; ++k)
4135 normals[k][offset + j] = normal[k][j];
4146 for (j = 0; j < e_npoints; ++j)
4150 for (k = 0; k < coordim; ++k)
4152 normals[k][offset + j] = locnormals[k][j];
4164 for (i = 0; i <
m_exp->size(); ++i)
4168 traceExp->GetLeftAdjacentElementExp();
4171 int faceNum = traceExp->GetLeftAdjacentElementTrace();
4175 exp3D->GetTraceNormal(faceNum);
4181 int fromid0, fromid1;
4195 exp3D->GetTraceBasisKey(faceNum, fromid0);
4197 exp3D->GetTraceBasisKey(faceNum, fromid1);
4199 traceExp->GetBasis(0)->GetBasisKey();
4201 traceExp->GetBasis(1)->GetBasisKey();
4207 exp3D->ReOrientTracePhysMap(orient, faceids, faceNq0, faceNq1);
4211 for (j = 0; j < coordim; ++j)
4213 Vmath::Scatr(faceNq0 * faceNq1, locNormals[j], faceids,
4219 traceBasis1.
GetPointsKey(), tmp = normals[j] + offset);
4227 "This method is not defined or valid for this class type");
4242 lengLR[0] = lengthsFwd;
4243 lengLR[1] = lengthsBwd;
4247 int e_npoints0 = -1;
4250 for (
int i = 0; i <
m_exp->size(); ++i)
4252 loc_exp = (*m_exp)[i];
4255 int e_nmodes = loc_exp->GetBasis(0)->GetNumModes();
4256 e_npoints = (*m_exp)[i]->GetNumPoints(0);
4257 if (e_npoints0 < e_npoints)
4259 for (
int nlr = 0; nlr < 2; nlr++)
4263 e_npoints0 = e_npoints;
4266 LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
4267 LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
4269 LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
4270 LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
4271 for (
int nlr = 0; nlr < 2; ++nlr)
4274 lengAdd[nlr] = lengintp[nlr];
4275 int bndNumber = LRbndnumbs[nlr];
4276 loc_elmt = LRelmts[nlr];
4279 locLeng = loc_elmt->GetElmtBndNormDirElmtLen(bndNumber);
4280 lengAdd[nlr] = locLeng;
4282 int loc_nmodes = loc_elmt->GetBasis(0)->GetNumModes();
4283 if (e_nmodes != loc_nmodes)
4287 loc_exp->GetBasis(0)->GetPointsKey();
4289 loc_elmt->GetBasis(0)->GetPointsKey();
4292 lengAdd[nlr] = lengintp[nlr];
4296 for (
int j = 0; j < e_npoints; ++j)
4298 lengLR[nlr][offset + j] = lengAdd[nlr][j];
4305 for (
int i = 0; i <
m_exp->size(); ++i)
4307 loc_exp = (*m_exp)[i];
4311 loc_exp->GetBasis(0)->GetBasisKey();
4313 loc_exp->GetBasis(1)->GetBasisKey();
4316 e_npoints = TraceNq0 * TraceNq1;
4317 if (e_npoints0 < e_npoints)
4319 for (
int nlr = 0; nlr < 2; nlr++)
4323 e_npoints0 = e_npoints;
4326 LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
4327 LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
4329 LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
4330 LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
4331 for (
int nlr = 0; nlr < 2; ++nlr)
4334 int bndNumber = LRbndnumbs[nlr];
4335 loc_elmt = LRelmts[nlr];
4338 locLeng = loc_elmt->GetElmtBndNormDirElmtLen(bndNumber);
4342 loc_elmt->GetTraceOrient(bndNumber);
4344 int fromid0, fromid1;
4357 loc_elmt->GetTraceBasisKey(bndNumber, fromid0);
4359 loc_elmt->GetTraceBasisKey(bndNumber, fromid1);
4364 AlignFace(orient, faceNq0, faceNq1, locLeng, alignedLeng);
4371 for (
int j = 0; j < e_npoints; ++j)
4373 lengLR[nlr][offset + j] = lengintp[nlr][j];
4384 boost::ignore_unused(Fx, Fy, outarray);
4386 "This method is not defined or valid for this class type");
4392 boost::ignore_unused(Fn, outarray);
4394 "This method is not defined or valid for this class type");
4401 boost::ignore_unused(Fwd, Bwd, outarray);
4403 "This method is not defined or valid for this class type");
4409 boost::ignore_unused(Fwd, Bwd);
4411 "This method is not defined or valid for this class type");
4417 bool PutFwdInBwdOnBCs,
bool DoExchange)
4419 boost::ignore_unused(field, Fwd, Bwd, FillBnd, PutFwdInBwdOnBCs,
4422 "This method is not defined or valid for this class type");
4427 bool PutFwdInBwdOnBCs)
4429 boost::ignore_unused(Fwd, Bwd, PutFwdInBwdOnBCs);
4431 "This method is not defined or valid for this class type");
4438 boost::ignore_unused(field, Fwd, Bwd);
4440 "v_AddTraceQuadPhysToField is not defined for this class type");
4447 boost::ignore_unused(field, Fwd, Bwd);
4449 "v_AddTraceQuadPhysToOffDiag is not defined for this class");
4457 boost::ignore_unused(Fwd, Bwd, locTraceFwd, locTraceBwd);
4459 "v_GetLocTraceFromTracePts is not defined for this class");
4465 "v_GetBndCondBwdWeight is not defined for this class type");
4472 boost::ignore_unused(index, value);
4474 "v_setBndCondBwdWeight is not defined for this class type");
4480 "This method is not defined or valid for this class type");
4481 static vector<bool> tmp;
4487 boost::ignore_unused(outarray);
4489 "This method is not defined or valid for this class type");
4495 boost::ignore_unused(inarray, outarray);
4497 "This method is not defined or valid for this class type");
4504 boost::ignore_unused(inarray, outarray);
4506 "This method is not defined or valid for this class type");
4516 boost::ignore_unused(inarray, outarray, factors, varcoeff, varfactors,
4517 dirForcing, PhysSpaceForcing);
4528 boost::ignore_unused(velocity, inarray, outarray, lambda, dirForcing);
4530 "LinearAdvectionDiffusionReactionSolve not implemented.");
4540 boost::ignore_unused(velocity, inarray, outarray, lambda, dirForcing);
4542 "This method is not defined or valid for this class type");
4548 bool Shuff,
bool UnShuff)
4550 boost::ignore_unused(npts, inarray, outarray, Shuff, UnShuff);
4552 "This method is not defined or valid for this class type");
4558 bool Shuff,
bool UnShuff)
4560 boost::ignore_unused(npts, inarray, outarray, Shuff, UnShuff);
4562 "This method is not defined or valid for this class type");
4570 boost::ignore_unused(npts, inarray1, inarray2, outarray);
4572 "This method is not defined or valid for this class type");
4580 boost::ignore_unused(npts, inarray1, inarray2, outarray);
4582 "This method is not defined or valid for this class type");
4588 boost::ignore_unused(BndVals, TotField, BndID);
4590 "This method is not defined or valid for this class type");
4598 boost::ignore_unused(V1, V2, outarray, BndID);
4600 "This method is not defined or valid for this class type");
4613 (*m_exp)[i]->NormVectorIProductWRTBase(
4623 (*m_exp)[i]->NormVectorIProductWRTBase(
4633 (*m_exp)[i]->NormVectorIProductWRTBase(
4648 boost::ignore_unused(outarray);
4650 "This method is not defined or valid for this class type");
4657 boost::ignore_unused(coeffs);
4659 "This method is not defined or valid for this class type");
4667 boost::ignore_unused(nreg, coeffs);
4669 "This method is not defined or valid for this class type");
4674 boost::ignore_unused(useComm);
4676 "This method is not defined or valid for this class type");
4682 boost::ignore_unused(inarray, outarray, useComm);
4684 "This method is not defined or valid for this class type");
4690 "This method is not defined or valid for this class type");
4696 boost::ignore_unused(inarray, outarray);
4698 "This method is not defined or valid for this class type");
4769 for (i = 0; i < (*m_exp).size(); ++i)
4772 (*m_exp)[i]->GetCoords(e_coord_0);
4776 ASSERTL0(coord_1.size() != 0,
"output coord_1 is not defined");
4778 for (i = 0; i < (*m_exp).size(); ++i)
4782 (*m_exp)[i]->GetCoords(e_coord_0, e_coord_1);
4786 ASSERTL0(coord_1.size() != 0,
"output coord_1 is not defined");
4787 ASSERTL0(coord_2.size() != 0,
"output coord_2 is not defined");
4789 for (i = 0; i < (*m_exp).size(); ++i)
4794 (*m_exp)[i]->GetCoords(e_coord_0, e_coord_1, e_coord_2);
4804 (*m_exp)[eid]->GetCoords(xc0, xc1, xc2);
4814 for (
int i = 0; i <
m_exp->size(); ++i)
4816 for (
int j = 0; j < (*m_exp)[i]->GetNtraces(); ++j)
4818 (*m_exp)[i]->ComputeTraceNormal(j);
4826 const bool DeclareCoeffPhysArrays)
4828 boost::ignore_unused(i, result, DeclareCoeffPhysArrays);
4830 "This method is not defined or valid for this class type");
4851 for (cnt = n = 0; n < i; ++n)
4862 elmt =
GetExp(ElmtID[cnt + n]);
4863 elmt->GetTracePhysVals(
4865 tmp1 = element + offsetElmt, tmp2 = boundary + offsetBnd);
4867 offsetElmt += elmt->GetTotPoints();
4883 for (cnt = n = 0; n < i; ++n)
4892 npoints +=
GetExp(ElmtID[cnt + n])->GetTotPoints();
4903 nq =
GetExp(ElmtID[cnt + n])->GetTotPoints();
4905 Vmath::Vcopy(nq, &phys[offsetPhys], 1, &bndElmt[offsetElmt], 1);
4928 for (cnt = n = 0; n < i; ++n)
4940 elmt =
GetExp(ElmtID[cnt + n]);
4941 elmt->GetTracePhysVals(EdgeID[cnt + n],
4943 phys + offsetPhys, tmp1 = bnd + offsetBnd);
4962 for (j = 0; j < coordim; ++j)
4969 for (cnt = n = 0; n < i; ++n)
4980 elmt =
GetExp(ElmtID[cnt + n]);
4982 elmt->GetTraceNormal(EdgeID[cnt + n]);
4984 for (j = 0; j < coordim; ++j)
4986 Vmath::Vcopy(nq, normalsElmt[j], 1, tmp = normals[j] + offset, 1);
4996 boost::ignore_unused(ElmtID, EdgeID);
4998 "This method is not defined or valid for this class type");
5004 boost::ignore_unused(weightave, weightjmp);
5011 boost::ignore_unused(Fwd, Bwd);
5021 "This method is not defined or valid for this class type");
5032 "This method is not defined or valid for this class type");
5040 const std::string varName,
5044 boost::ignore_unused(time, varName, x2_in, x3_in);
5046 "This method is not defined or valid for this class type");
5054 "This method is not defined or valid for this class type");
5055 static map<int, RobinBCInfoSharedPtr> result;
5065 boost::ignore_unused(periodicVerts, periodicEdges, periodicFaces);
5067 "This method is not defined or valid for this class type");
5072 unsigned int regionId,
const std::string &variable)
5074 auto collectionIter = collection.find(regionId);
5075 ASSERTL1(collectionIter != collection.end(),
5076 "Unable to locate collection " +
5077 boost::lexical_cast<string>(regionId));
5080 (*collectionIter).second;
5081 auto conditionMapIter = bndCondMap->find(variable);
5082 ASSERTL1(conditionMapIter != bndCondMap->end(),
5083 "Unable to locate condition map.");
5086 (*conditionMapIter).second;
5088 return boundaryCondition;
5093 boost::ignore_unused(n);
5095 "This method is not defined or valid for this class type");
5106 vector<std::pair<LocalRegions::ExpansionSharedPtr, int>>>
5132 if (
m_graph->GetMeshDimension() == (*
m_exp)[0]->GetShapeDimension())
5138 bool verbose = (
m_session->DefinesCmdLineArgument(
"verbose")) &&
5142 : 2 *
m_exp->size());
5150 for (
int i = 0; i <
m_exp->size(); ++i)
5152 collections[(*m_exp)[i]->DetShapeType()].push_back(
5153 std::pair<LocalRegions::ExpansionSharedPtr, int>((*
m_exp)[i], i));
5156 for (
auto &it : collections)
5162 vector<StdRegions::StdExpansionSharedPtr> collExp;
5173 if (it.second.size() == 1)
5175 collExp.push_back(it.second[0].first);
5182 if (collExp.size() > collsize)
5186 collsize = collExp.size();
5196 collExp.push_back(it.second[0].first);
5197 int prevnCoeff = it.second[0].first->GetNcoeffs();
5198 int prevnPhys = it.second[0].first->GetTotPoints();
5200 it.second[0].first->GetMetricInfo()->GetGtype() ==
5204 for (
int i = 1; i < it.second.size(); ++i)
5206 int nCoeffs = it.second[i].first->GetNcoeffs();
5207 int nPhys = it.second[i].first->GetTotPoints();
5209 it.second[i].first->GetMetricInfo()->GetGtype() ==
5217 if (prevCoeffOffset + nCoeffs != coeffOffset ||
5218 prevnCoeff != nCoeffs ||
5219 prevPhysOffset + nPhys != physOffset ||
5220 prevDeformed != Deformed || prevnPhys != nPhys ||
5229 if (collExp.size() > collsize)
5233 collsize = collExp.size();
5245 collExp.push_back(it.second[i].first);
5250 collExp.push_back(it.second[i].first);
5255 if (i == it.second.size() - 1)
5261 if (collExp.size() > collsize)
5265 collsize = collExp.size();
5276 prevCoeffOffset = coeffOffset;
5277 prevPhysOffset = physOffset;
5278 prevDeformed = Deformed;
5279 prevnCoeff = nCoeffs;
5336 int pt0 = (*m_exp)[i]->GetNumPoints(0);
5337 int pt1 = (*m_exp)[i]->GetNumPoints(1);
5338 int npt0 = (int)pt0 * scale;
5339 int npt1 = (int)pt1 * scale;
5342 npt0, (*
m_exp)[i]->GetPointsType(0));
5344 npt1, (*
m_exp)[i]->GetPointsType(1));
5348 (*
m_exp)[i]->GetBasis(1)->GetPointsKey(),
5349 &inarray[cnt], newPointsKey0,
5350 newPointsKey1, &outarray[cnt1]);
5353 cnt1 += npt0 * npt1;
5362 int pt0 = (*m_exp)[i]->GetNumPoints(0);
5363 int pt1 = (*m_exp)[i]->GetNumPoints(1);
5364 int pt2 = (*m_exp)[i]->GetNumPoints(2);
5365 int npt0 = (int)pt0 * scale;
5366 int npt1 = (int)pt1 * scale;
5367 int npt2 = (int)pt2 * scale;
5370 npt0, (*
m_exp)[i]->GetPointsType(0));
5372 npt1, (*
m_exp)[i]->GetPointsType(1));
5374 npt2, (*
m_exp)[i]->GetPointsType(2));
5378 (*
m_exp)[i]->GetBasis(1)->GetPointsKey(),
5379 (*
m_exp)[i]->GetBasis(2)->GetPointsKey(),
5380 &inarray[cnt], newPointsKey0,
5381 newPointsKey1, newPointsKey2,
5384 cnt += pt0 * pt1 * pt2;
5385 cnt1 += npt0 * npt1 * npt2;
5402 boost::ignore_unused(FwdFlux, BwdFlux, outarray);
5410 int nTotElmt = (*m_exp).size();
5411 int nElmtPnt = (*m_exp)[0]->GetTotPoints();
5412 int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
5417 for (
int nelmt = 0; nelmt < nTotElmt; nelmt++)
5419 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5420 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5422 if (tmpPhys.size() != nElmtPnt || tmpCoef.size() != nElmtCoef)
5428 for (
int ncl = 0; ncl < nElmtPnt; ncl++)
5430 tmpPhys[ncl] = inarray[nelmt][ncl];
5432 (*m_exp)[nelmt]->IProductWRTDerivBase(nDirctn, tmpPhys, tmpCoef);
5434 for (
int nrw = 0; nrw < nElmtCoef; nrw++)
5436 (*mtxPerVar[nelmt])(nrw, ncl) = tmpCoef[nrw];
5447 int nTotElmt = (*m_exp).size();
5449 int nspacedim =
m_graph->GetSpaceDimension();
5458 int nElmtPntPrevious = 0;
5459 int nElmtCoefPrevious = 0;
5461 int nElmtPnt, nElmtCoef;
5462 for (
int nelmt = 0; nelmt < nTotElmt; nelmt++)
5464 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5465 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5468 if (nElmtPntPrevious != nElmtPnt || nElmtCoefPrevious != nElmtCoef ||
5469 (ElmtTypeNow != ElmtTypePrevious))
5471 if (nElmtPntPrevious != nElmtPnt)
5473 for (
int ndir = 0; ndir < nspacedim; ndir++)
5480 stdExp = (*m_exp)[nelmt]->GetStdExp();
5482 stdExp->DetShapeType(), *stdExp);
5484 ArrayStdMat[0] = stdExp->GetStdMatrix(matkey);
5485 ArrayStdMat_data[0] = ArrayStdMat[0]->GetPtr();
5492 ArrayStdMat[1] = stdExp->GetStdMatrix(matkey);
5493 ArrayStdMat_data[1] = ArrayStdMat[1]->GetPtr();
5498 stdExp->DetShapeType(),
5501 ArrayStdMat[2] = stdExp->GetStdMatrix(matkey);
5502 ArrayStdMat_data[2] = ArrayStdMat[2]->GetPtr();
5506 ElmtTypePrevious = ElmtTypeNow;
5507 nElmtPntPrevious = nElmtPnt;
5508 nElmtCoefPrevious = nElmtCoef;
5512 for (
int ndir = 0; ndir < nspacedim; ndir++)
5518 for (
int ndir = 0; ndir < nspacedim; ndir++)
5520 (*m_exp)[nelmt]->AlignVectorToCollapsedDir(
5521 ndir, inarray[ndir][nelmt], tmppnts);
5522 for (
int n = 0; n < nspacedim; n++)
5524 Vmath::Vadd(nElmtPnt, tmppnts[n], 1, projectedpnts[n], 1,
5525 projectedpnts[n], 1);
5529 for (
int ndir = 0; ndir < nspacedim; ndir++)
5532 (*m_exp)[nelmt]->MultiplyByQuadratureMetric(projectedpnts[ndir],
5533 projectedpnts[ndir]);
5536 for (
int np = 0; np < nElmtPnt; np++)
5538 NekDouble factor = projectedpnts[ndir][np];
5539 clmnArray = MatDataArray + np * nElmtCoef;
5540 clmnStdMatArray = ArrayStdMat_data[ndir] + np * nElmtCoef;
5541 Vmath::Svtvp(nElmtCoef, factor, clmnStdMatArray, 1, clmnArray,
5554 int nElmtPntPrevious = 0;
5555 int nElmtCoefPrevious = 0;
5556 int nTotElmt = (*m_exp).size();
5557 int nElmtPnt = (*m_exp)[0]->GetTotPoints();
5558 int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
5564 for (
int nelmt = 0; nelmt < nTotElmt; nelmt++)
5566 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5567 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5570 if (nElmtPntPrevious != nElmtPnt || nElmtCoefPrevious != nElmtCoef ||
5571 (ElmtTypeNow != ElmtTypePrevious))
5574 stdExp = (*m_exp)[nelmt]->GetStdExp();
5576 stdExp->DetShapeType(), *stdExp);
5579 stdMat_data = BwdMat->GetPtr();
5581 if (nElmtPntPrevious != nElmtPnt)
5586 ElmtTypePrevious = ElmtTypeNow;
5587 nElmtPntPrevious = nElmtPnt;
5588 nElmtCoefPrevious = nElmtCoef;
5591 (*m_exp)[nelmt]->MultiplyByQuadratureMetric(
5597 for (
int np = 0; np < nElmtPnt; np++)
5600 clmnArray = MatDataArray + np * nElmtCoef;
5601 clmnStdMatArray = stdMat_data + np * nElmtCoef;
5602 Vmath::Smul(nElmtCoef, factor, clmnStdMatArray, 1, clmnArray, 1);
5626 std::shared_ptr<LocalRegions::ExpansionVector> traceExp =
5627 tracelist->GetExp();
5628 int ntotTrace = (*traceExp).size();
5629 int nTracePnt, nTraceCoef;
5631 std::shared_ptr<LocalRegions::ExpansionVector> fieldExp =
GetExp();
5637 locTraceToTraceMap->GetLeftRightAdjacentExpId();
5639 locTraceToTraceMap->GetLeftRightAdjacentExpFlag();
5642 locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffMap();
5644 locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffSign();
5649 int MatIndex, nPnts;
5652 int nTracePntsTtl = tracelist->GetTotPoints();
5653 int nlocTracePts = locTraceToTraceMap->GetNLocTracePts();
5654 int nlocTracePtsFwd = locTraceToTraceMap->GetNFwdLocTracePts();
5655 int nlocTracePtsBwd = nlocTracePts - nlocTracePtsFwd;
5658 nlocTracePtsLR[0] = nlocTracePtsFwd;
5659 nlocTracePtsLR[1] = nlocTracePtsBwd;
5661 size_t nFwdBwdNonZero = 0;
5663 for (
int i = 0; i < 2; ++i)
5665 if (nlocTracePtsLR[i] > 0)
5667 tmpIndex[nFwdBwdNonZero] = i;
5673 for (
int i = 0; i < nFwdBwdNonZero; ++i)
5675 nlocTracePtsNonZeroIndex[i] = tmpIndex[i];
5681 for (
int k = 0; k < 2; ++k)
5686 for (
int k = 0; k < nFwdBwdNonZero; ++k)
5688 size_t i = nlocTracePtsNonZeroIndex[k];
5692 int nNumbElmt = fieldMat.size();
5695 for (
int i = 0; i < nNumbElmt; i++)
5697 ElmtMatDataArray[i] = fieldMat[i]->GetPtr();
5701 int nTraceCoefMax = 0;
5702 int nTraceCoefMin = std::numeric_limits<int>::max();
5708 for (
int nt = 0; nt < ntotTrace; nt++)
5710 nTraceCoef = (*traceExp)[nt]->GetNcoeffs();
5711 nTracePnt = tracelist->GetTotPoints(nt);
5712 int noffset = tracelist->GetPhys_Offset(nt);
5713 TraceCoefArray[nt] = nTraceCoef;
5714 TracePntArray[nt] = nTracePnt;
5715 TraceOffArray[nt] = noffset;
5716 FwdMatData[nt] = FwdMat[nt]->GetPtr();
5717 BwdMatData[nt] = BwdMat[nt]->GetPtr();
5718 if (nTraceCoef > nTraceCoefMax)
5720 nTraceCoefMax = nTraceCoef;
5722 if (nTraceCoef < nTraceCoefMin)
5724 nTraceCoefMin = nTraceCoef;
5727 WARNINGL1(nTraceCoefMax == nTraceCoefMin,
5728 "nTraceCoefMax!=nTraceCoefMin: Effeciency may be low ");
5730 int traceID, nfieldPnts, ElmtId, noffset;
5732 locTraceToTraceMap->GetLocTracephysToTraceIDMap();
5734 locTraceToTraceMap->GetLocTraceToFieldMap();
5737 for (
int k = 0; k < nFwdBwdNonZero; ++k)
5739 size_t i = nlocTracePtsNonZeroIndex[k];
5741 Vmath::Vcopy(nlocTracePtsLR[i], &fieldToLocTraceMap[0] + noffset, 1,
5742 &fieldToLocTraceMapLR[i][0], 1);
5743 noffset += nlocTracePtsLR[i];
5747 for (
int k = 0; k < nFwdBwdNonZero; ++k)
5749 size_t nlr = nlocTracePtsNonZeroIndex[k];
5751 for (
int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
5753 traceID = LocTracephysToTraceIDMap[nlr][nloc];
5754 nTraceCoef = TraceCoefArray[traceID];
5755 ElmtId = LRAdjExpid[nlr][traceID];
5757 nElmtCoef = ElmtCoefArray[ElmtId];
5758 nfieldPnts = fieldToLocTraceMapLR[nlr][nloc];
5759 nPnts = nfieldPnts - noffset;
5761 MatIndexArray[nlr][nloc] = nPnts * nElmtCoef;
5765 for (
int nc = 0; nc < nTraceCoefMin; nc++)
5767 for (
int nt = 0; nt < ntotTrace; nt++)
5769 nTraceCoef = TraceCoefArray[nt];
5770 nTracePnt = TracePntArray[nt];
5771 noffset = TraceOffArray[nt];
5772 Vmath::Vcopy(nTracePnt, &FwdMatData[nt][nc], nTraceCoef,
5773 &TraceFwdPhy[noffset], 1);
5774 Vmath::Vcopy(nTracePnt, &BwdMatData[nt][nc], nTraceCoef,
5775 &TraceBwdPhy[noffset], 1);
5778 for (
int k = 0; k < nFwdBwdNonZero; ++k)
5780 size_t i = nlocTracePtsNonZeroIndex[k];
5781 Vmath::Zero(nlocTracePtsLR[i], tmplocTrace[i], 1);
5787 for (
int k = 0; k < nFwdBwdNonZero; ++k)
5789 size_t nlr = nlocTracePtsNonZeroIndex[k];
5790 for (
int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
5792 traceID = LocTracephysToTraceIDMap[nlr][nloc];
5793 nTraceCoef = TraceCoefArray[traceID];
5794 ElmtId = LRAdjExpid[nlr][traceID];
5795 nrwAdjExp = elmtLRMap[nlr][traceID][nc];
5796 sign = elmtLRSign[nlr][traceID][nc];
5797 MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
5799 ElmtMatDataArray[ElmtId][MatIndex] -=
5800 sign * tmplocTrace[nlr][nloc];
5805 for (
int nc = nTraceCoefMin; nc < nTraceCoefMax; nc++)
5807 for (
int nt = 0; nt < ntotTrace; nt++)
5809 nTraceCoef = TraceCoefArray[nt];
5810 nTracePnt = TracePntArray[nt];
5811 noffset = TraceOffArray[nt];
5812 if (nc < nTraceCoef)
5814 Vmath::Vcopy(nTracePnt, &FwdMatData[nt][nc], nTraceCoef,
5815 &TraceFwdPhy[noffset], 1);
5816 Vmath::Vcopy(nTracePnt, &BwdMatData[nt][nc], nTraceCoef,
5817 &TraceBwdPhy[noffset], 1);
5826 for (
int k = 0; k < nFwdBwdNonZero; ++k)
5828 size_t i = nlocTracePtsNonZeroIndex[k];
5829 Vmath::Zero(nlocTracePtsLR[i], tmplocTrace[i], 1);
5834 for (
int k = 0; k < nFwdBwdNonZero; ++k)
5836 size_t nlr = nlocTracePtsNonZeroIndex[k];
5837 for (
int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
5839 traceID = LocTracephysToTraceIDMap[nlr][nloc];
5840 nTraceCoef = TraceCoefArray[traceID];
5841 if (nc < nTraceCoef)
5843 ElmtId = LRAdjExpid[nlr][traceID];
5844 nrwAdjExp = elmtLRMap[nlr][traceID][nc];
5845 sign = -elmtLRSign[nlr][traceID][nc];
5846 MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
5848 ElmtMatDataArray[ElmtId][MatIndex] +=
5849 sign * tmplocTrace[nlr][nloc];
5861 int nelmtcoef, nelmtpnts, nelmtcoef0, nelmtpnts0;
5874 nelmtcoef0 = nelmtcoef;
5875 nelmtpnts0 = nelmtpnts;
5877 for (nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
5882 tmpMatQ = ElmtJacQuad[nelmt];
5883 tmpMatC = ElmtJacCoef[nelmt];
5885 MatQ_data = tmpMatQ->GetPtr();
5886 MatC_data = tmpMatC->GetPtr();
5888 if (nelmtcoef != nelmtcoef0)
5891 nelmtcoef0 = nelmtcoef;
5894 if (nelmtpnts != nelmtpnts0)
5897 nelmtpnts0 = nelmtpnts;
5900 for (
int np = 0; np < nelmtcoef; np++)
5902 Vmath::Vcopy(nelmtpnts, &MatQ_data[0] + np, nelmtcoef, &innarray[0],
5904 (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray, innarray);
5905 (*m_exp)[nelmt]->IProductWRTDerivBase(dir, innarray, outarray);
5907 Vmath::Vadd(nelmtcoef, &outarray[0], 1, &MatC_data[0] + np,
5908 nelmtcoef, &MatC_data[0] + np, nelmtcoef);
5918 int nelmtcoef, nelmtpnts, nelmtcoef0, nelmtpnts0;
5931 nelmtcoef0 = nelmtcoef;
5932 nelmtpnts0 = nelmtpnts;
5934 for (nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
5939 tmpMatQ = ElmtJacQuad[nelmt];
5940 tmpMatC = ElmtJacCoef[nelmt];
5942 MatQ_data = tmpMatQ->GetPtr();
5943 MatC_data = tmpMatC->GetPtr();
5945 if (nelmtcoef != nelmtcoef0)
5948 nelmtcoef0 = nelmtcoef;
5951 if (nelmtpnts != nelmtpnts0)
5954 nelmtpnts0 = nelmtpnts;
5957 for (
int np = 0; np < nelmtcoef; np++)
5959 Vmath::Vcopy(nelmtpnts, &MatQ_data[0] + np, nelmtcoef, &innarray[0],
5961 (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray, innarray);
5962 (*m_exp)[nelmt]->IProductWRTBase(innarray, outarray);
5964 Vmath::Vadd(nelmtcoef, &outarray[0], 1, &MatC_data[0] + np,
5965 nelmtcoef, &MatC_data[0] + np, nelmtcoef);
5985 int pt0 = (*m_exp)[i]->GetNumPoints(0);
5986 int pt1 = (*m_exp)[i]->GetNumPoints(1);
5987 int npt0 = (int)pt0 * scale;
5988 int npt1 = (int)pt1 * scale;
5991 npt0, (*
m_exp)[i]->GetPointsType(0));
5993 npt1, (*
m_exp)[i]->GetPointsType(1));
5997 newPointsKey0, newPointsKey1, &inarray[cnt],
5998 (*
m_exp)[i]->GetBasis(0)->GetPointsKey(),
5999 (*
m_exp)[i]->GetBasis(1)->GetPointsKey(), &outarray[cnt1]);
6011 int pt0 = (*m_exp)[i]->GetNumPoints(0);
6012 int pt1 = (*m_exp)[i]->GetNumPoints(1);
6013 int pt2 = (*m_exp)[i]->GetNumPoints(2);
6014 int npt0 = (int)pt0 * scale;
6015 int npt1 = (int)pt1 * scale;
6016 int npt2 = (int)pt2 * scale;
6019 npt0, (*
m_exp)[i]->GetPointsType(0));
6021 npt1, (*
m_exp)[i]->GetPointsType(1));
6023 npt2, (*
m_exp)[i]->GetPointsType(2));
6027 newPointsKey0, newPointsKey1, newPointsKey2, &inarray[cnt],
6028 (*
m_exp)[i]->GetBasis(0)->GetPointsKey(),
6029 (*
m_exp)[i]->GetBasis(1)->GetPointsKey(),
6030 (*
m_exp)[i]->GetBasis(2)->GetPointsKey(), &outarray[cnt1]);
6032 cnt += npt0 * npt1 * npt2;
6033 cnt1 += pt0 * pt1 * pt2;
#define WARNINGL1(condition, msg)
#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 LIKWID_MARKER_START(regionTag)
#define LIKWID_MARKER_STOP(regionTag)
#define sign(a, b)
return the sign(b)*a
COLLECTIONS_EXPORT OperatorImpMap SetWithTimings(std::vector< StdRegions::StdExpansionSharedPtr > pGeom, OperatorImpMap &impTypes, bool verbose=true)
unsigned int GetMaxCollectionSize()
COLLECTIONS_EXPORT void UpdateOptFile(std::string sessName, LibUtilities::CommSharedPtr &comm)
COLLECTIONS_EXPORT OperatorImpMap GetOperatorImpMap(StdRegions::StdExpansionSharedPtr pExp)
Get Operator Implementation Map from XMl or using default;.
Describes the specification for a Basis.
int GetNumPoints() const
Return points order at which basis is defined.
BasisType GetBasisType() const
Return type of expansion basis.
PointsKey GetPointsKey() const
Return distribution of points.
int GetNumModes() const
Returns the order of the basis.
static const std::string GetFileType(const std::string &filename, CommSharedPtr comm)
Determine file type of given input file.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
Defines a specification for a set of points.
void AccumulateRegion(std::string, int iolevel=0)
Accumulate elapsed time for a region.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Base class for all multi-elemental spectral/hp expansions.
virtual void v_Reset()
Reset geometry information, metrics, matrix managers and geometry information.
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
void AddTraceJacToElmtJac(const Array< OneD, const DNekMatSharedPtr > &FwdMat, const Array< OneD, const DNekMatSharedPtr > &BwdMat, Array< OneD, DNekMatSharedPtr > &fieldMat)
inverse process of v_GetFwdBwdTracePhys. Given Trace integration of Fwd and Bwd Jacobian,...
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function calculates the inner product of a function with respect to all local expansion modes .
const Array< OneD, const std::shared_ptr< ExpList > > & GetBndCondExpansions()
std::shared_ptr< ExpList > & GetTrace()
int GetNcoeffs(void) const
Returns the total number of local degrees of freedom .
virtual void v_ExtractCoeffsToCoeffs(const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
virtual void v_Upwind(const Array< OneD, const Array< OneD, NekDouble >> &Vec, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
const DNekScalBlkMatSharedPtr & GetBlockMatrix(const GlobalMatrixKey &gkey)
virtual void v_AddFwdBwdTraceIntegral(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > & GetGlobalLinSysManager(void)
ExpList(const ExpansionType Type=eNoType)
The default constructor using a type.
void CreateCollections(Collections::ImplementationType ImpType=Collections::eNoImpType)
Construct collections of elements containing a single element type and polynomial order from the list...
virtual void v_GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
void ExponentialFilter(Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
std::shared_ptr< GlobalMatrix > GenGlobalMatrix(const GlobalMatrixKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
Generates a global matrix from the given key and map.
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void AddRightIPTPhysDerivBase(const int dir, const Array< OneD, const DNekMatSharedPtr > ElmtJacQuad, Array< OneD, DNekMatSharedPtr > ElmtJacCoef)
virtual void v_ExtractTracePhys(Array< OneD, NekDouble > &outarray)
int GetExpIndex(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0, bool returnNearestElmt=false, int cachedId=-1, NekDouble maxDistance=1e6)
This function returns the index of the local elemental expansion containing the arbitrary point given...
virtual GlobalLinSysKey v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const MultiRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
virtual void v_WriteTecplotConnectivity(std::ostream &outfile, int expansion)
BlockMatrixMapShPtr m_blockMat
virtual Array< OneD, const unsigned int > v_GetYIDs(void)
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
multiply the metric jacobi and quadrature weights
void GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
void WriteVtkPieceFooter(std::ostream &outfile, int expansion)
virtual void v_ExtractPhysToBnd(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bnd)
void GetBwdWeight(Array< OneD, NekDouble > &weightAver, Array< OneD, NekDouble > &weightJump)
Get the weight value for boundary conditions for boundary average and jump calculations.
virtual void v_AddTraceIntegralToOffDiag(const Array< OneD, const NekDouble > &FwdFlux, const Array< OneD, const NekDouble > &BwdFlux, Array< OneD, NekDouble > &outarray)
virtual std::vector< bool > & v_GetLeftAdjacentTraces(void)
void InitialiseExpVector(const SpatialDomains::ExpansionInfoMap &expmap)
Define a list of elements using the geometry and basis key information in expmap;.
void SetupCoeffPhys(bool DeclareCoeffPhysArrays=true, bool SetupOffsets=true)
Definition of the total number of degrees of freedom and quadrature points and offsets to access data...
static SpatialDomains::BoundaryConditionShPtr GetBoundaryCondition(const SpatialDomains::BoundaryConditionCollection &collection, unsigned int index, const std::string &variable)
virtual void v_CurlCurl(Array< OneD, Array< OneD, NekDouble >> &Vel, Array< OneD, Array< OneD, NekDouble >> &Q)
virtual void v_PhysDirectionalDeriv(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
virtual void v_GetLocTraceFromTracePts(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &locTraceFwd, Array< OneD, NekDouble > &locTraceBwd)
virtual void v_WriteTecplotHeader(std::ostream &outfile, std::string var="")
virtual std::shared_ptr< ExpList > & v_GetPlane(int n)
int GetCoeff_Offset(int n) const
Get the start offset position for a local contiguous list of coeffs correspoinding to element n.
int GetExpSize(void)
This function returns the number of elements in the expansion.
virtual void v_AddTraceQuadPhysToOffDiag(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
virtual void v_ClearGlobalLinSysManager(void)
virtual void v_UnsetGlobalLinSys(GlobalLinSysKey, bool)
void GeneralGetFieldDefinitions(std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef, int NumHomoDir=0, Array< OneD, LibUtilities::BasisSharedPtr > &HomoBasis=LibUtilities::NullBasisSharedPtr1DArray, std::vector< NekDouble > &HomoLen=LibUtilities::NullNekDoubleVector, bool homoStrips=false, std::vector< unsigned int > &HomoSIDs=LibUtilities::NullUnsignedIntVector, std::vector< unsigned int > &HomoZIDs=LibUtilities::NullUnsignedIntVector, std::vector< unsigned int > &HomoYIDs=LibUtilities::NullUnsignedIntVector)
virtual void v_GetPeriodicEntities(PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces)
void IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function calculates the inner product of a function with respect to the derivative (in directio...
virtual void v_LocalToGlobal(bool UseComm)
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions()
virtual LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > & v_GetGlobalLinSysManager(void)
virtual ~ExpList()
The default destructor.
virtual void v_FwdTransLocalElmt(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
int GetPoolCount(std::string)
virtual void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
virtual void v_EvaluateBoundaryConditions(const NekDouble time=0.0, const std::string varName="", const NekDouble x2_in=NekConstants::kNekUnsetDouble, const NekDouble x3_in=NekConstants::kNekUnsetDouble)
void ClearGlobalLinSysManager(void)
virtual const std::vector< bool > & v_GetLeftAdjacentFaces(void) const
virtual void v_GetNormals(Array< OneD, Array< OneD, NekDouble >> &normals)
Populate normals with the normals of all expansions.
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
virtual NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble >> &inarray)
std::shared_ptr< AssemblyMapDG > & GetTraceMap(void)
size_t GetNumElmts(void)
This function returns the number of elements in the expansion which may be different for a homogeoeno...
virtual std::shared_ptr< AssemblyMapDG > & v_GetTraceMap()
Array< OneD, std::pair< int, int > > m_coeffsToElmt
m_coeffs to elemental value map
virtual void v_GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
NekDouble PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &phys)
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
virtual void v_ExtractDataToCoeffs(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs, std::unordered_map< int, int > zIdToPlane)
Extract data from raw field data into expansion list.
virtual std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo(void)
virtual const Array< OneD, const int > & v_GetTraceBndMap()
virtual GlobalLinSysKey v_LinearAdvectionDiffusionReactionSolve(const Array< OneD, Array< OneD, NekDouble >> &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
virtual Array< OneD, const NekDouble > v_HomogeneousEnergy(void)
virtual NekDouble v_GetHomoLen(void)
const LocTraceToTraceMapSharedPtr & GetLocTraceToTraceMap() const
virtual void v_LinearAdvectionReactionSolve(const Array< OneD, Array< OneD, NekDouble >> &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
virtual Array< OneD, const unsigned int > v_GetZIDs(void)
void ExtractCoeffsToCoeffs(const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
Extract the data from fromField using fromExpList the coeffs using the basic ExpList Elemental expans...
void GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1=NullNekDouble1DArray, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
This function calculates the coordinates of all the elemental quadrature points .
std::shared_ptr< GlobalLinSys > GenGlobalBndLinSys(const GlobalLinSysKey &mkey, const AssemblyMapSharedPtr &locToGloMap)
Generate a GlobalLinSys from information provided by the key "mkey" and the mapping provided in LocTo...
virtual void v_SetBndCondBwdWeight(const int index, const NekDouble value)
void GetMatIpwrtDeriveBase(const Array< OneD, const Array< OneD, NekDouble >> &inarray, const int nDirctn, Array< OneD, DNekMatSharedPtr > &mtxPerVar)
void UnsetGlobalLinSys(GlobalLinSysKey, bool)
virtual void v_SmoothField(Array< OneD, NekDouble > &field)
virtual void v_AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
std::vector< bool > m_collectionsDoInit
Vector of bools to act as an initialise on first call flag.
bool m_physState
The state of the array m_phys.
virtual void v_HomogeneousFwdTrans(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
virtual void v_DealiasedDotProd(const int num_dofs, const Array< OneD, Array< OneD, NekDouble >> &inarray1, const Array< OneD, Array< OneD, NekDouble >> &inarray2, Array< OneD, Array< OneD, NekDouble >> &outarray)
void ExtractCoeffsFromFile(const std::string &fileName, LibUtilities::CommSharedPtr comm, const std::string &varName, Array< OneD, NekDouble > &coeffs)
virtual void v_DealiasedProd(const int num_dofs, const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray)
void AddRightIPTBaseMatrix(const Array< OneD, const DNekMatSharedPtr > ElmtJacQuad, Array< OneD, DNekMatSharedPtr > ElmtJacCoef)
void GetLocTraceFromTracePts(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &locTraceFwd, Array< OneD, NekDouble > &locTraceBwd)
virtual void v_WriteVtkPieceData(std::ostream &outfile, int expansion, std::string var)
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
int GetShapeDimension()
This function returns the dimension of the shape of the element eid.
NekDouble H1(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
Calculates the error of the global spectral/hp element approximation.
std::vector< int > m_coll_phys_offset
Offset of elemental data into the array m_phys.
LibUtilities::CommSharedPtr m_comm
Communicator.
std::shared_ptr< GlobalLinSys > GenGlobalLinSys(const GlobalLinSysKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
This operation constructs the global linear system of type mkey.
void WriteVtkHeader(std::ostream &outfile)
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
void GenerateElementVector(const int ElementID, const NekDouble scalar1, const NekDouble scalar2, Array< OneD, NekDouble > &outarray)
Generate vector v such that v[i] = scalar1 if i is in the element < ElementID. Otherwise,...
std::shared_ptr< DNekMat > GenGlobalMatrixFull(const GlobalLinSysKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
virtual void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
virtual void v_ExtractElmtToBndPhys(const int i, const Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
virtual void v_ExtractPhysToBndElmt(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
virtual void v_AddTraceIntegral(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
virtual void v_FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
virtual void v_PhysGalerkinProjection1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void GeneralMatrixOp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function calculates the result of the multiplication of a matrix of type specified by mkey with ...
virtual void v_SetUpPhysNormals()
: Set up a normal along the trace elements between two elements at elemental level
virtual void v_GlobalToLocal(void)
virtual LibUtilities::TranspositionSharedPtr v_GetTransposition(void)
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
virtual void v_MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_AddTraceQuadPhysToField(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
virtual const Array< OneD, const NekDouble > & v_GetBndCondBwdWeight()
virtual void v_GetMovingFrames(const SpatialDomains::GeomMMF MMFdir, const Array< OneD, const NekDouble > &CircCentre, Array< OneD, Array< OneD, NekDouble >> &outarray)
virtual NekDouble v_L2(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
void WriteVtkFooter(std::ostream &outfile)
void MultiplyByBlockMatrix(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual std::shared_ptr< ExpList > & v_GetTrace()
void GetElmtNormalLength(Array< OneD, NekDouble > &lengthsFwd, Array< OneD, NekDouble > &lengthsBwd)
Get the length of elements in boundary normal direction.
virtual std::vector< LibUtilities::FieldDefinitionsSharedPtr > v_GetFieldDefinitions(void)
std::vector< int > m_coll_coeff_offset
Offset of elemental data into the array m_coeffs.
void IProductWRTDirectionalDerivBase(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Directional derivative along a given direction.
void FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
Fill Bwd with boundary conditions.
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
virtual void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1=NullNekDouble1DArray, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
virtual void v_WriteTecplotField(std::ostream &outfile, int expansion)
virtual void v_FillBndCondFromField(const Array< OneD, NekDouble > coeffs)
std::shared_ptr< ExpList > GetSharedThisPtr()
Returns a shared pointer to the current object.
Collections::CollectionVector m_collections
virtual int v_GetPoolCount(std::string)
virtual void v_PhysInterp1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_HomogeneousBwdTrans(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble >> &normals)
void ApplyGeomInfo()
Apply geometry information to each expansion.
Array< OneD, const unsigned int > GetZIDs(void)
This function returns a vector containing the wave numbers in z-direction associated with the 3D homo...
virtual void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
virtual void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
std::unordered_map< int, int > m_elmtToExpId
Mapping from geometry ID of element to index inside m_exp.
void GetDiagMatIpwrtBase(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, DNekMatSharedPtr > &mtxPerVar)
virtual void v_WriteTecplotZone(std::ostream &outfile, int expansion)
LibUtilities::SessionReaderSharedPtr m_session
Session.
virtual void v_PeriodicBwdCopy(const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
std::map< int, RobinBCInfoSharedPtr > GetRobinBCInfo()
virtual void v_FillBwdWithBoundCond(const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool PutFwdInBwdOnBCs)
void DivideByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Divided by the metric jacobi and quadrature weights.
virtual const Array< OneD, const std::shared_ptr< ExpList > > & v_GetBndCondExpansions(void)
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
virtual void v_SetHomoLen(const NekDouble lhom)
void Upwind(const Array< OneD, const NekDouble > &Vn, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
const DNekScalBlkMatSharedPtr GenBlockMatrix(const GlobalMatrixKey &gkey)
This function assembles the block diagonal matrix of local matrices of the type mtype.
void PhysDeriv(Direction edir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
void MultiplyByElmtInvMass(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function elementally mulplies the coefficient space of Sin my the elemental inverse of the mass ...
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function elementally evaluates the backward transformation of the global spectral/hp element exp...
virtual void v_GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays)
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual std::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i)
int GetPhys_Offset(int n) const
Get the start offset position for a local contiguous list of quadrature points in a full array corres...
virtual const std::shared_ptr< LocTraceToTraceMap > & v_GetLocTraceToTraceMap(void) const
void ExtractDataToCoeffs(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs, std::unordered_map< int, int > zIdToPlane=std::unordered_map< int, int >())
Extract the data in fielddata into the coeffs.
ExpansionType m_expType
Exapnsion type.
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
ExpansionType GetExpType(void)
Returns the type of the expansion.
NekDouble Linf(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
This function calculates the error of the global spectral/hp element approximation.
int GetTotPoints(void) const
Returns the total number of quadrature points m_npoints .
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
Describe a linear system.
GlobalSysSolnType GetGlobalSysSolnType() const
Return the associated solution type.
Describes a matrix with ordering defined by a local to global map.
const StdRegions::ConstFactorMap & GetConstFactors() const
Returns all the constants.
int GetNVarCoeffs() const
LibUtilities::ShapeType GetShapeType() const
Return the expansion type associated with key.
const StdRegions::VarCoeffMap & GetVarCoeffs() const
StdRegions::MatrixType GetMatrixType() const
Return the matrix type.
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
std::map< OperatorType, ImplementationType > OperatorImpMap
void PhysGalerkinProject3D(const BasisKey &fbasis0, const BasisKey &fbasis1, const BasisKey &fbasis2, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, const BasisKey &tbasis2, Array< OneD, NekDouble > &to)
std::shared_ptr< FieldIO > FieldIOSharedPtr
static const BasisKey NullBasisKey(eNoBasisType, 0, NullPointsKey)
Defines a null basis with no type or points.
void Interp1D(const BasisKey &fbasis0, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, Array< OneD, NekDouble > &to)
this function interpolates a 1D function evaluated at the quadrature points of the basis fbasis0 to ...
std::shared_ptr< SessionReader > SessionReaderSharedPtr
void Interp3D(const BasisKey &fbasis0, const BasisKey &fbasis1, const BasisKey &fbasis2, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, const BasisKey &tbasis2, Array< OneD, NekDouble > &to)
this function interpolates a 3D function evaluated at the quadrature points of the 3D basis,...
std::shared_ptr< FieldDefinitions > FieldDefinitionsSharedPtr
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,...
int GetNumberOfCoefficients(ShapeType shape, std::vector< unsigned int > &modes, int offset=0)
FieldIOFactory & GetFieldIOFactory()
Returns the FieldIO factory.
std::shared_ptr< Transposition > TranspositionSharedPtr
@ eNodalTriElec
2D Nodal Electrostatic Points on a Triangle
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
void PhysGalerkinProject2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
@ eGauss_Lagrange
Lagrange Polynomials using the Gauss points.
@ eOrtho_A
Principle Orthogonal Functions .
@ eGLL_Lagrange
Lagrange for SEM basis .
std::shared_ptr< PointExp > PointExpSharedPtr
std::shared_ptr< Expansion > ExpansionSharedPtr
std::shared_ptr< Expansion2D > Expansion2DSharedPtr
std::shared_ptr< Expansion0D > Expansion0DSharedPtr
std::shared_ptr< Expansion1D > Expansion1DSharedPtr
std::shared_ptr< Expansion3D > Expansion3DSharedPtr
std::vector< ExpansionSharedPtr > ExpansionVector
MultiRegions::Direction const DirCartesianMap[]
@ eSIZE_GlobalSysSolnType
void AlignFace(const StdRegions::Orientation orient, const int nquad1, const int nquad2, const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out)
Helper function to re-align face to a given orientation.
static ExpListSharedPtr NullExpListSharedPtr
std::shared_ptr< AssemblyMapCG > AssemblyMapCGSharedPtr
std::shared_ptr< RobinBCInfo > RobinBCInfoSharedPtr
const char *const GlobalSysSolnTypeMap[]
static LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > NullGlobalLinSysManager
std::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
std::shared_ptr< GlobalMatrix > GlobalMatrixSharedPtr
Shared pointer to a GlobalMatrix object.
GlobalLinSysFactory & GetGlobalLinSysFactory()
static LocTraceToTraceMapSharedPtr NullLocTraceToTraceMapSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
static GlobalLinSysKey NullGlobalLinSysKey(StdRegions::eNoMatrixType)
std::shared_ptr< LocTraceToTraceMap > LocTraceToTraceMapSharedPtr
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
std::map< GlobalMatrixKey, DNekScalBlkMatSharedPtr > BlockMatrixMap
A map between global matrix keys and their associated block matrices.
static const NekDouble kNekZeroTol
std::shared_ptr< QuadGeom > QuadGeomSharedPtr
GeomMMF
Principle direction for MMF.
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
std::shared_ptr< PrismGeom > PrismGeomSharedPtr
std::map< int, BoundaryConditionMapShPtr > BoundaryConditionCollection
@ eDeformed
Geometry is curved or has non-constant factors.
std::shared_ptr< HexGeom > HexGeomSharedPtr
std::shared_ptr< SegGeom > SegGeomSharedPtr
std::shared_ptr< PyrGeom > PyrGeomSharedPtr
std::shared_ptr< ExpansionInfo > ExpansionInfoShPtr
std::shared_ptr< TetGeom > TetGeomSharedPtr
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::shared_ptr< BoundaryConditionMap > BoundaryConditionMapShPtr
std::shared_ptr< PointGeom > PointGeomSharedPtr
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
std::shared_ptr< TriGeom > TriGeomSharedPtr
std::shared_ptr< Geometry1D > Geometry1DSharedPtr
std::map< int, ExpansionInfoShPtr > ExpansionInfoMap
std::map< int, CompositeSharedPtr > CompositeMap
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
VarCoeffMap RestrictCoeffMap(const VarCoeffMap &m, size_t offset, size_t cnt)
std::map< ConstFactorType, NekDouble > ConstFactorMap
@ eDir1BwdDir2_Dir2BwdDir1
@ eDir1BwdDir1_Dir2BwdDir2
@ eDir1BwdDir2_Dir2FwdDir1
@ eDir1FwdDir1_Dir2BwdDir2
@ eDir1BwdDir1_Dir2FwdDir2
@ eDir1FwdDir2_Dir2FwdDir1
@ eDir1FwdDir2_Dir2BwdDir1
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
The above copyright notice and this permission notice shall be included.
NekMatrix< NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag >, BlockMatrixTag > DNekScalBlkMat
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::pair< IndexType, IndexType > CoordType
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
@ ePOSITIVE_DEFINITE_SYMMETRIC_BANDED
@ ePOSITIVE_DEFINITE_SYMMETRIC
std::map< CoordType, NekDouble > COOMatType
static Array< OneD, NekDouble > NullNekDouble1DArray
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 Neg(int n, T *x, const int incx)
Negate x = -x.
T Vsum(int n, const T *x, const int incx)
Subtract return sum(x)
void Scatr(int n, const T *x, const int *y, T *z)
Scatter vector z[y[i]] = x[i].
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 Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Zero(int n, T *x, const int incx)
Zero vector.
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
scalarT< T > abs(scalarT< T > in)
scalarT< T > sqrt(scalarT< T > in)
Used to lookup the create function in NekManager.
std::shared_ptr< RobinBCInfo > next