Peano
Loading...
Searching...
No Matches
Project.SolverRepository.template.cpp
Go to the documentation of this file.
1#include "SolverRepository.h"
3#include "peano4/grid/grid.h"
6#include "tarch/logging/Log.h"
8
9
10{% for N in NAMESPACE %}
11namespace {{N}} {
12{% endfor %}
13 namespace repositories {
14 static tarch::logging::Log _log( "{{NAMESPACE | join("::")}}" );
15
16 {% for SOLVER in SOLVER_INSTANCES %}
17 {{SOLVER[0]}} {{SOLVER[1]}};
18 {% endfor %}
19
20 {% if LOAD_BALANCER != "" %}
21 {{LOAD_BALANCER}} loadBalancer({{LOAD_BALANCER_ARGUMENTS}});
22 {% else %}
24 {% endif %}
25 {% for SOLVER in AUX_SOLVER_INSTANCES %}
26 {{SOLVER[0]}} {{SOLVER[1]}};
27 {% endfor %}
28
29 bool terminationCriterionHolds() {
30 /*
31 Return true if all solvers returns true.
32
33 We don't test the aux solvers here.
34 */
35 bool output = true;
36 {% for SOLVER in SOLVER_INSTANCES %}
37 output &= {{SOLVER[1]}}.terminationCriterionHolds();
38 {% endfor %}
39 return output;
40 }
41
42
43 void beginMeshSweep() {
44 {% for SOLVER in SOLVER_INSTANCES %}
45 {{SOLVER[1]}}.beginMeshSweep();
46 {% endfor %}
47 {% for SOLVER in AUX_SOLVER_INSTANCES %}
48 {{SOLVER[1]}}.beginMeshSweep();
49 {% endfor %}
50 }
51
52 void endMeshSweep() {
53 {% for SOLVER in SOLVER_INSTANCES %}
54 {{SOLVER[1]}}.endMeshSweep();
55 {% endfor %}
56 {% for SOLVER in AUX_SOLVER_INSTANCES %}
57 {{SOLVER[1]}}.endMeshSweep();
58 {% endfor %}
59 }
60
61 void endCreateGrid() {
62 loadBalancer.finishStep();
63 tarch::multicore::setOrchestration( {{MULTICORE_ORCHESTRATION}} );
64 }
65
66 void incrementPlotCounter() {plotCounter++;}
67 int getPlotCounter() {
68 return plotCounter;
69 }
70 }
71{% for N in NAMESPACE %}
72}
73{% endfor %}
74
tarch::logging::Log _log("::")
Log Device.
Definition Log.h:516
virtual void finishStep() override
Finish a mesh sweep.
void setOrchestration(tarch::multicore::orchestration::Strategy *realisation)
Definition multicore.cpp:56