Skip to content

Commit b5682c8

Browse files
committed
Add pointer to TimeIntegratorTaskList to STSTaskList constructor
Stored in private variable. Also, change the type of ptlist in main.cpp to TimeIntegratorTaskList* from generic base class pointer TaskList* in order to pass it to the STS constructor.
1 parent e071c40 commit b5682c8

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/main.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ int main(int argc, char *argv[]) {
305305
//--- Step 5. --------------------------------------------------------------------------
306306
// Construct and initialize TaskList
307307

308-
TaskList *ptlist;
308+
TimeIntegratorTaskList *ptlist;
309309
#ifdef ENABLE_EXCEPTIONS
310310
try {
311311
#endif
@@ -327,7 +327,7 @@ int main(int argc, char *argv[]) {
327327
#ifdef ENABLE_EXCEPTIONS
328328
try {
329329
#endif
330-
pststlist = new SuperTimeStepTaskList(pinput, pmesh);
330+
pststlist = new SuperTimeStepTaskList(pinput, pmesh, ptlist);
331331
#ifdef ENABLE_EXCEPTIONS
332332
}
333333
catch(std::bad_alloc& ba) {

src/task_list/sts_task_list.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@
3737
//----------------------------------------------------------------------------------------
3838
// SuperTimeStepTaskList constructor
3939

40-
SuperTimeStepTaskList::SuperTimeStepTaskList(ParameterInput *pin, Mesh *pm)
41-
: TaskList(pm) {
40+
SuperTimeStepTaskList::SuperTimeStepTaskList(ParameterInput *pin, Mesh *pm,
41+
TimeIntegratorTaskList *ptlist)
42+
: TaskList(pm), ptlist_(ptlist) {
4243
// STS Incompatiblities
4344
if (MAGNETIC_FIELDS_ENABLED &&
4445
!(pm->pblock->pfield->pfdif->field_diffusion_defined) &&

src/task_list/task_list.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class TimeIntegratorTaskList : public TaskList {
160160

161161
class SuperTimeStepTaskList : public TaskList {
162162
public:
163-
SuperTimeStepTaskList(ParameterInput *pin, Mesh *pm);
163+
SuperTimeStepTaskList(ParameterInput *pin, Mesh *pm, TimeIntegratorTaskList *ptlist);
164164
~SuperTimeStepTaskList() {}
165165

166166
// functions
@@ -193,6 +193,7 @@ class SuperTimeStepTaskList : public TaskList {
193193
enum TaskStatus PhysicalBoundary_STS(MeshBlock *pmb, int stage);
194194

195195
private:
196+
TimeIntegratorTaskList *ptlist_;
196197
void AddTask(std::uint64_t id, std::uint64_t dep) override;
197198
void StartupTaskList(MeshBlock *pmb, int stage) override;
198199
};

0 commit comments

Comments
 (0)