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;
751 for (
size_t i = 0; i < nShrProc; ++i)
754 Vmath::Imin(nShrProc, &sharedid[numShared[rank]], 1);
755 sharedid[numShared[rank] + minId] += maxoffset;
758 doneDom.insert(ShrToDom[minId]);
764 if (doneDom.count(
d.first) == 0)
775 map<int, std::vector<InterfacePointShPtr>> VidToDomain;
785 for (
size_t omega = 0; omega <
m_nDomains; ++omega)
789 for (
size_t i = 0; i < (
m_vessels[vesselID]->GetBndConditions()).size();
792 if (
m_vessels[vesselID]->GetBndConditions()[i]->GetUserDefined() ==
797 ->UpdateBndCondExpansion(i)
809 size_t nExp =
m_vessels[vesselID]->GetExpSize();
810 for (
size_t n = 0; n < nExp; ++n)
812 for (
size_t p = 0;
p < 2; ++
p)
817 ->GetElmtToTrace()[n][
p]
824 ->GetElmtToTrace()[n][
p]
829 ->GetCoeff_Offset(eid);
846 VidToDomain[vid].push_back(Ipt);
857 domId[cnt] =
d.first;
863 int nvid2dom = VidToDomain.size();
868 for (
auto &v : VidToDomain)
870 tmp[cnt] = v.first + 1;
871 for (
size_t i = 0; i < v.second.size(); ++i)
878 const bool verbose =
m_session->DefinesCmdLineArgument(
"verbose");
891 for (
auto &v : VidToDomain)
893 if (nvid[cnt] == 3.0)
895 for (
size_t i = 0; i < v.second.size(); ++i)
900 if (v.second[i]->m_elmtVert == 0)
916 for (
auto &v : VidToDomain)
918 if (nvid[cnt] == 2.0)
921 for (
size_t i = 0; i < v.second.size(); ++i)
924 max(dom[cnt], (
NekDouble)domId[v.second[i]->m_domain]);
927 else if (nvid[cnt] == 3.0)
933 int val = (nbeg[cnt] == 2.0) ? 0 : 1;
935 for (
size_t i = 0; i < v.second.size(); ++i)
937 if (v.second[i]->m_elmtVert == val)
940 max(dom[cnt], (
NekDouble)domId[v.second[i]->m_domain]);
950 for (
auto &iter : VidToDomain)
952 ASSERTL1(nvid[v] != 1.0,
"Found an interface wth only "
953 "one domain which should not happen");
957 for (
size_t i = 0; i < iter.second.size(); ++i)
959 if (domId[iter.second[i]->m_domain] == dom[v])
961 iter.second[i]->m_riemannOrd = 1;
965 iter.second[i]->m_riemannOrd = 0;
970 else if (nvid[v] == 3.0)
973 int val = (nbeg[v] == 2.0) ? 1 : 0;
975 for (
size_t i = 0; i < iter.second.size(); ++i)
977 if (iter.second[i]->m_elmtVert == val)
979 iter.second[i]->m_riemannOrd = 0;
983 if (domId[iter.second[i]->m_domain] == dom[v])
985 iter.second[i]->m_riemannOrd = 2;
989 iter.second[i]->m_riemannOrd = 1;
1005 ASSERTL0(
false,
"Unknown junction type");
1021 for (
size_t i = 0; i < 3; ++i)
1023 tmp1[3 * cnt + i] = (
NekDouble)(3 * vid + i + 1);
1030 for (
size_t i = 0; i < 3; ++i)
1032 tmp1[3 * cnt + i] = (
NekDouble)(3 * vid + i + 1);
1039 for (
size_t i = 0; i < 3; ++i)
1041 tmp1[3 * cnt + i] = (
NekDouble)(3 * vid + i + 1);
1050 map<int, LibUtilities::CommSharedPtr> &domComm)
1065 map<int, SpatialDomains::GeometrySharedPtr> domvids;
1071 for (
size_t j = 0; j < compIt.second->m_geomVec.size(); ++j)
1075 for (
size_t p = 0;
p < 2; ++
p)
1078 compIt.second->m_geomVec[j]->GetVertex(
p);
1079 int vid = vert->GetGlobalID();
1083 if (domvids.count(vid))
1089 domvids[vid] = vert;
1095 ASSERTL1(domvids.size() == 2,
"Failed to find two end points "
1096 "of a domain (domvids = " +
1097 std::to_string(domvids.size()) +
")");
1099 size_t nprocs = domComm[
d]->GetSize();
1103 size_t rank = domComm[
d]->GetRank();
1105 nvids[rank] = domvids.size();
1113 for (
size_t i = 0; i < rank; ++i)
1118 for (
auto &i : domvids)
1120 locids[cnt++] = i.first;
1127 for (
size_t i = 0; i < totvids; ++i)
1129 if (chkvids.count(locids[i]))
1132 if (domvids.count(locids[i]))
1134 domvids.erase(locids[i]);
1139 chkvids.insert(locids[i]);
1148 for (
auto &it : bregions)
1150 for (
auto &bregionIt : *it.second)
1154 int id = bregionIt.second->m_geomVec[0]->GetGlobalID();
1156 if (domvids.count(
id))
1164 std::vector<std::string> variables =
m_session->GetVariables();
1168 for (
auto &b : bregions)
1170 maxbregind = (maxbregind > b.first) ? maxbregind : b.first;
1173 for (
auto &b : domvids)
1183 gvec->m_geomVec.push_back(b.second);
1184 (*breg)[b.first] = gvec;
1192 std::string userDefined =
"Interface";
1196 AllocateSharedPtr(
m_session,
"0", userDefined));
1198 for (
size_t i = 0; i < variables.size(); ++i)
1200 (*bCondition)[variables[i]] = DirichletInterface;
1217 [[maybe_unused]]
bool dumpInitialConditions)
1219 if (
m_session->GetComm()->GetRank() == 0)
1221 cout <<
"Initial Conditions: " << endl;
1229 for (
size_t i = 0; i < 2; ++i)
1234 if (
m_session->GetComm()->GetRank() == 0)
1236 cout <<
"Subdomain: " << omega << endl;
1244 for (
size_t i = 0; i < 2; ++i)
1288 time_v_IntStep.
Start();
1291 time_v_IntStep.
Stop();
1300 cout <<
"Steps: " << n + 1 <<
"\t Time: " <<
m_time
1301 <<
"\t Time-step: " <<
m_timestep <<
"\t" << endl;
1310 for (
size_t omega = 0; omega <
m_nDomains; omega++)
1344 time_FillDataFromInterfacePoint.
Start();
1346 int omega = I->m_domain;
1347 int traceId = I->m_traceId;
1348 int eid = I->m_elmt;
1349 int vert = I->m_elmtVert;
1351 int phys_offset =
m_vessels[vesselID]->GetPhys_Offset(eid);
1355 m_vessels[vesselID]->GetExp(eid)->GetTracePhysVals(
1358 m_vessels[vesselID]->GetExp(eid)->GetTracePhysVals(
1365 time_FillDataFromInterfacePoint.
Stop();
1367 "PulseWaveSystem::FillDataFromInterfacePoint", 2);
1374 time_EnforceInterfaceConditions.
Start();
1395 beta[l + 3 * cnt], A_0[l + 3 * cnt], alpha[l + 3 * cnt]);
1407 m_mergingJcts[n][i], fields, Au[l + 3 * cnt], uu[l + 3 * cnt],
1408 beta[l + 3 * cnt], A_0[l + 3 * cnt], alpha[l + 3 * cnt]);
1420 beta[l + 3 * cnt], A_0[l + 3 * cnt], alpha[l + 3 * cnt]);
1437 betat =
beta + 3 * cnt, A_0t = A_0 + 3 * cnt,
1438 alphat = alpha + 3 * cnt);
1447 ->UpdateBndCondExpansion(bcpos)
1448 ->UpdatePhys()[0] = Au[l + 3 * cnt];
1450 ->UpdateBndCondExpansion(bcpos)
1451 ->UpdatePhys()[0] = uu[l + 3 * cnt];
1460 betat =
beta + 3 * cnt, A_0t = A_0 + 3 * cnt,
1461 alphat = alpha + 3 * cnt);
1470 ->UpdateBndCondExpansion(bcpos)
1471 ->UpdatePhys()[0] = Au[l + 3 * cnt];
1473 ->UpdateBndCondExpansion(bcpos)
1474 ->UpdatePhys()[0] = uu[l + 3 * cnt];
1482 betat =
beta + 3 * cnt, A_0t = A_0 + 3 * cnt,
1483 alphat = alpha + 3 * cnt);
1492 ->UpdateBndCondExpansion(bcpos)
1493 ->UpdatePhys()[0] = Au[l + 3 * cnt];
1495 ->UpdateBndCondExpansion(bcpos)
1496 ->UpdatePhys()[0] = uu[l + 3 * cnt];
1499 time_EnforceInterfaceConditions.
Stop();
1501 "PulseWaveSystem::EnforceInterfaceConditions", 1);
1537 for (
size_t i = 1; i < 3; ++i)
1546 while ((proceed) && (iter < MAX_ITER))
1549 time_BifurcationRiemann.
Start();
1565 for (
size_t i = 0; i < 3; ++i)
1576 f[0] = W_Au[0] - W[0];
1577 f[1] = W_Au[1] - W[1];
1578 f[2] = W_Au[2] - W[2];
1579 f[3] = Au[0] * uu[0] - Au[1] * uu[1] - Au[2] * uu[2];
1580 f[4] = uu[0] * uu[0] + 2 * P_Au[0] / rho - uu[1] * uu[1] -
1582 f[5] = uu[0] * uu[0] + 2 * P_Au[0] / rho - uu[2] * uu[2] -
1592 for (
int i = 0; i < 3; ++i)
1599 if (
Dot(dx, dx) < Tol)
1605 if (iter >= MAX_ITER)
1607 ASSERTL0(
false,
"Riemann solver for Bifurcation did not converge.");
1609 time_BifurcationRiemann.
Stop();
1611 "PulseWaveSystem::Bifurcation Riemann", 2);
1647 for (
size_t i = 1; i < 3; ++i)
1656 while ((proceed) && (iter < MAX_ITER))
1659 time_MergingRiemann.
Start();
1677 for (
size_t i = 0; i < 3; ++i)
1688 f[0] = W_Au[0] - W[0];
1689 f[1] = W_Au[1] - W[1];
1690 f[2] = W_Au[2] - W[2];
1691 f[3] = Au[0] * uu[0] - Au[1] * uu[1] - Au[2] * uu[2];
1692 f[4] = uu[0] * uu[0] + 2 * P_Au[0] / rho - uu[1] * uu[1] -
1694 f[5] = uu[0] * uu[0] + 2 * P_Au[0] / rho - uu[2] * uu[2] -
1704 for (
size_t i = 0; i < 3; ++i)
1711 if (
Dot(dx, dx) < Tol)
1717 if (iter >= MAX_ITER)
1719 ASSERTL0(
false,
"Riemann solver for Merging Flow did not converge");
1721 time_MergingRiemann.
Stop();
1761 while ((proceed) && (iter < MAX_ITER))
1764 time_InterfaceRiemann.
Start();
1776 for (
size_t i = 0; i < 2; ++i)
1786 f[0] = W_Au[0] - W[0];
1787 f[1] = W_Au[1] - W[1];
1788 f[2] = Au[0] * uu[0] - Au[1] * uu[1];
1789 f[3] = uu[0] * uu[0] + 2 * P_Au[0] / rho - uu[1] * uu[1] -
1799 for (
size_t i = 0; i < 2; ++i)
1806 if (
Dot(dx, dx) < Tol)
1810 time_InterfaceRiemann.
Stop();
1812 "PulseWaveSystem::InterfaceRiemann", 2);
1815 if (iter >= MAX_ITER)
1817 ASSERTL0(
false,
"Riemann solver for Interface did not converge");
1842 std::stringstream outname;
1854 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
1855 std::vector<std::string> variables =
m_session->GetVariables();
1862 std::vector<std::vector<NekDouble>> FieldData(FieldDef.size());
1864 size_t nFieldDefPerDomain = FieldDef.size() /
m_nDomains;
1873 for (
size_t i = 0; i < nFieldDefPerDomain; ++i)
1875 cnt = n * nFieldDefPerDomain + i;
1877 FieldDef[cnt]->m_fields.push_back(variables[j]);
1880 FieldDef[cnt], FieldData[cnt],
1890 for (
size_t i = 0; i < nFieldDefPerDomain; ++i)
1892 cnt = n * nFieldDefPerDomain + i;
1894 FieldDef[cnt]->m_fields.push_back(
"P");
1897 FieldData[cnt], PFwd);
1913 for (
size_t i = 0; i < nFieldDefPerDomain; ++i)
1915 cnt = n * nFieldDefPerDomain + i;
1917 FieldDef[cnt]->m_fields.push_back(
"c");
1918 FieldDef[cnt]->m_fields.push_back(
"W1");
1919 FieldDef[cnt]->m_fields.push_back(
"W2");
1922 FieldDef[cnt], FieldData[cnt], PWVFwd);
1924 FieldDef[cnt], FieldData[cnt], W1Fwd);
1926 FieldDef[cnt], FieldData[cnt], W2Fwd);
1956 for (
size_t omega = 0; omega <
m_nDomains; omega++)
1966 if (
m_vessels[vesselid]->GetPhysState() ==
false)
1973 if (exactsoln.size())
1976 m_vessels[vesselid]->GetPhys(), exactsoln);
1978 else if (
m_session->DefinesFunction(
"ExactSolution"))
1990 m_vessels[vesselid]->GetPhys(), exactsoln);
1998 if (
m_vessels[vesselid]->GetComm()->GetRank())
2005 L2error += L2error_dom * L2error_dom;
2007 if (Normalised ==
true)
2012 Vol +=
m_vessels[vesselid]->Integral(one);
2023 if (Normalised ==
true)
2027 L2error =
sqrt(L2error / Vol);
2031 L2error =
sqrt(L2error);
2046 NekDouble LinferrorDom, Linferror = -1.0;
2048 for (
size_t omega = 0; omega <
m_nDomains; ++omega)
2060 if (
m_vessels[vesselid]->GetPhysState() ==
false)
2067 if (exactsoln.size())
2069 LinferrorDom =
m_vessels[vesselid]->Linf(
2070 m_vessels[vesselid]->GetPhys(), exactsoln);
2072 else if (
m_session->DefinesFunction(
"ExactSolution"))
2081 LinferrorDom =
m_vessels[vesselid]->Linf(
2082 m_vessels[vesselid]->GetPhys(), exactsoln);
2089 Linferror = (Linferror > LinferrorDom) ? Linferror : LinferrorDom;
2093 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
void v_DoInitialise(bool dumpInitialConditions=false) override
Sets up initial conditions.
Array< OneD, Array< OneD, NekDouble > > m_beta_trace
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
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
Array< OneD, Array< OneD, NekDouble > > m_pressure
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
void v_Output(void) override
Array< OneD, MultiRegions::ExpListSharedPtr > m_vessels
~PulseWaveSystem() override
Destructor.
void FillDataFromInterfacePoint(InterfacePointShPtr &I, const Array< OneD, const Array< OneD, NekDouble > > &field, NekDouble &A, NekDouble &u, NekDouble &beta, NekDouble &A_0, NekDouble &alpha)
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)
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.
void v_DoSolve() override
Solves an unsteady problem.
void EnforceInterfaceConditions(const Array< OneD, const Array< OneD, NekDouble > > &fields)
Array< OneD, Array< OneD, NekDouble > > m_beta
PulseWaveSystem(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Initialises PulseWaveSystem class members.
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.
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
std::vector< double > d(NPUPPER *NPUPPER)
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)