From cce2e7b1025517dc1fd66b91edc0d400d5cab453 Mon Sep 17 00:00:00 2001 From: mac/cli Date: Sat, 13 Apr 2024 12:25:52 -0400 Subject: [PATCH] scalar runs but wrong --- cmake/examples/hjupiter.cmake | 1 + patches/24.time_integrator.patch | 58 ++++++++++++++++++++++++++------ patches/31.task_list.patch | 8 +++-- 3 files changed, 54 insertions(+), 13 deletions(-) diff --git a/cmake/examples/hjupiter.cmake b/cmake/examples/hjupiter.cmake index c9849549..660a36db 100644 --- a/cmake/examples/hjupiter.cmake +++ b/cmake/examples/hjupiter.cmake @@ -15,6 +15,7 @@ set(PNETCDF ON) set(MPI ON) set(DISORT ON) set(PYTHON_BINDINGS ON) +set(NCHEMISTRY 1) set_if_empty(RSOLVER hllc_transform) # set(GLOG ON) diff --git a/patches/24.time_integrator.patch b/patches/24.time_integrator.patch index 3cf654df..4e6688a1 100644 --- a/patches/24.time_integrator.patch +++ b/patches/24.time_integrator.patch @@ -1,5 +1,5 @@ diff --git a/src/task_list/time_integrator.cpp b/src/task_list/time_integrator.cpp -index 2bfc5178..e0fca29d 100644 +index 2bfc5178..173b2566 100644 --- a/src/task_list/time_integrator.cpp +++ b/src/task_list/time_integrator.cpp @@ -36,6 +36,13 @@ @@ -16,13 +16,15 @@ index 2bfc5178..e0fca29d 100644 //---------------------------------------------------------------------------------------- //! TimeIntegratorTaskList constructor -@@ -998,6 +1005,14 @@ TimeIntegratorTaskList::TimeIntegratorTaskList(ParameterInput *pin, Mesh *pm) { +@@ -998,6 +1005,16 @@ TimeIntegratorTaskList::TimeIntegratorTaskList(ParameterInput *pin, Mesh *pm) { AddTask(SEND_HYD,src_aterm); AddTask(RECV_HYD,NONE); AddTask(SETB_HYD,(RECV_HYD|SRC_TERM)); + +#ifdef CUBED_SPHERE -+ AddTask(CLEAR_ALLBND2, SETB_HYD); ++ if (NSCALARS == 0) { ++ AddTask(CLEAR_ALLBND2, SETB_HYD); ++ } + AddTask(RESTART_RECV, CLEAR_ALLBND2); + AddTask(SEND_HYD2, CLEAR_ALLBND2); + AddTask(RECV_HYD2, RESTART_RECV); @@ -31,12 +33,25 @@ index 2bfc5178..e0fca29d 100644 } if (SHEAR_PERIODIC) { -@@ -1157,9 +1172,17 @@ TimeIntegratorTaskList::TimeIntegratorTaskList(ParameterInput *pin, Mesh *pm) { +@@ -1035,6 +1052,12 @@ TimeIntegratorTaskList::TimeIntegratorTaskList(ParameterInput *pin, Mesh *pm) { + AddTask(SEND_SCLR,SRC_TERM); + AddTask(RECV_SCLR,NONE); + AddTask(SETB_SCLR,(RECV_SCLR|SRC_TERM)); ++#ifdef CUBED_SPHERE ++ AddTask(CLEAR_ALLBND2, (SETB_HYD|SETB_SCLR)); ++ AddTask(SEND_SCLR2, CLEAR_ALLBND2); ++ AddTask(RECV_SCLR2, RESTART_RECV); ++ AddTask(SETB_SCLR2, RECV_SCLR2); ++#endif + } + if (SHEAR_PERIODIC) { + AddTask(SEND_SCLRSH,SETB_SCLR); +@@ -1157,9 +1180,17 @@ TimeIntegratorTaskList::TimeIntegratorTaskList(ParameterInput *pin, Mesh *pm) { } } else { if (NSCALARS > 0) { +#ifdef CUBED_SPHERE -+ AddTask(CONS2PRIM,(SETB_HYD2|SETB_SCLR)); ++ AddTask(CONS2PRIM,(SETB_HYD2|SETB_SCLR2)); +#else AddTask(CONS2PRIM,(SETB_HYD|SETB_SCLR)); +#endif // CUBED_SPHERE @@ -49,7 +64,7 @@ index 2bfc5178..e0fca29d 100644 } } } -@@ -1225,11 +1248,16 @@ void TimeIntegratorTaskList::AddTask(const TaskID& id, const TaskID& dep) { +@@ -1225,11 +1256,16 @@ void TimeIntegratorTaskList::AddTask(const TaskID& id, const TaskID& dep) { //! SRC_TERM and SourceTerms(), USERWORK, PHY_BVAL, PROLONG, CONS2PRIM, //! ... Although, AMR_FLAG = "flag blocks for AMR" should be FLAG_AMR in VERB_OBJECT using namespace HydroIntegratorTaskNames; // NOLINT (build/namespace) @@ -67,7 +82,7 @@ index 2bfc5178..e0fca29d 100644 } else if (id == CALC_HYDFLX) { task_list_[ntasks].TaskFunc= static_cast -@@ -1275,7 +1303,7 @@ void TimeIntegratorTaskList::AddTask(const TaskID& id, const TaskID& dep) { +@@ -1275,7 +1311,7 @@ void TimeIntegratorTaskList::AddTask(const TaskID& id, const TaskID& dep) { static_cast (&TimeIntegratorTaskList::AddSourceTerms); task_list_[ntasks].lb_time = true; @@ -76,7 +91,7 @@ index 2bfc5178..e0fca29d 100644 task_list_[ntasks].TaskFunc= static_cast (&TimeIntegratorTaskList::SendHydro); -@@ -1285,17 +1313,16 @@ void TimeIntegratorTaskList::AddTask(const TaskID& id, const TaskID& dep) { +@@ -1285,17 +1321,16 @@ void TimeIntegratorTaskList::AddTask(const TaskID& id, const TaskID& dep) { static_cast (&TimeIntegratorTaskList::SendField); task_list_[ntasks].lb_time = true; @@ -96,7 +111,28 @@ index 2bfc5178..e0fca29d 100644 task_list_[ntasks].TaskFunc= static_cast (&TimeIntegratorTaskList::SetBoundariesHydro); -@@ -1688,6 +1715,19 @@ TaskStatus TimeIntegratorTaskList::ClearAllBoundary(MeshBlock *pmb, int stage) { +@@ -1405,17 +1440,17 @@ void TimeIntegratorTaskList::AddTask(const TaskID& id, const TaskID& dep) { + static_cast + (&TimeIntegratorTaskList::IntegrateScalars); + task_list_[ntasks].lb_time = true; +- } else if (id == SEND_SCLR) { ++ } else if (id == SEND_SCLR or id == SEND_SCLR2) { + task_list_[ntasks].TaskFunc= + static_cast + (&TimeIntegratorTaskList::SendScalars); + task_list_[ntasks].lb_time = true; +- } else if (id == RECV_SCLR) { ++ } else if (id == RECV_SCLR or id == RECV_SCLR2) { + task_list_[ntasks].TaskFunc= + static_cast + (&TimeIntegratorTaskList::ReceiveScalars); + task_list_[ntasks].lb_time = false; +- } else if (id == SETB_SCLR) { ++ } else if (id == SETB_SCLR or id == SETB_SCLR2) { + task_list_[ntasks].TaskFunc= + static_cast + (&TimeIntegratorTaskList::SetBoundariesScalars); +@@ -1688,6 +1723,19 @@ TaskStatus TimeIntegratorTaskList::ClearAllBoundary(MeshBlock *pmb, int stage) { return TaskStatus::success; } @@ -116,7 +152,7 @@ index 2bfc5178..e0fca29d 100644 //---------------------------------------------------------------------------------------- // Functions to calculates Hydro fluxes -@@ -2305,6 +2345,12 @@ TaskStatus TimeIntegratorTaskList::PhysicalBoundary(MeshBlock *pmb, int stage) { +@@ -2305,6 +2353,12 @@ TaskStatus TimeIntegratorTaskList::PhysicalBoundary(MeshBlock *pmb, int stage) { TaskStatus TimeIntegratorTaskList::UserWork(MeshBlock *pmb, int stage) { if (stage != nstages) return TaskStatus::success; // only do on last stage @@ -129,7 +165,7 @@ index 2bfc5178..e0fca29d 100644 pmb->UserWorkInLoop(); return TaskStatus::success; } -@@ -2395,6 +2441,7 @@ TaskStatus TimeIntegratorTaskList::IntegrateScalars(MeshBlock *pmb, int stage) { +@@ -2395,6 +2449,7 @@ TaskStatus TimeIntegratorTaskList::IntegrateScalars(MeshBlock *pmb, int stage) { ave_wghts[2] = stage_wghts[stage-1].gamma_3; if (ave_wghts[0] == 0.0 && ave_wghts[1] == 1.0 && ave_wghts[2] == 0.0) { ps->s.SwapAthenaArray(ps->s1); diff --git a/patches/31.task_list.patch b/patches/31.task_list.patch index a2521123..88c192ba 100644 --- a/patches/31.task_list.patch +++ b/patches/31.task_list.patch @@ -1,5 +1,5 @@ diff --git a/src/task_list/task_list.hpp b/src/task_list/task_list.hpp -index d71ae3ea..ab14ee30 100644 +index d71ae3ea..931b17c2 100644 --- a/src/task_list/task_list.hpp +++ b/src/task_list/task_list.hpp @@ -146,6 +146,7 @@ class TimeIntegratorTaskList : public TaskList { @@ -10,7 +10,7 @@ index d71ae3ea..ab14ee30 100644 TaskStatus CalculateHydroFlux(MeshBlock *pmb, int stage); TaskStatus CalculateEMF(MeshBlock *pmb, int stage); -@@ -387,5 +388,11 @@ const TaskID RECV_RADSH(73); +@@ -387,5 +388,15 @@ const TaskID RECV_RADSH(73); const TaskID SRCTERM_IMRAD(74); @@ -19,6 +19,10 @@ index d71ae3ea..ab14ee30 100644 +const TaskID SETB_HYD2(103); +const TaskID CLEAR_ALLBND2(104); +const TaskID RESTART_RECV(105); ++ ++const TaskID SEND_SCLR2(106); ++const TaskID RECV_SCLR2(107); ++const TaskID SETB_SCLR2(108); + } // namespace HydroIntegratorTaskNames #endif // TASK_LIST_TASK_LIST_HPP_