146 Create a repository of algorithmic steps which are then
147 ordered into the actual time stepping sequence.
157 name=
"ForceCalculation",
158 dependencies=AlgorithmStep.Dependencies.NEIGHBOURS,
159 effect=AlgorithmStep.Effect.ALTER_LOCAL_STATE,
160 touch_vertex_first_time_kernel=
"",
162 touch_vertex_last_time_kernel=
"",
166 dependencies=AlgorithmStep.Dependencies.SELF,
167 effect=AlgorithmStep.Effect.ALTER_LOCAL_STATE,
168 touch_vertex_first_time_kernel=f
"""
169 // Template in python/swift2/particle/LeapfrogFixedSearchRadius.py
170 ::swift2::kernels::forAllParticles(marker,
172 numberOfCoalescedAssignedParticles,
173 ::swift2::timestepping::leapfrogKickWithGlobalTimeStepSize<globaldata::{PARTICLE}>,
174 ::swift2::kernels::alwaysUpdateInVertexKernel<globaldata::{PARTICLE}>);
178 #include "swift2/timestepping/Leapfrog.h"
179 #include "swift2/timestepping/GlobalTimeStepping.h"
180 #include "swift2/timestepping/TimeStepping.h"
185 dependencies=AlgorithmStep.Dependencies.SELF,
186 effect=AlgorithmStep.Effect.CHANGE_POSITION_OR_INTERACTION_RADIUS,
187 touch_vertex_first_time_kernel=f
"""
188 // Template in python/swift2/particle/LeapfrogFixedSearchRadius.py
189 ::swift2::kernels::forAllParticles(
192 numberOfCoalescedAssignedParticles,
193 ::swift2::timestepping::resetMovedParticleMarker<globaldata::{PARTICLE}>,
194 ::swift2::kernels::alwaysUpdateInVertexKernel<globaldata::{PARTICLE}>);
197 touch_vertex_last_time_kernel=f
"""
198 // Template in python/swift2/particle/LeapfrogFixedSearchRadius.py
199 auto oldParticlePositions = ::toolbox::particles::assignmentchecks::recordParticlePositions(assignedParticles);
201 ::swift2::kernels::forAllParticles(
204 numberOfCoalescedAssignedParticles,
205 ::swift2::timestepping::leapfrogDriftWithGlobalTimeStepSize<globaldata::{PARTICLE}>,
206 ::swift2::kernels::alwaysUpdateInVertexKernel<globaldata::{PARTICLE}>
209 ::toolbox::particles::assignmentchecks::traceParticleMovements(assignedParticles, oldParticlePositions, marker.x(), marker.h(), _spacetreeId);
213 #include "swift2/timestepping/Leapfrog.h"
214 #include "swift2/timestepping/GlobalTimeStepping.h"
215 #include "swift2/timestepping/TimeStepping.h"
217 cell_kernel_dependency_policy=
"TouchAtLeastOnce_AllPreviousStepsUpdateAtLeastOnce_MayOverwritePreviousCellUpdatesFromSameSweep_FutureStagesMayUpdate",
218 touch_vertex_first_time_dependency_policy=
"TouchAtLeastOnce_AllPreviousStepsUpdateAtLeastOnce_FutureStagesMayUpdate",
219 touch_vertex_last_time_dependency_policy=
"TouchAtLeastOnce_AllPreviousStepsUpdateAtLeastOnce",
223 dependencies=AlgorithmStep.Dependencies.SELF,
224 effect=AlgorithmStep.Effect.ALTER_LOCAL_STATE,
225 touch_vertex_first_time_kernel=f
"""
226 // Template in python/swift2/particle/LeapfrogFixedSearchRadius.py
227 ::swift2::kernels::forAllParticles(
230 numberOfCoalescedAssignedParticles,
231 ::swift2::timestepping::resetMovedParticleMarker<globaldata::{PARTICLE}>,
232 ::swift2::kernels::alwaysUpdateInVertexKernel<globaldata::{PARTICLE}>);
234 ::swift2::kernels::forAllParticles(marker,
236 numberOfCoalescedAssignedParticles,
237 ::swift2::timestepping::leapfrogKickWithGlobalTimeStepSize<globaldata::{PARTICLE}>,
238 ::swift2::kernels::alwaysUpdateInVertexKernel<globaldata::{PARTICLE}>);
242 #include "swift2/timestepping/Leapfrog.h"
243 #include "swift2/timestepping/GlobalTimeStepping.h"
244 #include "swift2/timestepping/TimeStepping.h"
246 touch_vertex_first_time_dependency_policy=
"TouchAtLeastOnce_AllPreviousStepsUpdateAtLeastOnce_MayOverwritePreviousCellUpdatesFromSameSweep",
247 cell_kernel_dependency_policy=
"TouchAtLeastOnce_AllPreviousStepsUpdateAtLeastOnce_MayOverwritePreviousCellUpdatesFromSameSweep",
250 name=
"ReduceVelocityAndDetermineTimeStepSize",
251 dependencies=AlgorithmStep.Dependencies.SELF,
252 effect=AlgorithmStep.Effect.ALTER_GLOBAL_STATE,
253 prepare_traversal_kernel=f
"""
254 // Template in python/swift2/particle/LeapfrogFixedSearchRadius.py
255 ::swift2::timestepping::computeAdmissibleTimeStepSizeFromGlobalMeshSizeAndMaximumVelocity<globaldata::{PARTICLE}>({CFL_FACTOR},{TIME_STEP_SIZE});
259 #include "swift2/timestepping/Euler.h"
260 #include "swift2/timestepping/GlobalTimeStepping.h"
261 #include "swift2/timestepping/TimeStepping.h"
265 name=
"ReduceGlobalQuantities",
266 dependencies=AlgorithmStep.Dependencies.SELF,
267 effect=AlgorithmStep.Effect.ALTER_GLOBAL_STATE,
268 touch_vertex_first_time_kernel=f
"""
269 // Template in python/swift2/particle/LeapfrogFixedSearchRadius.py
270 ::swift2::kernels::forAllParticles(
273 numberOfCoalescedAssignedParticles,
274 ::swift2::statistics::reduceVelocityAndSearchRadius<globaldata::{PARTICLE}>,
275 ::swift2::kernels::alwaysUpdateInVertexKernel<globaldata::{PARTICLE}>);
278 prepare_traversal_kernel=f
"""
279 // Template in python/swift2/particle/LeapfrogFixedSearchRadius.py
280 globaldata::{PARTICLE}::getSpecies().clearSearchRadius();
281 globaldata::{PARTICLE}::getSpecies().clearVelocity();
284 unprepare_traversal_kernel=f
"""
285 // Template in python/swift2/particle/LeapfrogFixedSearchRadius.py
286 globaldata::{PARTICLE}::getSpecies().allReduce();
287 globaldata::{PARTICLE}::getSpecies().setTimeStamp( globaldata::{PARTICLE}::getSpecies().getMinTimeStamp() + globaldata::{PARTICLE}::getSpecies().getMinTimeStepSize(), false );
288 ::swift2::statistics::reportSearchRadiusVTDt<globaldata::{PARTICLE}>( "{PARTICLE}" );
292 #include "swift2/statistics/Reports.h"
293 #include "swift2/statistics/Statistics.h"
297 name=
"FirstInitParticle",
298 dependencies=AlgorithmStep.Dependencies.SELF,
299 effect=AlgorithmStep.Effect.CHANGE_POSITION_OR_INTERACTION_RADIUS,
300 touch_vertex_last_time_kernel=
"",
302 cell_kernel_dependency_policy=
"TouchAtLeastOnce_AllPreviousStepsUpdateAtLeastOnce_MayOverwritePreviousCellUpdatesFromSameSweep_FutureStagesMayUpdate",
303 touch_vertex_first_time_dependency_policy=
"TouchAtLeastOnce_AllPreviousStepsUpdateAtLeastOnce_FutureStagesMayUpdate",
304 touch_vertex_last_time_dependency_policy=
"TouchAtLeastOnce_AllPreviousStepsUpdateAtLeastOnce",