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
c3138392
Commit
c3138392
authored
Jul 15, 2020
by
steffen.schotthoefer
Browse files
more header cleanup for faster compilation
parent
564322ce
Changes
15
Hide whitespace changes
Inline
Side-by-side
code/include/common/config.h
View file @
c3138392
...
...
@@ -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:
/*!
...
...
code/include/common/globalconstants.h
View file @
c3138392
...
...
@@ -9,14 +9,12 @@
#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. */
const
unsigned
int
MAX_STRING_SIZE
=
200
;
/*!< @brief Maximum size for strings. */
// --- Definition of enums goes here ---
...
...
code/include/common/io.h
View file @
c3138392
...
...
@@ -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
,
...
...
code/include/spline.h
View file @
c3138392
#ifndef SPLINE_H
#define SPLINE_H
#include
<blaze/math/lapack/posv.h>
#include
"common/typedef.h"
#include
"toolboxes/errormessages.h"
class
Spline
{
...
...
code/src/common/config.cpp
View file @
c3138392
...
...
@@ -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
);
...
...
code/src/cubic2dspline.cpp
View file @
c3138392
#include
"cubic2dspline.h"
#include
<iostream>
Cubic2DSpline
::
Cubic2DSpline
(
const
Vector
&
x
,
const
Vector
&
y
,
const
Matrix
&
data
)
:
_x
(
x
),
_y
(
y
),
_data
(
data
)
{}
Cubic2DSpline
::~
Cubic2DSpline
()
{}
...
...
code/src/main.cpp
View file @
c3138392
...
...
@@ -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
);
...
...
code/src/physics.cpp
View file @
c3138392
#include
"physics.h"
#include
"spline.h"
#include
"toolboxes/errormessages.h"
#include
<fstream>
#include
<list>
...
...
code/src/quadratures/qlookupquadrature.cpp
View file @
c3138392
...
...
@@ -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
...
...
code/src/solvers/csdsnsolver.cpp
View file @
c3138392
...
...
@@ -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
);
...
...
code/src/solvers/mnsolver.cpp
View file @
c3138392
...
...
@@ -8,6 +8,8 @@
#include
"solvers/sphericalharmonics.h"
#include
"toolboxes/textprocessingtoolbox.h"
// externals
#include
"spdlog/spdlog.h"
#include
<mpi.h>
//#include <chrono>
...
...
code/src/solvers/pnsolver.cpp
View file @
c3138392
...
...
@@ -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
)
{
...
...
code/src/solvers/snsolver.cpp
View file @
c3138392
...
...
@@ -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
)
{
...
...
code/src/solvers/snsolverMPI.cpp
View file @
c3138392
#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
)
{}
...
...
code/src/spline.cpp
View file @
c3138392
#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
)
{}
...
...
Write
Preview
Supports
Markdown
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