Commit dba5dca7 authored by steffen.schotthoefer's avatar steffen.schotthoefer
Browse files

Merge branch 'feature_output' into 'master'

Feature output

Closes #48, #64, and #63

See merge request !30
parents 380ada4d cf4911c7
Pipeline #118831 passed with stage
in 12 minutes and 41 seconds
......@@ -34,12 +34,13 @@ class Config
// --- Options ---
// File Structure
std::string _inputDir; /*!< @brief Directory for input files*/
std::string _outputDir; /*!< @brief Directory for output files*/
std::string _outputFile; /*!< @brief Name of output file*/
std::string _logDir; /*!< @brief Directory of log file*/
std::string _meshFile; /*!< @brief Name of mesh file*/
std::string _ctFile; /*!< @brief Name of CT file*/
std::string _inputDir; /*!< @brief Directory for input files*/
std::string _outputDir; /*!< @brief Directory for output files*/
std::string _outputFile; /*!< @brief Name of output file*/
std::string _logDir; /*!< @brief Directory of log file*/
std::string _logFileName; /*!< @brief Name of log file*/
std::string _meshFile; /*!< @brief Name of mesh file*/
std::string _ctFile; /*!< @brief Name of CT file*/
// Quadrature
QUAD_NAME _quadName; /*!< @brief Quadrature Name*/
......@@ -93,7 +94,15 @@ class Config
// Output Options
unsigned short _nVolumeOutput; /*!< @brief Number of volume outputs */
std::vector<VOLUME_OUTPUT> _volumeOutput; /*!< @brief Output groups for volume output*/
unsigned short _outputFrequency; /*!< @brief Frequency of vtk write of volume output*/
unsigned short _volumeOutputFrequency; /*!< @brief Frequency of vtk write of volume output*/
unsigned short _nScreenOutput; /*!< @brief Number of screen outputs */
std::vector<SCALAR_OUTPUT> _screenOutput; /*!< @brief Output groups for screen output*/
unsigned short _screenOutputFrequency; /*!< @brief Frequency of screen output*/
unsigned short _nHistoryOutput; /*!< @brief Number of screen outputs */
std::vector<SCALAR_OUTPUT> _historyOutput; /*!< @brief Output groups for screen output*/
unsigned short _historyOutputFrequency; /*!< @brief Frequency of screen output*/
// --- Parsing Functionality and Initializing of Options ---
/*!
......@@ -218,6 +227,7 @@ class Config
std::string inline GetCTFile() const { return std::filesystem::path( _ctFile ).lexically_normal(); }
std::string inline GetHydrogenFile() const { return std::filesystem::path( _hydrogenFile ).lexically_normal(); }
std::string inline GetLogDir() const { return std::filesystem::path( _logDir ).lexically_normal(); }
std::string inline GetLogFile() const { return std::filesystem::path( _logFileName ).lexically_normal(); }
std::string inline GetMeshFile() const { return std::filesystem::path( _meshFile ).lexically_normal(); }
std::string inline GetOutputDir() const { return std::filesystem::path( _outputDir ).lexically_normal(); }
std::string inline GetOutputFile() const { return std::filesystem::path( _outputFile ).lexically_normal(); }
......@@ -263,8 +273,15 @@ class Config
// Output Structure
std::vector<VOLUME_OUTPUT> inline GetVolumeOutput() { return _volumeOutput; }
unsigned short inline GetNVolumeOutput() { return _nVolumeOutput; }
unsigned short inline GetOutputFrequency() { return _outputFrequency; }
unsigned short inline GetVolumeOutputFrequency() { return _volumeOutputFrequency; }
std::vector<SCALAR_OUTPUT> inline GetScreenOutput() { return _screenOutput; }
unsigned short inline GetNScreenOutput() { return _nScreenOutput; }
unsigned short inline GetScreenOutputFrequency() { return _screenOutputFrequency; }
std::vector<SCALAR_OUTPUT> inline GetHistoryOutput() { return _historyOutput; }
unsigned short inline GetNHistoryOutput() { return _nHistoryOutput; }
unsigned short inline GetHistoryOutputFrequency() { return _historyOutputFrequency; }
// ---- Setters for option structure
// Quadrature Structure
......
......@@ -76,9 +76,15 @@ enum OPTIMIZER_NAME { NEWTON, ML };
inline std::map<std::string, OPTIMIZER_NAME> Optimizer_Map{ { "NEWTON", NEWTON }, { "ML", ML } };
// Volume output
enum VOLUME_OUTPUT { ANALYTIC, MINIMAL, MOMENTS, DUAL_MOMENTS };
enum VOLUME_OUTPUT { ANALYTIC, MINIMAL, MOMENTS, DUAL_MOMENTS, DOSE };
inline std::map<std::string, VOLUME_OUTPUT> VolOutput_Map{
{ "ANALYTIC", ANALYTIC }, { "MINIMAL", MINIMAL }, { "MOMENTS", MOMENTS }, { "DUAL_MOMENTS", DUAL_MOMENTS } };
{ "ANALYTIC", ANALYTIC }, { "MINIMAL", MINIMAL }, { "MOMENTS", MOMENTS }, { "DUAL_MOMENTS", DUAL_MOMENTS }, { "DOSE", DOSE } };
// Scalar output
enum SCALAR_OUTPUT { ITER, MASS, RMS_FLUX, VTK_OUTPUT, CSV_OUTPUT };
inline std::map<std::string, SCALAR_OUTPUT> ScalarOutput_Map{
{ "ITER", ITER }, { "MASS", MASS }, { "RMS_FLUX", RMS_FLUX }, { "VTK_OUTPUT", VTK_OUTPUT }, { "CSV_OUTPUT", CSV_OUTPUT } };
#endif // GLOBAL_CONSTANTS_H
......@@ -25,12 +25,11 @@ class CSDSNSolver : public SNSolver
/**
* @brief Solve functions runs main time loop
*/
virtual void Solve();
/**
* @brief Output solution to VTK file
*/
virtual void Save() const;
virtual void Save( int currEnergy ) const;
void Solve() override;
private:
void PrepareVolumeOutput() override;
void WriteVolumeOutput( unsigned idx_pseudoTime ) override;
};
#endif // CSDSNSOLVER_H
......@@ -19,11 +19,8 @@ class MNSolver : public Solver
/*! @brief MNSolver destructor */
~MNSolver();
void Solve() override; /*! @brief Solve functions runs main time loop */
void Save() const override; /*! @brief Save Output solution to VTK file */
void Save( int currEnergy ) const override; /*! @brief Save Output solution at given energy (pseudo time) to VTK file */
private:
// --- Private member variables ---
unsigned _nTotalEntries; /*! @brief: Total number of equations in the system */
unsigned short _LMaxDegree; /*! @brief: Max Order of Moments */
......@@ -31,11 +28,10 @@ class MNSolver : public Solver
SphericalHarmonics* _basis; /*! @brief: Class to compute and store current spherical harmonics basis */
VectorVector _moments; /*! @brief: Moment Vector pre-computed at each quadrature point: dim= _nq x _nTotalEntries */
// Right hand side members
// Scattering
Vector _scatterMatDiag; /*! @brief: Diagonal of the scattering matrix (its a diagonal matrix by construction) */
// TODO: Source
// quadrature related members
// Quadrature related members
VectorVector _quadPoints; /*! @brief quadrature points, dim(_quadPoints) = (_nq,spatialDim) */
Vector _weights; /*! @brief quadrature weights, dim(_weights) = (_nq) */
VectorVector _quadPointsSphere; /*! @brief (my,phi), dim(_quadPoints) = (_nq,2) */
......@@ -46,44 +42,41 @@ class MNSolver : public Solver
Layout: _nCells x _nTotalEntries*/
OptimizerBase* _optimizer; /*! @brief: Class to solve minimal entropy problem */
// Output related members
std::vector<std::vector<std::vector<double>>> _outputFields; /*! @brief: Solver Output: dimensions (GroupID,FieldID,CellID). !Protoype output for
multiple output fields. Will replace _solverOutput */
std::vector<std::vector<std::string>> _outputFieldNames; /*! @brief: Names of the outputFields: dimensions (GroupID,FieldID) */
// ---- Member functions ---
/*! @brief Initializes the output groups and fields of this solver and names the fields */
void PrepareOutputFields();
// ---- Private Member functions ---
// IO
/*! @brief Function that writes NN Training Data in a .csv file */
void WriteNNTrainingData( unsigned idx_pseudoTime );
/*! @brief Function that prepares VTK export and csv export of the current solver iteration
@returns: Mass of current iteration
*/
double WriteOutputFields( unsigned idx_pseudoTime );
/*! @brief : computes the global index of the moment corresponding to basis function (l,k)
* @param : degree l, it must hold: 0 <= l <=_nq
* @param : order k, it must hold: -l <=k <= l
* @returns : global index
*/
int GlobalIndex( int l, int k ) const;
void PrepareVolumeOutput() override;
void WriteVolumeOutput( unsigned idx_pseudoTime ) override;
// Solver
void FVMUpdate( unsigned idx_energy ) override;
void FluxUpdate() override;
void IterPreprocessing() override;
void IterPostprocessing();
/*! @brief : Construct flux by computing the Moment of the sum of FVM discretization at the interface of cell
* @param : idx_cell = current cell id
* @returns : sum over all neighbors of flux for all moments at interface of idx_cell, idx_neighbor */
Vector ConstructFlux( unsigned idx_cell );
/*! @brief Corrects the solution _sol[idx_cell] to be realizable w.r.t. the reconstructed entropy (eta'(alpha*m))
@param idx_cell = cell where the correction happens*/
void ComputeRealizableSolution( unsigned idx_cell );
// Initialization of the solver
/*! @brief : Pre-Compute Moments at all quadrature points. */
void ComputeMoments();
/*! @brief: fucntion for computing and setting up EV matrix for scattering kernel */
void ComputeScatterMatrix();
/*! @brief Corrects the solution _sol[idx_cell] to be realizable w.r.t. the reconstructed entropy (eta'(alpha*m))
@param idx_cell = cell where the correction happens*/
void ComputeRealizableSolution( unsigned idx_cell );
// Helper
void ComputeRadFlux();
/*! @brief : computes the global index of the moment corresponding to basis function (l,k)
* @param : degree l, it must hold: 0 <= l <=_nq
* @param : order k, it must hold: -l <=k <= l
* @returns : global index
*/
int GlobalIndex( int l, int k ) const;
};
#endif // MNSOLVER_H
......@@ -11,15 +11,13 @@ class PNSolver : public Solver
*/
PNSolver( Config* settings );
virtual void Solve() override; /*! @brief Solve functions runs main time loop. (Run Solver) */
void Save() const override; /*! @brief Save Output solution to VTK file */
void Save( int currEnergy ) const override; /*! @brief Save Output solution at given energy (pseudo time) to VTK file */
/*! @brief PNSolver destructor */
~PNSolver();
protected:
private:
unsigned _nTotalEntries; /*! @brief: total number of equations in the system */
unsigned _LMaxDegree; /*! @brief: maximal degree of the spherical harmonics basis*/
// VectorVector _sigmaA; /*! @brief: Absorption coefficient for all energies*/
// System Matrix for x, y and z flux
// ==> not needed after computation of A+ and A- ==> maybe safe only temporarly and remove as member?
SymMatrix _Ax; /*! @brief: Flux Jacbioan in x direction */
......@@ -37,28 +35,28 @@ class PNSolver : public Solver
Matrix _AzMinus; /*! @brief: Flux Jacbioan in z direction, negative part */
Matrix _AzAbs; /*! @brief: Flux Jacbioan in z direction, absolute part */
// double _combinedSpectralRadius; /*! @brief: Combined spectral radius of sum of flux jacobians*/
Vector _scatterMatDiag; /*! @brief: diagonal of the scattering matrix (its a diagonal matrix by construction). Contains eigenvalues of the
scattering kernel. */
// Output related members
std::vector<std::vector<std::vector<double>>> _outputFields; /*! @brief: Solver Output: dimensions (GroupID,FieldID,CellID). !Protoype output for
multiple output fields. Will replace _solverOutput */
std::vector<std::vector<std::string>> _outputFieldNames; /*! @brief: Names of the outputFields: dimensions (GroupID,FieldID) */
// ---- Member functions ----
// IO
/*! @brief Initializes the output groups and fields of this solver and names the fields */
void PrepareOutputFields();
void PrepareVolumeOutput() override;
/*! @brief Function that prepares VTK export and csv export of the current solver iteration
@returns: Mass of current iteration
*/
double WriteOutputFields( unsigned idx_pseudoTime );
@returns: Mass of current iteration */
void WriteVolumeOutput( unsigned idx_pseudoTime ) override;
// Solver
void FVMUpdate( unsigned idx_energy ) override;
void FluxUpdate() override;
void IterPreprocessing() override;
void IterPostprocessing();
// Helper
void ComputeRadFlux();
// Initialization of the Solver
/*! @brief: parameter functions for setting up system matrix
* @param: degree l, it must hold: 0 <= l <=_nq
* @param : order k, it must hold: -l <=k <= l
......
......@@ -14,20 +14,26 @@ class SNSolver : public Solver
Vector _weights; /*! @brief quadrature weights, dim(_weights) = (_nq) */
public:
/**
* @brief SNSolver constructor
/*! @brief SNSolver constructor
* @param settings stores all needed information
*/
SNSolver( Config* settings );
/**
* @brief Solve functions runs main time loop
*/
void Solve() override;
/**
* @brief Output solution to VTK file
*/
void Save() const override;
void Save( int currEnergy ) const override;
private:
// IO
void PrepareVolumeOutput() override;
void WriteVolumeOutput( unsigned idx_pseudoTime ) override;
// Solver
void FVMUpdate( unsigned idx_energy ) override;
void FluxUpdate() override;
void IterPreprocessing() override;
void IterPostprocessing() override;
// Helper
void ComputeRadFlux();
// --- Member variables ---
};
#endif // SNSOLVER_H
......@@ -20,7 +20,7 @@ class SNSolverMPI : public SNSolver
/**
* @brief Output solution to VTK file
*/
virtual void Save() const;
virtual void PrintVolumeOutput() const;
};
#endif // SNSOLVERMPI_H
......@@ -5,6 +5,9 @@
#include "common/globalconstants.h"
#include "common/typedef.h"
// externals
#include "spdlog/spdlog.h"
// Forward Declarations
class NumericalFlux;
class Mesh;
......@@ -52,41 +55,79 @@ class Solver
VectorVector _sol; /*! @brief solution of the PDE, e.g. angular flux or moments */
std::vector<double> _solverOutput; /*! @brief LEGACY: Outputfield for solver ==> Will be replaced by _outputFields in the near future */
// Output related members
std::vector<std::vector<std::vector<double>>> _outputFields; /*! @brief: Solver Output: dimensions (GroupID,FieldID,CellID).*/
std::vector<std::vector<std::string>> _outputFieldNames; /*! @brief: Names of the outputFields: dimensions (GroupID,FieldID) */
// we will have to add a further dimension for quadPoints and weights once we start with multilevel SN
/**
* @brief ComputeTimeStep calculates the maximal stable time step
* @param cfl is cfl number
*/
// Output related members
std::vector<double> _screenOutputFields; /*! @brief: Solver Output: dimensions (FieldID). */
std::vector<std::string> _screenOutputFieldNames; /*! @brief: Names of the outputFields: dimensions (FieldID) */
// Output related members
std::vector<double> _historyOutputFields; /*! @brief: Solver Output: dimensions (FieldID). */
std::vector<std::string> _historyOutputFieldNames; /*! @brief: Names of the outputFields: dimensions (FieldID) */
// Internal Members
VectorVector _solNew; /*! @brief: VectorVector to store the new flux and later the new solution per iteration */ // REPLACES psiNEW
Vector _fluxNew; /*! @brief: Vector to store the new Flux */
Vector _flux; /*! @brief: Vector to store the old Flux */
// ---- Member functions ----
// Solver
/*! @brief Performs preprocessing for the current solver iteration */
virtual void IterPreprocessing() = 0;
/*! @brief Performs postprocessing for the current solver iteration */
virtual void IterPostprocessing() = 0;
/*! @brief Constructs the flux update for the current iteration and stores it in psiNew*/
virtual void FluxUpdate() = 0;
/*! @brief Computes the finite Volume update step for the current iteration */
virtual void FVMUpdate( unsigned idx_energy ) = 0;
// Helper
/*! @brief ComputeTimeStep calculates the maximal stable time step */
double ComputeTimeStep( double cfl ) const;
/*! @brief: Computes the flux of the solution to check conservation properties */
virtual void ComputeRadFlux() = 0;
// IO
/*! @brief Initializes the output groups and fields of this solver and names the fields */
virtual void PrepareVolumeOutput() = 0;
/*! @brief Function that prepares VTK export and csv export of the current solver iteration */
virtual void WriteVolumeOutput( unsigned iteration ) = 0;
/*! @brief Save Output solution at given energy (pseudo time) to VTK file. Write frequency is given by
option VOLUME_OUTPUT_FREQUENCY. Always prints last iteration without iteration affix.*/
void PrintVolumeOutput( int currEnergy ) const;
/*! @brief: Initialized the output fields and their Names for the screenoutput */
void PrepareScreenOutput();
/*! @brief Function that writes screen and history output fields */
void WriteScalarOutput( unsigned iteration );
/*! @brief Prints ScreenOutputFields to Screen and to logger. Write frequency is given by
option SCREEN_OUTPUT_FREQUENCY. Always prints last iteration. */
void PrintScreenOutput( unsigned iteration );
/*! @brief: Initialized the historyOutputFields and their Names for history output. Write frequency is given by
option HISTORY_OUTPUT_FREQUENCY. Always prints last iteration. */
void PrepareHistoryOutput();
/*! @brief Prints HistoryOutputFields to logger */
void PrintHistoryOutput( unsigned iteration );
public:
/**
* @brief Solver constructor
* @param settings stores all needed information
*/
/*! @brief Solver constructor
* @param settings stores all needed information */
Solver( Config* settings );
~Solver();
/**
* @brief Create constructor
* @param settings stores all needed information
* @return pointer to Solver
*/
/*! @brief Create constructor
* @param settings stores all needed information
* @return pointer to Solver */
static Solver* Create( Config* settings );
/**
* @brief Solve functions runs main time loop
*/
virtual void Solve() = 0;
/**
* @brief Output solution to VTK file
*/
virtual void Save() const = 0;
/*! @brief Solve functions runs main time loop */
virtual void Solve();
virtual void Save( int currEnergy ) const = 0;
/*! @brief Save Output solution to VTK file */
void PrintVolumeOutput() const; // Only for debugging purposes.
};
#endif // SOLVER_H
......@@ -17,9 +17,11 @@ LOG_DIR = ../result/logs
MESH_FILE = linesource.su2
%MESH_FILE = linesource_debug.su2
%
% ---- Problem description ---
%
PROBLEM = LINESOURCE
SCATTER_COEFF = 1
%
% ---- Solver specifications ----
%
% Solver type
......@@ -60,4 +62,8 @@ QUAD_ORDER = 8
% ----- Output ----
%
VOLUME_OUTPUT = (ANALYTIC, MINIMAL, MOMENTS, DUAL_MOMENTS)
OUTPUT_FREQUENCY = 1
VOLUME_OUTPUT_FREQUENCY = 0
SCREEN_OUTPUT = (ITER, MASS, RMS_FLUX, VTK_OUTPUT, CSV_OUTPUT)
SCREEN_OUTPUT_FREQUENCY = 1
HISTORY_OUTPUT = (ITER, MASS, RMS_FLUX, VTK_OUTPUT, CSV_OUTPUT)
HISTORY_OUTPUT_FREQUENCY = 1
......@@ -39,3 +39,8 @@ BC_DIRICHLET = ( void )
QUAD_TYPE = GAUSS_LEGENDRE_TENSORIZED
% Quadrature Order
QUAD_ORDER = 8
%
% ----- Output ----
%
VOLUME_OUTPUT = (ANALYTIC, MINIMAL)
OUTPUT_FREQUENCY = 1
......@@ -202,7 +202,9 @@ void Config::SetConfigOptions() {
/*! @brief OUTPUT_FILE \n DESCRIPTION: Name of output file \n DEFAULT "output" @ingroup Config.*/
AddStringOption( "OUTPUT_FILE", _outputFile, string( "output" ) );
/*! @brief LOG_DIR \n DESCRIPTION: Relative Directory of log files \n DEFAULT "/out" @ingroup Config.*/
AddStringOption( "LOG_DIR", _logDir, string( "/out" ) );
AddStringOption( "LOG_DIR", _logDir, string( "/out/logs" ) );
/*! @brief LOG_DIR \n DESCRIPTION: Name of log files \n DEFAULT "/out" @ingroup Config.*/
AddStringOption( "LOG_FILE", _logFileName, string( "use_date" ) );
/*! @brief MESH_FILE \n DESCRIPTION: Name of mesh file \n DEFAULT "" \ingroup Config.*/
AddStringOption( "MESH_FILE", _meshFile, string( "mesh.su2" ) );
/*! @brief MESH_FILE \n DESCRIPTION: Name of mesh file \n DEFAULT "" \ingroup Config.*/
......@@ -279,8 +281,16 @@ void Config::SetConfigOptions() {
// Output related options
/*! @brief Volume output \n DESCRIPTION: Describes output groups to write to vtk \ingroup Config */
AddEnumListOption( "VOLUME_OUTPUT", _nVolumeOutput, _volumeOutput, VolOutput_Map );
/*! @brief Output Frequency \n DESCRIPTION: Describes output write frequency \n DEFAULT 0 ,i.e. only last value \ingroup Config */
AddUnsignedShortOption( "OUTPUT_FREQUENCY", _outputFrequency, 0 );
/*! @brief Volume output Frequency \n DESCRIPTION: Describes output write frequency \n DEFAULT 0 ,i.e. only last value \ingroup Config */
AddUnsignedShortOption( "VOLUME_OUTPUT_FREQUENCY", _volumeOutputFrequency, 0 );
/*! @brief Screen output \n DESCRIPTION: Describes screen output fields \ingroup Config */
AddEnumListOption( "SCREEN_OUTPUT", _nScreenOutput, _screenOutput, ScalarOutput_Map );
/*! @brief Screen output Frequency \n DESCRIPTION: Describes screen output write frequency \n DEFAULT 1 \ingroup Config */
AddUnsignedShortOption( "SCREEN_OUTPUT_FREQUENCY", _screenOutputFrequency, 1 );
/*! @brief History output \n DESCRIPTION: Describes history output fields \ingroup Config */
AddEnumListOption( "HISTORY_OUTPUT", _nHistoryOutput, _historyOutput, ScalarOutput_Map );
/*! @brief History output Frequency \n DESCRIPTION: Describes history output write frequency \n DEFAULT 1 \ingroup Config */
AddUnsignedShortOption( "HISTORY_OUTPUT_FREQUENCY", _historyOutputFrequency, 1 );
}
void Config::SetConfigParsing( string case_filename ) {
......@@ -418,82 +428,163 @@ void Config::SetPostprocessing() {
// --- Output Postprocessing ---
// Check for doublicates in VOLUME OUTPUT
std::map<VOLUME_OUTPUT, int> dublicate_map;
// Volume Output Postprocessing
{
// Check for doublicates in VOLUME OUTPUT
std::map<VOLUME_OUTPUT, int> dublicate_map;
for( unsigned short idx_volOutput = 0; idx_volOutput < _nVolumeOutput; idx_volOutput++ ) {
std::map<VOLUME_OUTPUT, int>::iterator it = dublicate_map.find( _volumeOutput[idx_volOutput] );
if( it == dublicate_map.end() ) {
dublicate_map.insert( std::pair<VOLUME_OUTPUT, int>( _volumeOutput[idx_volOutput], 0 ) );
for( unsigned short idx_volOutput = 0; idx_volOutput < _nVolumeOutput; idx_volOutput++ ) {
std::map<VOLUME_OUTPUT, int>::iterator it = dublicate_map.find( _volumeOutput[idx_volOutput] );
if( it == dublicate_map.end() ) {
dublicate_map.insert( std::pair<VOLUME_OUTPUT, int>( _volumeOutput[idx_volOutput], 0 ) );
}
else {
it->second++;
}
}
else {
it->second++;
for( auto& e : dublicate_map ) {
if( e.second > 0 ) {
ErrorMessages::Error( "Each output group for option VOLUME_OUTPUT can only be set once.\nPlease check your .cfg file.",
CURRENT_FUNCTION );
}
}
}
for( auto& e : dublicate_map ) {
if( e.second > 0 ) {
ErrorMessages::Error( "Each output group for option VOLUME_OUTPUT can only be set once.\nPlease check your .cfg file.",
CURRENT_FUNCTION );
// Check, if the choice of volume output is compatible to the solver
std::vector<VOLUME_OUTPUT> supportedGroups;
for( unsigned short idx_volOutput = 0; idx_volOutput < _nVolumeOutput; idx_volOutput++ ) {
switch( _solverName ) {
case SN_SOLVER:
supportedGroups = { MINIMAL, ANALYTIC };
if( supportedGroups.end() == std::find( supportedGroups.begin(), supportedGroups.end(), _volumeOutput[idx_volOutput] ) ) {
ErrorMessages::Error( "SN_SOLVER only supports volume output MINIMAL and ANALYTIC.\nPlease check your .cfg file.",
CURRENT_FUNCTION );
}
if( _volumeOutput[idx_volOutput] == ANALYTIC && _problemName != PROBLEM_LineSource ) {
ErrorMessages::Error( "Analytical solution (VOLUME_OUTPUT=ANALYTIC) is only available for the PROBLEM=LINESOURCE.\nPlease "
"check your .cfg file.",
CURRENT_FUNCTION );
}
break;
case MN_SOLVER:
supportedGroups = { MINIMAL, MOMENTS, DUAL_MOMENTS, ANALYTIC };
if( supportedGroups.end() == std::find( supportedGroups.begin(), supportedGroups.end(), _volumeOutput[idx_volOutput] ) ) {
ErrorMessages::Error(
"MN_SOLVER only supports volume output ANALYTIC, MINIMAL, MOMENTS and DUAL_MOMENTS.\nPlease check your .cfg file.",
CURRENT_FUNCTION );
}
if( _volumeOutput[idx_volOutput] == ANALYTIC && _problemName != PROBLEM_LineSource ) {
ErrorMessages::Error( "Analytical solution (VOLUME_OUTPUT=ANALYTIC) is only available for the PROBLEM=LINESOURCE.\nPlease "
"check your .cfg file.",
CURRENT_FUNCTION );
}
break;
case PN_SOLVER:
supportedGroups = { MINIMAL, MOMENTS, ANALYTIC };
if( supportedGroups.end() == std::find( supportedGroups.begin(), supportedGroups.end(), _volumeOutput[idx_volOutput] ) ) {
ErrorMessages::Error( "PN_SOLVER only supports volume output ANALYTIC, MINIMAL and MOMENTS.\nPlease check your .cfg file.",
CURRENT_FUNCTION );
}
if( _volumeOutput[idx_volOutput] == ANALYTIC && _problemName != PROBLEM_LineSource ) {
ErrorMessages::Error( "Analytical solution (VOLUME_OUTPUT=ANALYTIC) is only available for the PROBLEM=LINESOURCE.\nPlease "
"check your .cfg file.",
CURRENT_FUNCTION );
}
break;
case CSD_SN_SOLVER:
supportedGroups = { MINIMAL, DOSE };
if( supportedGroups.end() == std::find( supportedGroups.begin(), supportedGroups.end(), _volumeOutput[idx_volOutput] ) ) {
ErrorMessages::Error( "CSD_SN_SOLVER only supports volume output ANALYTIC and MINIMAL.\nPlease check your .cfg file.",
CURRENT_FUNCTION );
}
break;
}
}
// Set default volume output
if( _nVolumeOutput == 0 ) { // If no specific output is chosen, use "MINIMAL"
_nVolumeOutput = 1;
_volumeOutput.push_back( MINIMAL );
}
}
// Check, if the choice of volume output is compatible to the solver
std::vector<VOLUME_OUTPUT> supportedGroups;
// Screen Output Postprocessing
{
// Check for doublicates in SCALAR OUTPUT
std::map<SCALAR_OUTPUT, int> dublicate_map;
for( unsigned short idx_volOutput = 0; idx_volOutput < _nVolumeOutput; idx_volOutput++ ) {
switch( _solverName ) {
case SN_SOLVER:
supportedGroups = { MINIMAL, ANALYTIC };
if( supportedGroups.end() == std::find( supportedGroups.begin(), supportedGroups.end(), _volumeOutput[idx_volOutput] ) ) {
ErrorMessages::Error( "SN_SOLVER only supports volume output MINIMAL and ANALYTIC.\nPlease check your .cfg file.",
CURRENT_FUNCTION );
}
if( _volumeOutput[idx_volOutput] == ANALYTIC && _problemName != PROBLEM_LineSource ) {
ErrorMessages::Error(
"Analytical solution (VOLUME_OUTPUT=ANALYTIC) is only available for the PROBLEM=LINESOURCE.\nPlease check your .cfg file.",
CURRENT_FUNCTION );
}
break;
case MN_SOLVER:
supportedGroups = { MINIMAL, MOMENTS, DUAL_MOMENTS, ANALYTIC };
if( supportedGroups.end() == std::find( supportedGroups.begin(), supportedGroups.end(), _volumeOutput[idx_volOutput] ) ) {
ErrorMessages::Error(
"MN_SOLVER only supports volume output ANALYTIC, MINIMAL, MOMENTS and DUAL_MOMENTS.\nPlease check your .cfg file.",
CURRENT_FUNCTION );
}
if( _volumeOutput[idx_volOutput] == ANALYTIC && _problemName != PROBLEM_LineSource ) {