Peano
Loading...
Searching...
No Matches
Spacetree-main.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
3#include "Spacetree-main.h"
4
5#include "Constants.h"
8#include "peano4/grid/Spacetree.h"
9#include "peano4/peano4.h"
10#include "tarch/logging/Log.h"
11#include "tarch/logging/LogFilter.h"
12#include "tarch/timing/Measurement.h"
13#include "tarch/timing/Watch.h"
14
15namespace {
16 tarch::logging::Log _log("");
17} // namespace
18
19using namespace tests::peano4::grid;
20
21int main(int argc, char** argv) {
22 static tarch::timing::Watch watch("::", "step()", false);
23
24#if DIMENSIONS == 2
25 const auto DomainOffset = {0.0, 0.0};
26 const auto DomainSize = {1.0, 1.0};
27#else
28 const auto DomainOffset = {0.0, 0.0, 0.0};
29 const auto DomainSize = {1.0, 1.0, 1.0};
30#endif
31
32 ::peano4::init(&argc, &argv, DomainOffset, DomainSize, 0);
33 ::peano4::writeCopyrightMessage();
34
35 ::peano4::grid::Spacetree spacetree(DomainOffset, DomainSize, 0);
36
37 CreateGridObserver createGridObserver;
38 while (spacetree.getGridStatistics().minH(0) > MinH) {
39 watch.start();
40 spacetree.traverse(createGridObserver, true);
41 watch.stop();
42 logInfo("main()", "Grid construction took " << watch.getCalendarTime() << "s: " << spacetree.getGridStatistics());
43 }
44
45 EmptyTraversalObserver emptyTraversalObserver;
46 watch.start();
47 spacetree.traverse(emptyTraversalObserver, true);
48 watch.stop();
49 logInfo("main()", "Empty traversal took " << watch.getCalendarTime() << "s: " << spacetree.getGridStatistics());
50
51 ::peano4::shutdown();
52
53 return EXIT_SUCCESS;
54}
int main(int argc, char **argv)
tarch::logging::Log _log("::")