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

more header cleanup for faster compilation

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