120 Add the reconstruction of the halo and the writing of the checkpoint
123 All action sets are guarded by the checkpoint's is<Name>Active(),
124 i.e. the tasks do no work in plot phases without checkpoint. The
125 writing task is the last one, so it moves the checkpoint on to its
130 "Create checkpoint task graph for Finite Volume scheme over block-structured meshes"
136 "_patch_overlap_current_time_step",
139 f
"Solver {self._solver.name} has no attribute {attribute}. "
140 "WriteCheckpoint assumes the numerical scheme has added this field "
141 "to the solver immediately upon construction."
149 Access = peano4.api.taskgraph.Task.DataAccess
163 name=f
"{self._solver.name}_{self.name}_Reconstruct",
164 entity=peano4.api.taskgraph.Task.GridEntity.CELL,
165 may_spawn_background_tasks=
False,
168 name=f
"{self._solver.name}_{self.name}_Write checkpoint",
169 entity=peano4.api.taskgraph.Task.GridEntity.CELL,
170 may_spawn_background_tasks=
False,
172 plot.add_task(reconstruction_task)
173 plot.add_task(write_checkpoint_task)
176 reconstruction_task.use_cell(self.
_solver_solver._patch, Access.READ_AND_WRITE)
177 reconstruction_task.use_cell(self.
_solver_solver._patch_with_halo, Access.WRITE)
178 reconstruction_task.use_face(
179 self.
_solver_solver._patch_overlap_current_time_step, Access.READ_AND_WRITE
181 reconstruction_task.add_action_set(
182 toolbox.blockstructured.api.ReconstructPatchWithHalo(
184 patch_overlap=self.
_solver_solver._patch_overlap_current_time_step,
187 add_assertions_to_halo_exchange=
False,
188 additional_includes=includes,
194 interpolation = getattr(self.
_solver_solver.numerical_scheme,
"interpolation",
None)
195 if interpolation
is not None:
196 reconstruction_task.add_action_set(
197 toolbox.blockstructured.api.InterpolateHangingFaces(
199 scheme=interpolation,
201 additional_includes=includes,
205 ApplyDirichletBoundaryConditions.add_task_to_time_step(
210 name_suffix=f
" for {self.name}",
211 additional_guard=is_active,
215 write_checkpoint_task.add_dependency(reconstruction_task)
216 write_checkpoint_task.use_cell(
219 write_checkpoint_task.add_action_set(
221 is_active_predicate=is_active,
226 description=
", ".join(self.
_solver_solver.variable_names_per_entry())
229 additional_includes=
"""
230#include "../repositories/SolverRepository.h"
234 time_stamp_evaluation=
"0.5*(repositories::getMinTimeStamp()+repositories::getMaxTimeStamp())",
237 metadata_evaluation=
"repositories::"
239 +
".toCheckpointMetaData()",
244 plot.visualise(title=
"Plot task graph for {}".format(self.
_solver_solver.name))
246 plot.log_as_text(title=
"Plot task graph for {}".format(self.
_solver_solver.name))