16 Memory pools can ask the system to scatter all data to start from a clean
17 plate again. This is notably important for the global memory pool.
19 The action set is kind of the antidote to peano4.toolbox.particles.GatherParticlesInMemoryPool.
20 It should be used within dummy sweeps typically.
29 Construct the action set
33 particle_set: peano4.toolbox.particles.ParticleSet
34 Instance of the particle set that is to be scattered.
38 super(ScatterGlobalMemory,self).
__init__()
41 self.
d[
"PARTICLE"] = particle_set.particle_model.name
42 self.
d[
"PARTICLES_CONTAINER"] = particle_set.name
48 __Template_TouchVertexLastTime = jinja2.Template(
50 if ( vertexdata::{{PARTICLES_CONTAINER}}::MemoryPool::requestCompleteScatter() ) {
51 fineGridVertex{{PARTICLES_CONTAINER}}.scatter();
57 return jinja2.Template(
59 if ( vertexdata::{{PARTICLES_CONTAINER}}::MemoryPool::requestCompleteScatter() ) {
60 logInfo( "prepareTraversal(...)", "start to scatter all memory to allow for a data rearrangement" );
67 if operation_name == ActionSet.OPERATION_TOUCH_VERTEX_LAST_TIME:
73 return __name__.replace(
".py",
"").replace(
".",
"_")
77 result = jinja2.Template(
79#include "vertexdata/{{PARTICLES_CONTAINER}}.h"
80#include "globaldata/{{PARTICLE}}.h"
83 return result.render(**self.
d)
Action set (reactions to events)
__init__(self, particle_set)
Construct the action set.
get_body_of_prepareTraversal(self)
user_should_modify_template(self)
Is the user allowed to modify the output.
__Template_TouchVertexLastTime
get_includes(self)
Return include statements that you need.
get_action_set_name(self)
Return unique action set name.
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.