Peano
Loading...
Searching...
No Matches
StepToObserver.py
Go to the documentation of this file.
1# This file is part of the Peano project. For conditions of distribution and
2# use, please see the copyright notice at www.peano-framework.org
4
5
6class StepToObserver(object):
7 """!
8
9 Take an action set and construct an observer from it.
10
11 An action set is, as the name suggests, a set of actions. Each action
12 set will have to be mapped onto one C++ action set, which is a where the
13 action behaviour is implemented: a selection of functions which react to
14 events such as "I have hit a face for the first time".
15
16 An observer administers these action sets:
17
18 - It holds a series of action sets dispatches the events to them.
19 - It manages the data movements induced by the grid traversal automaton
20 running through the mesh.
21
22 Consequently, each action set among the solver steps yields exactly one
23 observer, but potentially many action sets in the C++ implementation.
24
25
26 ## Important links
27
28 - @ref page_peano_action_sets
29 - @ref peano4.api.taskgraph
30
31
32 """
33
34
35
36 def __init__(self,step):
37 self.step = step
38
39
40 def construct_output(self,output,included_action_sets,task_groups=None):
41 """!
42 Construct one mapping
43
44 @param task_groups: [[int]] or None
45 Groups of indices into included_action_sets, i.e. action sets
46 which run in parallel - @ref peano4.api.output.Observer.Observer.
47 """
49 self.step.get_observer_class_name(), self.step.project.namespace + [ "observers" ], self.step.project.subdirectory + "observers",
50 included_action_sets,
51 self.step.vertex_data,
52 self.step.face_data,
53 self.step.cell_data,
54 task_groups
55 )
56 output.artefacts.append( observer )
57 output.makefile.add_cpp_file( observer.get_cpp_file_name(), generated=True )
Code generator for one action set.
Definition ActionSet.py:12
C++ observer of one mesh traversal.
Definition Observer.py:17
Take an action set and construct an observer from it.
construct_output(self, output, included_action_sets, task_groups=None)
Construct one mapping.