Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KiT-RT
KiT-RT
Commits
7312d69b
Commit
7312d69b
authored
Dec 17, 2020
by
Steffen Schotthöfer
Browse files
added validation test for data gen (might be slow). added option to specify training set
parent
d7fff826
Pipeline
#123924
failed with stage
in 8 minutes and 41 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
code/include/common/config.h
View file @
7312d69b
...
...
@@ -112,7 +112,8 @@ class Config
// Data Generator Settings
/*!< @brief Check, if data generator mode is active. If yes, no solver is called, but instead the data generator is executed */
bool
_dataGeneratorMode
;
unsigned
long
_tainingSetSize
;
/*!< @brief Size of training data set for data generator */
unsigned
long
_tainingSetSize
;
/*!< @brief Size of training data set for data generator */
unsigned
long
_maxValFirstMoment
;
/*!< @brief Size of training data set for data generator */
// --- Parsing Functionality and Initializing of Options ---
/*!
...
...
@@ -296,6 +297,7 @@ class Config
// Data generator
bool
inline
GetDataGeneratorMode
()
{
return
_dataGeneratorMode
;
}
unsigned
long
inline
GetTrainingDataSetSize
()
{
return
_tainingSetSize
;
}
unsigned
long
inline
GetMaxValFirstMoment
()
{
return
_maxValFirstMoment
;
}
// ---- Setters for option structure
// This section is dangerous
...
...
code/include/toolboxes/datagenerator.h
View file @
7312d69b
...
...
@@ -68,8 +68,11 @@ class nnDataGenerator
void
PrintTrainingData
();
/*! @brief : Print computed training data to csv file and screen */
void
PrintLoadScreen
();
/*! @brief: Print screen IO*/
// Helper functions
void
ComputeMoments
();
/*! @brief: Pre-Compute Moments at all quadrature points. */
void
ComputeMoments
();
/*! @brief: Pre-Compute Moments at all quadrature points. */
void
CheckRealizability
();
// Debugging helper
inline
VectorVector
GetuSol
()
{
return
_uSol
;
}
/*! @brief: Get the computed solution vector uSol */
inline
VectorVector
GetAlpha
()
{
return
_alpha
;
}
/*! @brief: Get the computed vector alpha */
inline
std
::
vector
<
double
>
GethEntropy
()
{
return
_hEntropy
;
}
/*! @brief: Get the computed entropy value h */
};
#endif // DATAGENERATOR_H
code/src/common/config.cpp
View file @
7312d69b
...
...
@@ -304,6 +304,8 @@ void Config::SetConfigOptions() {
// Data generator related options
/*! @brief Size of training data set \n DESCRIPTION: Size of training data set \n DEFAULT 1 \ingroup Config */
AddUnsignedLongOption
(
"TRAINING_SET_SIZE"
,
_tainingSetSize
,
1
);
/*! @brief Size of training data set \n DESCRIPTION: Size of training data set \n DEFAULT 10 \ingroup Config */
AddUnsignedLongOption
(
"MAX_VALUE_FIRST_MOMENT"
,
_maxValFirstMoment
,
10
);
/*! @brief Data generator mode \n DESCRIPTION: Check, if data generator mode is active. If yes, no solver is called, but instead the data
* generator is executed \n DEFAULT false \ingroup Config */
AddBoolOption
(
"DATA_GENERATOR_MODE"
,
_dataGeneratorMode
,
false
);
...
...
code/src/toolboxes/datagenerator.cpp
View file @
7312d69b
...
...
@@ -97,7 +97,7 @@ void nnDataGenerator::SampleSolutionU() {
// Use necessary conditions from Monreal, Dissertation, Chapter 3.2.1, Page 26
// --- Determine stepsizes etc ---
double
du0
=
10.0
/
(
double
)
_setSize
;
// Prototype: u is sampled from [0,10]
double
du0
=
_settings
->
GetMaxValFirstMoment
()
/
(
double
)
_setSize
;
// different processes for different
if
(
_LMaxDegree
==
0
)
{
...
...
@@ -243,6 +243,3 @@ void nnDataGenerator::PrintLoadScreen() {
log
->
info
(
"------------------------ Data Generation Starts --------------------------"
);
log
->
info
(
"| Generating {} datapoints."
,
_setSize
);
}
// changed datatype of newton options;
// changed moments in newton optimizer to const( safety reasons )
// .parallelized newton multicell optimizer.removed<iostream> from several files.Added datagenerator mode to GaussLegendreQuadrature
code/tests/input/validation_tests/dataGenerator/validate_dataGen.cfg
0 → 100644
View file @
7312d69b
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Data Generator for %
% Neural Entropy Closure %
% Author <Steffen Schotthöfer> %
% Date 17.12.2020 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ---- Global settings ----
DATA_GENERATOR_MODE = YES
TRAINING_SET_SIZE = 2
MAX_VALUE_FIRST_MOMENT = 10
%
% ---- File specifications ----
%
% Output directory
OUTPUT_DIR = ../result
% Output file
OUTPUT_FILE = trainM0
% Log directory
LOG_DIR = ../../../result/logs
LOG_FILE = validate_dataGen
%
% --- Spherical Basis ----
%
% Choice of basis functions
SPHERICAL_BASIS = SPHERICAL_MONOMIALS
%
% Maximal Moment degree
MAX_MOMENT_SOLVER = 1
%
% --- Entropy settings ----
ENTROPY_FUNCTIONAL = MAXWELL_BOLTZMANN
ENTROPY_OPTIMIZER = NEWTON
%
% ----- Newton Solver Specifications ----
%
NEWTON_FAST_MODE = NO
NEWTON_ITER = 1000
NEWTON_EPSILON = 0.5
NEWTON_STEP_SIZE = 0.7
NEWTON_LINE_SEARCH_ITER = 1000
%
% ----- Quadrature ----
%
% Quadrature Rule
QUAD_TYPE = GAUSS_LEGENDRE_TENSORIZED
% Quadrature Order
QUAD_ORDER = 8
%
code/tests/input/validation_tests/dataGenerator/validate_dataGen_csv_reference
0 → 100644
View file @
7312d69b
2020-12-17 19:18:24.518145 , u_0 , u_1 , u_2 , u_3 , alpha_0 , alpha_1 , alpha_2 , alpha_3 , h
2020-12-17 19:18:24.518177 , 6.000000 , 1.368216 , 0.272155 , -4.801449 , -2.931460 , 1.217045 , 0.242085 , -4.270945 , -3.1052245087280075
2020-12-17 19:18:24.518188 , 6.000000 , 1.159918 , 0.775032 , -4.801449 , -2.931460 , 1.031761 , 0.689400 , -4.270945 , -3.1052243967129365
2020-12-17 19:18:24.518199 , 6.000000 , 0.775032 , 1.159918 , -4.801449 , -2.931460 , 0.689400 , 1.031761 , -4.270945 , -3.1052243817854506
2020-12-17 19:18:24.518210 , 6.000000 , 0.272155 , 1.368216 , -4.801449 , -2.931460 , 0.242085 , 1.217045 , -4.270945 , -3.105224488681416
2020-12-17 19:18:24.518220 , 6.000000 , -0.272155 , 1.368216 , -4.801449 , -2.931460 , -0.242085 , 1.217045 , -4.270945 , -3.105224488681415
2020-12-17 19:18:24.518231 , 6.000000 , -0.775032 , 1.159918 , -4.801449 , -2.931460 , -0.689400 , 1.031761 , -4.270945 , -3.105224381785452
2020-12-17 19:18:24.518241 , 6.000000 , -1.159918 , 0.775032 , -4.801449 , -2.931460 , -1.031761 , 0.689400 , -4.270945 , -3.105224396712946
2020-12-17 19:18:24.518251 , 6.000000 , -1.368216 , 0.272155 , -4.801449 , -2.931460 , -1.217045 , 0.242085 , -4.270945 , -3.105224508727997
2020-12-17 19:18:24.518262 , 6.000000 , -1.368216 , -0.272155 , -4.801449 , -2.931460 , -1.217045 , -0.242085 , -4.270945 , -3.1052245087280044
2020-12-17 19:18:24.518272 , 6.000000 , -1.159918 , -0.775032 , -4.801449 , -2.931460 , -1.031761 , -0.689400 , -4.270945 , -3.1052243967129414
2020-12-17 19:18:24.518283 , 6.000000 , -0.775032 , -1.159918 , -4.801449 , -2.931460 , -0.689400 , -1.031761 , -4.270945 , -3.105224381785454
2020-12-17 19:18:24.518293 , 6.000000 , -0.272155 , -1.368216 , -4.801449 , -2.931460 , -0.242085 , -1.217045 , -4.270945 , -3.1052244886814147
2020-12-17 19:18:24.518303 , 6.000000 , 0.272155 , -1.368216 , -4.801449 , -2.931460 , 0.242085 , -1.217045 , -4.270945 , -3.1052244886814147
2020-12-17 19:18:24.518314 , 6.000000 , 0.775032 , -1.159918 , -4.801449 , -2.931460 , 0.689400 , -1.031761 , -4.270945 , -3.1052243817854515
2020-12-17 19:18:24.518324 , 6.000000 , 1.159918 , -0.775032 , -4.801449 , -2.931460 , 1.031761 , -0.689400 , -4.270945 , -3.1052243967129405
2020-12-17 19:18:24.518335 , 6.000000 , 1.368216 , -0.272155 , -4.801449 , -2.931460 , 1.217045 , -0.242085 , -4.270945 , -3.105224508728007
2020-12-17 19:18:24.518345 , 6.000000 , 2.964027 , 0.589582 , -3.983332 , -2.931460 , 2.636537 , 0.524440 , -3.543221 , -3.1052244555540924
2020-12-17 19:18:24.518355 , 6.000000 , 2.512781 , 1.678986 , -3.983332 , -2.931460 , 2.235148 , 1.493478 , -3.543221 , -3.1052244551584662
2020-12-17 19:18:24.518366 , 6.000000 , 1.678986 , 2.512781 , -3.983332 , -2.931460 , 1.493478 , 2.235148 , -3.543221 , -3.105224489360173
2020-12-17 19:18:24.518376 , 6.000000 , 0.589582 , 2.964027 , -3.983332 , -2.931460 , 0.524440 , 2.636537 , -3.543221 , -3.10522440804957
2020-12-17 19:18:24.518387 , 6.000000 , -0.589582 , 2.964027 , -3.983332 , -2.931460 , -0.524440 , 2.636537 , -3.543221 , -3.1052244080495695
2020-12-17 19:18:24.518397 , 6.000000 , -1.678986 , 2.512781 , -3.983332 , -2.931460 , -1.493478 , 2.235148 , -3.543221 , -3.105224489360184
2020-12-17 19:18:24.518407 , 6.000000 , -2.512781 , 1.678986 , -3.983332 , -2.931460 , -2.235148 , 1.493478 , -3.543221 , -3.1052244551584702
2020-12-17 19:18:24.518417 , 6.000000 , -2.964027 , 0.589582 , -3.983332 , -2.931460 , -2.636537 , 0.524440 , -3.543221 , -3.105224455554098
2020-12-17 19:18:24.518428 , 6.000000 , -2.964027 , -0.589582 , -3.983332 , -2.931460 , -2.636537 , -0.524440 , -3.543221 , -3.105224455554096
2020-12-17 19:18:24.518438 , 6.000000 , -2.512781 , -1.678986 , -3.983332 , -2.931460 , -2.235148 , -1.493478 , -3.543221 , -3.1052244551584707
2020-12-17 19:18:24.518448 , 6.000000 , -1.678986 , -2.512781 , -3.983332 , -2.931460 , -1.493478 , -2.235148 , -3.543221 , -3.1052244893601784
2020-12-17 19:18:24.518458 , 6.000000 , -0.589582 , -2.964027 , -3.983332 , -2.931460 , -0.524440 , -2.636537 , -3.543221 , -3.1052244080495717
2020-12-17 19:18:24.518469 , 6.000000 , 0.589582 , -2.964027 , -3.983332 , -2.931460 , 0.524440 , -2.636537 , -3.543221 , -3.105224408049574
2020-12-17 19:18:24.518505 , 6.000000 , 1.678986 , -2.512781 , -3.983332 , -2.931460 , 1.493478 , -2.235148 , -3.543221 , -3.1052244893601766
2020-12-17 19:18:24.518515 , 6.000000 , 2.512781 , -1.678986 , -3.983332 , -2.931460 , 2.235148 , -1.493478 , -3.543221 , -3.1052244551584685
2020-12-17 19:18:24.518526 , 6.000000 , 2.964027 , -0.589582 , -3.983332 , -2.931460 , 2.636537 , -0.524440 , -3.543221 , -3.1052244555540893
2020-12-17 19:18:24.518536 , 6.000000 , 4.172131 , 0.829888 , -2.627662 , -2.931460 , 3.711159 , 0.738195 , -2.337336 , -3.1052244314484776
2020-12-17 19:18:24.518547 , 6.000000 , 3.536962 , 2.363322 , -2.627662 , -2.931460 , 3.146169 , 2.102203 , -2.337336 , -3.105224534939292
2020-12-17 19:18:24.518557 , 6.000000 , 2.363322 , 3.536962 , -2.627662 , -2.931460 , 2.102203 , 3.146169 , -2.337336 , -3.1052244603405184
2020-12-17 19:18:24.518567 , 6.000000 , 0.829888 , 4.172131 , -2.627662 , -2.931460 , 0.738195 , 3.711159 , -2.337336 , -3.1052243709410967
2020-12-17 19:18:24.518578 , 6.000000 , -0.829888 , 4.172131 , -2.627662 , -2.931460 , -0.738195 , 3.711159 , -2.337336 , -3.1052243709410967
2020-12-17 19:18:24.518588 , 6.000000 , -2.363322 , 3.536962 , -2.627662 , -2.931460 , -2.102203 , 3.146169 , -2.337336 , -3.1052244603405263
2020-12-17 19:18:24.518598 , 6.000000 , -3.536962 , 2.363322 , -2.627662 , -2.931460 , -3.146169 , 2.102203 , -2.337336 , -3.105224534939292
2020-12-17 19:18:24.518609 , 6.000000 , -4.172131 , 0.829888 , -2.627662 , -2.931460 , -3.711159 , 0.738195 , -2.337336 , -3.1052244314484923
2020-12-17 19:18:24.518619 , 6.000000 , -4.172131 , -0.829888 , -2.627662 , -2.931460 , -3.711159 , -0.738195 , -2.337336 , -3.1052244314484887
2020-12-17 19:18:24.518629 , 6.000000 , -3.536962 , -2.363322 , -2.627662 , -2.931460 , -3.146169 , -2.102203 , -2.337336 , -3.1052245349392926
2020-12-17 19:18:24.518639 , 6.000000 , -2.363322 , -3.536962 , -2.627662 , -2.931460 , -2.102203 , -3.146169 , -2.337336 , -3.1052244603405277
2020-12-17 19:18:24.518650 , 6.000000 , -0.829888 , -4.172131 , -2.627662 , -2.931460 , -0.738195 , -3.711159 , -2.337336 , -3.1052243709410963
2020-12-17 19:18:24.518660 , 6.000000 , 0.829888 , -4.172131 , -2.627662 , -2.931460 , 0.738195 , -3.711159 , -2.337336 , -3.1052243709411
2020-12-17 19:18:24.518670 , 6.000000 , 2.363322 , -3.536962 , -2.627662 , -2.931460 , 2.102203 , -3.146169 , -2.337336 , -3.1052244603405272
2020-12-17 19:18:24.518681 , 6.000000 , 3.536962 , -2.363322 , -2.627662 , -2.931460 , 3.146169 , -2.102203 , -2.337336 , -3.105224534939293
2020-12-17 19:18:24.518691 , 6.000000 , 4.172131 , -0.829888 , -2.627662 , -2.931460 , 3.711159 , -0.738195 , -2.337336 , -3.105224431448481
2020-12-17 19:18:24.518702 , 6.000000 , 4.820716 , 0.958900 , -0.917173 , -2.931460 , 4.288083 , 0.852953 , -0.815836 , -3.1052244031627643
2020-12-17 19:18:24.518712 , 6.000000 , 4.086806 , 2.730716 , -0.917173 , -2.931460 , 3.635261 , 2.429004 , -0.815836 , -3.1052244221007737
2020-12-17 19:18:24.518722 , 6.000000 , 2.730716 , 4.086806 , -0.917173 , -2.931460 , 2.429004 , 3.635261 , -0.815836 , -3.1052244267837454
2020-12-17 19:18:24.518733 , 6.000000 , 0.958900 , 4.820716 , -0.917173 , -2.931460 , 0.852953 , 4.288083 , -0.815836 , -3.105224366427218
2020-12-17 19:18:24.518743 , 6.000000 , -0.958900 , 4.820716 , -0.917173 , -2.931460 , -0.852953 , 4.288083 , -0.815836 , -3.1052243664272106
2020-12-17 19:18:24.518753 , 6.000000 , -2.730716 , 4.086806 , -0.917173 , -2.931460 , -2.429004 , 3.635261 , -0.815836 , -3.1052244267837423
2020-12-17 19:18:24.518764 , 6.000000 , -4.086806 , 2.730716 , -0.917173 , -2.931460 , -3.635261 , 2.429004 , -0.815836 , -3.105224422100789
2020-12-17 19:18:24.518774 , 6.000000 , -4.820716 , 0.958900 , -0.917173 , -2.931460 , -4.288083 , 0.852953 , -0.815836 , -3.1052244031627905
2020-12-17 19:18:24.518785 , 6.000000 , -4.820716 , -0.958900 , -0.917173 , -2.931460 , -4.288083 , -0.852953 , -0.815836 , -3.1052244031627914
2020-12-17 19:18:24.518804 , 6.000000 , -4.086806 , -2.730716 , -0.917173 , -2.931460 , -3.635261 , -2.429004 , -0.815836 , -3.105224422100789
2020-12-17 19:18:24.518815 , 6.000000 , -2.730716 , -4.086806 , -0.917173 , -2.931460 , -2.429004 , -3.635261 , -0.815836 , -3.105224426783754
2020-12-17 19:18:24.518825 , 6.000000 , -0.958900 , -4.820716 , -0.917173 , -2.931460 , -0.852953 , -4.288083 , -0.815836 , -3.1052243664272137
2020-12-17 19:18:24.518836 , 6.000000 , 0.958900 , -4.820716 , -0.917173 , -2.931460 , 0.852953 , -4.288083 , -0.815836 , -3.1052243664272168
2020-12-17 19:18:24.518846 , 6.000000 , 2.730716 , -4.086806 , -0.917173 , -2.931460 , 2.429004 , -3.635261 , -0.815836 , -3.1052244267837437
2020-12-17 19:18:24.518857 , 6.000000 , 4.086806 , -2.730716 , -0.917173 , -2.931460 , 3.635261 , -2.429004 , -0.815836 , -3.1052244221007754
2020-12-17 19:18:24.518867 , 6.000000 , 4.820716 , -0.958900 , -0.917173 , -2.931460 , 4.288083 , -0.852953 , -0.815836 , -3.1052244031627643
2020-12-17 19:18:24.518878 , 6.000000 , 4.820716 , 0.958900 , 0.917173 , -2.931460 , 4.288083 , 0.852953 , 0.815836 , -3.1052244031627665
2020-12-17 19:18:24.518888 , 6.000000 , 4.086806 , 2.730716 , 0.917173 , -2.931460 , 3.635261 , 2.429004 , 0.815836 , -3.1052244221007785
2020-12-17 19:18:24.518898 , 6.000000 , 2.730716 , 4.086806 , 0.917173 , -2.931460 , 2.429004 , 3.635261 , 0.815836 , -3.1052244267837446
2020-12-17 19:18:24.518909 , 6.000000 , 0.958900 , 4.820716 , 0.917173 , -2.931460 , 0.852953 , 4.288083 , 0.815836 , -3.1052243664272146
2020-12-17 19:18:24.518919 , 6.000000 , -0.958900 , 4.820716 , 0.917173 , -2.931460 , -0.852953 , 4.288083 , 0.815836 , -3.1052243664272163
2020-12-17 19:18:24.518930 , 6.000000 , -2.730716 , 4.086806 , 0.917173 , -2.931460 , -2.429004 , 3.635261 , 0.815836 , -3.1052244267837463
2020-12-17 19:18:24.518940 , 6.000000 , -4.086806 , 2.730716 , 0.917173 , -2.931460 , -3.635261 , 2.429004 , 0.815836 , -3.1052244221007896
2020-12-17 19:18:24.518951 , 6.000000 , -4.820716 , 0.958900 , 0.917173 , -2.931460 , -4.288083 , 0.852953 , 0.815836 , -3.105224403162794
2020-12-17 19:18:24.518961 , 6.000000 , -4.820716 , -0.958900 , 0.917173 , -2.931460 , -4.288083 , -0.852953 , 0.815836 , -3.1052244031627936
2020-12-17 19:18:24.518971 , 6.000000 , -4.086806 , -2.730716 , 0.917173 , -2.931460 , -3.635261 , -2.429004 , 0.815836 , -3.1052244221007923
2020-12-17 19:18:24.518982 , 6.000000 , -2.730716 , -4.086806 , 0.917173 , -2.931460 , -2.429004 , -3.635261 , 0.815836 , -3.1052244267837574
2020-12-17 19:18:24.518992 , 6.000000 , -0.958900 , -4.820716 , 0.917173 , -2.931460 , -0.852953 , -4.288083 , 0.815836 , -3.105224366427219
2020-12-17 19:18:24.519003 , 6.000000 , 0.958900 , -4.820716 , 0.917173 , -2.931460 , 0.852953 , -4.288083 , 0.815836 , -3.1052243664272248
2020-12-17 19:18:24.519013 , 6.000000 , 2.730716 , -4.086806 , 0.917173 , -2.931460 , 2.429004 , -3.635261 , 0.815836 , -3.1052244267837406
2020-12-17 19:18:24.519023 , 6.000000 , 4.086806 , -2.730716 , 0.917173 , -2.931460 , 3.635261 , -2.429004 , 0.815836 , -3.105224422100778
2020-12-17 19:18:24.519034 , 6.000000 , 4.820716 , -0.958900 , 0.917173 , -2.931460 , 4.288083 , -0.852953 , 0.815836 , -3.10522440316277
2020-12-17 19:18:24.519044 , 6.000000 , 4.172131 , 0.829888 , 2.627662 , -2.931460 , 3.711159 , 0.738195 , 2.337336 , -3.1052244314484785
2020-12-17 19:18:24.519055 , 6.000000 , 3.536962 , 2.363322 , 2.627662 , -2.931460 , 3.146169 , 2.102203 , 2.337336 , -3.1052245349392913
2020-12-17 19:18:24.519065 , 6.000000 , 2.363322 , 3.536962 , 2.627662 , -2.931460 , 2.102203 , 3.146169 , 2.337336 , -3.1052244603405255
2020-12-17 19:18:24.519075 , 6.000000 , 0.829888 , 4.172131 , 2.627662 , -2.931460 , 0.738195 , 3.711159 , 2.337336 , -3.1052243709410994
2020-12-17 19:18:24.519086 , 6.000000 , -0.829888 , 4.172131 , 2.627662 , -2.931460 , -0.738195 , 3.711159 , 2.337336 , -3.105224370941096
2020-12-17 19:18:24.519098 , 6.000000 , -2.363322 , 3.536962 , 2.627662 , -2.931460 , -2.102203 , 3.146169 , 2.337336 , -3.1052244603405303
2020-12-17 19:18:24.519117 , 6.000000 , -3.536962 , 2.363322 , 2.627662 , -2.931460 , -3.146169 , 2.102203 , 2.337336 , -3.1052245349392917
2020-12-17 19:18:24.519128 , 6.000000 , -4.172131 , 0.829888 , 2.627662 , -2.931460 , -3.711159 , 0.738195 , 2.337336 , -3.1052244314484905
2020-12-17 19:18:24.519138 , 6.000000 , -4.172131 , -0.829888 , 2.627662 , -2.931460 , -3.711159 , -0.738195 , 2.337336 , -3.1052244314484883
2020-12-17 19:18:24.519148 , 6.000000 , -3.536962 , -2.363322 , 2.627662 , -2.931460 , -3.146169 , -2.102203 , 2.337336 , -3.105224534939289
2020-12-17 19:18:24.519159 , 6.000000 , -2.363322 , -3.536962 , 2.627662 , -2.931460 , -2.102203 , -3.146169 , 2.337336 , -3.105224460340529
2020-12-17 19:18:24.519169 , 6.000000 , -0.829888 , -4.172131 , 2.627662 , -2.931460 , -0.738195 , -3.711159 , 2.337336 , -3.1052243709411007
2020-12-17 19:18:24.519179 , 6.000000 , 0.829888 , -4.172131 , 2.627662 , -2.931460 , 0.738195 , -3.711159 , 2.337336 , -3.1052243709410985
2020-12-17 19:18:24.519190 , 6.000000 , 2.363322 , -3.536962 , 2.627662 , -2.931460 , 2.102203 , -3.146169 , 2.337336 , -3.1052244603405232
2020-12-17 19:18:24.519200 , 6.000000 , 3.536962 , -2.363322 , 2.627662 , -2.931460 , 3.146169 , -2.102203 , 2.337336 , -3.1052245349392944
2020-12-17 19:18:24.519210 , 6.000000 , 4.172131 , -0.829888 , 2.627662 , -2.931460 , 3.711159 , -0.738195 , 2.337336 , -3.1052244314484807
2020-12-17 19:18:24.519221 , 6.000000 , 2.964027 , 0.589582 , 3.983332 , -2.931460 , 2.636537 , 0.524440 , 3.543221 , -3.105224455554093
2020-12-17 19:18:24.519231 , 6.000000 , 2.512781 , 1.678986 , 3.983332 , -2.931460 , 2.235148 , 1.493478 , 3.543221 , -3.105224455158472
2020-12-17 19:18:24.519241 , 6.000000 , 1.678986 , 2.512781 , 3.983332 , -2.931460 , 1.493478 , 2.235148 , 3.543221 , -3.105224489360174
2020-12-17 19:18:24.519252 , 6.000000 , 0.589582 , 2.964027 , 3.983332 , -2.931460 , 0.524440 , 2.636537 , 3.543221 , -3.105224408049576
2020-12-17 19:18:24.519262 , 6.000000 , -0.589582 , 2.964027 , 3.983332 , -2.931460 , -0.524440 , 2.636537 , 3.543221 , -3.1052244080495703
2020-12-17 19:18:24.519273 , 6.000000 , -1.678986 , 2.512781 , 3.983332 , -2.931460 , -1.493478 , 2.235148 , 3.543221 , -3.1052244893601766
2020-12-17 19:18:24.519283 , 6.000000 , -2.512781 , 1.678986 , 3.983332 , -2.931460 , -2.235148 , 1.493478 , 3.543221 , -3.1052244551584716
2020-12-17 19:18:24.519293 , 6.000000 , -2.964027 , 0.589582 , 3.983332 , -2.931460 , -2.636537 , 0.524440 , 3.543221 , -3.1052244555540924
2020-12-17 19:18:24.519304 , 6.000000 , -2.964027 , -0.589582 , 3.983332 , -2.931460 , -2.636537 , -0.524440 , 3.543221 , -3.105224455554094
2020-12-17 19:18:24.519314 , 6.000000 , -2.512781 , -1.678986 , 3.983332 , -2.931460 , -2.235148 , -1.493478 , 3.543221 , -3.1052244551584733
2020-12-17 19:18:24.519324 , 6.000000 , -1.678986 , -2.512781 , 3.983332 , -2.931460 , -1.493478 , -2.235148 , 3.543221 , -3.105224489360176
2020-12-17 19:18:24.519335 , 6.000000 , -0.589582 , -2.964027 , 3.983332 , -2.931460 , -0.524440 , -2.636537 , 3.543221 , -3.1052244080495712
2020-12-17 19:18:24.519345 , 6.000000 , 0.589582 , -2.964027 , 3.983332 , -2.931460 , 0.524440 , -2.636537 , 3.543221 , -3.1052244080495703
2020-12-17 19:18:24.519356 , 6.000000 , 1.678986 , -2.512781 , 3.983332 , -2.931460 , 1.493478 , -2.235148 , 3.543221 , -3.1052244893601735
2020-12-17 19:18:24.519366 , 6.000000 , 2.512781 , -1.678986 , 3.983332 , -2.931460 , 2.235148 , -1.493478 , 3.543221 , -3.1052244551584667
2020-12-17 19:18:24.519376 , 6.000000 , 2.964027 , -0.589582 , 3.983332 , -2.931460 , 2.636537 , -0.524440 , 3.543221 , -3.1052244555540933
2020-12-17 19:18:24.519387 , 6.000000 , 1.368216 , 0.272155 , 4.801449 , -2.931460 , 1.217045 , 0.242085 , 4.270945 , -3.1052245087279973
2020-12-17 19:18:24.519397 , 6.000000 , 1.159918 , 0.775032 , 4.801449 , -2.931460 , 1.031761 , 0.689400 , 4.270945 , -3.1052243967129365
2020-12-17 19:18:24.519408 , 6.000000 , 0.775032 , 1.159918 , 4.801449 , -2.931460 , 0.689400 , 1.031761 , 4.270945 , -3.1052243817854506
2020-12-17 19:18:24.519427 , 6.000000 , 0.272155 , 1.368216 , 4.801449 , -2.931460 , 0.242085 , 1.217045 , 4.270945 , -3.1052244886814027
2020-12-17 19:18:24.519437 , 6.000000 , -0.272155 , 1.368216 , 4.801449 , -2.931460 , -0.242085 , 1.217045 , 4.270945 , -3.105224488681416
2020-12-17 19:18:24.519447 , 6.000000 , -0.775032 , 1.159918 , 4.801449 , -2.931460 , -0.689400 , 1.031761 , 4.270945 , -3.105224381785454
2020-12-17 19:18:24.519458 , 6.000000 , -1.159918 , 0.775032 , 4.801449 , -2.931460 , -1.031761 , 0.689400 , 4.270945 , -3.1052243967129365
2020-12-17 19:18:24.519468 , 6.000000 , -1.368216 , 0.272155 , 4.801449 , -2.931460 , -1.217045 , 0.242085 , 4.270945 , -3.1052245087279973
2020-12-17 19:18:24.519479 , 6.000000 , -1.368216 , -0.272155 , 4.801449 , -2.931460 , -1.217045 , -0.242085 , 4.270945 , -3.1052245087279995
2020-12-17 19:18:24.519489 , 6.000000 , -1.159918 , -0.775032 , 4.801449 , -2.931460 , -1.031761 , -0.689400 , 4.270945 , -3.105224396712944
2020-12-17 19:18:24.519499 , 6.000000 , -0.775032 , -1.159918 , 4.801449 , -2.931460 , -0.689400 , -1.031761 , 4.270945 , -3.105224381785451
2020-12-17 19:18:24.519510 , 6.000000 , -0.272155 , -1.368216 , 4.801449 , -2.931460 , -0.242085 , -1.217045 , 4.270945 , -3.105224488681412
2020-12-17 19:18:24.519520 , 6.000000 , 0.272155 , -1.368216 , 4.801449 , -2.931460 , 0.242085 , -1.217045 , 4.270945 , -3.10522448868141
2020-12-17 19:18:24.519530 , 6.000000 , 0.775032 , -1.159918 , 4.801449 , -2.931460 , 0.689400 , -1.031761 , 4.270945 , -3.105224381785444
2020-12-17 19:18:24.519541 , 6.000000 , 1.159918 , -0.775032 , 4.801449 , -2.931460 , 1.031761 , -0.689400 , 4.270945 , -3.105224396712938
2020-12-17 19:18:24.519551 , 6.000000 , 1.368216 , -0.272155 , 4.801449 , -2.931460 , 1.217045 , -0.242085 , 4.270945 , -3.1052245087280066
code/tests/test_cases.cpp
View file @
7312d69b
...
...
@@ -7,6 +7,7 @@
#include "common/config.h"
#include "solvers/solverbase.h"
#include "toolboxes/datagenerator.h"
using
vtkUnstructuredGridReaderSP
=
vtkSmartPointer
<
vtkUnstructuredGridReader
>
;
...
...
@@ -286,3 +287,64 @@ TEST_CASE( "screen_output", "[output]" ) {
}
REQUIRE
(
eqLen
);
// Files must be of same length
}
TEST_CASE
(
"Test the Data Generator"
,
"[dataGen]"
)
{
std
::
string
out_fileDir
=
"input/validation_tests/dataGenerator/"
;
spdlog
::
drop_all
();
// Make sure to write in own logging file
std
::
string
config_file_name
=
std
::
string
(
TESTS_PATH
)
+
out_fileDir
+
"validate_dataGen.cfg"
;
std
::
string
historyLoggerReference
=
std
::
string
(
TESTS_PATH
)
+
out_fileDir
+
"validate_dataGen_csv_reference"
;
std
::
string
historyLogger
=
std
::
string
(
TESTS_PATH
)
+
"result/logs/validate_dataGen_csv"
;
// --- Generate Data ---
// Load Settings from File
Config
*
config
=
new
Config
(
config_file_name
);
// Build Data generator
nnDataGenerator
*
datagen
=
new
nnDataGenerator
(
config
);
// Generate Data and export
datagen
->
computeTrainingData
();
// --- Force Logger to flush
auto
log
=
spdlog
::
get
(
"event"
);
auto
logCSV
=
spdlog
::
get
(
"tabular"
);
log
->
flush
();
logCSV
->
flush
();
// --- Read and validate logger ---
std
::
ifstream
historyLoggerReferenceStream
(
historyLoggerReference
);
std
::
ifstream
historyLoggerStream
(
historyLogger
);
std
::
string
line
,
lineRef
;
bool
lineValid
;
const
char
delimHist
=
','
;
bool
testPassed
=
true
;
// --- History Logger
unsigned
count
=
0
;
while
(
!
historyLoggerReferenceStream
.
eof
()
&&
!
historyLoggerStream
.
eof
()
&&
count
<
3
)
{
std
::
getline
(
historyLoggerReferenceStream
,
lineRef
);
std
::
getline
(
historyLoggerStream
,
line
);
// ignore date (before first "|")
std
::
vector
<
std
::
string
>
out
;
std
::
vector
<
std
::
string
>
outRef
;
tokenize
(
line
,
delimHist
,
out
);
tokenize
(
lineRef
,
delimHist
,
outRef
);
if
(
out
.
size
()
!=
outRef
.
size
()
)
{
std
::
cout
<<
lineRef
<<
"
\n
"
<<
line
<<
"
\n
"
;
testPassed
=
false
;
break
;
}
for
(
unsigned
idx_token
=
1
;
idx_token
<
out
.
size
();
idx_token
++
)
{
// Skip date ==> start from 1
lineValid
=
outRef
[
idx_token
].
compare
(
out
[
idx_token
]
)
==
0
;
if
(
!
lineValid
)
{
std
::
cout
<<
lineRef
<<
"
\n
"
<<
line
<<
"
\n
"
;
testPassed
=
false
;
break
;
}
}
count
++
;
}
REQUIRE
(
testPassed
);
}
code/tests/test_optimizer.cpp
View file @
7312d69b
...
...
@@ -31,12 +31,11 @@ TEST_CASE( "Test the Newton Optimizer", "[optimizers]" ) {
Vector
alpha
(
nTotalEntries
,
27.0
);
// Get Moments
config
->
SetNQuadPoints
(
quad
->
GetNq
()
);
VectorVector
moments
=
VectorVector
(
quad
->
GetNq
()
);
double
my
,
phi
;
VectorVector
quadPointsSphere
=
quad
->
GetPointsSphere
();
for
(
unsigned
idx_quad
=
0
;
idx_quad
<
config
->
GetNQuadPoints
();
idx_quad
++
)
{
for
(
unsigned
idx_quad
=
0
;
idx_quad
<
quad
->
GetNq
();
idx_quad
++
)
{
my
=
quadPointsSphere
[
idx_quad
][
0
];
phi
=
quadPointsSphere
[
idx_quad
][
1
];
...
...
jannick.wolters
@jm2154
mentioned in commit
11c4a65a
·
Apr 30, 2021
mentioned in commit
11c4a65a
mentioned in commit 11c4a65a0f461ea7e0caf340431f5d1b620d1e8c
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment