91 : m_expType(type), m_ncoeffs(0), m_npoints(0), m_physState(false),
107 : std::enable_shared_from_this<
ExpList>(in), m_expType(in.m_expType),
109 m_comm(in.m_comm), m_session(in.m_session), m_graph(in.m_graph),
110 m_ncoeffs(in.m_ncoeffs), m_npoints(in.m_npoints), m_physState(false),
111 m_exp(in.m_exp), m_collections(in.m_collections),
112 m_collectionsDoInit(in.m_collectionsDoInit),
113 m_coll_coeff_offset(in.m_coll_coeff_offset),
114 m_coll_phys_offset(in.m_coll_phys_offset),
115 m_coeff_offset(in.m_coeff_offset), m_phys_offset(in.m_phys_offset),
116 m_blockMat(in.m_blockMat), m_WaveSpace(false),
117 m_elmtToExpId(in.m_elmtToExpId)
130 const bool DeclareCoeffPhysArrays,
132 : m_expType(in.m_expType), m_comm(in.m_comm), m_session(in.m_session),
133 m_graph(in.m_graph), m_physState(false),
138 for (
int i = 0; i < eIDs.size(); ++i)
140 (*m_exp).push_back((*(in.
m_exp))[eIDs[i]]);
171 const bool DeclareCoeffPhysArrays,
const std::string &var,
173 : m_comm(pSession->GetComm()), m_session(pSession), m_graph(graph),
181 graph->GetExpansionInfo(var);
213 const bool DeclareCoeffPhysArrays,
215 : m_comm(pSession->GetComm()), m_session(pSession), m_physState(false),
234 : m_expType(
e0D), m_ncoeffs(1), m_npoints(1), m_physState(false),
241 (*m_exp).push_back(
Point);
272 [[maybe_unused]]
const std::string variable,
274 : m_comm(comm), m_session(pSession), m_graph(graph), m_physState(false),
279 int i, j, id, elmtid = 0;
297 for (i = 0; i < bndCond.size(); ++i)
299 if (bndCond[i]->GetBoundaryConditionType() ==
302 for (j = 0; j < bndConstraint[i]->GetExpSize(); ++j)
305 std::dynamic_pointer_cast<LocalRegions::Expansion0D>(
306 bndConstraint[i]->
GetExp(j))))
310 PointGeom = exp0D->GetGeom()->GetVertex(0);
313 tracesDone.insert(PointGeom->GetVid());
315 else if ((exp1D = std::dynamic_pointer_cast<
317 bndConstraint[i]->
GetExp(j))))
322 exp1D->GetBasis(0)->GetBasisKey();
323 segGeom = exp1D->GetGeom1D();
327 tracesDone.insert(segGeom->GetGlobalID());
329 else if ((exp2D = std::dynamic_pointer_cast<
330 LocalRegions::Expansion2D>(
331 bndConstraint[i]->
GetExp(j))))
335 LibUtilities::BasisKey bkey0 =
336 exp2D->GetBasis(0)->GetBasisKey();
337 LibUtilities::BasisKey bkey1 =
338 exp2D->GetBasis(1)->GetBasisKey();
339 FaceGeom = exp2D->GetGeom2D();
342 if ((QuadGeom = std::dynamic_pointer_cast<
343 SpatialDomains::QuadGeom>(FaceGeom)))
346 LocalRegions::QuadExp>::AllocateSharedPtr(bkey0,
349 tracesDone.insert(QuadGeom->GetGlobalID());
352 else if ((TriGeom = std::dynamic_pointer_cast<
353 SpatialDomains::TriGeom>(FaceGeom)))
356 LocalRegions::TriExp>::AllocateSharedPtr(bkey0,
359 tracesDone.insert(TriGeom->GetGlobalID());
365 "proper face geometry failed");
369 exp->SetElmtId(elmtid++);
372 (*m_exp).push_back(exp);
377 map<int, pair<SpatialDomains::Geometry1DSharedPtr, LibUtilities::BasisKey>>
381 pair<LibUtilities::BasisKey, LibUtilities::BasisKey>>>
384 for (i = 0; i < locexp.size(); ++i)
386 if ((exp1D = std::dynamic_pointer_cast<LocalRegions::Expansion1D>(
391 for (j = 0; j < 2; ++j)
393 PointGeom = (exp1D->GetGeom1D())->GetVertex(j);
394 id = PointGeom->GetVid();
397 if (tracesDone.count(
id) != 0)
404 tracesDone.insert(
id);
405 exp->SetElmtId(elmtid++);
406 (*m_exp).push_back(exp);
409 else if ((exp2D = std::dynamic_pointer_cast<LocalRegions::Expansion2D>(
413 for (j = 0; j < locexp[i]->GetNtraces(); ++j)
415 segGeom = exp2D->GetGeom2D()->GetEdge(j);
416 id = segGeom->GetGlobalID();
418 if (tracesDone.count(
id) != 0)
423 auto it = edgeOrders.find(
id);
425 if (it == edgeOrders.end())
427 edgeOrders.insert(std::make_pair(
428 id, std::make_pair(segGeom,
429 locexp[i]->GetTraceBasisKey(j))));
433 LibUtilities::BasisKey edge =
434 locexp[i]->GetTraceBasisKey(j);
435 LibUtilities::BasisKey existing = it->second.second;
437 int np1 = edge.GetNumPoints();
438 int np2 = existing.GetNumPoints();
439 int nm1 = edge.GetNumModes();
440 int nm2 = existing.GetNumModes();
448 if (np2 >= np1 && nm2 >= nm1)
452 else if (np2 <= np1 && nm2 <= nm1)
454 it->second.second = edge;
459 "inappropriate number of points/modes (max"
460 "num of points is not set with max order)");
465 else if ((exp3D = dynamic_pointer_cast<LocalRegions::Expansion3D>(
469 for (j = 0; j < exp3D->GetNtraces(); ++j)
471 FaceGeom = exp3D->GetGeom3D()->GetFace(j);
472 id = FaceGeom->GetGlobalID();
474 if (tracesDone.count(
id) != 0)
478 auto it = faceOrders.find(
id);
480 if (it == faceOrders.end())
484 LibUtilities::BasisKey face_dir0 =
485 locexp[i]->GetTraceBasisKey(j, 0);
486 LibUtilities::BasisKey face_dir1 =
487 locexp[i]->GetTraceBasisKey(j, 1);
492 if (locexp[i]->GetTraceOrient(j) >= 9)
494 std::swap(face_dir0, face_dir1);
497 faceOrders.insert(std::make_pair(
499 std::make_pair(FaceGeom,
500 std::make_pair(face_dir0, face_dir1))));
504 LibUtilities::BasisKey face0 =
505 locexp[i]->GetTraceBasisKey(j, 0);
506 LibUtilities::BasisKey face1 =
507 locexp[i]->GetTraceBasisKey(j, 1);
508 LibUtilities::BasisKey existing0 = it->second.second.first;
509 LibUtilities::BasisKey existing1 = it->second.second.second;
513 int np11 = face0.GetNumPoints();
514 int np12 = face1.GetNumPoints();
515 int np21 = existing0.GetNumPoints();
516 int np22 = existing1.GetNumPoints();
517 int nm11 = face0.GetNumModes();
518 int nm12 = face1.GetNumModes();
519 int nm21 = existing0.GetNumModes();
520 int nm22 = existing1.GetNumModes();
529 if (locexp[i]->GetTraceOrient(j) >= 9)
531 std::swap(np11, np12);
532 std::swap(nm11, nm12);
533 std::swap(face0, face1);
539 if (existing1.GetPointsType() ==
540 LibUtilities::eGaussRadauMAlpha1Beta0)
542 if (face1.GetPointsType() ==
550 if (face1.GetPointsType() ==
551 LibUtilities::eGaussRadauMAlpha1Beta0)
557 if (existing0.GetPointsType() ==
558 LibUtilities::eGaussRadauMAlpha1Beta0)
560 if (face0.GetPointsType() ==
568 if (face0.GetPointsType() ==
569 LibUtilities::eGaussRadauMAlpha1Beta0)
578 if (np22 >= np12 && nm22 >= nm12)
582 else if (np22 <= np12 && nm22 <= nm12)
586 LibUtilities::BasisKey newbkey(
587 existing1.GetBasisType(), nm12,
588 LibUtilities::PointsKey(np12,
589 existing1.GetPointsType()));
590 it->second.second.second = newbkey;
595 "inappropriate number of points/modes (max"
596 "num of points is not set with max order)");
599 if (np21 >= np11 && nm21 >= nm11)
603 else if (np21 <= np11 && nm21 <= nm11)
607 LibUtilities::PointsKey newpkey(
608 np11, existing0.GetPointsType());
609 LibUtilities::BasisKey newbkey(existing0.GetBasisType(),
611 it->second.second.first = newbkey;
616 "inappropriate number of points/modes (max"
617 "num of points is not set with max order)");
624 int nproc =
m_comm->GetRowComm()->GetSize();
625 int tracepr =
m_comm->GetRowComm()->GetRank();
632 for (i = 0; i < locexp.size(); ++i)
634 tCnt += locexp[i]->GetNtraces();
639 Array<OneD, int> tracesCnt(nproc, 0);
640 tracesCnt[tracepr] = tCnt;
644 int totTraceCnt =
Vmath::Vsum(nproc, tracesCnt, 1);
645 Array<OneD, int> tTotOffsets(nproc, 0);
647 for (i = 1; i < nproc; ++i)
649 tTotOffsets[i] = tTotOffsets[i - 1] + tracesCnt[i - 1];
654 Array<OneD, int> TracesTotID(totTraceCnt, 0);
655 Array<OneD, int> TracesTotNm0(totTraceCnt, 0);
656 Array<OneD, int> TracesTotNm1(totTraceCnt, 0);
657 Array<OneD, int> TracesTotPnts0(totTraceCnt, 0);
658 Array<OneD, int> TracesTotPnts1(totTraceCnt, 0);
659 Array<OneD, int> TracesPointsType0(totTraceCnt, 0);
660 Array<OneD, int> TracesPointsType1(totTraceCnt, 0);
671 int cntr = tTotOffsets[tracepr];
673 for (i = 0; i < locexp.size(); ++i)
675 if ((exp2D = locexp[i]->as<LocalRegions::Expansion2D>()))
677 int nedges = locexp[i]->GetNtraces();
679 for (j = 0; j < nedges; ++j, ++cntr)
681 LibUtilities::BasisKey bkeyEdge =
682 locexp[i]->GetTraceBasisKey(j);
683 TracesTotID[cntr] = exp2D->GetGeom2D()->GetEid(j);
684 TracesTotNm0[cntr] = bkeyEdge.GetNumModes();
685 TracesTotPnts0[cntr] = bkeyEdge.GetNumPoints();
686 TracesPointsType0[cntr] =
687 static_cast<int>(bkeyEdge.GetPointsType());
692 else if ((exp3D = locexp[i]->as<LocalRegions::Expansion3D>()))
694 int nfaces = locexp[i]->GetNtraces();
696 for (j = 0; j < nfaces; ++j, ++cntr)
698 LibUtilities::BasisKey face_dir0 =
699 locexp[i]->GetTraceBasisKey(j, 0);
700 LibUtilities::BasisKey face_dir1 =
701 locexp[i]->GetTraceBasisKey(j, 1);
706 if (locexp[i]->GetTraceOrient(j) >= 9)
708 std::swap(face_dir0, face_dir1);
711 TracesTotID[cntr] = exp3D->GetGeom3D()->GetFid(j);
712 TracesTotNm0[cntr] = face_dir0.GetNumModes();
713 TracesTotNm1[cntr] = face_dir1.GetNumModes();
714 TracesTotPnts0[cntr] = face_dir0.GetNumPoints();
715 TracesTotPnts1[cntr] = face_dir1.GetNumPoints();
716 TracesPointsType0[cntr] =
717 static_cast<int>(face_dir0.GetPointsType());
718 TracesPointsType1[cntr] =
719 static_cast<int>(face_dir1.GetPointsType());
726 m_comm->GetRowComm()->AllReduce(TracesTotPnts0,
728 m_comm->GetRowComm()->AllReduce(TracesPointsType0,
732 m_comm->GetRowComm()->AllReduce(TracesTotNm1,
734 m_comm->GetRowComm()->AllReduce(TracesTotPnts1,
736 m_comm->GetRowComm()->AllReduce(TracesPointsType1,
744 if (edgeOrders.size())
746 for (i = 0; i < totTraceCnt; ++i)
748 auto it = edgeOrders.find(TracesTotID[i]);
750 if (it == edgeOrders.end())
755 LibUtilities::BasisKey existing = it->second.second;
757 int np1 = TracesTotPnts0[i];
758 int np2 = existing.GetNumPoints();
759 int nm1 = TracesTotNm0[i];
760 int nm2 = existing.GetNumModes();
764 if (np2 >= np1 && nm2 >= nm1)
768 else if (np2 <= np1 && nm2 <= nm1)
772 LibUtilities::BasisKey newbkey(
773 existing.GetBasisType(), nm1,
774 LibUtilities::PointsKey(np1, existing.GetPointsType()));
775 it->second.second = newbkey;
780 "inappropriate number of points/modes (max "
781 "num of points is not set with max order)");
785 else if (faceOrders.size())
787 for (i = 0; i < totTraceCnt; ++i)
789 auto it = faceOrders.find(TracesTotID[i]);
791 if (it == faceOrders.end())
796 LibUtilities::BasisKey existing0 = it->second.second.first;
797 LibUtilities::BasisKey existing1 = it->second.second.second;
801 int np11 = TracesTotPnts0[i];
802 int np12 = TracesTotPnts1[i];
803 int np21 = existing0.GetNumPoints();
804 int np22 = existing1.GetNumPoints();
805 int nm11 = TracesTotNm0[i];
806 int nm12 = TracesTotNm1[i];
807 int nm21 = existing0.GetNumModes();
808 int nm22 = existing1.GetNumModes();
813 if (existing1.GetPointsType() ==
814 LibUtilities::eGaussRadauMAlpha1Beta0)
817 TracesPointsType1[i]) ==
826 TracesPointsType1[i]) ==
827 LibUtilities::eGaussRadauMAlpha1Beta0)
833 if (existing0.GetPointsType() ==
834 LibUtilities::eGaussRadauMAlpha1Beta0)
837 TracesPointsType0[i]) ==
846 TracesPointsType0[i]) ==
847 LibUtilities::eGaussRadauMAlpha1Beta0)
856 if (np22 >= np12 && nm22 >= nm12)
860 else if (np22 <= np12 && nm22 <= nm12)
862 LibUtilities::BasisKey newbkey(
863 existing1.GetBasisType(), nm12,
864 LibUtilities::PointsKey(np12,
865 existing1.GetPointsType()));
866 it->second.second.second = newbkey;
871 "inappropriate number of points/modes (max "
872 "num of points is not set with max order)");
875 if (np21 >= np11 && nm21 >= nm11)
879 else if (np21 <= np11 && nm21 <= nm11)
881 LibUtilities::BasisKey newbkey(
882 existing0.GetBasisType(), nm11,
883 LibUtilities::PointsKey(np11,
884 existing0.GetPointsType()));
885 it->second.second.first = newbkey;
890 "inappropriate number of points/modes (max"
891 "num of points is not set with max order)");
897 if (edgeOrders.size())
899 for (
auto &it : edgeOrders)
902 it.second.second, it.second.first);
903 exp->SetElmtId(elmtid++);
904 (*m_exp).push_back(exp);
909 for (
auto &it : faceOrders)
911 FaceGeom = it.second.first;
913 if ((QuadGeom = std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
917 it.second.second.first, it.second.second.second, QuadGeom);
920 std::dynamic_pointer_cast<SpatialDomains::TriGeom>(
924 it.second.second.first, it.second.second.second, TriGeom);
926 exp->SetElmtId(elmtid++);
927 (*m_exp).push_back(exp);
944 for (
int i = (*m_exp).size() - 1; i >= 0; --i)
966 const bool DeclareCoeffPhysArrays,
967 [[maybe_unused]]
const std::string variable,
969 : m_comm(pSession->GetComm()), m_session(pSession), m_graph(graph),
975 int i, j, elmtid = 0;
990 for (i = 0; i < locexp.size(); ++i)
992 if ((exp1D = std::dynamic_pointer_cast<LocalRegions::Expansion1D>(
997 for (j = 0; j < 2; ++j)
999 PointGeom = (exp1D->GetGeom1D())->GetVertex(j);
1003 exp->SetElmtId(elmtid++);
1004 (*m_exp).push_back(exp);
1007 else if ((exp2D = std::dynamic_pointer_cast<LocalRegions::Expansion2D>(
1012 locexp[i]->GetBasis(0)->GetBasisKey();
1014 for (j = 0; j < locexp[i]->GetNtraces(); ++j)
1016 segGeom = exp2D->GetGeom2D()->GetEdge(j);
1018 int dir = exp2D->GetGeom2D()->GetDir(j);
1020 if (locexp[i]->GetNtraces() == 3)
1023 locexp[i]->GetBasis(dir)->GetBasisKey();
1037 locexp[i]->GetBasis(dir)->GetBasisKey(), segGeom);
1040 exp->SetElmtId(elmtid++);
1041 (*m_exp).push_back(exp);
1044 else if ((exp3D = dynamic_pointer_cast<LocalRegions::Expansion3D>(
1050 locexp[i]->GetBasis(0)->GetBasisKey();
1052 locexp[i]->GetBasis(1)->GetBasisKey();
1054 for (j = 0; j < exp3D->GetNtraces(); ++j)
1056 FaceGeom = exp3D->GetGeom3D()->GetFace(j);
1058 int dir0 = exp3D->GetGeom3D()->GetDir(j, 0);
1059 int dir1 = exp3D->GetGeom3D()->GetDir(j, 1);
1062 locexp[i]->GetBasis(dir0)->GetBasisKey();
1064 locexp[i]->GetBasis(dir1)->GetBasisKey();
1067 std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
1072 face_dir0, face_dir1, QuadGeom);
1074 else if ((TriGeom = std::dynamic_pointer_cast<
1085 nface_dir0, nface_dir1, TriGeom);
1087 exp->SetElmtId(elmtid++);
1088 (*m_exp).push_back(exp);
1128 const bool DeclareCoeffPhysArrays,
const std::string variable,
1129 bool SetToOneSpaceDimension,
1132 : m_comm(comm), m_session(pSession), m_graph(graph), m_physState(false),
1147 int meshdim = graph->GetMeshDimension();
1151 graph->GetExpansionInfo(variable);
1155 for (
auto &compIt : domain)
1158 for (j = 0; j < compIt.second->m_geomVec.size(); ++j)
1160 if ((PtGeom = std::dynamic_pointer_cast<SpatialDomains::PointGeom>(
1161 compIt.second->m_geomVec[j])))
1169 std::dynamic_pointer_cast<SpatialDomains::SegGeom>(
1170 compIt.second->m_geomVec[j])))
1180 auto expIt = expansions.find(SegGeom->GetGlobalID());
1181 ASSERTL0(expIt != expansions.end(),
1182 "Failed to find basis key");
1183 bkey = expIt->second->m_basisKeyVector[0];
1189 graph->GetElementsFromEdge(SegGeom);
1195 int edge_id = elmts->at(0).second;
1197 graph->GetExpansionInfo(geom, variable);
1207 else if (geom->GetShapeType() ==
1216 "Fail to cast geom to a known 2D shape.");
1220 bkey = elmtStdExp->GetTraceBasisKey(edge_id);
1223 if (SetToOneSpaceDimension)
1226 SegGeom->GenerateOneSpaceDimGeom();
1230 bkey, OneDSegmentGeom);
1240 std::dynamic_pointer_cast<SpatialDomains::TriGeom>(
1241 compIt.second->m_geomVec[j])))
1247 graph->GetElementsFromFace(TriGeom);
1252 int face_id = elmts->at(0).second;
1254 graph->GetExpansionInfo(geom, variable);
1280 "Fail to cast geom to a known 3D shape.");
1285 elmtStdExp->GetTraceBasisKey(face_id, 0);
1287 elmtStdExp->GetTraceBasisKey(face_id, 1);
1289 if (geom->GetForient(face_id) >= 9)
1291 std::swap(TriBa, TriBb);
1294 if (graph->GetExpansionInfo()
1296 ->second->m_basisKeyVector[0]
1312 TriBa, TriBb, TriGeom);
1315 else if ((QuadGeom =
1316 std::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
1317 compIt.second->m_geomVec[j])))
1323 graph->GetElementsFromFace(QuadGeom);
1328 int face_id = elmts->at(0).second;
1330 graph->GetExpansionInfo(geom, variable);
1356 "Fail to cast geom to a known 3D shape.");
1361 elmtStdExp->GetTraceBasisKey(face_id, 0);
1363 elmtStdExp->GetTraceBasisKey(face_id, 1);
1365 if (geom->GetForient(face_id) >= 9)
1367 std::swap(QuadBa, QuadBb);
1371 QuadBa, QuadBb, QuadGeom);
1376 "dynamic cast to a Geom (possibly 3D) failed");
1379 exp->SetElmtId(elmtid++);
1380 (*m_exp).push_back(exp);
1415 for (i = 0; i <
m_exp->size(); ++i)
1420 m_npoints += (*m_exp)[i]->GetTotPoints();
1424 if (DeclareCoeffPhysArrays)
1432 for (
int i = 0; i <
m_exp->size(); ++i)
1436 int loccoeffs = (*m_exp)[i]->GetNcoeffs();
1438 for (
int j = 0; j < loccoeffs; ++j)
1462 for (
auto &expIt : expmap)
1466 switch (expInfo->m_basisKeyVector.size())
1471 "Cannot mix expansion dimensions in one vector");
1475 std::dynamic_pointer_cast<SpatialDomains::SegGeom>(
1476 expInfo->m_geomShPtr)))
1488 "dynamic cast to a 1D Geom failed");
1495 "Cannot mix expansion dimensions in one vector");
1502 std::dynamic_pointer_cast<SpatialDomains ::TriGeom>(
1503 expInfo->m_geomShPtr)))
1523 else if ((QuadrilateralGeom = std::dynamic_pointer_cast<
1528 Ba, Bb, QuadrilateralGeom);
1533 "dynamic cast to a 2D Geom failed");
1540 "Cannot mix expansion dimensions in one vector");
1548 std::dynamic_pointer_cast<SpatialDomains::TetGeom>(
1549 expInfo->m_geomShPtr)))
1555 "LocalRegions::NodalTetExp is not implemented "
1565 else if ((PrismGeom = std::dynamic_pointer_cast<
1566 SpatialDomains ::PrismGeom>(
1567 expInfo->m_geomShPtr)))
1573 else if ((PyrGeom = std::dynamic_pointer_cast<
1578 Ba, Bb, Bc, PyrGeom);
1580 else if ((HexGeom = std::dynamic_pointer_cast<
1585 Ba, Bb, Bc, HexGeom);
1590 "dynamic cast to a Geom failed");
1596 "Dimension of basis key is greater than 3");
1600 exp->SetElmtId(
id++);
1603 (*m_exp).push_back(exp);
1633 int nrows = blockmat->GetRows();
1634 int ncols = blockmat->GetColumns();
1641 out = (*blockmat) * in;
1653 for (
int i = 0; i < (*m_exp).size(); ++i)
1655 (*m_exp)[i]->MultiplyByQuadratureMetric(inarray +
m_phys_offset[i],
1656 e_outarray = outarray +
1670 for (
int i = 0; i < (*m_exp).size(); ++i)
1672 (*m_exp)[i]->DivideByQuadratureMetric(inarray +
m_phys_offset[i],
1698 for (i = 0; i < (*m_exp).size(); ++i)
1700 (*m_exp)[i]->IProductWRTDerivBase(dir, inarray +
m_phys_offset[i],
1716 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
1717 int nq = direction.size() / coordim;
1724 for (
int i = 0; i < (*m_exp).size(); ++i)
1726 npts_e = (*m_exp)[i]->GetTotPoints();
1729 for (
int k = 0; k < coordim; ++k)
1732 &locdir[k * npts_e], 1);
1735 (*m_exp)[i]->IProductWRTDirectionalDerivBase(
1760 ASSERTL1(inarray.size() >= dim,
"inarray is not of sufficient dimension");
1773 int input_offset{0};
1774 int output_offset{0};
1785 inarray[0] + input_offset, tmp0 = outarray + output_offset);
1797 inarray[0] + input_offset, tmp0 = inarray[1] + input_offset,
1798 tmp1 = outarray + output_offset);
1810 inarray[0] + input_offset, tmp0 = inarray[1] + input_offset,
1811 tmp1 = inarray[2] + input_offset,
1812 tmp2 = outarray + output_offset);
1888 e_out_d0 = out_d0 + offset;
1889 e_out_d1 = out_d1 + offset;
1890 e_out_d2 = out_d2 + offset;
1892 inarray + offset, e_out_d0, e_out_d1,
1917 for (i = 0; i < (*m_exp).size(); ++i)
1920 (*m_exp)[i]->PhysDeriv_s(inarray +
m_phys_offset[i], e_out_ds);
1926 for (i = 0; i < (*m_exp).size(); i++)
1929 (*m_exp)[i]->PhysDeriv_n(inarray +
m_phys_offset[i], e_out_dn);
1945 int intdir = (int)edir;
1950 e_out_d = out_d + offset;
1952 inarray + offset, e_out_d);
1998 ASSERTL0(0,
"Dimension not supported by ExpList::Curl");
2019 bool halfMode =
false;
2022 m_session->MatchSolverInfo(
"ModeType",
"HalfMode", halfMode,
false);
2074 ASSERTL0(0,
"Dimension not supported");
2085 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
2086 int nq = direction.size() / coordim;
2092 for (
int i = 0; i < (*m_exp).size(); ++i)
2094 npts_e = (*m_exp)[i]->GetTotPoints();
2097 for (
int k = 0; k < coordim; ++k)
2100 &locdir[k * npts_e], 1);
2103 (*m_exp)[i]->PhysDirectionalDeriv(inarray +
m_phys_offset[i], locdir,
2115 for (
int i = 0; i < (*m_exp).size(); ++i)
2117 (*m_exp)[i]->ExponentialFilter(e_array = array +
m_phys_offset[i],
2118 alpha, exponent, cutoff);
2138 if (inarray.get() == outarray.get())
2141 out = (*InvMass) * in;
2146 out = (*InvMass) * in;
2185 for (i = 0; i < (*m_exp).size(); ++i)
2187 (*m_exp)[i]->FwdTransBndConstrained(inarray +
m_phys_offset[i],
2214 "Smoothing is currently not allowed unless you are using "
2215 "a nodal base for efficiency reasons. The implemented "
2216 "smoothing technique requires the mass matrix inversion "
2217 "which is trivial just for GLL_LAGRANGE_SEM and "
2218 "GAUSS_LAGRANGE_SEMexpansions.");
2246 map<int, int> elmt_id;
2251 for (i = 0; i < (*m_exp).size(); ++i)
2255 elmt_id[n_exp++] = i;
2261 n_exp = (*m_exp).size();
2262 for (i = 0; i < n_exp; ++i)
2276 for (i = 0; i < n_exp; ++i)
2278 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
2279 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2286 for (i = 0; i < n_exp; ++i)
2288 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2289 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
2300 for (i = 0; i < n_exp; ++i)
2302 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2303 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2311 for (i = 0; i < n_exp; ++i)
2313 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
2315 (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
2322 for (i = 0; i < n_exp; ++i)
2325 (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
2327 (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
2334 "Global Matrix creation not defined for this "
2347 for (i = cnt1 = 0; i < n_exp; ++i)
2358 (*
m_exp)[i]->GetTotPoints());
2365 loc_mat = std::dynamic_pointer_cast<LocalRegions::Expansion>(
2366 (*
m_exp)[elmt_id.find(i)->second])
2367 ->GetLocMatrix(matkey);
2368 BlkMatrix->SetBlock(i, i, loc_mat);
2385 return matrixIter->second;
2448 int input_offset{0};
2449 int output_offset{0};
2455 inarray + input_offset,
2456 tmp = outarray + output_offset);
2466 for (
int i = 0; i < (*m_exp).size(); ++i)
2476 (*
m_exp)[i]->GetTotPoints());
2483 (*m_exp)[i]->GeneralMatrixOp(
2500 int i, j, n, gid1, gid2, cntdim1, cntdim2;
2504 unsigned int glob_rows = 0;
2505 unsigned int glob_cols = 0;
2506 unsigned int loc_rows = 0;
2507 unsigned int loc_cols = 0;
2509 bool assembleFirstDim =
false;
2510 bool assembleSecondDim =
false;
2517 glob_cols = locToGloMap->GetNumGlobalCoeffs();
2519 assembleFirstDim =
false;
2520 assembleSecondDim =
true;
2525 glob_rows = locToGloMap->GetNumGlobalCoeffs();
2528 assembleFirstDim =
true;
2529 assembleSecondDim =
false;
2537 glob_rows = locToGloMap->GetNumGlobalCoeffs();
2538 glob_cols = locToGloMap->GetNumGlobalCoeffs();
2540 assembleFirstDim =
true;
2541 assembleSecondDim =
true;
2547 "Global Matrix creation not defined for this "
2559 for (n = cntdim1 = cntdim2 = 0; n < (*m_exp).size(); ++n)
2570 (*
m_exp)[eid]->GetTotPoints());
2578 std::dynamic_pointer_cast<LocalRegions::Expansion>((*
m_exp)[n])
2579 ->GetLocMatrix(matkey);
2581 loc_rows = loc_mat->GetRows();
2582 loc_cols = loc_mat->GetColumns();
2584 for (i = 0; i < loc_rows; ++i)
2586 if (assembleFirstDim)
2588 gid1 = locToGloMap->GetLocalToGlobalMap(cntdim1 + i);
2589 sign1 = locToGloMap->GetLocalToGlobalSign(cntdim1 + i);
2597 for (j = 0; j < loc_cols; ++j)
2599 if (assembleSecondDim)
2601 gid2 = locToGloMap->GetLocalToGlobalMap(cntdim2 + j);
2602 sign2 = locToGloMap->GetLocalToGlobalSign(cntdim2 + j);
2611 coord = make_pair(gid1, gid2);
2612 if (spcoomat.count(coord) == 0)
2614 spcoomat[coord] = sign1 * sign2 * (*loc_mat)(i, j);
2618 spcoomat[coord] += sign1 * sign2 * (*loc_mat)(i, j);
2622 cntdim1 += loc_rows;
2623 cntdim2 += loc_cols;
2627 glob_cols, spcoomat);
2633 int i, j, n, gid1, gid2, loc_lda, eid;
2637 int totDofs = locToGloMap->GetNumGlobalCoeffs();
2638 int NumDirBCs = locToGloMap->GetNumGlobalDirBndCoeffs();
2640 unsigned int rows = totDofs - NumDirBCs;
2641 unsigned int cols = totDofs - NumDirBCs;
2645 int bwidth = locToGloMap->GetFullSystemBandWidth();
2657 if ((2 * (bwidth + 1)) < rows)
2661 rows, cols, zero, matStorage, bwidth, bwidth);
2667 rows, cols, zero, matStorage);
2676 rows, cols, zero, matStorage);
2681 for (n = 0; n < (*m_exp).size(); ++n)
2692 (*
m_exp)[eid]->GetTotPoints());
2700 std::dynamic_pointer_cast<LocalRegions::Expansion>((*
m_exp)[n])
2701 ->GetLocMatrix(matkey);
2708 int rows = loc_mat->GetRows();
2709 int cols = loc_mat->GetColumns();
2710 const NekDouble *dat = loc_mat->GetRawPtr();
2713 Blas::Dscal(rows * cols, loc_mat->Scale(), new_mat->GetRawPtr(), 1);
2718 (*m_exp)[n]->AddRobinMassMatrix(
2719 rBC->m_robinID, rBC->m_robinPrimitiveCoeffs, new_mat);
2728 loc_lda = loc_mat->GetColumns();
2730 for (i = 0; i < loc_lda; ++i)
2734 sign1 = locToGloMap->GetLocalToGlobalSign(
m_coeff_offset[n] + i);
2737 for (j = 0; j < loc_lda; ++j)
2742 sign2 = locToGloMap->GetLocalToGlobalSign(
2750 if ((matStorage ==
eFULL) || (gid2 >= gid1))
2752 value = Gmat->GetValue(gid1, gid2) +
2753 sign1 * sign2 * (*loc_mat)(i, j);
2754 Gmat->SetValue(gid1, gid2, value);
2804 const map<int, RobinBCInfoSharedPtr> vRobinBCInfo =
GetRobinBCInfo();
2861 int input_offset{0};
2862 int output_offset{0};
2866 inarray + input_offset,
2867 tmp = outarray + output_offset);
2893 NekDouble tol,
bool returnNearestElmt,
int cachedId,
2898 return GetExpIndex(gloCoord, Lcoords, tol, returnNearestElmt, cachedId,
2904 bool returnNearestElmt,
int cachedId,
2917 for (
int i = (*m_exp).size() - 1; i >= 0; --i)
2928 if (cachedId >= 0 && cachedId < (*m_exp).size())
2931 if ((*
m_exp)[cachedId]->GetGeom()->ContainsPoint(gloCoords, locCoords,
2936 else if (returnNearestElmt && (nearpt < nearpt_min))
2941 nearpt_min = nearpt;
2942 Vmath::Vcopy(locCoords.size(), locCoords, 1, savLocCoords, 1);
2946 NekDouble x = (gloCoords.size() > 0 ? gloCoords[0] : 0.0);
2947 NekDouble y = (gloCoords.size() > 1 ? gloCoords[1] : 0.0);
2948 NekDouble z = (gloCoords.size() > 2 ? gloCoords[2] : 0.0);
2955 std::vector<int> elmts =
m_graph->GetElementsContainingPoint(
p);
2958 for (
int i = 0; i < elmts.size(); ++i)
2965 if ((*
m_exp)[
id]->GetGeom()->ContainsPoint(gloCoords, locCoords, tol,
2970 else if (returnNearestElmt && (nearpt < nearpt_min))
2975 nearpt_min = nearpt;
2976 Vmath::Vcopy(locCoords.size(), locCoords, 1, savLocCoords, 1);
2982 if (returnNearestElmt && nearpt_min <= maxDistance)
2985 std::string
msg =
"Failed to find point within element to "
2987 boost::lexical_cast<std::string>(tol) +
2988 " using local point (" +
2989 boost::lexical_cast<std::string>(locCoords[0]) +
"," +
2990 boost::lexical_cast<std::string>(locCoords[1]) +
"," +
2991 boost::lexical_cast<std::string>(locCoords[1]) +
2992 ") in element: " + std::to_string(min_id);
2995 Vmath::Vcopy(locCoords.size(), savLocCoords, 1, locCoords, 1);
3012 ASSERTL0(dim == coords.size(),
"Invalid coordinate dimension.");
3017 ASSERTL0(elmtIdx > 0,
"Unable to find element containing point.");
3023 return (*
m_exp)[elmtIdx]->StdPhysEvaluate(xi, elmtPhys);
3052 for (
int i = 0; i <
m_exp->size(); ++i)
3054 (*m_exp)[i]->GetGeom()->Reset(
m_graph->GetCurvedEdges(),
3059 for (
int i = 0; i <
m_exp->size(); ++i)
3061 (*m_exp)[i]->Reset();
3077 int coordim =
GetExp(0)->GetCoordim();
3078 char vars[3] = {
'x',
'y',
'z'};
3089 outfile <<
"Variables = x";
3090 for (
int i = 1; i < coordim; ++i)
3092 outfile <<
", " << vars[i];
3097 outfile <<
", " << var;
3100 outfile << std::endl << std::endl;
3113 int nBases = (*m_exp)[0]->GetNumBases();
3118 if (expansion == -1)
3126 GetCoords(coords[0], coords[1], coords[2]);
3128 for (i = 0; i <
m_exp->size(); ++i)
3132 for (j = 0; j < nBases; ++j)
3134 numInt *= (*m_exp)[i]->GetNumPoints(j) - 1;
3137 numBlocks += numInt;
3142 nPoints = (*m_exp)[expansion]->GetTotPoints();
3148 (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
3151 for (j = 0; j < nBases; ++j)
3153 numBlocks *= (*m_exp)[expansion]->GetNumPoints(j) - 1;
3161 int nPlanes =
GetZIDs().size();
3162 NekDouble tmp = numBlocks * (nPlanes - 1.0) / nPlanes;
3163 numBlocks = (int)tmp;
3171 outfile <<
"Zone, N=" << nPoints <<
", E=" << numBlocks <<
", F=FEBlock";
3176 outfile <<
", ET=QUADRILATERAL" << std::endl;
3179 outfile <<
", ET=BRICK" << std::endl;
3187 for (j = 0; j < coordim; ++j)
3189 for (i = 0; i < nPoints; ++i)
3191 outfile << coords[j][i] <<
" ";
3192 if (i % 1000 == 0 && i)
3194 outfile << std::endl;
3197 outfile << std::endl;
3204 int nbase = (*m_exp)[0]->GetNumBases();
3207 std::shared_ptr<LocalRegions::ExpansionVector> exp =
m_exp;
3209 if (expansion != -1)
3211 exp = std::shared_ptr<LocalRegions::ExpansionVector>(
3213 (*exp)[0] = (*m_exp)[expansion];
3218 for (i = 0; i < (*exp).size(); ++i)
3220 const int np0 = (*exp)[i]->GetNumPoints(0);
3221 const int np1 = (*exp)[i]->GetNumPoints(1);
3223 for (j = 1; j < np1; ++j)
3225 for (k = 1; k < np0; ++k)
3227 outfile << cnt + (j - 1) * np0 + k <<
" ";
3228 outfile << cnt + (j - 1) * np0 + k + 1 <<
" ";
3229 outfile << cnt + j * np0 + k + 1 <<
" ";
3230 outfile << cnt + j * np0 + k << endl;
3237 else if (nbase == 3)
3239 for (i = 0; i < (*exp).size(); ++i)
3241 const int np0 = (*exp)[i]->GetNumPoints(0);
3242 const int np1 = (*exp)[i]->GetNumPoints(1);
3243 const int np2 = (*exp)[i]->GetNumPoints(2);
3244 const int np01 = np0 * np1;
3246 for (j = 1; j < np2; ++j)
3248 for (k = 1; k < np1; ++k)
3250 for (l = 1; l < np0; ++l)
3252 outfile << cnt + (j - 1) * np01 + (k - 1) * np0 + l
3254 outfile << cnt + (j - 1) * np01 + (k - 1) * np0 + l + 1
3256 outfile << cnt + (j - 1) * np01 + k * np0 + l + 1
3258 outfile << cnt + (j - 1) * np01 + k * np0 + l <<
" ";
3259 outfile << cnt + j * np01 + (k - 1) * np0 + l <<
" ";
3260 outfile << cnt + j * np01 + (k - 1) * np0 + l + 1
3262 outfile << cnt + j * np01 + k * np0 + l + 1 <<
" ";
3263 outfile << cnt + j * np01 + k * np0 + l << endl;
3267 cnt += np0 * np1 * np2;
3283 if (expansion == -1)
3291 for (
int i = 0; i < totpoints; ++i)
3293 outfile <<
m_phys[i] <<
" ";
3294 if (i % 1000 == 0 && i)
3296 outfile << std::endl;
3299 outfile << std::endl;
3303 int nPoints = (*m_exp)[expansion]->GetTotPoints();
3305 for (
int i = 0; i < nPoints; ++i)
3310 outfile << std::endl;
3316 outfile <<
"<?xml version=\"1.0\"?>" << endl;
3317 outfile << R
"(<VTKFile type="UnstructuredGrid" version="0.1" )"
3318 << "byte_order=\"LittleEndian\">" << endl;
3319 outfile <<
" <UnstructuredGrid>" << endl;
3324 outfile <<
" </UnstructuredGrid>" << endl;
3325 outfile <<
"</VTKFile>" << endl;
3329 [[maybe_unused]]
int istrip)
3332 int nbase = (*m_exp)[expansion]->GetNumBases();
3333 int ntot = (*m_exp)[expansion]->GetTotPoints();
3337 for (i = 0; i < nbase; ++i)
3339 nquad[i] = (*m_exp)[expansion]->GetNumPoints(i);
3340 ntotminus *= (nquad[i] - 1);
3347 (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
3349 outfile <<
" <Piece NumberOfPoints=\"" << ntot <<
"\" NumberOfCells=\""
3350 << ntotminus <<
"\">" << endl;
3351 outfile <<
" <Points>" << endl;
3352 outfile <<
" <DataArray type=\"Float64\" "
3353 << R
"(NumberOfComponents="3" format="ascii">)" << endl;
3355 for (i = 0; i < ntot; ++i)
3357 for (j = 0; j < 3; ++j)
3359 outfile << setprecision(8) << scientific << (float)coords[j][i]
3365 outfile <<
" </DataArray>" << endl;
3366 outfile <<
" </Points>" << endl;
3367 outfile <<
" <Cells>" << endl;
3368 outfile <<
" <DataArray type=\"Int32\" "
3369 << R
"(Name="connectivity" format="ascii">)" << endl;
3379 for (i = 0; i < nquad[0] - 1; ++i)
3381 outfile << i <<
" " << i + 1 << endl;
3389 for (i = 0; i < nquad[0] - 1; ++i)
3391 for (j = 0; j < nquad[1] - 1; ++j)
3393 outfile << j * nquad[0] + i <<
" " << j * nquad[0] + i + 1
3394 <<
" " << (j + 1) * nquad[0] + i + 1 <<
" "
3395 << (j + 1) * nquad[0] + i << endl;
3404 for (i = 0; i < nquad[0] - 1; ++i)
3406 for (j = 0; j < nquad[1] - 1; ++j)
3408 for (k = 0; k < nquad[2] - 1; ++k)
3411 << k * nquad[0] * nquad[1] + j * nquad[0] + i <<
" "
3412 << k * nquad[0] * nquad[1] + j * nquad[0] + i + 1
3414 << k * nquad[0] * nquad[1] + (j + 1) * nquad[0] +
3417 << k * nquad[0] * nquad[1] + (j + 1) * nquad[0] + i
3419 << (k + 1) * nquad[0] * nquad[1] + j * nquad[0] + i
3421 << (k + 1) * nquad[0] * nquad[1] + j * nquad[0] +
3424 << (k + 1) * nquad[0] * nquad[1] +
3425 (j + 1) * nquad[0] + i + 1
3427 << (k + 1) * nquad[0] * nquad[1] +
3428 (j + 1) * nquad[0] + i
3440 outfile <<
" </DataArray>" << endl;
3441 outfile <<
" <DataArray type=\"Int32\" "
3442 << R
"(Name="offsets" format="ascii">)" << endl;
3443 for (i = 0; i < ntotminus; ++i)
3445 outfile << i * ns + ns <<
" ";
3448 outfile <<
" </DataArray>" << endl;
3449 outfile <<
" <DataArray type=\"UInt8\" "
3450 << R
"(Name="types" format="ascii">)" << endl;
3451 for (i = 0; i < ntotminus; ++i)
3456 outfile <<
" </DataArray>" << endl;
3457 outfile <<
" </Cells>" << endl;
3458 outfile <<
" <PointData>" << endl;
3462 [[maybe_unused]]
int expansion)
3464 outfile <<
" </PointData>" << endl;
3465 outfile <<
" </Piece>" << endl;
3472 int nq = (*m_exp)[expansion]->GetTotPoints();
3475 outfile << R
"( <DataArray type="Float64" Name=")" << var << "\">"
3481 for (i = 0; i < nq; ++i)
3487 outfile <<
" </DataArray>" << endl;
3521 err = max(err,
abs(inarray[i] - soln[i]));
3554 for (i = 0; i < (*m_exp).size(); ++i)
3557 err += errl2 * errl2;
3562 for (i = 0; i < (*m_exp).size(); ++i)
3566 err += errl2 * errl2;
3596 for (i = 0; i < (*m_exp).size(); ++i)
3612 for (i = 0; i < (*m_exp).size(); ++i)
3615 for (j = 0; j < inarray.size(); ++j)
3619 flux += (*m_exp)[i]->VectorFlux(tmp);
3628 "This method is not defined or valid for this class type");
3636 "This method is not defined or valid for this class type");
3644 "This method is not defined or valid for this class type");
3652 "This method is not defined or valid for this class type");
3658 "This method is not defined or valid for this class type");
3666 "This method is not defined or valid for this class type");
3674 "ClearGlobalLinSysManager not implemented for ExpList.");
3684 [[maybe_unused]]
bool clearLocalMatrices)
3687 "UnsetGlobalLinSys not implemented for ExpList.");
3694 "GetGlobalLinSysManager not implemented for ExpList.");
3700 const std::string &varName,
3703 string varString = fileName.substr(0, fileName.find_last_of(
"."));
3704 int j, k, len = varString.length();
3705 varString = varString.substr(len - 1, len);
3707 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
3708 std::vector<std::vector<NekDouble>> FieldData;
3713 ft, comm,
m_session->GetSharedFilesystem());
3715 f->Import(fileName, FieldDef, FieldData);
3718 for (j = 0; j < FieldDef.size(); ++j)
3720 for (k = 0; k < FieldDef[j]->m_fields.size(); ++k)
3722 if (FieldDef[j]->m_fields[k] == varName)
3726 FieldDef[j]->m_fields[k], coeffs);
3732 ASSERTL0(found,
"Could not find variable '" + varName +
3733 "' in file boundary condition " + fileName);
3759 for (i = 0; i < (*m_exp).size(); ++i)
3763 err += errh1 * errh1;
3772 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef,
3774 std::vector<NekDouble> &HomoLen,
bool homoStrips,
3775 std::vector<unsigned int> &HomoSIDs, std::vector<unsigned int> &HomoZIDs,
3776 std::vector<unsigned int> &HomoYIDs)
3783 ASSERTL1(NumHomoDir == HomoBasis.size(),
3784 "Homogeneous basis is not the same length as NumHomoDir");
3785 ASSERTL1(NumHomoDir == HomoLen.size(),
3786 "Homogeneous length vector is not the same length as NumHomDir");
3805 for (s = startenum; s <= endenum; ++s)
3807 std::vector<unsigned int> elementIDs;
3808 std::vector<LibUtilities::BasisType> basis;
3809 std::vector<unsigned int> numModes;
3810 std::vector<std::string> fields;
3813 bool UniOrder =
true;
3818 for (
int i = 0; i < (*m_exp).size(); ++i)
3820 if ((*
m_exp)[i]->GetGeom()->GetShapeType() == shape)
3822 elementIDs.push_back((*
m_exp)[i]->GetGeom()->GetGlobalID());
3825 for (
int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
3828 (*
m_exp)[i]->GetBasis(j)->GetBasisType());
3830 (*
m_exp)[i]->GetBasis(j)->GetNumModes());
3834 for (n = 0; n < NumHomoDir; ++n)
3836 basis.push_back(HomoBasis[n]->GetBasisType());
3837 numModes.push_back(HomoBasis[n]->GetNumModes());
3845 (*
m_exp)[i]->GetBasis(0)->GetBasisType() == basis[0],
3846 "Routine is not set up for multiple bases definitions");
3848 for (
int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
3851 (*
m_exp)[i]->GetBasis(j)->GetNumModes());
3853 (*
m_exp)[i]->GetBasis(j)->GetNumModes())
3859 for (n = 0; n < NumHomoDir; ++n)
3861 numModes.push_back(HomoBasis[n]->GetNumModes());
3867 if (elementIDs.size() > 0)
3872 numModes, fields, NumHomoDir, HomoLen,
3873 homoStrips, HomoSIDs, HomoZIDs, HomoYIDs);
3874 fielddef.push_back(fdef);
3882std::vector<LibUtilities::FieldDefinitionsSharedPtr>
ExpList::
3885 std::vector<LibUtilities::FieldDefinitionsSharedPtr> returnval;
3891 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef)
3900 std::vector<NekDouble> &fielddata)
3914 map<int, int> ElmtID_to_ExpID;
3915 for (i = 0; i < (*m_exp).size(); ++i)
3917 ElmtID_to_ExpID[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
3920 for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
3922 int eid = ElmtID_to_ExpID[fielddef->m_elementIDs[i]];
3923 int datalen = (*m_exp)[eid]->GetNcoeffs();
3932 std::vector<NekDouble> &fielddata, std::string &field,
3939 const std::shared_ptr<ExpList> &fromExpList,
3956 std::vector<NekDouble> &fielddata, std::string &field,
3958 [[maybe_unused]] std::unordered_map<int, int> zIdToPlane)
3962 int modes_offset = 0;
3963 int datalen = fielddata.size() / fielddef->m_fields.size();
3966 for (i = 0; i < fielddef->m_fields.size(); ++i)
3968 if (fielddef->m_fields[i] == field)
3975 ASSERTL0(i != fielddef->m_fields.size(),
3976 "Field (" + field +
") not found in file.");
3983 for (i = (*m_exp).size() - 1; i >= 0; --i)
3989 for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
3993 if (fielddef->m_uniOrder ==
true)
3999 fielddef->m_shapeType, fielddef->m_numModes, modes_offset);
4001 const int elmtId = fielddef->m_elementIDs[i];
4007 modes_offset += (*m_exp)[0]->GetNumBases();
4011 expId = eIt->second;
4013 bool sameBasis =
true;
4014 for (
int j = 0; j < fielddef->m_basis.size(); ++j)
4016 if (fielddef->m_basis[j] != (*
m_exp)[expId]->GetBasisType(j))
4030 (*m_exp)[expId]->ExtractDataToCoeffs(
4031 &fielddata[offset], fielddef->m_numModes, modes_offset,
4036 modes_offset += (*m_exp)[0]->GetNumBases();
4043 const std::shared_ptr<ExpList> &fromExpList,
4050 for (i = 0; i < (*m_exp).size(); ++i)
4052 std::vector<unsigned int> nummodes;
4053 vector<LibUtilities::BasisType> basisTypes;
4054 for (
int j = 0; j < fromExpList->GetExp(i)->GetNumBases(); ++j)
4056 nummodes.push_back(fromExpList->GetExp(i)->GetBasisNumModes(j));
4057 basisTypes.push_back(fromExpList->GetExp(i)->GetBasisType(j));
4060 (*m_exp)[i]->ExtractDataToCoeffs(&fromCoeffs[offset], nummodes, 0,
4064 offset += fromExpList->GetExp(i)->GetNcoeffs();
4074 size_t nTracePts = weightAver.size();
4076 for (
int i = 0; i < nTracePts; ++i)
4078 weightAver[i] = 0.5;
4079 weightJump[i] = 1.0;
4091 int nq = outarray[0].size() / MFdim;
4094 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
4098 for (
int i = 0; i <
m_exp->size(); ++i)
4100 npts = (*m_exp)[i]->GetTotPoints();
4102 for (
int j = 0; j < MFdim * coordim; ++j)
4108 (*m_exp)[i]->GetMetricInfo()->GetMovingFrames(
4109 (*
m_exp)[i]->GetPointsKeys(), MMFdir, CircCentre, MFloc);
4112 for (
int j = 0; j < MFdim; ++j)
4114 for (
int k = 0; k < coordim; ++k)
4138 for (
int i = 0; i < (*m_exp).size(); ++i)
4140 npoints_e = (*m_exp)[i]->GetTotPoints();
4161 "This method is not defined or valid for this class type");
4167 [[maybe_unused]]
int i)
4170 "This method is not defined or valid for this class type");
4171 static std::shared_ptr<ExpList> result;
4194 int i, j, k, e_npoints, offset;
4202 "Input vector does not have sufficient dimensions to "
4206 for (i = 0; i <
m_exp->size(); ++i)
4209 e_npoints = (*m_exp)[i]->GetNumPoints(0);
4210 normals = (*m_exp)[i]->GetPhysNormals();
4216 for (j = 0; j < e_npoints; ++j)
4220 for (k = 0; k < coordim; ++k)
4222 Vn += Vec[k][offset + j] * normals[k * e_npoints + j];
4228 Upwind[offset + j] = Fwd[offset + j];
4232 Upwind[offset + j] = Bwd[offset + j];
4240 "This method is not defined or valid for this class type");
4286 "This method is not defined or valid for this class type");
4287 static std::shared_ptr<ExpList> returnVal;
4294 "This method is not defined or valid for this class type");
4295 static std::shared_ptr<AssemblyMapDG> result;
4301 return GetTraceMap()->GetBndCondIDToGlobalTraceID();
4307 "This method is not defined or valid for this class type");
4308 static std::vector<bool> result;
4325 for (
int i = 0; i < nquad2; ++i)
4327 for (
int j = 0; j < nquad1; ++j)
4329 out[i * nquad1 + j] = in[j * nquad2 + i];
4335 for (
int i = 0; i < nquad2; ++i)
4337 for (
int j = 0; j < nquad1; ++j)
4339 out[i * nquad1 + j] = in[i * nquad1 + j];
4350 for (
int i = 0; i < nquad2; ++i)
4352 for (
int j = 0; j < nquad1 / 2; ++j)
4354 swap(out[i * nquad1 + j], out[i * nquad1 + nquad1 - j - 1]);
4365 for (
int j = 0; j < nquad1; ++j)
4367 for (
int i = 0; i < nquad2 / 2; ++i)
4369 swap(out[i * nquad1 + j], out[(nquad2 - i - 1) * nquad1 + j]);
4386 int i, j, k, e_npoints, offset;
4392 ASSERTL1(normals.size() >= coordim,
4393 "Output vector does not have sufficient dimensions to "
4401 for (i = 0; i <
m_exp->size(); ++i)
4406 loc_exp->GetLeftAdjacentElementExp();
4410 locnormals = loc_elmt->GetTraceNormal(
4411 loc_exp->GetLeftAdjacentElementTrace());
4417 for (j = 0; j < e_npoints; ++j)
4421 for (k = 0; k < coordim; ++k)
4423 normals[k][offset] = locnormals[k][0];
4432 for (i = 0; i <
m_exp->size(); ++i)
4440 traceExp->GetLeftAdjacentElementExp();
4441 int edgeId = traceExp->GetLeftAdjacentElementTrace();
4443 exp2D->GetTraceBasisKey(edgeId).GetPointsKey();
4445 traceExp->GetBasis(0)->GetPointsKey();
4452 bool useRight =
false;
4453 if (traceExp->GetRightAdjacentElementTrace() >= 0)
4456 traceExp->GetRightAdjacentElementExp();
4457 int RedgeId = traceExp->GetRightAdjacentElementTrace();
4459 Rexp2D->GetTraceBasisKey(RedgeId).GetPointsKey();
4465 edgePoints = RedgePoints;
4471 exp2D->GetTraceNormal(edgeId);
4476 for (
int d = 0;
d < coordim; ++
d)
4480 normals[
d].data() + offset);
4486 &normals[
d][offset], 1);
4497 for (i = 0; i <
m_exp->size(); ++i)
4518 traceExp->GetLeftAdjacentElementExp();
4519 int faceId = traceExp->GetLeftAdjacentElementTrace();
4521 exp3D->GetTraceNormal(faceId);
4527 int fromid0, fromid1;
4541 exp3D->GetTraceBasisKey(faceId, fromid0);
4543 exp3D->GetTraceBasisKey(faceId, fromid1);
4545 traceExp->GetBasis(0)->GetBasisKey();
4547 traceExp->GetBasis(1)->GetBasisKey();
4556 exp3D->ReOrientTracePhysMap(orient, map, faceNq0, faceNq1);
4560 for (j = 0; j < coordim; ++j)
4568 traceBasis1.
GetPointsKey(), tmp = normals[j] + offset);
4576 "This method is not defined or valid for this class type");
4603 lengLR[0] = lengthsFwd;
4604 lengLR[1] = lengthsBwd;
4608 int e_npoints0 = -1;
4611 for (
int i = 0; i <
m_exp->size(); ++i)
4613 loc_exp = (*m_exp)[i];
4616 e_npoints = (*m_exp)[i]->GetNumPoints(0);
4617 if (e_npoints0 < e_npoints)
4619 for (
int nlr = 0; nlr < 2; nlr++)
4623 e_npoints0 = e_npoints;
4626 LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
4627 LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
4629 LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
4630 LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
4631 for (
int nlr = 0; nlr < 2; ++nlr)
4634 lengAdd[nlr] = lengintp[nlr];
4635 int bndNumber = LRbndnumbs[nlr];
4636 loc_elmt = LRelmts[nlr];
4639 locLeng = loc_elmt->GetElmtBndNormDirElmtLen(bndNumber);
4642 loc_exp->GetBasis(0)->GetPointsKey();
4644 loc_elmt->GetTraceBasisKey(bndNumber).GetPointsKey();
4653 lengAdd[nlr] = lengintp[nlr];
4656 for (
int j = 0; j < e_npoints; ++j)
4658 lengLR[nlr][offset + j] = lengAdd[nlr][j];
4665 for (
int i = 0; i <
m_exp->size(); ++i)
4667 loc_exp = (*m_exp)[i];
4671 loc_exp->GetBasis(0)->GetBasisKey();
4673 loc_exp->GetBasis(1)->GetBasisKey();
4676 e_npoints = TraceNq0 * TraceNq1;
4677 if (e_npoints0 < e_npoints)
4679 for (
int nlr = 0; nlr < 2; nlr++)
4683 e_npoints0 = e_npoints;
4686 LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
4687 LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
4689 LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
4690 LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
4691 for (
int nlr = 0; nlr < 2; ++nlr)
4694 int bndNumber = LRbndnumbs[nlr];
4695 loc_elmt = LRelmts[nlr];
4698 locLeng = loc_elmt->GetElmtBndNormDirElmtLen(bndNumber);
4702 loc_elmt->GetTraceOrient(bndNumber);
4704 int fromid0, fromid1;
4717 loc_elmt->GetTraceBasisKey(bndNumber, fromid0);
4719 loc_elmt->GetTraceBasisKey(bndNumber, fromid1);
4724 AlignFace(orient, faceNq0, faceNq1, locLeng, alignedLeng);
4731 for (
int j = 0; j < e_npoints; ++j)
4733 lengLR[nlr][offset + j] = lengintp[nlr][j];
4745 "This method is not defined or valid for this class type");
4754 "This method is not defined or valid for this class type");
4761 "This method is not defined or valid for this class type");
4768 [[maybe_unused]]
bool PutFwdInBwdOnBCs, [[maybe_unused]]
bool DoExchange)
4771 "This method is not defined or valid for this class type");
4777 [[maybe_unused]]
bool PutFwdInBwdOnBCs)
4780 "This method is not defined or valid for this class type");
4789 "v_AddTraceQuadPhysToField is not defined for this class type");
4798 "v_AddTraceQuadPhysToOffDiag is not defined for this class");
4808 "v_GetLocTraceFromTracePts is not defined for this class");
4814 "v_GetBndCondBwdWeight is not defined for this class type");
4823 "v_setBndCondBwdWeight is not defined for this class type");
4829 "This method is not defined or valid for this class type");
4830 static vector<bool> tmp;
4838 "This method is not defined or valid for this class type");
4846 "This method is not defined or valid for this class type");
4854 "This method is not defined or valid for this class type");
4864 [[maybe_unused]]
const bool PhysSpaceForcing)
4877 [[maybe_unused]]
const bool PhysSpaceForcing)
4880 "LinearAdvectionDiffusionReactionSolve not implemented.");
4888 [[maybe_unused]]
const NekDouble lambda,
4892 "This method is not defined or valid for this class type");
4896 [[maybe_unused]]
const int npts,
4899 [[maybe_unused]]
bool Shuff, [[maybe_unused]]
bool UnShuff)
4902 "This method is not defined or valid for this class type");
4906 [[maybe_unused]]
const int npts,
4909 [[maybe_unused]]
bool Shuff, [[maybe_unused]]
bool UnShuff)
4912 "This method is not defined or valid for this class type");
4916 [[maybe_unused]]
const int npts,
4922 "This method is not defined or valid for this class type");
4926 [[maybe_unused]]
const int npts,
4932 "This method is not defined or valid for this class type");
4938 [[maybe_unused]]
int BndID)
4941 "This method is not defined or valid for this class type");
4948 [[maybe_unused]]
int BndID)
4951 "This method is not defined or valid for this class type");
4964 (*m_exp)[i]->NormVectorIProductWRTBase(
4974 (*m_exp)[i]->NormVectorIProductWRTBase(
4984 (*m_exp)[i]->NormVectorIProductWRTBase(
5001 "This method is not defined or valid for this class type");
5010 "This method is not defined or valid for this class type");
5016 [[maybe_unused]]
const int nreg,
5020 "This method is not defined or valid for this class type");
5026 "This method is not defined or valid for this class type");
5032 [[maybe_unused]]
bool useComm)
5035 "This method is not defined or valid for this class type");
5041 "This method is not defined or valid for this class type");
5049 "This method is not defined or valid for this class type");
5085 int input_offset{0};
5086 int output_offset{0};
5090 inarray + input_offset,
5091 tmp = outarray + output_offset);
5130 for (i = 0; i < (*m_exp).size(); ++i)
5133 (*m_exp)[i]->GetCoords(e_coord_0);
5137 ASSERTL0(coord_1.size() != 0,
"output coord_1 is not defined");
5139 for (i = 0; i < (*m_exp).size(); ++i)
5143 (*m_exp)[i]->GetCoords(e_coord_0, e_coord_1);
5147 ASSERTL0(coord_1.size() != 0,
"output coord_1 is not defined");
5148 ASSERTL0(coord_2.size() != 0,
"output coord_2 is not defined");
5150 for (i = 0; i < (*m_exp).size(); ++i)
5155 (*m_exp)[i]->GetCoords(e_coord_0, e_coord_1, e_coord_2);
5165 (*m_exp)[eid]->GetCoords(xc0, xc1, xc2);
5175 for (
int i = 0; i <
m_exp->size(); ++i)
5177 for (
int j = 0; j < (*m_exp)[i]->GetNtraces(); ++j)
5179 (*m_exp)[i]->ComputeTraceNormal(j);
5187 [[maybe_unused]]
int i, [[maybe_unused]] std::shared_ptr<ExpList> &result,
5188 [[maybe_unused]]
const bool DeclareCoeffPhysArrays)
5191 "This method is not defined or valid for this class type");
5212 for (cnt = n = 0; n < i; ++n)
5223 elmt =
GetExp(ElmtID[cnt + n]);
5224 elmt->GetTracePhysVals(
5226 tmp1 = element + offsetElmt, tmp2 = boundary + offsetBnd);
5228 offsetElmt += elmt->GetTotPoints();
5244 for (cnt = n = 0; n < i; ++n)
5253 npoints +=
GetExp(ElmtID[cnt + n])->GetTotPoints();
5264 nq =
GetExp(ElmtID[cnt + n])->GetTotPoints();
5266 Vmath::Vcopy(nq, &phys[offsetPhys], 1, &bndElmt[offsetElmt], 1);
5289 for (cnt = n = 0; n < i; ++n)
5301 elmt =
GetExp(ElmtID[cnt + n]);
5302 elmt->GetTracePhysVals(EdgeID[cnt + n],
5304 phys + offsetPhys, tmp1 = bnd + offsetBnd);
5323 for (j = 0; j < coordim; ++j)
5330 for (cnt = n = 0; n < i; ++n)
5341 elmt =
GetExp(ElmtID[cnt + n]);
5343 elmt->GetTraceNormal(EdgeID[cnt + n]);
5345 for (j = 0; j < coordim; ++j)
5347 Vmath::Vcopy(nq, normalsElmt[j], 1, tmp = normals[j] + offset, 1);
5358 "This method is not defined or valid for this class type");
5381 "This method is not defined or valid for this class type");
5392 "This method is not defined or valid for this class type");
5401 [[maybe_unused]]
const std::string varName,
5406 "This method is not defined or valid for this class type");
5414 "This method is not defined or valid for this class type");
5415 static map<int, RobinBCInfoSharedPtr> result;
5426 "This method is not defined or valid for this class type");
5431 unsigned int regionId,
const std::string &variable)
5433 auto collectionIter = collection.find(regionId);
5434 ASSERTL1(collectionIter != collection.end(),
5435 "Unable to locate collection " +
5436 boost::lexical_cast<string>(regionId));
5439 (*collectionIter).second;
5440 auto conditionMapIter = bndCondMap->find(variable);
5441 ASSERTL1(conditionMapIter != bndCondMap->end(),
5442 "Unable to locate condition map.");
5445 (*conditionMapIter).second;
5447 return boundaryCondition;
5453 "This method is not defined or valid for this class type");
5485 if (
m_graph->GetMeshDimension() == (*
m_exp)[0]->GetShapeDimension())
5491 bool verbose = (
m_session->DefinesCmdLineArgument(
"verbose")) &&
5508 : 2 *
m_exp->size());
5510 vector<StdRegions::StdExpansionSharedPtr> collExp;
5519 collExp.push_back(exp);
5523 std::vector<LibUtilities::BasisKey> thisbasisKeys(
5525 std::vector<LibUtilities::BasisKey> prevbasisKeys(
5528 for (
int d = 0;
d < exp->GetNumBases();
d++)
5530 prevbasisKeys[
d] = exp->GetBasis(
d)->GetBasisKey();
5539 for (
int i = 1; i < (*m_exp).size(); i++)
5544 for (
int d = 0;
d < exp->GetNumBases();
d++)
5546 thisbasisKeys[
d] = exp->GetBasis(
d)->GetBasisKey();
5554 if (thisbasisKeys != prevbasisKeys || prevDef != Deformed ||
5564 if (collExp.size() > collsize)
5568 collsize = collExp.size();
5591 collExp.push_back(exp);
5594 prevbasisKeys = thisbasisKeys;
5601 if (collExp.size() > collsize)
5604 collsize = collExp.size();
5684 int input_offset{0};
5685 int output_offset{0};
5689 inarray + input_offset,
5690 tmp = outarray + output_offset);
5712 int nTotElmt = (*m_exp).size();
5713 int nElmtPnt = (*m_exp)[0]->GetTotPoints();
5714 int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
5719 for (
int nelmt = 0; nelmt < nTotElmt; nelmt++)
5721 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5722 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5724 if (tmpPhys.size() != nElmtPnt || tmpCoef.size() != nElmtCoef)
5730 for (
int ncl = 0; ncl < nElmtPnt; ncl++)
5732 tmpPhys[ncl] = inarray[nelmt][ncl];
5734 (*m_exp)[nelmt]->IProductWRTDerivBase(nDirctn, tmpPhys, tmpCoef);
5736 for (
int nrw = 0; nrw < nElmtCoef; nrw++)
5738 (*mtxPerVar[nelmt])(nrw, ncl) = tmpCoef[nrw];
5749 int nTotElmt = (*m_exp).size();
5751 int nspacedim =
m_graph->GetSpaceDimension();
5760 int nElmtPntPrevious = 0;
5761 int nElmtCoefPrevious = 0;
5763 int nElmtPnt, nElmtCoef;
5764 for (
int nelmt = 0; nelmt < nTotElmt; nelmt++)
5766 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5767 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5770 if (nElmtPntPrevious != nElmtPnt || nElmtCoefPrevious != nElmtCoef ||
5771 (ElmtTypeNow != ElmtTypePrevious))
5773 if (nElmtPntPrevious != nElmtPnt)
5775 for (
int ndir = 0; ndir < nspacedim; ndir++)
5782 stdExp = (*m_exp)[nelmt]->GetStdExp();
5784 stdExp->DetShapeType(), *stdExp);
5786 ArrayStdMat[0] = stdExp->GetStdMatrix(matkey);
5787 ArrayStdMat_data[0] = ArrayStdMat[0]->GetPtr();
5794 ArrayStdMat[1] = stdExp->GetStdMatrix(matkey);
5795 ArrayStdMat_data[1] = ArrayStdMat[1]->GetPtr();
5800 stdExp->DetShapeType(),
5803 ArrayStdMat[2] = stdExp->GetStdMatrix(matkey);
5804 ArrayStdMat_data[2] = ArrayStdMat[2]->GetPtr();
5808 ElmtTypePrevious = ElmtTypeNow;
5809 nElmtPntPrevious = nElmtPnt;
5810 nElmtCoefPrevious = nElmtCoef;
5814 for (
int ndir = 0; ndir < nspacedim; ndir++)
5820 for (
int ndir = 0; ndir < nspacedim; ndir++)
5822 (*m_exp)[nelmt]->AlignVectorToCollapsedDir(
5823 ndir, inarray[ndir][nelmt], tmppnts);
5824 for (
int n = 0; n < nspacedim; n++)
5826 Vmath::Vadd(nElmtPnt, tmppnts[n], 1, projectedpnts[n], 1,
5827 projectedpnts[n], 1);
5831 for (
int ndir = 0; ndir < nspacedim; ndir++)
5834 (*m_exp)[nelmt]->MultiplyByQuadratureMetric(projectedpnts[ndir],
5835 projectedpnts[ndir]);
5838 for (
int np = 0; np < nElmtPnt; np++)
5840 NekDouble factor = projectedpnts[ndir][np];
5841 clmnArray = MatDataArray + np * nElmtCoef;
5842 clmnStdMatArray = ArrayStdMat_data[ndir] + np * nElmtCoef;
5843 Vmath::Svtvp(nElmtCoef, factor, clmnStdMatArray, 1, clmnArray,
5856 int nElmtPntPrevious = 0;
5857 int nElmtCoefPrevious = 0;
5858 int nTotElmt = (*m_exp).size();
5859 int nElmtPnt = (*m_exp)[0]->GetTotPoints();
5860 int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
5866 for (
int nelmt = 0; nelmt < nTotElmt; nelmt++)
5868 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5869 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5872 if (nElmtPntPrevious != nElmtPnt || nElmtCoefPrevious != nElmtCoef ||
5873 (ElmtTypeNow != ElmtTypePrevious))
5876 stdExp = (*m_exp)[nelmt]->GetStdExp();
5878 stdExp->DetShapeType(), *stdExp);
5881 stdMat_data = BwdMat->GetPtr();
5883 if (nElmtPntPrevious != nElmtPnt)
5888 ElmtTypePrevious = ElmtTypeNow;
5889 nElmtPntPrevious = nElmtPnt;
5890 nElmtCoefPrevious = nElmtCoef;
5893 (*m_exp)[nelmt]->MultiplyByQuadratureMetric(
5899 for (
int np = 0; np < nElmtPnt; np++)
5902 clmnArray = MatDataArray + np * nElmtCoef;
5903 clmnStdMatArray = stdMat_data + np * nElmtCoef;
5904 Vmath::Smul(nElmtCoef, factor, clmnStdMatArray, 1, clmnArray, 1);
5928 std::shared_ptr<LocalRegions::ExpansionVector> traceExp =
5929 tracelist->GetExp();
5930 int ntotTrace = (*traceExp).size();
5931 int nTracePnt, nTraceCoef;
5933 std::shared_ptr<LocalRegions::ExpansionVector> fieldExp =
GetExp();
5939 locTraceToTraceMap->GetLeftRightAdjacentExpId();
5941 locTraceToTraceMap->GetLeftRightAdjacentExpFlag();
5944 locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffMap();
5946 locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffSign();
5951 int MatIndex, nPnts;
5954 int nTracePntsTtl = tracelist->GetTotPoints();
5955 int nlocTracePts = locTraceToTraceMap->GetNLocTracePts();
5956 int nlocTracePtsFwd = locTraceToTraceMap->GetNFwdLocTracePts();
5957 int nlocTracePtsBwd = nlocTracePts - nlocTracePtsFwd;
5960 nlocTracePtsLR[0] = nlocTracePtsFwd;
5961 nlocTracePtsLR[1] = nlocTracePtsBwd;
5963 size_t nFwdBwdNonZero = 0;
5965 for (
int i = 0; i < 2; ++i)
5967 if (nlocTracePtsLR[i] > 0)
5969 tmpIndex[nFwdBwdNonZero] = i;
5975 for (
int i = 0; i < nFwdBwdNonZero; ++i)
5977 nlocTracePtsNonZeroIndex[i] = tmpIndex[i];
5983 for (
int k = 0; k < 2; ++k)
5988 for (
int k = 0; k < nFwdBwdNonZero; ++k)
5990 size_t i = nlocTracePtsNonZeroIndex[k];
5994 int nNumbElmt = fieldMat.size();
5997 for (
int i = 0; i < nNumbElmt; i++)
5999 ElmtMatDataArray[i] = fieldMat[i]->GetPtr();
6003 int nTraceCoefMax = 0;
6004 int nTraceCoefMin = std::numeric_limits<int>::max();
6010 for (
int nt = 0; nt < ntotTrace; nt++)
6012 nTraceCoef = (*traceExp)[nt]->GetNcoeffs();
6013 nTracePnt = tracelist->GetTotPoints(nt);
6014 int noffset = tracelist->GetPhys_Offset(nt);
6015 TraceCoefArray[nt] = nTraceCoef;
6016 TracePntArray[nt] = nTracePnt;
6017 TraceOffArray[nt] = noffset;
6018 FwdMatData[nt] = FwdMat[nt]->GetPtr();
6019 BwdMatData[nt] = BwdMat[nt]->GetPtr();
6020 if (nTraceCoef > nTraceCoefMax)
6022 nTraceCoefMax = nTraceCoef;
6024 if (nTraceCoef < nTraceCoefMin)
6026 nTraceCoefMin = nTraceCoef;
6029 WARNINGL1(nTraceCoefMax == nTraceCoefMin,
6030 "nTraceCoefMax!=nTraceCoefMin: Effeciency may be low ");
6032 int traceID, nfieldPnts, ElmtId, noffset;
6034 locTraceToTraceMap->GetLocTracephysToTraceIDMap();
6036 locTraceToTraceMap->GetLocTraceToFieldMap();
6039 for (
int k = 0; k < nFwdBwdNonZero; ++k)
6041 size_t i = nlocTracePtsNonZeroIndex[k];
6043 Vmath::Vcopy(nlocTracePtsLR[i], &fieldToLocTraceMap[0] + noffset, 1,
6044 &fieldToLocTraceMapLR[i][0], 1);
6045 noffset += nlocTracePtsLR[i];
6049 for (
int k = 0; k < nFwdBwdNonZero; ++k)
6051 size_t nlr = nlocTracePtsNonZeroIndex[k];
6053 for (
int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
6055 traceID = LocTracephysToTraceIDMap[nlr][nloc];
6056 nTraceCoef = TraceCoefArray[traceID];
6057 ElmtId = LRAdjExpid[nlr][traceID];
6059 nElmtCoef = ElmtCoefArray[ElmtId];
6060 nfieldPnts = fieldToLocTraceMapLR[nlr][nloc];
6061 nPnts = nfieldPnts - noffset;
6063 MatIndexArray[nlr][nloc] = nPnts * nElmtCoef;
6067 for (
int nc = 0; nc < nTraceCoefMin; nc++)
6069 for (
int nt = 0; nt < ntotTrace; nt++)
6071 nTraceCoef = TraceCoefArray[nt];
6072 nTracePnt = TracePntArray[nt];
6073 noffset = TraceOffArray[nt];
6074 Vmath::Vcopy(nTracePnt, &FwdMatData[nt][nc], nTraceCoef,
6075 &TraceFwdPhy[noffset], 1);
6076 Vmath::Vcopy(nTracePnt, &BwdMatData[nt][nc], nTraceCoef,
6077 &TraceBwdPhy[noffset], 1);
6080 for (
int k = 0; k < nFwdBwdNonZero; ++k)
6082 size_t i = nlocTracePtsNonZeroIndex[k];
6083 Vmath::Zero(nlocTracePtsLR[i], tmplocTrace[i], 1);
6089 for (
int k = 0; k < nFwdBwdNonZero; ++k)
6091 size_t nlr = nlocTracePtsNonZeroIndex[k];
6092 for (
int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
6094 traceID = LocTracephysToTraceIDMap[nlr][nloc];
6095 nTraceCoef = TraceCoefArray[traceID];
6096 ElmtId = LRAdjExpid[nlr][traceID];
6097 nrwAdjExp = elmtLRMap[nlr][traceID][nc];
6098 sign = elmtLRSign[nlr][traceID][nc];
6099 MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
6101 ElmtMatDataArray[ElmtId][MatIndex] -=
6102 sign * tmplocTrace[nlr][nloc];
6107 for (
int nc = nTraceCoefMin; nc < nTraceCoefMax; nc++)
6109 for (
int nt = 0; nt < ntotTrace; nt++)
6111 nTraceCoef = TraceCoefArray[nt];
6112 nTracePnt = TracePntArray[nt];
6113 noffset = TraceOffArray[nt];
6114 if (nc < nTraceCoef)
6116 Vmath::Vcopy(nTracePnt, &FwdMatData[nt][nc], nTraceCoef,
6117 &TraceFwdPhy[noffset], 1);
6118 Vmath::Vcopy(nTracePnt, &BwdMatData[nt][nc], nTraceCoef,
6119 &TraceBwdPhy[noffset], 1);
6128 for (
int k = 0; k < nFwdBwdNonZero; ++k)
6130 size_t i = nlocTracePtsNonZeroIndex[k];
6131 Vmath::Zero(nlocTracePtsLR[i], tmplocTrace[i], 1);
6136 for (
int k = 0; k < nFwdBwdNonZero; ++k)
6138 size_t nlr = nlocTracePtsNonZeroIndex[k];
6139 for (
int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
6141 traceID = LocTracephysToTraceIDMap[nlr][nloc];
6142 nTraceCoef = TraceCoefArray[traceID];
6143 if (nc < nTraceCoef)
6145 ElmtId = LRAdjExpid[nlr][traceID];
6146 nrwAdjExp = elmtLRMap[nlr][traceID][nc];
6147 sign = -elmtLRSign[nlr][traceID][nc];
6148 MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
6150 ElmtMatDataArray[ElmtId][MatIndex] +=
6151 sign * tmplocTrace[nlr][nloc];
6163 int nelmtcoef, nelmtpnts, nelmtcoef0, nelmtpnts0;
6176 nelmtcoef0 = nelmtcoef;
6177 nelmtpnts0 = nelmtpnts;
6179 for (nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
6184 tmpMatQ = ElmtJacQuad[nelmt];
6185 tmpMatC = ElmtJacCoef[nelmt];
6187 MatQ_data = tmpMatQ->GetPtr();
6188 MatC_data = tmpMatC->GetPtr();
6190 if (nelmtcoef != nelmtcoef0)
6193 nelmtcoef0 = nelmtcoef;
6196 if (nelmtpnts != nelmtpnts0)
6199 nelmtpnts0 = nelmtpnts;
6202 for (
int np = 0; np < nelmtcoef; np++)
6204 Vmath::Vcopy(nelmtpnts, &MatQ_data[0] + np, nelmtcoef, &innarray[0],
6206 (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray, innarray);
6207 (*m_exp)[nelmt]->IProductWRTDerivBase(dir, innarray, outarray);
6209 Vmath::Vadd(nelmtcoef, &outarray[0], 1, &MatC_data[0] + np,
6210 nelmtcoef, &MatC_data[0] + np, nelmtcoef);
6220 int nelmtcoef, nelmtpnts, nelmtcoef0, nelmtpnts0;
6233 nelmtcoef0 = nelmtcoef;
6234 nelmtpnts0 = nelmtpnts;
6236 for (nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
6241 tmpMatQ = ElmtJacQuad[nelmt];
6242 tmpMatC = ElmtJacCoef[nelmt];
6244 MatQ_data = tmpMatQ->GetPtr();
6245 MatC_data = tmpMatC->GetPtr();
6247 if (nelmtcoef != nelmtcoef0)
6250 nelmtcoef0 = nelmtcoef;
6253 if (nelmtpnts != nelmtpnts0)
6256 nelmtpnts0 = nelmtpnts;
6259 for (
int np = 0; np < nelmtcoef; np++)
6261 Vmath::Vcopy(nelmtpnts, &MatQ_data[0] + np, nelmtcoef, &innarray[0],
6263 (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray, innarray);
6264 (*m_exp)[nelmt]->IProductWRTBase(innarray, outarray);
6266 Vmath::Vadd(nelmtcoef, &outarray[0], 1, &MatC_data[0] + np,
6267 nelmtcoef, &MatC_data[0] + np, nelmtcoef);
6287 int pt0 = (*m_exp)[i]->GetNumPoints(0);
6288 int pt1 = (*m_exp)[i]->GetNumPoints(1);
6289 int npt0 = (int)pt0 * scale;
6290 int npt1 = (int)pt1 * scale;
6293 npt0, (*
m_exp)[i]->GetPointsType(0));
6295 npt1, (*
m_exp)[i]->GetPointsType(1));
6299 newPointsKey0, newPointsKey1, &inarray[cnt],
6300 (*
m_exp)[i]->GetBasis(0)->GetPointsKey(),
6301 (*
m_exp)[i]->GetBasis(1)->GetPointsKey(), &outarray[cnt1]);
6313 int pt0 = (*m_exp)[i]->GetNumPoints(0);
6314 int pt1 = (*m_exp)[i]->GetNumPoints(1);
6315 int pt2 = (*m_exp)[i]->GetNumPoints(2);
6316 int npt0 = (int)pt0 * scale;
6317 int npt1 = (int)pt1 * scale;
6318 int npt2 = (int)pt2 * scale;
6321 npt0, (*
m_exp)[i]->GetPointsType(0));
6323 npt1, (*
m_exp)[i]->GetPointsType(1));
6325 npt2, (*
m_exp)[i]->GetPointsType(2));
6329 newPointsKey0, newPointsKey1, newPointsKey2, &inarray[cnt],
6330 (*
m_exp)[i]->GetBasis(0)->GetPointsKey(),
6331 (*
m_exp)[i]->GetBasis(1)->GetPointsKey(),
6332 (*
m_exp)[i]->GetBasis(2)->GetPointsKey(), &outarray[cnt1]);
6334 cnt += npt0 * npt1 * npt2;
6335 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)
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;.
size_t GetMaxCollectionSize()
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.
size_t GetNumPoints() const
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)
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
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)
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_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)
virtual void v_CurlCurl(Array< OneD, Array< OneD, NekDouble > > &Vel, Array< OneD, Array< OneD, NekDouble > > &Q)
virtual void v_LocalToGlobal(bool UseComm)
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions()
virtual LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > & v_GetGlobalLinSysManager(void)
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)
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)
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_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
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
std::shared_ptr< AssemblyMapDG > & GetTraceMap(void)
virtual void v_GetMovingFrames(const SpatialDomains::GeomMMF MMFdir, const Array< OneD, const NekDouble > &CircCentre, Array< OneD, Array< OneD, NekDouble > > &outarray)
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 GlobalLinSysKey v_LinearAdvectionDiffusionReactionSolve(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 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 void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals)
virtual Array< OneD, const NekDouble > v_HomogeneousEnergy(void)
virtual NekDouble v_GetHomoLen(void)
const LocTraceToTraceMapSharedPtr & GetLocTraceToTraceMap() const
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 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)
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)
std::shared_ptr< ExpList > GetSharedThisPtr()
Returns a shared pointer to the current object.
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)
std::map< int, RobinBCInfoSharedPtr > GetRobinBCInfo()
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)
virtual void v_FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
virtual void v_Curl(Array< OneD, Array< OneD, NekDouble > > &Vel, Array< OneD, Array< OneD, NekDouble > > &Q)
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 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 NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &inarray)
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()
void GetMatIpwrtDeriveBase(const Array< OneD, const Array< OneD, NekDouble > > &inarray, const int nDirctn, Array< OneD, DNekMatSharedPtr > &mtxPerVar)
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)
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)
void ApplyGeomInfo()
Apply geometry information to each expansion.
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.
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)
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)
virtual void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
Populate normals with the normals of all expansions.
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
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
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.
virtual void v_AddTraceIntegral(const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
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.
void GetDiagMatIpwrtBase(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, DNekMatSharedPtr > &mtxPerVar)
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.
Class representing a prismatic element in reference space.
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
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
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
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
const std::vector< NekDouble > velocity
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::shared_ptr< std::vector< std::pair< GeometrySharedPtr, int > > > GeometryLinkSharedPtr
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< Geometry > GeometrySharedPtr
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
std::vector< double > z(NPUPPER)
std::vector< double > d(NPUPPER *NPUPPER)
StdRegions::ConstFactorMap factors
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