Peano
Loading...
Searching...
No Matches
MyObserver.h
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
3#ifndef _EXAMPLES_REGULAR_GRID_UPSCALING_MYOBSERVER_H_
4#define _EXAMPLES_REGULAR_GRID_UPSCALING_MYOBSERVER_H_
5
6
8#include "tarch/logging/Log.h"
9
10
11namespace examples {
12 namespace regulargridupscaling {
13 class MyObserver;
14 }
15}
16
17
19 private:
21
22 const int _spacetreeId;
23 const double _h;
24 const int _flopsPerCell;
25
30
32
33 public:
34 static constexpr int RanksObserverTemplate = 1;
35
38
39 MyObserver(int spacetreeId, double h, int flopsPerCell);
40 virtual ~MyObserver();
41
42 void beginTraversal(
45 ) override;
46
47 void endTraversal(
50 ) override;
51
52 void enterCell(
54 ) override;
55
56
57 void leaveCell(
59 ) override;
60
66 TraversalObserver* clone(int spacetreeId) override;
67
68 std::vector< peano4::grid::GridControlEvent > getGridControlEvents() override;
69};
70
71#endif
static tarch::logging::Log _log
Definition MyObserver.h:20
void enterCell(const peano4::grid::GridTraversalEvent &event) override
Event is invoked per cell.
double _accumulator
I use an accumulator just to ensure that the flop calculations are not removed.
Definition MyObserver.h:29
std::vector< peano4::grid::GridControlEvent > getGridControlEvents() override
void leaveCell(const peano4::grid::GridTraversalEvent &event) override
void endTraversal(const tarch::la::Vector< Dimensions, double > &x, const tarch::la::Vector< Dimensions, double > &h) override
MyObserver(int spacetreeId, double h, int flopsPerCell)
TraversalObserver * clone(int spacetreeId) override
I use the clone to create one observer object per traversal thread.
void beginTraversal(const tarch::la::Vector< Dimensions, double > &x, const tarch::la::Vector< Dimensions, double > &h) override
Begin the traversal.
Log Device.
Definition Log.h:516
This code is taken from the original ExaHyPE project written by colleagues from the University of Tre...
Definition MyObserver.h:11
Simple vector class.
Definition Vector.h:150