124 Add the reconstruction of the halo and the writing of the checkpoint
127 All action sets are guarded by the checkpoint's is<Name>Active(),
128 i.e. the tasks do no work in plot phases without checkpoint. The
129 writing task is the last one, so it moves the checkpoint on to its
134 "Create checkpoint task graph for fourth-order Finite Differences with Runge-Kutta over block-structured meshes"
140 "_patch_overlap_current_time_step",
143 f
"Solver {self._solver.name} has no attribute {attribute}. "
144 "WriteCheckpoint assumes the numerical scheme has added this field "
145 "to the solver immediately upon construction."
153 Access = peano4.api.taskgraph.Task.DataAccess
167 name=f
"{self._solver.name}_{self.name}_Reconstruct",
168 entity=peano4.api.taskgraph.Task.GridEntity.CELL,
169 may_spawn_background_tasks=
False,
172 name=f
"{self._solver.name}_{self.name}_Write checkpoint",
173 entity=peano4.api.taskgraph.Task.GridEntity.CELL,
174 may_spawn_background_tasks=
False,
176 plot.add_task(reconstruction_task)
177 plot.add_task(write_checkpoint_task)
180 reconstruction_task.use_cell(self.
_solver_solver._patch, Access.READ_AND_WRITE)
181 reconstruction_task.use_cell(self.
_solver_solver._patch_with_halo, Access.WRITE)
182 reconstruction_task.use_face(
183 self.
_solver_solver._patch_overlap_current_time_step, Access.READ_AND_WRITE
185 reconstruction_task.add_action_set(
186 toolbox.blockstructured.api.ReconstructPatchWithHalo(
188 patch_overlap=self.
_solver_solver._patch_overlap_current_time_step,
191 add_assertions_to_halo_exchange=
False,
192 additional_includes=includes,
197 reconstruction_task.add_action_set(
198 toolbox.blockstructured.api.InterpolateHangingFaces(
202 additional_includes=includes,
207 ApplyDirichletBoundaryConditions.add_task_to_time_step(
212 name_suffix=f
" for {self.name}",
213 relative_time_step_size=0.0,
214 additional_guard=is_active,
218 write_checkpoint_task.add_dependency(reconstruction_task)
219 write_checkpoint_task.use_cell(
222 write_checkpoint_task.add_action_set(
224 is_active_predicate=is_active,
229 description=
", ".join(self.
_solver_solver.variable_names_per_entry())
232 additional_includes=
"""
233#include "../repositories/SolverRepository.h"
237 time_stamp_evaluation=
"0.5*(repositories::getMinTimeStamp()+repositories::getMaxTimeStamp())",
240 metadata_evaluation=
"repositories::"
242 +
".toCheckpointMetaData()",
247 plot.visualise(title=
"Plot task graph for {}".format(self.
_solver_solver.name))
249 plot.log_as_text(title=
"Plot task graph for {}".format(self.
_solver_solver.name))