Peano
Loading...
Searching...
No Matches
DefaultSequence.template.cpp
Go to the documentation of this file.
1// **********************************************************************************************
2// *** !!!WARNING!!! ***
3// *** WARNING: AUTO GENERATED FILE! DO NOT MODIFY BY HAND! YOUR CHANGES WILL BE OVERWRITTEN! ***
4// *** !!!WARNING!!! ***
5// *** Generated by Peano's Python API: www.peano-framework.org ***
6// **********************************************************************************************
7
8#include "{{MAIN_NAME}}.h"
9
10#include "tarch/logging/Log.h"
13
14#include "peano4/peano.h"
17
18{% if SUBDIRECTORIES -%}
19{% for subdirectory in SUBDIRECTORIES %}
20#include "{{subdirectory}}Constants.h"
21#include "{{subdirectory}}repositories/DataRepository.h"
22#include "{{subdirectory}}repositories/StepRepository.h"
23{% endfor -%}
24{% else %}
25#include "Constants.h"
26#include "repositories/DataRepository.h"
27#include "repositories/StepRepository.h"
28{%- endif %}
29
30#include "peano4/UnitTests.h"
31#include "tarch/UnitTests.h"
32
33{% if FENV_ARGS is defined and FENV_ARGS != "" -%}
34#include <fenv.h>
35#pragma float_control(precise, on)
36#pragma STDC FENV_ACCESS ON
37{% endif -%}
38
40
41int main(int argc, char** argv) {
42 constexpr int ExitCodeSuccess = 0;
43 constexpr int ExitCodeUnitTestsFailed = 1;
44
48 "peano4",
51 ));
55 "peano4",
58 ));
62 "peano4",
65 ));
66
70 "tarch",
73 ));
77 "tarch",
80 ));
84 "tarch",
87 ));
88
92 "{{NAMESPACE | join("::")}}",
95 ));
99 "{{NAMESPACE | join("::")}}",
102 ));
106 "{{NAMESPACE | join("::")}}",
109 ));
110
111 #if Dimensions==2
112 auto DomainOffset = {0.0, 0.0};
113 auto DomainSize = {1.0, 1.0};
114 #else
115 auto DomainOffset = {0.0, 0.0, 0.0};
116 auto DomainSize = {1.0, 1.0, 1.0};
117 #endif
118
121 {{NAMESPACE | join("::")}}::repositories::DataRepository::initDatatypes();
123 DomainOffset,
124 DomainSize,
125 0
126 );
127
128 {% if FENV_ARGS is defined and FENV_ARGS != "" -%}
129 feenableexcept({{FENV_ARGS}} );
130 {% endif -%}
131
132 #if PeanoDebug>=2
134 peanoCoreTests->run();
135 if (peanoCoreTests->getNumberOfErrors() != 0) {
136 logError("main()", "Peano4 core unit tests failed. Quit.");
137 exit(ExitCodeUnitTestsFailed);
138 }
139 delete peanoCoreTests;
140
141 tarch::tests::TestCase* peanoTarchTests = tarch::getUnitTests();
142 peanoTarchTests->run();
143 if (peanoTarchTests->getNumberOfErrors() != 0) {
144 logError("main()", "technical architecture (tarch) unit tests failed. Quit.");
145 exit(ExitCodeUnitTestsFailed);
146 }
147 delete peanoTarchTests;
148
149 #endif
150
151 #if defined(SharedOMP)
152 #pragma omp parallel
153 {
154 #pragma omp master
155 {
156 #endif
157 if (tarch::mpi::Rank::getInstance().isGlobalMaster() ) {
158 }
159 else {
160 while (peano4::parallel::Node::getInstance().continueToRun()) {
161 logDebug( "runParallel(...)", "trigger a new sweep with step " << peano4::parallel::Node::getInstance().getCurrentProgramStep() );
162 }
163 }
164 #if defined(SharedOMP)
165 }
166 }
167 #endif
168
170 {{NAMESPACE | join("::")}}::repositories::DataRepository::shutdownDatatypes();
172
173 return ExitCodeSuccess;
174}
#define logError(methodName, logMacroMessageStream)
Wrapper macro around tarch::tarch::logging::Log to improve logging.
Definition Log.h:464
#define logDebug(methodName, logMacroMessageStream)
Definition Log.h:50
tarch::logging::Log _log("::")
int main()
Definition main.cpp:321
static Node & getInstance()
This operation returns the singleton instance.
Definition Node.cpp:108
void addFilterListEntry(const FilterListEntry &entry)
Add one filter list entry.
static LogFilter & getInstance()
Log Device.
Definition Log.h:516
static Rank & getInstance()
This operation returns the singleton instance.
Definition Rank.cpp:539
Represents one test case.
Definition TestCase.h:57
int getNumberOfErrors() const
Definition TestCase.cpp:11
virtual void run()=0
This routine is triggered by the TestCaseCollection.
tarch::tests::TestCase * getUnitTests()
Please destroy after usage.
Definition UnitTests.cpp:12
void shutdownSingletons()
The very first thing I have to do is to shut down Node.
Definition peano.cpp:150
void fillLookupTables()
Fill Lookup Tables.
Definition peano.cpp:87
int initParallelEnvironment(int *argc, char ***argv)
Init Parallel Environment.
Definition peano.cpp:101
void initSingletons(const tarch::la::Vector< Dimensions, double > &offset, const tarch::la::Vector< Dimensions, double > &width, const std::bitset< Dimensions > &periodicBC=0)
Fire up all the singletons.
Definition peano.cpp:133
void shutdownParallelEnvironment()
Shutdown all the parallel environment, i.e.
Definition peano.cpp:127
tarch::tests::TestCase * getUnitTests()
Please destroy after usage.
Definition UnitTests.cpp:17
Represents one entry of the filter list.
Definition LogFilter.h:30
static const std::string TargetTrace
Definition LogFilter.h:36
static const std::string TargetDebug
Definition LogFilter.h:35
static const std::string TargetInfo
Definition LogFilter.h:34
static const std::string AlwaysOn
Definition LogFilter.h:39