114 Leapfrog consists basically of four steps per particle. We first
115 determine the force. Then we update the velocity by half a timestep and move
116 the particle by a full timestep. Then the force is re-computed and the
117 second half of the velocity update is done.
118 Some variations of this KDK form re-arrange the steps executed per timestep
119 to avoid a second force loop.
123 name=
"ForceCalculation",
124 dependencies=AlgorithmStep.Dependencies.NEIGHBOURS,
125 effect=AlgorithmStep.Effect.ALTER_LOCAL_STATE,
128 ::swift2::kernels::genericInteraction<globaldata::{}>(
131 [&] (globaldata::{}* localParticle, const globaldata::{} * const globalParticle) -> void {{
143 #include "Constants.h"
144 #include "swift2/kernels/ParticleParticleInteraction.h"
149 dependencies=AlgorithmStep.Dependencies.SELF,
150 effect=AlgorithmStep.Effect.ALTER_LOCAL_STATE,
151 touch_vertex_first_time_kernel=
"""::swift2::timestepping::resetMovedParticleMarker(assignedParticles);""",
152 touch_vertex_last_time_kernel=
"""::swift2::timestepping::computeLeapfrogKickWithGlobalTimeStepSize(
153 assignedParticles, 1 , false);""",
154 prepare_traversal_kernel=
"""::swift2::timestepping::computeAdmissibleTimeStepSizeFromGlobalMeshSizeAndMaximumVelocity<globaldata::{}>({},{});""".format(
158 #include "Constants.h"
159 #include "swift2/timestepping/Leapfrog.h"
160 #include "swift2/timestepping/GlobalTimeStepping.h"
161 #include "swift2/timestepping/TimeStepping.h"
163 #include "swift2/kernels/kernel_hydro.h"
164 #include "swift2/kernels/equation_of_state.h"
168 name=
"moveParticleIntoCriticalLine",
169 dependencies=AlgorithmStep.Dependencies.SELF,
170 effect=AlgorithmStep.Effect.CHANGE_POSITION_OR_INTERACTION_RADIUS,
171 touch_vertex_first_time_kernel=
"""::swift2::timestepping::resetMovedParticleMarker(assignedParticles);""",
172 touch_vertex_last_time_kernel=
"""::swift2::timestepping::moveParticleIntoCriticalLine( assignedParticles );""",
174 #include "Constants.h"
175 #include "swift2/timestepping/Leapfrog.h"
176 #include "swift2/timestepping/GlobalTimeStepping.h"
177 #include "swift2/timestepping/TimeStepping.h"
181 name=
"ForceCalculation",
182 dependencies=AlgorithmStep.Dependencies.NEIGHBOURS,
183 effect=AlgorithmStep.Effect.ALTER_LOCAL_STATE,
186 ::swift2::kernels::genericInteraction<globaldata::{}>(
189 [&] (globaldata::{}* localParticle, const globaldata::{} * const globalParticle) -> void {{
201 #include "Constants.h"
202 #include "swift2/kernels/ParticleParticleInteraction.h"
207 dependencies=AlgorithmStep.Dependencies.SELF,
208 effect=AlgorithmStep.Effect.ALTER_LOCAL_STATE,
209 touch_vertex_first_time_kernel=
"""::swift2::timestepping::resetMovedParticleMarker(assignedParticles);""",
210 touch_vertex_last_time_kernel=
"""::swift2::timestepping::computeLeapfrogKickWithGlobalTimeStepSize(
211 assignedParticles, 2, false );""",
213 #include "Constants.h"
214 #include "swift2/timestepping/Leapfrog.h"
215 #include "swift2/timestepping/GlobalTimeStepping.h"
216 #include "swift2/timestepping/TimeStepping.h"
218 #include "swift2/kernels/kernel_hydro.h"
219 #include "swift2/kernels/equation_of_state.h"
223 name=
"ReduceGlobalQuantities",
224 dependencies=AlgorithmStep.Dependencies.SELF,
225 effect=AlgorithmStep.Effect.ALTER_GLOBAL_STATE,
226 cell_kernel=
"""::swift2::statistics::reduceVelocityAndSearchRadius( localParticles );""",
227 prepare_traversal_kernel=
"""
228 globaldata::{PARTICLE}::getSpecies().clearSearchRadius();
229 globaldata::{PARTICLE}::getSpecies().clearVelocity();
233 unprepare_traversal_kernel=
"""
234 globaldata::{PARTICLE}::getSpecies().setTimeStamp( globaldata::{PARTICLE}::getSpecies().getMinTimeStamp() + globaldata::{PARTICLE}::getSpecies().getMinTimeStepSize(), false );
235 ::swift2::statistics::reportSearchRadiusVTDt<globaldata::{PARTICLE}>( "{PARTICLE}" );
240 #include "Constants.h"
241 #include "swift2/statistics/Reports.h"
242 #include "swift2/statistics/Statistics.h"