Peano
Loading...
Searching...
No Matches
UpdateParticle_SingleLevelInteraction.py
Go to the documentation of this file.
1# This file is part of the ExaParty project. For conditions of distribution and
2# use, please see the copyright notice at www.peano-framework.org
4
5
6from .TaskGraphKernelWrappers import (
7 construct_touch_vertex_first_time_call,
8 construct_touch_cell_first_time_call,
9 construct_touch_vertex_last_time_call,
10)
11
14):
15 """!
16
17 Wrapper around toolbox baseclass
18
19 Close to trivial wrapper which really only adds a tarch::multicore::waitForAllTasks()
20 iff the particles might move. The interesting stuff is actually happing in
21 TaskGarphKernelWrappers.py however.
22
23 """
25 self,
26 particle_set,
27 particle_cell_update_kernel,
28 touch_vertex_first_time_compute_particle_update_kernel,
29 touch_vertex_last_time_compute_particle_update_kernel,
30 prepare_traversal_kernel,
31 unprepare_traversal_kernel,
32 additional_includes,
33 active_particle_set,
34 alter_particle_position_or_interaction_radius,
35 wait_for_all_tasks_to_finish_after_traversal,
36 ):
37 """!
38
39 Construct
40
41
42 @param wait_for_all_tasks_to_finish_after_traversal: Boolean
43
44 @param alter_particle_position_or_interaction_radius: Boolean
45 Set if the underlying AlgorithmStep's effect might change a
46 particle's position or interaction radius.
47 @see exaparty.api.particle.AlgorithmStep.AlgorithmStep.may_trigger_rerun()
48
49 """
50 if wait_for_all_tasks_to_finish_after_traversal:
51 unprepare_traversal_kernel = (
52 unprepare_traversal_kernel + "tarch::multicore::waitForAllTasks();"
53 )
54
55 super(UpdateParticle_SingleLevelInteraction, self).__init__(
56 particle_set,
57 particle_cell_update_kernel=construct_touch_cell_first_time_call(
58 particle_set,particle_cell_update_kernel,False
59 ),
60 touch_vertex_first_time_compute_particle_update_kernel=construct_touch_vertex_first_time_call(
61 particle_set,touch_vertex_first_time_compute_particle_update_kernel,False
62 ),
63 touch_vertex_last_time_compute_particle_update_kernel=construct_touch_vertex_last_time_call(
64 particle_set,touch_vertex_last_time_compute_particle_update_kernel,False, alter_particle_position_or_interaction_radius
65 ),
66 prepare_traversal_kernel=prepare_traversal_kernel,
67 unprepare_traversal_kernel=unprepare_traversal_kernel,
68 additional_includes=additional_includes
69 + """
70#include "tarch/multicore/Task.h"
71#include "exaparty/exaparty.h"
72#include "exaparty/TaskNumber.h"
73 """,
74 active_particle_set=active_particle_set,
75 )
76
77
79 return __name__.replace(".py", "").replace(".", "_")
__init__(self, particle_set, particle_cell_update_kernel, touch_vertex_first_time_compute_particle_update_kernel, touch_vertex_last_time_compute_particle_update_kernel, prepare_traversal_kernel, unprepare_traversal_kernel, additional_includes, active_particle_set, alter_particle_position_or_interaction_radius, wait_for_all_tasks_to_finish_after_traversal)
Construct.