Commit 1952c219 authored by Steffen Schotthöfer's avatar Steffen Schotthöfer
Browse files

added d1 normalized datagenerator

parent 8acf866f
Pipeline #141623 passed with stage
in 19 minutes and 49 seconds
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 1D Data Generator for %
% 1D Data Generator for %
% Neural Entropy Closure %
% Author <Steffen Schotthöfer> %
% Author <Steffen Schotthöfer> %
% Date 17.02.2021 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ---- Datagenerator settings ----
DATA_GENERATOR_MODE = YES
TRAINING_SET_SIZE = 100
TRAINING_SET_SIZE = 2000
MAX_VALUE_FIRST_MOMENT = 1
SPATIAL_DIM = 1
REALIZABLE_SET_EPSILON_U1 = 0.003
REALIZABLE_SET_EPSILON_U0 = 0.003
NORMALIZED_SAMPLING = NO
MAX_MOMENT_SOLVER = 3
NORMALIZED_SAMPLING = YES
MAX_MOMENT_SOLVER = 1
%
% ---- File specifications ----
%
%
% Output directory
OUTPUT_DIR = ../result
% Output file
......@@ -45,7 +45,7 @@ NEWTON_STEP_SIZE = 0.7
NEWTON_LINE_SEARCH_ITER = 100000
%
% ----- Quadrature ----
%
%
% Quadrature Rule
QUAD_TYPE = GAUSS_LEGENDRE_1D
% Quadrature Order
......
......@@ -134,6 +134,18 @@ void DataGenerator1D::SampleSolutionU() {
}
}
else if( _settings->GetSphericalBasisName() == SPHERICAL_MONOMIALS && _settings->GetNormalizedSampling() ) {
if( _LMaxDegree == 1 ) {
// Carefull: This computes only normalized moments, i.e. sampling for u_0 = 1
unsigned c = 0;
double dN = 2.0 / (double)_gridSize;
double N1 = -1.0 + _settings->GetRealizableSetEpsilonU0();
while( N1 < 1.0 - _settings->GetRealizableSetEpsilonU0() ) {
_uSol[c][0] = 1; // u0 (normalized i.e. N0) by Monreals notation
_uSol[c][1] = N1; // u1 (normalized i.e. N1) by Monreals notation
N1 += dN;
c++;
}
}
if( _LMaxDegree == 2 ) {
// Carefull: This computes only normalized moments, i.e. sampling for u_0 = 1
unsigned c = 0;
......@@ -234,8 +246,7 @@ void DataGenerator1D::ComputeSetSize() {
}
_setSize = c;
}
else if( _LMaxDegree == 3 && _settings->GetSphericalBasisName() == SPHERICAL_MONOMIALS && !_settings->GetNormalizedSampling() ) {
// Carefull: This computes only normalized moments, i.e. sampling for u_0 = 1
else if( _LMaxDegree == 3 ) {
unsigned c = 0;
double du = _settings->GetMaxValFirstMoment() / (double)_gridSize;
double u0 = _settings->GetRealizableSetEpsilonU0();
......@@ -267,7 +278,18 @@ void DataGenerator1D::ComputeSetSize() {
}
}
else if( _settings->GetSphericalBasisName() == SPHERICAL_MONOMIALS && _settings->GetNormalizedSampling() ) {
if( _LMaxDegree == 2 ) {
if( _LMaxDegree == 1 ) {
// Carefull: This computes only normalized moments, i.e. sampling for u_0 = 1
unsigned c = 0;
double dN = 2.0 / (double)_gridSize;
double N1 = -1.0 + _settings->GetRealizableSetEpsilonU0();
while( N1 < 1.0 - _settings->GetRealizableSetEpsilonU0() ) {
N1 += dN;
c++;
}
_setSize = c;
}
else if( _LMaxDegree == 2 ) {
// Carefull: This computes only normalized moments, i.e. sampling for u_0 = 1
unsigned c = 1;
double N1 = -1.0 + _settings->GetRealizableSetEpsilonU0();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment