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

more header cleanup for faster compilation

parent 564322ce
...@@ -11,11 +11,7 @@ ...@@ -11,11 +11,7 @@
#include <filesystem> #include <filesystem>
#include <map> #include <map>
#include <mpi.h> #include <vector>
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/sinks/stdout_sinks.h"
#include "spdlog/spdlog.h"
#include "globalconstants.h" #include "globalconstants.h"
...@@ -183,7 +179,7 @@ class Config ...@@ -183,7 +179,7 @@ class Config
void AddStringListOption( const std::string name, unsigned short& num_marker, std::vector<std::string>& option_field ); void AddStringListOption( const std::string name, unsigned short& num_marker, std::vector<std::string>& option_field );
// Initialize the cmdline and file logger // Initialize the cmdline and file logger
void InitLogger( spdlog::level::level_enum terminalLogLvl, spdlog::level::level_enum fileLogLvl ); void InitLogger();
public: public:
/*! /*!
......
...@@ -9,14 +9,12 @@ ...@@ -9,14 +9,12 @@
#ifndef GLOBAL_CONSTANTS_H #ifndef GLOBAL_CONSTANTS_H
#define GLOBAL_CONSTANTS_H #define GLOBAL_CONSTANTS_H
#include <cmath>
#include <map> #include <map>
#include <string> #include <string>
// --- Definition for global constants goes here --- // --- Definition for global constants goes here ---
const double PI_NUMBER = M_PI; /*!< @brief Pi number. */ const unsigned int MAX_STRING_SIZE = 200; /*!< @brief Maximum size for strings. */
const unsigned int MAX_STRING_SIZE = 200; /*!< @brief Maximum size for strings. */
// --- Definition of enums goes here --- // --- Definition of enums goes here ---
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
// Forward Declarations // Forward Declarations
class Config; class Config;
class Mesh; class Mesh;
// class Matrix;
void ExportVTK( const std::string fileName, void ExportVTK( const std::string fileName,
const std::vector<std::vector<std::vector<double>>>& results, const std::vector<std::vector<std::vector<double>>>& results,
......
#ifndef SPLINE_H #ifndef SPLINE_H
#define SPLINE_H #define SPLINE_H
#include <blaze/math/lapack/posv.h>
#include "common/typedef.h" #include "common/typedef.h"
#include "toolboxes/errormessages.h"
class Spline class Spline
{ {
......
...@@ -11,9 +11,15 @@ ...@@ -11,9 +11,15 @@
#include "common/optionstructure.h" #include "common/optionstructure.h"
#include "toolboxes/errormessages.h" #include "toolboxes/errormessages.h"
#include "toolboxes/textprocessingtoolbox.h" #include "toolboxes/textprocessingtoolbox.h"
// externals
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/sinks/stdout_sinks.h"
#include "spdlog/spdlog.h"
#include <cassert> #include <cassert>
#include <filesystem> #include <filesystem>
#include <fstream> #include <fstream>
#include <mpi.h>
using namespace std; using namespace std;
...@@ -349,12 +355,9 @@ void Config::SetPostprocessing() { ...@@ -349,12 +355,9 @@ void Config::SetPostprocessing() {
// create directories if they dont exist // create directories if they dont exist
if( !std::filesystem::exists( _outputDir ) ) std::filesystem::create_directory( _outputDir ); if( !std::filesystem::exists( _outputDir ) ) std::filesystem::create_directory( _outputDir );
// init logger // // init logger
#ifdef BUILD_TESTING
InitLogger( spdlog::level::err, spdlog::level::off ); InitLogger();
#else
InitLogger( spdlog::level::info, spdlog::level::info );
#endif
// Regroup Boundary Conditions to std::vector<std::pair<std::string, BOUNDARY_TYPE>> _boundaries; // Regroup Boundary Conditions to std::vector<std::pair<std::string, BOUNDARY_TYPE>> _boundaries;
for( int i = 0; i < _nMarkerDirichlet; i++ ) { for( int i = 0; i < _nMarkerDirichlet; i++ ) {
...@@ -501,7 +504,21 @@ bool Config::TokenizeString( string& str, string& option_name, vector<string>& o ...@@ -501,7 +504,21 @@ bool Config::TokenizeString( string& str, string& option_name, vector<string>& o
return true; return true;
} }
void Config::InitLogger( spdlog::level::level_enum terminalLogLvl, spdlog::level::level_enum fileLogLvl ) { void Config::InitLogger() {
// Declare Logger
spdlog::level::level_enum terminalLogLvl;
spdlog::level::level_enum fileLogLvl;
// Choose Logger
#ifdef BUILD_TESTING
terminalLogLvl = spdlog::level::err;
fileLogLvl = spdlog::level::off;
#else
terminalLogLvl = spdlog::level::info;
fileLogLvl = spdlog::level::info;
#endif
// create log dir if not existent // create log dir if not existent
if( !std::filesystem::exists( _logDir ) ) { if( !std::filesystem::exists( _logDir ) ) {
std::filesystem::create_directory( _logDir ); std::filesystem::create_directory( _logDir );
......
#include "cubic2dspline.h" #include "cubic2dspline.h"
#include <iostream>
Cubic2DSpline::Cubic2DSpline( const Vector& x, const Vector& y, const Matrix& data ) : _x( x ), _y( y ), _data( data ) {} Cubic2DSpline::Cubic2DSpline( const Vector& x, const Vector& y, const Matrix& data ) : _x( x ), _y( y ), _data( data ) {}
Cubic2DSpline::~Cubic2DSpline() {} Cubic2DSpline::~Cubic2DSpline() {}
......
...@@ -31,10 +31,6 @@ int main( int argc, char** argv ) { ...@@ -31,10 +31,6 @@ int main( int argc, char** argv ) {
// CD Load Settings from File // CD Load Settings from File
Config* config = new Config( filename ); Config* config = new Config( filename );
// Test the physics reader
// Physics testPhysic();
// testPhysic.ReadENDL( "ENDL_H.txt" );
// Print input file and run info to file // Print input file and run info to file
PrintLogHeader( filename ); PrintLogHeader( filename );
......
#include "physics.h" #include "physics.h"
#include "spline.h" #include "spline.h"
#include "toolboxes/errormessages.h"
#include <fstream> #include <fstream>
#include <list> #include <list>
......
...@@ -74,7 +74,7 @@ void QLookupQuadrature::SetPointsAndWeights() { ...@@ -74,7 +74,7 @@ void QLookupQuadrature::SetPointsAndWeights() {
// Correct the scaling of the weights // Correct the scaling of the weights
for( unsigned idx = 0; idx < _nq; idx++ ) { for( unsigned idx = 0; idx < _nq; idx++ ) {
_weights[idx] /= sumWeights; _weights[idx] /= sumWeights;
_weights[idx] *= 4.0 * PI_NUMBER; _weights[idx] *= 4.0 * M_PI;
} }
// Transform _points to _pointsSphere // Transform _points to _pointsSphere
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
#include "kernels/scatteringkernelbase.h" #include "kernels/scatteringkernelbase.h"
#include "physics.h" #include "physics.h"
// externals
#include "spdlog/spdlog.h"
#include <mpi.h>
CSDSNSolver::CSDSNSolver( Config* settings ) : SNSolver( settings ) { CSDSNSolver::CSDSNSolver( Config* settings ) : SNSolver( settings ) {
_dose = std::vector<double>( _settings->GetNCells(), 0.0 ); _dose = std::vector<double>( _settings->GetNCells(), 0.0 );
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include "solvers/sphericalharmonics.h" #include "solvers/sphericalharmonics.h"
#include "toolboxes/textprocessingtoolbox.h" #include "toolboxes/textprocessingtoolbox.h"
// externals
#include "spdlog/spdlog.h"
#include <mpi.h> #include <mpi.h>
//#include <chrono> //#include <chrono>
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include "toolboxes/errormessages.h" #include "toolboxes/errormessages.h"
#include "toolboxes/textprocessingtoolbox.h" #include "toolboxes/textprocessingtoolbox.h"
// externals
#include "spdlog/spdlog.h"
#include <mpi.h> #include <mpi.h>
PNSolver::PNSolver( Config* settings ) : Solver( settings ) { PNSolver::PNSolver( Config* settings ) : Solver( settings ) {
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "kernels/scatteringkernelbase.h" #include "kernels/scatteringkernelbase.h"
#include "quadratures/quadraturebase.h" #include "quadratures/quadraturebase.h"
// externals
#include "spdlog/spdlog.h"
#include <mpi.h> #include <mpi.h>
SNSolver::SNSolver( Config* settings ) : Solver( settings ) { SNSolver::SNSolver( Config* settings ) : Solver( settings ) {
......
#include "solvers/snsolverMPI.h"
#include "common/config.h" #include "common/config.h"
#include "common/io.h" #include "common/io.h"
#include "solvers/snsolverMPI.h" // externals
#include "spdlog/spdlog.h"
#include <mpi.h> #include <mpi.h>
SNSolverMPI::SNSolverMPI( Config* settings ) : SNSolver( settings ) {} SNSolverMPI::SNSolverMPI( Config* settings ) : SNSolver( settings ) {}
......
#include "spline.h" #include "spline.h"
#include "toolboxes/errormessages.h"
#include <blaze/math/lapack/posv.h>
Spline::Spline() : m_left( first_deriv ), m_right( first_deriv ), m_left_value( 0.0 ), m_right_value( 0.0 ), m_force_linear_extrapolation( false ) {} Spline::Spline() : m_left( first_deriv ), m_right( first_deriv ), m_left_value( 0.0 ), m_right_value( 0.0 ), m_force_linear_extrapolation( false ) {}
......
Supports Markdown
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