65 PulseWaveSystem::PulseWaveSystem(
99 "Pulse solver only set up for Discontinuous projections");
102 m_graph->GetMeshDimension() == 1,
103 "Pulse wave solver only set up for expansion dimension equal to 1");
116 if (
m_session->DefinesSolverInfo(
"PressureArea"))
137 bool SetToOneSpaceDimension =
true;
139 if (
m_session->DefinesCmdLineArgument(
"SetToOneSpaceDimension"))
141 std::string cmdline =
m_session->GetCmdLineArgument<std::string>(
142 "SetToOneSpaceDimension");
143 if (boost::to_upper_copy(cmdline) ==
"FALSE")
145 SetToOneSpaceDimension =
false;
150 map<int, LibUtilities::CommSharedPtr> domComm;
163 SetToOneSpaceDimension);
253 if (
m_session->DefinesFunction(
"Viscoelasticity"))
260 for (
int j = 0; j < nq; ++j)
271 if (
m_session->DefinesFunction(
"StrainStiffening"))
278 for (
int j = 0; j < nq; ++j)
298 if (SetToOneSpaceDimension)
303 int nelmt_trace = trace->GetExpSize();
307 for (
int i = 0; i < nelmt_trace; ++i)
314 trace->GetExp(0)->GetGeom()->SetCoordim(1);
316 trace->GetNormals(normals);
325 map<int, LibUtilities::CommSharedPtr> &retval)
329 std::string def(
"default");
330 char *argv =
new char[def.length() + 1];
331 std::strcpy(argv, def.c_str());
335 size_t nprocs =
m_comm->GetSize();
342 retval[d.first] = serialComm;
349 size_t rank =
m_comm->GetRank();
355 dmax = ((size_t)d.first > dmax) ? d.first : dmax;
365 commtmp[d.first] = 1;
374 for (
size_t d = 0; d < dmax; ++d)
385 if ((
size_t)d1.first == d)
391 newcomm =
m_comm->CommCreateIf(flag);
396 if ((
size_t)d1.first == d)
415 map<int, int> SharedProc;
420 if (commtmp[d.first] == 1)
422 retval[d.first] = serialComm;
424 else if (commtmp[d.first] == 2)
426 SharedProc[d.first] = 1;
427 commtmp1[d.first] = rank;
435 size_t nShrProc = SharedProc.size();
436 int commMax = nShrProc;
445 for (
auto &d : SharedProc)
447 SharedProc[d.first] = commtmp1[d.first] - rank;
453 map<int, pair<int, int>> CreateComm;
465 while (dorank < nprocs)
470 if (DoneCreate[dorank] ==
false)
473 ncomms = (rank == dorank) ? nShrProc : 0;
478 DoneCreate[dorank] = (ncomms == 0) ?
true :
false;
484 bool doneCreateOnDoRank =
false;
485 bool doneCreateOnSharedProc =
false;
486 bool createdComm =
false;
490 if ((proclist.count(dorank) == 0))
496 for (
auto &d : SharedProc)
498 if (CreateComm.count(d.first) == 0)
500 sharedproc = SharedProc[d.first];
506 "Failed to fine a new "
507 "processor to set up another "
510 if (proclist.count(sharedproc) == 0)
514 for (
auto &d : SharedProc)
516 if (d.second == sharedproc)
518 CreateComm[d.first] = pair<int, int>(
519 commcall, flag + d.first);
526 if (CreateComm.size() == nShrProc)
528 doneCreateOnDoRank =
true;
539 "Error in obtaining rank "
540 "shared by domain. Sharedproc value is greater "
541 "than number of procs");
543 if (proclist.count(sharedproc) == 0)
545 if ((
int)rank == sharedproc)
549 for (
auto &d : SharedProc)
551 if (d.second == (
int)dorank)
553 CreateComm[d.first] = pair<int, int>(
554 commcall, flag + d.first);
559 if (CreateComm.size() == nShrProc)
561 doneCreateOnSharedProc =
true;
568 setdone[0] = (doneCreateOnDoRank) ? 1 : 0;
569 setdone[1] = (doneCreateOnSharedProc) ? 1 : 0;
570 setdone[2] = (createdComm) ? 1 : 0;
572 DoneCreate[dorank] = (bool)setdone[0];
573 if (sharedproc != -1)
575 DoneCreate[sharedproc] = (bool)setdone[1];
579 proclist.insert(dorank);
580 proclist.insert(sharedproc);
589 for (i = 0; i < nprocs; ++i)
591 if (DoneCreate[i] ==
false)
605 "Failed to find sub communicators "
606 "pattern in 4*commMax searches");
610 ASSERTL1(CreateComm.size() == nShrProc,
611 "Have not created communicators for all shared procs");
614 size_t maxCreateComm = CreateComm.size();
618 for (
size_t i = 0; i < maxCreateComm; ++i)
623 for (
auto &d : CreateComm)
625 if (d.second.first == (
int)i)
627 flag = d.second.second;
631 newcomm =
m_comm->CommCreateIf(flag);
633 for (
auto &d : CreateComm)
635 if (d.second.first == (
int)i)
637 retval[d.first] = newcomm;
651 numShared[rank] = nShrProc;
653 int totShared = (int)
Vmath::Vsum(nprocs, numShared, 1);
659 for (
auto &s : SharedProc)
661 if (s.second > (
int)rank)
667 numOffset[rank] = cnt;
671 for (
size_t i = 1; i < nprocs; ++i)
673 numShared[i] += numShared[i - 1];
674 numOffset[i] += numOffset[i - 1];
676 for (
size_t i = nprocs - 1; i > 0; --i)
678 numShared[i] = numShared[i - 1];
679 numOffset[i] = numOffset[i - 1];
687 for (
auto &s : SharedProc)
689 shareddom[numShared[rank] + cnt] = s.first;
698 for (
auto &s : SharedProc)
700 if (s.second > (
int)rank)
702 sharedid[numShared[rank] + cnt] = numOffset[rank] + cnt1;
706 for (j = 0; j < maxCreateComm; ++j)
708 if ((numShared[s.second] + j < totShared) &&
709 (shareddom[numShared[s.second] + j] == s.first))
715 sharedid[numShared[s.second] + j] = numOffset[rank] + cnt1;
726 for (
size_t i = 0; i < (size_t)totShared; ++i)
729 "Failed to number shared proc uniquely");
735 (int)
Vmath::Vmax(nShrProc, &sharedid[numShared[rank]], 1);
740 map<int, int> ShrToDom;
742 for (
auto &s : SharedProc)
744 ShrToDom[cnt] = s.first;
753 for (
size_t i = 0; i < nShrProc; ++i)
756 Vmath::Imin(nShrProc, &sharedid[numShared[rank]], 1);
757 sharedid[numShared[rank] + minId] += maxoffset;
760 doneDom.insert(ShrToDom[minId]);
766 if (doneDom.count(d.first) == 0)
777 map<int, std::vector<InterfacePointShPtr>> VidToDomain;
787 for (
size_t omega = 0; omega <
m_nDomains; ++omega)
791 for (
size_t i = 0; i < (
m_vessels[vesselID]->GetBndConditions()).size();
794 if (
m_vessels[vesselID]->GetBndConditions()[i]->GetUserDefined() ==
799 ->UpdateBndCondExpansion(i)
811 size_t nExp =
m_vessels[vesselID]->GetExpSize();
812 for (
size_t n = 0; n < nExp; ++n)
814 for (
size_t p = 0;
p < 2; ++
p)
819 ->GetElmtToTrace()[n][
p]
826 ->GetElmtToTrace()[n][
p]
831 ->GetCoeff_Offset(eid);
848 VidToDomain[vid].push_back(Ipt);
859 domId[cnt] = d.first;
865 int nvid2dom = VidToDomain.size();
870 for (
auto &v : VidToDomain)
872 tmp[cnt] = v.first + 1;
873 for (
size_t i = 0; i < v.second.size(); ++i)
880 const bool verbose =
m_session->DefinesCmdLineArgument(
"verbose");
893 for (
auto &v : VidToDomain)
895 if (nvid[cnt] == 3.0)
897 for (
size_t i = 0; i < v.second.size(); ++i)
902 if (v.second[i]->m_elmtVert == 0)
918 for (
auto &v : VidToDomain)
920 if (nvid[cnt] == 2.0)
923 for (
size_t i = 0; i < v.second.size(); ++i)
926 max(dom[cnt], (
NekDouble)domId[v.second[i]->m_domain]);
929 else if (nvid[cnt] == 3.0)
935 int val = (nbeg[cnt] == 2.0) ? 0 : 1;
937 for (
size_t i = 0; i < v.second.size(); ++i)
939 if (v.second[i]->m_elmtVert == val)
942 max(dom[cnt], (
NekDouble)domId[v.second[i]->m_domain]);
952 for (
auto &iter : VidToDomain)
954 ASSERTL1(nvid[v] != 1.0,
"Found an interface wth only "
955 "one domain which should not happen");
959 for (
size_t i = 0; i < iter.second.size(); ++i)
961 if (domId[iter.second[i]->m_domain] == dom[v])
963 iter.second[i]->m_riemannOrd = 1;
967 iter.second[i]->m_riemannOrd = 0;
972 else if (nvid[v] == 3.0)
975 int val = (nbeg[v] == 2.0) ? 1 : 0;
977 for (
size_t i = 0; i < iter.second.size(); ++i)
979 if (iter.second[i]->m_elmtVert == val)
981 iter.second[i]->m_riemannOrd = 0;
985 if (domId[iter.second[i]->m_domain] == dom[v])
987 iter.second[i]->m_riemannOrd = 2;
991 iter.second[i]->m_riemannOrd = 1;
1007 ASSERTL0(
false,
"Unknown junction type");
1023 for (
size_t i = 0; i < 3; ++i)
1025 tmp1[3 * cnt + i] = (
NekDouble)(3 * vid + i + 1);
1032 for (
size_t i = 0; i < 3; ++i)
1034 tmp1[3 * cnt + i] = (
NekDouble)(3 * vid + i + 1);
1041 for (
size_t i = 0; i < 3; ++i)
1043 tmp1[3 * cnt + i] = (
NekDouble)(3 * vid + i + 1);
1052 map<int, LibUtilities::CommSharedPtr> &domComm)
1067 map<int, SpatialDomains::GeometrySharedPtr> domvids;
1073 for (
size_t j = 0; j < compIt.second->m_geomVec.size(); ++j)
1077 for (
size_t p = 0;
p < 2; ++
p)
1080 compIt.second->m_geomVec[j]->GetVertex(
p);
1081 int vid = vert->GetGlobalID();
1085 if (domvids.count(vid))
1091 domvids[vid] = vert;
1098 "Failed to find two end points "
1099 "of a domain (domvids = " +
1100 boost::lexical_cast<std::string>(domvids.size()) +
")");
1102 size_t nprocs = domComm[d]->GetSize();
1106 size_t rank = domComm[d]->GetRank();
1108 nvids[rank] = domvids.size();
1116 for (
size_t i = 0; i < rank; ++i)
1121 for (
auto &i : domvids)
1123 locids[cnt++] = i.first;
1130 for (
size_t i = 0; i < totvids; ++i)
1132 if (chkvids.count(locids[i]))
1135 if (domvids.count(locids[i]))
1137 domvids.erase(locids[i]);
1142 chkvids.insert(locids[i]);
1151 for (
auto &it : bregions)
1153 for (
auto &bregionIt : *it.second)
1157 int id = bregionIt.second->m_geomVec[0]->GetGlobalID();
1159 if (domvids.count(
id))
1167 std::vector<std::string> variables =
m_session->GetVariables();
1171 for (
auto &b : bregions)
1173 maxbregind = (maxbregind > b.first) ? maxbregind : b.first;
1176 for (
auto &b : domvids)
1186 gvec->m_geomVec.push_back(b.second);
1187 (*breg)[b.first] = gvec;
1195 std::string userDefined =
"Interface";
1199 AllocateSharedPtr(
m_session,
"0", userDefined));
1201 for (
size_t i = 0; i < variables.size(); ++i)
1203 (*bCondition)[variables[i]] = DirichletInterface;
1222 if (
m_session->GetComm()->GetRank() == 0)
1224 cout <<
"Initial Conditions: " << endl;
1232 for (
size_t i = 0; i < 2; ++i)
1237 if (
m_session->GetComm()->GetRank() == 0)
1239 cout <<
"Subdomain: " << omega << endl;
1247 for (
size_t i = 0; i < 2; ++i)
1291 time_v_IntStep.
Start();
1294 time_v_IntStep.
Stop();
1303 cout <<
"Steps: " << n + 1 <<
"\t Time: " <<
m_time
1304 <<
"\t Time-step: " <<
m_timestep <<
"\t" << endl;
1313 for (
size_t omega = 0; omega <
m_nDomains; omega++)
1347 time_FillDataFromInterfacePoint.
Start();
1349 int omega = I->m_domain;
1350 int traceId = I->m_traceId;
1351 int eid = I->m_elmt;
1352 int vert = I->m_elmtVert;
1354 int phys_offset =
m_vessels[vesselID]->GetPhys_Offset(eid);
1358 m_vessels[vesselID]->GetExp(eid)->GetTracePhysVals(
1361 m_vessels[vesselID]->GetExp(eid)->GetTracePhysVals(
1368 time_FillDataFromInterfacePoint.
Stop();
1370 "PulseWaveSystem::FillDataFromInterfacePoint", 2);
1377 time_EnforceInterfaceConditions.
Start();
1398 beta[l + 3 * cnt], A_0[l + 3 * cnt], alpha[l + 3 * cnt]);
1410 m_mergingJcts[n][i], fields, Au[l + 3 * cnt], uu[l + 3 * cnt],
1411 beta[l + 3 * cnt], A_0[l + 3 * cnt], alpha[l + 3 * cnt]);
1423 beta[l + 3 * cnt], A_0[l + 3 * cnt], alpha[l + 3 * cnt]);
1440 betat =
beta + 3 * cnt, A_0t = A_0 + 3 * cnt,
1441 alphat = alpha + 3 * cnt);
1450 ->UpdateBndCondExpansion(bcpos)
1451 ->UpdatePhys()[0] = Au[l + 3 * cnt];
1453 ->UpdateBndCondExpansion(bcpos)
1454 ->UpdatePhys()[0] = uu[l + 3 * cnt];
1463 betat =
beta + 3 * cnt, A_0t = A_0 + 3 * cnt,
1464 alphat = alpha + 3 * cnt);
1473 ->UpdateBndCondExpansion(bcpos)
1474 ->UpdatePhys()[0] = Au[l + 3 * cnt];
1476 ->UpdateBndCondExpansion(bcpos)
1477 ->UpdatePhys()[0] = uu[l + 3 * cnt];
1485 betat =
beta + 3 * cnt, A_0t = A_0 + 3 * cnt,
1486 alphat = alpha + 3 * cnt);
1495 ->UpdateBndCondExpansion(bcpos)
1496 ->UpdatePhys()[0] = Au[l + 3 * cnt];
1498 ->UpdateBndCondExpansion(bcpos)
1499 ->UpdatePhys()[0] = uu[l + 3 * cnt];
1502 time_EnforceInterfaceConditions.
Stop();
1504 "PulseWaveSystem::EnforceInterfaceConditions", 1);
1540 for (
size_t i = 1; i < 3; ++i)
1549 while ((proceed) && (iter < MAX_ITER))
1552 time_BifurcationRiemann.
Start();
1568 for (
size_t i = 0; i < 3; ++i)
1579 f[0] = W_Au[0] - W[0];
1580 f[1] = W_Au[1] - W[1];
1581 f[2] = W_Au[2] - W[2];
1582 f[3] = Au[0] * uu[0] - Au[1] * uu[1] - Au[2] * uu[2];
1583 f[4] = uu[0] * uu[0] + 2 * P_Au[0] / rho - uu[1] * uu[1] -
1585 f[5] = uu[0] * uu[0] + 2 * P_Au[0] / rho - uu[2] * uu[2] -
1595 for (
int i = 0; i < 3; ++i)
1602 if (
Dot(dx, dx) < Tol)
1608 if (iter >= MAX_ITER)
1610 ASSERTL0(
false,
"Riemann solver for Bifurcation did not converge.");
1612 time_BifurcationRiemann.
Stop();
1614 "PulseWaveSystem::Bifurcation Riemann", 2);
1650 for (
size_t i = 1; i < 3; ++i)
1659 while ((proceed) && (iter < MAX_ITER))
1662 time_MergingRiemann.
Start();
1680 for (
size_t i = 0; i < 3; ++i)
1691 f[0] = W_Au[0] - W[0];
1692 f[1] = W_Au[1] - W[1];
1693 f[2] = W_Au[2] - W[2];
1694 f[3] = Au[0] * uu[0] - Au[1] * uu[1] - Au[2] * uu[2];
1695 f[4] = uu[0] * uu[0] + 2 * P_Au[0] / rho - uu[1] * uu[1] -
1697 f[5] = uu[0] * uu[0] + 2 * P_Au[0] / rho - uu[2] * uu[2] -
1707 for (
size_t i = 0; i < 3; ++i)
1714 if (
Dot(dx, dx) < Tol)
1720 if (iter >= MAX_ITER)
1722 ASSERTL0(
false,
"Riemann solver for Merging Flow did not converge");
1724 time_MergingRiemann.
Stop();
1764 while ((proceed) && (iter < MAX_ITER))
1767 time_InterfaceRiemann.
Start();
1779 for (
size_t i = 0; i < 2; ++i)
1789 f[0] = W_Au[0] - W[0];
1790 f[1] = W_Au[1] - W[1];
1791 f[2] = Au[0] * uu[0] - Au[1] * uu[1];
1792 f[3] = uu[0] * uu[0] + 2 * P_Au[0] / rho - uu[1] * uu[1] -
1802 for (
size_t i = 0; i < 2; ++i)
1809 if (
Dot(dx, dx) < Tol)
1813 time_InterfaceRiemann.
Stop();
1815 "PulseWaveSystem::InterfaceRiemann", 2);
1818 if (iter >= MAX_ITER)
1820 ASSERTL0(
false,
"Riemann solver for Interface did not converge");
1845 std::stringstream outname;
1857 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
1858 std::vector<std::string> variables =
m_session->GetVariables();
1865 std::vector<std::vector<NekDouble>> FieldData(FieldDef.size());
1867 size_t nFieldDefPerDomain = FieldDef.size() /
m_nDomains;
1876 for (
size_t i = 0; i < nFieldDefPerDomain; ++i)
1878 cnt = n * nFieldDefPerDomain + i;
1880 FieldDef[cnt]->m_fields.push_back(variables[j]);
1883 FieldDef[cnt], FieldData[cnt],
1893 for (
size_t i = 0; i < nFieldDefPerDomain; ++i)
1895 cnt = n * nFieldDefPerDomain + i;
1897 FieldDef[cnt]->m_fields.push_back(
"P");
1900 FieldData[cnt], PFwd);
1916 for (
size_t i = 0; i < nFieldDefPerDomain; ++i)
1918 cnt = n * nFieldDefPerDomain + i;
1920 FieldDef[cnt]->m_fields.push_back(
"c");
1921 FieldDef[cnt]->m_fields.push_back(
"W1");
1922 FieldDef[cnt]->m_fields.push_back(
"W2");
1925 FieldDef[cnt], FieldData[cnt], PWVFwd);
1927 FieldDef[cnt], FieldData[cnt], W1Fwd);
1929 FieldDef[cnt], FieldData[cnt], W2Fwd);
1953 boost::ignore_unused(exact);
1961 for (
size_t omega = 0; omega <
m_nDomains; omega++)
1971 if (
m_vessels[vesselid]->GetPhysState() ==
false)
1978 if (exactsoln.size())
1981 m_vessels[vesselid]->GetPhys(), exactsoln);
1983 else if (
m_session->DefinesFunction(
"ExactSolution"))
1989 m_session->GetFunction(
"ExactSolution", field, omega);
1991 ->Evaluate(
m_session->GetVariable(field), exactsoln,
1995 m_vessels[vesselid]->GetPhys(), exactsoln);
2003 if (
m_vessels[vesselid]->GetComm()->GetRank())
2010 L2error += L2error_dom * L2error_dom;
2012 if (Normalised ==
true)
2017 Vol +=
m_vessels[vesselid]->Integral(one);
2028 if (Normalised ==
true)
2032 L2error =
sqrt(L2error / Vol);
2036 L2error =
sqrt(L2error);
2051 boost::ignore_unused(exact);
2053 NekDouble LinferrorDom, Linferror = -1.0;
2055 for (
size_t omega = 0; omega <
m_nDomains; ++omega)
2067 if (
m_vessels[vesselid]->GetPhysState() ==
false)
2074 if (exactsoln.size())
2076 LinferrorDom =
m_vessels[vesselid]->Linf(
2077 m_vessels[vesselid]->GetPhys(), exactsoln);
2079 else if (
m_session->DefinesFunction(
"ExactSolution"))
2085 ->Evaluate(
m_session->GetVariable(field), exactsoln,
2088 LinferrorDom =
m_vessels[vesselid]->Linf(
2089 m_vessels[vesselid]->GetPhys(), exactsoln);
2096 Linferror = (Linferror > LinferrorDom) ? Linferror : LinferrorDom;
2100 ASSERTL0(
false,
"ErrorExtraPoints not allowed for this solver");
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
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.
Array< OneD, Array< OneD, NekDouble > > m_A_0
Array< OneD, int > m_fieldPhysOffset
Array< OneD, Array< OneD, NekDouble > > m_beta_trace
virtual void v_DoInitialise() override
Sets up initial conditions.
void EnforceInterfaceConditions(const Array< OneD, const Array< OneD, NekDouble >> &fields)
Array< OneD, Array< OneD, NekDouble > > m_W2
Array< OneD, Array< OneD, NekDouble > > m_trace_fwd_normal
PulseWavePressureAreaSharedPtr m_pressureArea
void CheckPoint_Output(const int n)
Array< OneD, Array< OneD, NekDouble > > m_W1
virtual void v_InitObject(bool DeclareField=false) override
std::vector< int > m_domOrder
void MergingRiemann(Array< OneD, NekDouble > &Au, Array< OneD, NekDouble > &uu, Array< OneD, NekDouble > &beta, Array< OneD, NekDouble > &A_0, Array< OneD, NekDouble > &alpha)
Riemann Problem for Merging Flow.
void InterfaceRiemann(Array< OneD, NekDouble > &Au, Array< OneD, NekDouble > &uu, Array< OneD, NekDouble > &beta, Array< OneD, NekDouble > &A_0, Array< OneD, NekDouble > &alpha)
Riemann Problem for Interface/Junction.
Array< OneD, Array< OneD, NekDouble > > m_alpha_trace
std::map< int, SpatialDomains::CompositeMap > m_domain
UpwindTypePulse m_upwindTypePulse
Array< OneD, Array< OneD, NekDouble > > m_A_0_trace
void FillDataFromInterfacePoint(InterfacePointShPtr &I, const Array< OneD, const Array< OneD, NekDouble >> &field, NekDouble &A, NekDouble &u, NekDouble &beta, NekDouble &A_0, NekDouble &alpha)
Array< OneD, Array< OneD, NekDouble > > m_pressure
virtual ~PulseWaveSystem()
Destructor.
virtual NekDouble v_LinfError(unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray) override
Compute the L_inf error between fields and a given exact solution.
Array< OneD, Array< OneD, NekDouble > > m_gamma
void WriteVessels(const std::string &outname)
Write input fields to the given filename.
void GetCommArray(std::map< int, LibUtilities::CommSharedPtr > &retval)
Set and retrn a series of communicators for each partition.
Array< OneD, Array< OneD, NekDouble > > m_alpha
Gs::gs_data * m_intComm
Communicator for interfaces.
std::vector< std::vector< InterfacePointShPtr > > m_vesselIntfcs
Array< OneD, Array< OneD, NekDouble > > m_PWV
virtual void v_Output(void) override
Array< OneD, MultiRegions::ExpListSharedPtr > m_vessels
std::vector< std::vector< InterfacePointShPtr > > m_bifurcations
void SetUpDomainInterfaceBCs(SpatialDomains::BoundaryConditions &AllBcs, std::map< int, LibUtilities::CommSharedPtr > &domComm)
std::vector< std::vector< InterfacePointShPtr > > m_mergingJcts
void SetUpDomainInterfaces(void)
virtual NekDouble v_L2Error(unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray, bool Normalised=false) override
Compute the L2 error between fields and a given exact solution.
virtual void v_DoSolve() override
Solves an unsteady problem.
Array< OneD, Array< OneD, NekDouble > > m_beta
void BifurcationRiemann(Array< OneD, NekDouble > &Au, Array< OneD, NekDouble > &uu, Array< OneD, NekDouble > &beta, Array< OneD, NekDouble > &A_0, Array< OneD, NekDouble > &alpha)
Riemann Problem for Bifurcation.
LibUtilities::FieldIOSharedPtr m_fld
Field input/output.
SpatialDomains::MeshGraphSharedPtr m_graph
Pointer to graph defining mesh.
LibUtilities::CommSharedPtr m_comm
Communicator.
NekDouble m_timestep
Time step size.
int m_infosteps
Number of time steps between outputting status information.
NekDouble m_time
Current time of simulation.
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
SOLVER_UTILS_EXPORT void EvaluateExactSolution(int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
Evaluates an exact solution.
std::string m_sessionName
Name of the session.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
SOLVER_UTILS_EXPORT int GetNpoints()
SOLVER_UTILS_EXPORT int GetNcoeffs()
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
int m_steps
Number of steps to take.
int m_NumQuadPointsError
Number of Quadrature points used to work out the error.
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
Map to identify relevant solver info to dump in output fields.
int m_checksteps
Number of steps between checkpoints.
SOLVER_UTILS_EXPORT void SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
Initialise the data in the dependent fields.
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction(std::string name, const MultiRegions::ExpListSharedPtr &field=MultiRegions::NullExpListSharedPtr, bool cache=false)
Get a SessionFunction by name.
Base class for unsteady solvers.
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
LibUtilities::TimeIntegrationSchemeSharedPtr m_intScheme
Wrapper to the time integration scheme.
virtual SOLVER_UTILS_EXPORT void v_InitObject(bool DeclareField=true) override
Init object for UnsteadySystem class.
void AddBoundaryRegions(const int regionID, BoundaryRegionShPtr &bRegion)
const BoundaryRegionCollection & GetBoundaryRegions(void) const
void AddBoundaryConditions(const int regionID, BoundaryConditionMapShPtr &bCond)
static void Gather(Nektar::Array< OneD, NekDouble > pU, gs_op pOp, gs_data *pGsh, Nektar::Array< OneD, NekDouble > pBuffer=NullNekDouble1DArray)
Performs a gather-scatter operation of the provided values.
static gs_data * Init(const Nektar::Array< OneD, long > pId, const LibUtilities::CommSharedPtr &pComm, bool verbose=true)
Initialise Gather-Scatter map.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Equation > EquationSharedPtr
@ beta
Gauss Radau pinned at x=-1,.
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
std::shared_ptr< Expansion > ExpansionSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::map< int, CompositeSharedPtr > BoundaryRegion
std::map< int, BoundaryRegionShPtr > BoundaryRegionCollection
std::shared_ptr< BoundaryRegion > BoundaryRegionShPtr
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
std::map< std::string, BoundaryConditionShPtr > BoundaryConditionMap
std::shared_ptr< Composite > CompositeSharedPtr
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::shared_ptr< BoundaryConditionMap > BoundaryConditionMapShPtr
std::shared_ptr< Geometry > GeometrySharedPtr
The above copyright notice and this permission notice shall be included.
std::shared_ptr< InterfacePoint > InterfacePointShPtr
PressureAreaFactory & GetPressureAreaFactory()
void Multiply(NekMatrix< ResultDataType, StandardMatrixTag > &result, const NekMatrix< LhsDataType, LhsMatrixType > &lhs, const ResultDataType &rhs)
@ SIZE_UpwindTypePulse
Length of enum list.
const char *const UpwindTypeMapPulse[]
DataType Dot(const NekVector< DataType > &lhs, const NekVector< DataType > &rhs)
T Vsum(int n, const T *x, const int incx)
Subtract return sum(x)
int Imin(int n, const T *x, const int incx)
Return the index of the minimum element in 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)
scalarT< T > sqrt(scalarT< T > in)