Peano
Loading...
Searching...
No Matches
__init__.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
3r"""!
4
5The Python-side model of "what happens during one mesh sweep"
6
7A @ref peano4.api.solversteps.Step.Step corresponds to one generated C++
8Observer, i.e. one grid traversal. It holds the vertex/face/cell data it
9touches and an ordered list of @ref peano4.api.solversteps.ActionSet.ActionSet
10instances - the actual "reactions to events" (touch vertex first time,
11create cell, ...) that get woven into that Observer.
12@ref peano4.api.solversteps.UserActionSet.UserActionSet is the one action
13set every Step gets by default: an empty, user-editable stub placed under
14`actions/` rather than being regenerated every run.
15
16@ref peano4.api.solversteps.Steps.Steps is the top-level collection: it
17holds every Step a peano4.api.Project knows about and, via
18StepsToStepRepository, additionally generates the C++ `StepRepository`
19that lets the runtime look steps up by name/index at runtime.
20
21Steps and Step do not write C++ themselves. Each delegates to a private
22generator held by aggregation: Step to StepToActionSets/StepToObserver,
23Steps to StepsToStepRepository. Those generators are the bridge into
24@ref peano4.api.output "peano4.api.output" - the actual C++ code writers -
25turning one Python-side ActionSet/Step/Steps object into a
26peano4.api.output.ActionSet/Observer/TemplatedHeaderImplementationFilePair
27that is what ends up on disk.
28
29\dot
30digraph SolverStepsClasses {
31 rankdir=BT
32 fontname="Helvetica"
33 node [shape=record, fontname="Helvetica", fontsize=10]
34 edge [fontname="Helvetica", fontsize=9]
35
36 ActionSet [label="{«abstract»\nActionSet|+ descend_invocation_order : int\l+ parallel : bool\l|+ get_guard_of_operation(name) : str\l+ get_body_of_operation(name) : str\l+ get_implementation_of_operation(name) : str\l+ get_action_set_name() : str\l+ user_should_modify_template() : bool\l+ get_attributes() : str\l+ get_includes() : str\l}"]
37 UserActionSet [label="{UserActionSet|+ name : str\l}"]
38 Step [label="{Step|+ name : str\l+ action_sets : [ActionSet]\l+ vertex_data, face_data, cell_data : [...]\l|+ add_action_set(action_set) : void\l+ construct_output(output) : void\l}"]
39 Steps [label="{Steps|+ _steps : [Step]\l|+ add_step(step) : void\l+ construct_output(output) : void\l}"]
40 StepToActionSets [label="{StepToActionSets|+ step : Step\l|+ construct_output(output, action_set) : str\l}"]
41 StepToObserver [label="{StepToObserver|+ step : Step\l|+ construct_output(output, included_action_sets) : void\l}"]
42 StepsToStepRepository [label="{StepsToStepRepository|+ steps : Steps\l|+ construct_output(output) : void\l}"]
43
44 OutputActionSet [label="{«external»\npeano4.api.output.ActionSet}", style=dashed]
45 OutputObserver [label="{«external»\npeano4.api.output.Observer}", style=dashed]
46 OutputTemplatePair [label="{«external»\npeano4.api.output.TemplatedHeaderImplementationFilePair}", style=dashed]
47
48 edge [arrowhead=empty, style=solid, dir=forward]
49 UserActionSet -> ActionSet
50
51 edge [dir=both, arrowtail=diamond, arrowhead=none, style=solid]
52 Step -> ActionSet [taillabel="1", headlabel="0..*", label="action_sets"]
53 Step -> StepToActionSets [taillabel="1", headlabel="1", label="action_set_generator"]
54 Step -> StepToObserver [taillabel="1", headlabel="1", label="observer_generator"]
55 Steps -> Step [taillabel="1", headlabel="0..*", label="_steps"]
56 Steps -> StepsToStepRepository [taillabel="1", headlabel="1", label="generator"]
57
58 edge [dir=forward, arrowhead=open, arrowtail=none, style=solid]
59 StepToActionSets -> Step [label="step"]
60 StepToObserver -> Step [label="step"]
61 StepsToStepRepository -> Steps [label="steps"]
62
63 edge [dir=forward, arrowhead=vee, arrowtail=none, style=dashed]
64 StepToActionSets -> OutputActionSet [label="«creates»"]
65 StepToObserver -> OutputObserver [label="«creates»"]
66 StepsToStepRepository -> OutputTemplatePair [label="«creates»"]
67}
68\enddot
69
70Solid hollow-triangle arrows are inheritance (UserActionSet extends
71ActionSet); diamond-ended lines are aggregation/composition (a Step owns
72its list of action sets and its two generators; a Steps owns its list of
73Steps and its one generator); open-arrow solid lines are the plain
74back-references the generators keep to the object they serve; dashed
75open arrows are "creates" dependencies into @ref peano4.api.output.
76
77@see @ref peano4.api.solversteps.Step.Step
78@see @ref peano4.api.solversteps.Steps.Steps
79@see @ref peano4.api.solversteps.ActionSet.ActionSet
80@see @ref peano4.api.solversteps.UserActionSet.UserActionSet
81@see @ref peano4.api.output.ActionSet.ActionSet
82
83"""
84
85from .Step import Step
86from .Steps import Steps
87from .ActionSet import ActionSet
88from .UserActionSet import UserActionSet
89from .SynchroniseActionSets import SynchroniseActionSets, get_task_groups