Turn on/off radiation - #118
Conversation
…ments will initialize to LTE
| enum class PackageControl { inactive = -1, shutdown = 0, active = 1, initial = 2 }; | ||
|
|
||
| template <class PKG> | ||
| inline PackageControl CheckPackageStatus(PKG &pkg, const Real time) { |
There was a problem hiding this comment.
Not a problem for today... but something like this might be a bit more nuanced for non operator-split physics. For example, I don't think we would want to turn off physics in between the the 1st and 2nd stage of RK2. Not an issue at the moment, just thinking aloud.
There was a problem hiding this comment.
This is only called before entering Step, so there won't be any switching mid RK-stage
There was a problem hiding this comment.
I have expanded this use to physics that is done in the rk substeps, in those cases i also only turn on/off for the first stage
|
I will add this machinery also to the cooling package |
…oments. Still need a jaybenne mesh initializer function
| //! \fn TaskListStatus SelfGravity::PoissonDriver | ||
| //! \brief | ||
| void SolvePoisson(TaskCollection &tc, Mesh *pmesh) { | ||
| void SolvePoisson(TaskCollection &tc, Mesh *pmesh, const Real time, const int stage) { |
There was a problem hiding this comment.
I noticed this doesn't return TaskListStatus, but should it @pdmullen ?
There was a problem hiding this comment.
I think not. All we are doing is passing the TaskCollection tc to SolvePoisson and having that function add a region with its own tasks.
When we call Execute on the final TaskCollection, that returns TaskListStatus (see StepTasks.Execute()).
The comment is wrong in the //! \fn though.
Background
This adds the machinery to turn on/off and initialize/shutdown a package during a simulation. To start, I have enrolled moments and raytrace into this.
When moments comes on, it will set all variables to LTE values.
We should do the same for IMC and pretty much all of the packages.
I have tested this locally, and it works correctly, even through restarts.
Description of Changes
Checklist
// This file was created in part or in whole by generative AI