Peano
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_GRID_MYOBSERVER_H_
4 #define _EXAMPLES_GRID_MYOBSERVER_H_
5 
6 
7 #include "peano4/grid/TraversalObserver.h"
8 #include "peano4/grid/TraversalVTKPlotter.h"
9 
10 
11 namespace examples {
12  namespace grid {
13  class MyObserver;
14  }
15 }
16 
17 
18 class examples::grid::MyObserver: public
19  #if PEANO_DEBUG>0
20  peano4::grid::TraversalVTKPlotter
21  #else
22  peano4::grid::TraversalObserver
23  #endif
24 {
25  private:
26  static int _iterationCounter;
27  public:
28  static constexpr int GridRefinementIterations = 16;
29  static constexpr int StationaryIterations = 4;
30 
31  MyObserver(int spacetreeId = -1, int counter=0);
32  virtual ~MyObserver();
33 
34  void beginTraversal(
35  const tarch::la::Vector<DIMENSIONS,double>& x,
36  const tarch::la::Vector<DIMENSIONS,double>& h
37  ) override;
38 
39  void endTraversal(
40  const tarch::la::Vector<DIMENSIONS,double>& x,
41  const tarch::la::Vector<DIMENSIONS,double>& h
42  ) override;
43 
44  void enterCell(
45  const peano4::grid::GridTraversalEvent& event
46  ) override;
47 
48 
49  void leaveCell(
50  const peano4::grid::GridTraversalEvent& event
51  ) override;
52 
58  TraversalObserver* clone(int spacetreeId) override;
59 
60  std::vector< peano4::grid::GridControlEvent > getGridControlEvents() override;
61 };
62 
63 #endif
h
Definition: swe.py:79