106 particle_particle_interaction_kernel,
107 touch_vertex_first_time_compute_particle_update_kernel=None,
108 touch_vertex_last_time_compute_particle_update_kernel=None,
109 prepare_traversal_kernel="",
110 unprepare_traversal_kernel="",
111 additional_includes="",
112 active_particle_set=None,
120 particle_set: ParticleSet
122 particle_particle_interaction_kernel: String holding C++ code
123 This C++ code can access three different types of variables: There's
124 a list of particles called activeParticles, there's a list of particles
125 called localParticles, and there's the cell marker. See the guidebook
126 for further info. A typical kernel resembles
128 for (auto* localParticle: localParticles )
129 for (auto* activeParticle: activeParticles ) {
130 localParticle->doSomethingFancy( activeParticle );
133 active_particle_set: ParticleSet or None
134 You can compare different particles species with this argument. It
135 allows you to make the active particles stem from another species than
136 the local ones that you actually update. Pick None if both sets are of
139 touch_vertex_first_time_compute_particle_update_kernel: String or None
140 Can be empty, but if you wanna move particles, then a minimal example
143 for (auto* localParticle: localParticles ) {
144 localParticle->setMoveState( globaldata::Particle::MoveState::NotMovedYet );
147 i.e. you will have a variable localParticle available in this kernel
152 super(UpdateParticle_MultiLevelInteraction_StackOfLists, self).
__init__(
153 descend_invocation_order=1, parallel=
False
158 self.
d[
"LOCAL_PARTICLE"] = particle_set.particle_model.name
159 self.
d[
"LOCAL_PARTICLES_CONTAINER"] = particle_set.name
160 if active_particle_set ==
None:
161 self.
d[
"ACTIVE_PARTICLE"] = particle_set.particle_model.name
162 self.
d[
"ACTIVE_PARTICLES_CONTAINER"] = particle_set.name
164 self.
d[
"ACTIVE_PARTICLE"] = active_particle_set.particle_model.name
165 self.
d[
"ACTIVE_PARTICLES_CONTAINER"] = active_particle_set.name
167 "PARTICLE_PARTICLE_INTERACTION_KERNEL"
168 ] = particle_particle_interaction_kernel
170 "TOUCH_VERTEX_FIRST_COMPUTE_KERNEL"
171 ] = touch_vertex_first_time_compute_particle_update_kernel
173 "TOUCH_VERTEX_LAST_COMPUTE_KERNEL"
174 ] = touch_vertex_last_time_compute_particle_update_kernel
175 self.
d[
"ADDITIONAL_INCLUDES"] = additional_includes
176 self.
d[
"PREPARE_TRAVERSAL_KERNEL"] = prepare_traversal_kernel
177 self.
d[
"UNPREPARE_TRAVERSAL_KERNEL"] = unprepare_traversal_kernel