|
Peano
|
Definition of particle update (unary operation) More...
#include <ParticleSetIterators.h>
Definition of particle update (unary operation)
The interface uses the marker, as it is the responsibility of any update to check if theupdate is actually valid". That is, an operator should always use a UpdateParticleAssignedToVertexPredicate internally to check if it actually should update. How this knowledge is taken into account is however up to the realisation. In the simplest case, it is just a mere enclosing if statement. A typical operator looks like @icode [=]( const peano4::datamanagement::VertexMarker& marker, globaldata::MyParticle& particle ) -> void { if ( ::exaparty::kernels::localParticleCanBeMoved(marker, particle) ) { [...] particle.setMoveState(Particle::MoveState::Moved); } } @endicode This realisation is stereotypical and also highlight one tiny detail: If you alter the particle position, you have to reset the MoveState. Other kernels do not have any additional bookkeeping. ExaParty offers a set of pre-defined timestepping and reduction kernels. These are templates and hence have to be specialised: @icode AlgorithmStep( [...] touch_vertex_first_time_kernel = """exaparty::kernels::forAllParticles( marker, assignedParticles, exaparty::timestepping::resetMovedParticleMarker<globaldata::{}> );""".format( my_particle_type ), touch_vertex_last_time_kernel = """exaparty::kernels::forAllParticles( marker, assignedParticles, exaparty::timestepping::computeExplicitEulerWithGlobalTimeStepSize<globaldata::{}> );""".format( my_particle_type ), [...] )
Definition at line 67 of file ParticleSetIterators.h.