Peano
Loading...
Searching...
No Matches
swift2.particle.AlgorithmStep.AlgorithmStep Class Reference

Defines the meta data around one algorithmic step per particle. More...

Inheritance diagram for swift2.particle.AlgorithmStep.AlgorithmStep:
Collaboration diagram for swift2.particle.AlgorithmStep.AlgorithmStep:

Data Structures

class  Dependencies
 An algorithmic step for one particle can depend on different pre-conditions: More...
 
class  Effect
 What happens in this algorithmic step per particle: More...
 
class  PeanoEventUsedBySwift
 Enumeration of different Peano events during a grid traversal into which Swift 2 plugs in. More...
 

Public Member Functions

 may_trigger_rerun (Effect effect)
 Return True if the effect object may trigger a rerun.
 
 __init__ (self, name, Dependencies dependencies, Effect effect, cell_kernel=None, touch_vertex_first_time_kernel=None, touch_vertex_last_time_kernel=None, prepare_traversal_kernel="", unprepare_traversal_kernel="", input_particles=None, includes="", cell_kernel_dependency_policy=None, touch_vertex_first_time_dependency_policy=None, touch_vertex_last_time_dependency_policy=None)
 The algorithmic step description is a meta data object, i.e.
 
 __str__ (self)
 

Static Public Member Functions

 get_event_name (PeanoEventUsedBySwift stage)
 Get the name as a string of a sweep stage for a given PeanoEventUsedBySwift enum.
 

Data Fields

 name
 
 dependencies
 
 effect
 
 cell_kernel
 
 touch_vertex_first_time_kernel
 
 touch_vertex_last_time_kernel
 
 prepare_traversal_kernel
 
 unprepare_traversal_kernel
 
 input_particles
 
 includes
 
 cell_kernel_dependency_policy
 
 touch_vertex_first_time_dependency_policy
 
 touch_vertex_last_time_dependency_policy
 

Detailed Description

Defines the meta data around one algorithmic step per particle.

A sequence of these steps describes the particle lifecycle per time step. It is Peano's/SWIFT's responsibility to arrange these steps in grid sweeps and to identify concurrency.

Definition at line 11 of file AlgorithmStep.py.

Constructor & Destructor Documentation

◆ __init__()

swift2.particle.AlgorithmStep.AlgorithmStep.__init__ ( self,
name,
Dependencies dependencies,
Effect effect,
cell_kernel = None,
touch_vertex_first_time_kernel = None,
touch_vertex_last_time_kernel = None,
prepare_traversal_kernel = "",
unprepare_traversal_kernel = "",
input_particles = None,
includes = "",
cell_kernel_dependency_policy = None,
touch_vertex_first_time_dependency_policy = None,
touch_vertex_last_time_dependency_policy = None )

The algorithmic step description is a meta data object, i.e.

it only holds properties.

Parameters/attributes

Parameters
cell_kernelC++ code (string) Kernel invocation what happens in a cell. Set to None if nothing is to be done per cell.
touch_vertex_first_time_kernelC++ code (string) Kernel invocation what happens when we read a vertex and its particles for the first time. Set to None if nothing is to be done.
touch_vertex_last_time_kernelC++ code (string) Kernel invocation what happens when we read a vertex and its particles for the last time. Set to None if nothing is to be done.
input_particlesParticleSet Switch to None in most cases. This fragment gives you the opportunity to couple the particles of one step with another particle species. If you hand in None, then we assume that the algorithm step updates the particles as input function from the particles.
includesString Additional include statements

prepare_traversals_kernel = None,

Parameters
prepare_traversal_kernelString (C++ code snippet) Whenever Peano runs through the mesh, it creates one instance of the mesh observer and then runs through all subpartitions (trees) in parallel. Each replica of the observer issues its own touchVertexFirstTime(), touchCellLastTime(), ... events, and each replica starts its traversal with a call to beginTraversal() and endTraversal(). If you want to plug into the phase such before these parallel instances are created, you can use prepareTraversal() - the C++ code snippet passed to this attribute is copied into prepareTraversal(). The overview over action sets provides more details. Note that no action set (or observer object) is created at this point, i.e. the C++ code snippet will be injected into a static routine and can therefore only access static information. Often, this routine is used for some MPI communication (global data exchange), e.g., or to update some other static properties for whole sets of objects.
unprepare_traversal_kernelString (C++ code snippet) Counterpart of prepare_traversal_kernel. Consult action sets for more context.
cell_kernel_dependency_policyString or None If it is a string, it should identify one of the variants of swift2::dependencychecks::Invariant. If you pick None, Swift 2 will add default dependencies. They might be too strict.
touch_vertex_first_time_dependency_policyString or None If it is a string, it should identify one of the variants of swift2::dependencychecks::Invariant. If you pick None, Swift 2 will add default dependencies. They might be too strict.
touch_vertex_last_time_dependency_policyString or None If it is a string, it should identify one of the variants of swift2::dependencychecks::Invariant. If you pick None, Swift 2 will add default dependencies. They might be too strict.

Definition at line 119 of file AlgorithmStep.py.

Member Function Documentation

◆ __str__()

◆ get_event_name()

swift2.particle.AlgorithmStep.AlgorithmStep.get_event_name ( PeanoEventUsedBySwift stage)
static

Get the name as a string of a sweep stage for a given PeanoEventUsedBySwift enum.

Definition at line 105 of file AlgorithmStep.py.

◆ may_trigger_rerun()

swift2.particle.AlgorithmStep.AlgorithmStep.may_trigger_rerun ( Effect effect)

Return True if the effect object may trigger a rerun.

Definition at line 71 of file AlgorithmStep.py.

Field Documentation

◆ cell_kernel

swift2.particle.AlgorithmStep.AlgorithmStep.cell_kernel

Definition at line 205 of file AlgorithmStep.py.

◆ cell_kernel_dependency_policy

swift2.particle.AlgorithmStep.AlgorithmStep.cell_kernel_dependency_policy

Definition at line 224 of file AlgorithmStep.py.

◆ dependencies

swift2.particle.AlgorithmStep.AlgorithmStep.dependencies

◆ effect

swift2.particle.AlgorithmStep.AlgorithmStep.effect

◆ includes

◆ input_particles

swift2.particle.AlgorithmStep.AlgorithmStep.input_particles

Definition at line 211 of file AlgorithmStep.py.

◆ name

◆ prepare_traversal_kernel

swift2.particle.AlgorithmStep.AlgorithmStep.prepare_traversal_kernel

Definition at line 208 of file AlgorithmStep.py.

◆ touch_vertex_first_time_dependency_policy

swift2.particle.AlgorithmStep.AlgorithmStep.touch_vertex_first_time_dependency_policy

Definition at line 225 of file AlgorithmStep.py.

◆ touch_vertex_first_time_kernel

swift2.particle.AlgorithmStep.AlgorithmStep.touch_vertex_first_time_kernel

Definition at line 206 of file AlgorithmStep.py.

◆ touch_vertex_last_time_dependency_policy

swift2.particle.AlgorithmStep.AlgorithmStep.touch_vertex_last_time_dependency_policy

Definition at line 228 of file AlgorithmStep.py.

◆ touch_vertex_last_time_kernel

swift2.particle.AlgorithmStep.AlgorithmStep.touch_vertex_last_time_kernel

Definition at line 207 of file AlgorithmStep.py.

◆ unprepare_traversal_kernel

swift2.particle.AlgorithmStep.AlgorithmStep.unprepare_traversal_kernel

Definition at line 209 of file AlgorithmStep.py.


The documentation for this class was generated from the following file: