Peano
Loading...
Searching...
No Matches
CreateGridObserver.cpp
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#include "Constants.h"
6
8 _doRefinement(doRefinement) {}
9
11 const tarch::la::Vector<DIMENSIONS, double>& x,
12 const tarch::la::Vector<DIMENSIONS, double>& h
13) {}
14
16 const tarch::la::Vector<DIMENSIONS, double>& x,
17 const tarch::la::Vector<DIMENSIONS, double>& h
18) {}
19
20void tests::peano4::parallel::CreateGridObserver::enterNode(const ::peano4::grid::GridTraversalEvent& event) {}
21
22void tests::peano4::parallel::CreateGridObserver::leaveNode(const ::peano4::grid::GridTraversalEvent& event) {}
23
24::peano4::grid::GridTraversalObserver* tests::peano4::parallel::CreateGridObserver::clone(int spacetreeId) {
25 return new CreateGridObserver(_doRefinement);
26}
27
28std::vector<::peano4::grid::GridControlEvent> tests::peano4::parallel::CreateGridObserver::
30 std::vector<::peano4::grid::GridControlEvent> controlEvents;
31
32 if (not _doRefinement) {
33 return controlEvents;
34 }
35
36 ::peano4::grid::GridControlEvent newEvent;
37 newEvent.setRefinementControl(::peano4::grid::GridControlEvent::RefinementControl::Refine);
38#if DIMENSIONS == 2
39 newEvent.offset = {0.0, 0.0};
40 newEvent.width = {1.0, 1.0};
41 newEvent.targetH = {MinH, MinH};
42#else
43 newEvent.offset = {0.0, 0.0, 0.0};
44 newEvent.width = {1.0, 1.0, 1.0};
45 newEvent.targetH = {MinH, MinH, MinH};
46#endif
47 controlEvents.push_back(std::move(newEvent));
48 return controlEvents;
49}
void beginTraversal(const tarch::la::Vector< DIMENSIONS, double > &x, const tarch::la::Vector< DIMENSIONS, double > &h) override
std::vector<::peano4::grid::GridControlEvent > getGridControlEvents() const override
void enterNode(const ::peano4::grid::GridTraversalEvent &event) override
void leaveNode(const ::peano4::grid::GridTraversalEvent &event) override
void endTraversal(const tarch::la::Vector< DIMENSIONS, double > &x, const tarch::la::Vector< DIMENSIONS, double > &h) override
GridTraversalObserver * clone(int spacetreeId) override