Commit 6011c06d authored by Steffen Schotthöfer's avatar Steffen Schotthöfer
Browse files

config constructor now deletes options proberly. shperical harmonics is now in...

config constructor now deletes options proberly. shperical harmonics is now in toolboxes. icru is now in problems.
parent 5b65d73c
Pipeline #120490 passed with stage
in 16 minutes and 5 seconds
......@@ -22,7 +22,7 @@ class OptionBase
std::vector<std::string> _value; /*! @brief: String name of the option */
public:
OptionBase(){};
OptionBase() {}
virtual ~OptionBase() = 0;
virtual std::string SetValue( std::vector<std::string> value ); /*! @brief: Set string name of the option */
......@@ -45,7 +45,7 @@ class OptionDouble : public OptionBase
public:
OptionDouble( std::string option_field_name, double& option_field, double default_value );
~OptionDouble() override{};
~OptionDouble() override {}
std::string SetValue( std::vector<std::string> option_value ) override;
......@@ -61,7 +61,7 @@ class OptionString : public OptionBase
public:
OptionString( std::string option_field_name, std::string& option_field, std::string default_value );
~OptionString() override{};
~OptionString() override {}
std::string SetValue( std::vector<std::string> option_value ) override;
......@@ -77,7 +77,7 @@ class OptionInt : public OptionBase
public:
OptionInt( std::string option_field_name, int& option_field, int default_value );
~OptionInt() override{};
~OptionInt() override {}
std::string SetValue( std::vector<std::string> option_value ) override;
......@@ -93,7 +93,7 @@ class OptionULong : public OptionBase
public:
OptionULong( std::string option_field_name, unsigned long& option_field, unsigned long default_value );
~OptionULong() override{};
~OptionULong() override {}
std::string SetValue( std::vector<std::string> option_value ) override;
......@@ -109,7 +109,7 @@ class OptionUShort : public OptionBase
public:
OptionUShort( std::string option_field_name, unsigned short& option_field, unsigned short default_value );
~OptionUShort() override{};
~OptionUShort() override {}
std::string SetValue( std::vector<std::string> option_value ) override;
......@@ -125,7 +125,7 @@ class OptionLong : public OptionBase
public:
OptionLong( std::string option_field_name, long& option_field, long default_value );
~OptionLong() override{};
~OptionLong() override {}
std::string SetValue( std::vector<std::string> option_value ) override;
......@@ -141,7 +141,7 @@ class OptionBool : public OptionBase
public:
OptionBool( std::string option_field_name, bool& option_field, bool default_value );
~OptionBool() override{};
~OptionBool() override {}
std::string SetValue( std::vector<std::string> option_value ) override;
......@@ -157,7 +157,7 @@ class OptionStringList : public OptionBase
public:
OptionStringList( std::string option_field_name, unsigned short& list_size, std::vector<std::string>& option_field );
~OptionStringList() override{};
~OptionStringList() override {}
std::string SetValue( std::vector<std::string> option_value ) override;
......
......@@ -5,6 +5,7 @@
* Disclaimer: This is copied from the code distributed with the ICRU 77 report
* Link: https://icru.org/home/reports/elastic-scattering-of-electrons-and-positrons-icru-report-77
*/
#ifndef ICRU_H
#define ICRU_H
......
#ifndef CSDSNSOLVER_H
#define CSDSNSOLVER_H
#include "icru.h"
#include "solvers/snsolver.h"
class CSDSNSolver : public SNSolver
......
#ifndef CSDSNSOLVERFP_H
#define CSDSNSOLVERFP_H
#include "icru.h"
#include "solvers/snsolver.h"
class Physics;
......@@ -22,9 +21,9 @@ class CSDSNSolverFP : public SNSolver
Matrix _IL; /*! @brief Laplace Beltrami Matrix */
double _alpha; /*! @brief Coefficient of GFP operators (see Olbrant 2010, eq. (8)*/
double _beta; /*! @brief Coefficient of GFP operators (see Olbrant 2010, eq. (8)*/
double _beta; /*! @brief Coefficient of GFP operators (see Olbrant 2010, eq. (8)*/
Matrix _xi; /*! @brief matrix of transport coefficients */
Matrix _xi; /*! @brief matrix of transport coefficients */
bool _RT; /*! @brief radiotherapy application (on/off), if true use crosssections + stopping powers from database */
......
#ifndef CSDSNSOLVERNOTRAFO_H
#define CSDSNSOLVERNOTRAFO_H
#include "icru.h"
#include "solvers/snsolver.h"
class Physics;
......
#ifndef CSDSOLVERTRAFOFP_H
#define CSDSOLVERTRAFOFP_H
#include "icru.h"
#include "solvers/snsolver.h"
class Physics;
......@@ -21,15 +20,16 @@ class CSDSolverTrafoFP : public SNSolver
Matrix _L; /*! @brief Laplace Beltrami Matrix */
Matrix _IL; /*! @brief Laplace Beltrami Matrix */
double _alpha; /*! @brief Coefficient of GFP operators (see Olbrant 2010, Appendix B)*/
double _alpha; /*! @brief Coefficient of GFP operators (see Olbrant 2010, Appendix B)*/
double _alpha2; /*! @brief Coefficient of GFP operators (see Olbrant 2010, Appendix B)*/
double _beta; /*! @brief Coefficient of GFP operators (see Olbrant 2010, Appendix B)*/
double _beta; /*! @brief Coefficient of GFP operators (see Olbrant 2010, Appendix B)*/
Matrix _xi; /*! @brief matrix of transport coefficients */
Matrix _xi; /*! @brief matrix of transport coefficients */
Vector _xi1;
Vector _xi2;
unsigned _FPMethod; /*! @brief Encodes different ways of computing coefficients alpha, alpha2 & beta, _FPMethod == 1, 2 ,3 stand for methods with increasing accuracy (see Olbrant 2010, Appendix B)*/
unsigned _FPMethod; /*! @brief Encodes different ways of computing coefficients alpha, alpha2 & beta, _FPMethod == 1, 2 ,3 stand for methods with
increasing accuracy (see Olbrant 2010, Appendix B)*/
bool _RT; /*! @brief radiotherapy application (on/off), if true use crosssections + stopping powers from database */
......
#ifndef CSDSOLVERTRAFOFP2D_H
#define CSDSOLVERTRAFOFP2D_H
#include "icru.h"
#include "solvers/snsolver.h"
class Physics;
......
......@@ -8,12 +8,11 @@
#include "common/config.h"
#include "common/io.h"
#include "fluxes/numericalflux.h"
#include "icru.h"
#include "kernels/scatteringkernelbase.h"
#include "problems/problembase.h"
#include "quadratures/quadraturebase.h"
#include "solvers/snsolver.h"
#include "sphericalharmonics.h"
#include "toolboxes/sphericalharmonics.h"
class Physics;
......
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Checkerboard Benchmarking File SN %
% Author <Jonas Kusch> %
% Date 01.12.2020 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
OUTPUT_DIR = ../result
OUTPUT_FILE = example_csd_1d_10MeV_fine
LOG_DIR = ../result/logs
......
......@@ -16,7 +16,6 @@
#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>
......@@ -74,6 +73,12 @@ Config::Config( string case_filename ) {
Config::~Config( void ) {
// Delete all introduced arrays!
// delete _option map values proberly
for( auto const& x : _optionMap ) {
delete x.second;
_optionMap.erase( x.first );
}
}
// ---- Add Options ----
......
/*! @file: main.cpp
* @brief: Main method to call the KiT-RT solver suite
* @author: J. Kusch, S. Schotthöfer, P. Stammer, J. Wolters, T. Xiao
* @version: 0.1
*/
#include <Python.h>
#include <mpi.h>
#include <string>
#include "common/config.h"
#include "common/io.h"
#include "solvers/solverbase.h"
#include "common/config.h"
#include "solvers/sphericalharmonics.h"
#include <fstream>
#include <iostream>
#include <string>
// ----
#include "optimizers/optimizerbase.h"
#include "quadratures/qgausslegendretensorized.h"
#include "quadratures/qmontecarlo.h"
#include "solvers/sphericalharmonics.h"
double testFunc( double my, double phi ) { return my * my + phi; }
double testFunc2( double x, double y, double z ) { return x + y + z; }
int main( int argc, char** argv ) {
MPI_Init( &argc, &argv );
wchar_t* program = Py_DecodeLocale( argv[0], NULL );
......
#include "icru.h"
#include "problems/icru.h"
void ICRU::angdcs( unsigned ncor, double e, std::vector<double>& dxse, std::vector<double>& dxsi, std::vector<double>& dxs ) {
......
......@@ -3,6 +3,7 @@
#include "common/io.h"
#include "fluxes/numericalflux.h"
#include "kernels/scatteringkernelbase.h"
#include "problems/icru.h"
#include "problems/problembase.h"
// externals
......
......@@ -4,6 +4,7 @@
#include "common/mesh.h"
#include "fluxes/numericalflux.h"
#include "kernels/scatteringkernelbase.h"
#include "problems/icru.h"
#include "problems/problembase.h"
#include "quadratures/quadraturebase.h"
......
......@@ -3,6 +3,7 @@
#include "common/io.h"
#include "fluxes/numericalflux.h"
#include "kernels/scatteringkernelbase.h"
#include "problems/icru.h"
#include "problems/problembase.h"
// externals
......
......@@ -3,6 +3,7 @@
#include "common/io.h"
#include "fluxes/numericalflux.h"
#include "kernels/scatteringkernelbase.h"
#include "problems/icru.h"
#include "problems/problembase.h"
#include "quadratures/quadraturebase.h"
......
......@@ -3,6 +3,7 @@
#include "common/io.h"
#include "fluxes/numericalflux.h"
#include "kernels/scatteringkernelbase.h"
#include "problems/icru.h"
#include "problems/problembase.h"
#include "quadratures/qproduct.h"
#include "quadratures/quadraturebase.h"
......
#include "solvers/csdsolvertrafofpsh2d.h"
#include "problems/icru.h"
CSDSolverTrafoFPSH2D::CSDSolverTrafoFPSH2D( Config* settings ) : SNSolver( settings ) {
_dose = std::vector<double>( _settings->GetNCells(), 0.0 );
......
......@@ -7,8 +7,8 @@
#include "optimizers/optimizerbase.h"
#include "problems/problembase.h"
#include "quadratures/quadraturebase.h"
#include "solvers/sphericalharmonics.h"
#include "toolboxes/errormessages.h"
#include "toolboxes/sphericalharmonics.h"
#include "toolboxes/textprocessingtoolbox.h"
// externals
......
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