Commit 1a927787 authored by steffen.schotthoefer's avatar steffen.schotthoefer
Browse files

started CSDSolver constructor

parent 7ff95418
Pipeline #97980 passed with stages
in 40 minutes and 24 seconds
......@@ -26,7 +26,7 @@ class Physics
* @param density is vector with patient densities (at different spatial cells)
* @param Omega are scattering angles
*/
VectorVector GetScatteringXS( Vector energies, Vector density, Vector angle );
VectorVector GetScatteringXS( Vector energies, Vector angle );
/**
* @brief GetTotalXS gives back vector of vectors of total cross sections for materials defined by density and energies in vector energy
......
......@@ -3,10 +3,18 @@
#include "solvers/snsolver.h"
class Physics;
class CSDSNSolver : public SNSolver
{
private:
std::vector<double> _dose;
std::vector<double> _dose; /*! @brief: TODO */
// Physics acess
Vector _energies; /*! @brief: energy levels for CSD, lenght = _nEnergies */
Vector _angle; /*! @brief: angles for SN */
Vector _density; /*! @brief: patient density for each grid cell */
Physics* _physics; /*! @brief: class that hold physics information */
public:
/**
......
......@@ -80,7 +80,7 @@ void Physics::LoadDatabase( std::string fileName_H, std::string fileName_O, std:
_stpowH2O = ReadStoppingPowers( fileName_stppower );
}
VectorVector Physics::GetScatteringXS( Vector energies, Vector density, Vector angle ) {
VectorVector Physics::GetScatteringXS( Vector energies, Vector angle ) {
std::cout << _xsH2O.size() << " " << _xsH2O[0].size() << std::endl;
std::vector<std::vector<double>> tmp; // vectorvector which stores data at fixed energies
......@@ -141,7 +141,15 @@ VectorVector Physics::GetScatteringXS( Vector energies, Vector density, Vector a
}
//_xsH2O
VectorVector scattering_XS;
VectorVector scattering_XS( xsH2OGridGrid.size() );
// write vector<vector> to VectorVector
for( unsigned idx_energy = 0; idx_energy < xsH2OGridGrid.size(); idx_energy++ ) {
scattering_XS[idx_energy] = Vector( xsH2OGridGrid[idx_energy].size() );
for( unsigned idx_angular = 0; idx_angular < xsH2OGridGrid[idx_energy].size(); idx_angular++ ) {
scattering_XS[idx_energy][idx_angular] = xsH2OGridGrid[idx_energy][idx_angular];
}
}
return scattering_XS;
}
......
#include "solvers/csdsnsolver.h"
#include "common/config.h"
#include "common/io.h"
#include "fluxes/numericalflux.h"
#include "kernels/scatteringkernelbase.h"
#include "physics.h"
#include "solvers/csdsnsolver.h"
CSDSNSolver::CSDSNSolver( Config* settings ) : SNSolver( settings ) {
_dose = std::vector<double>( _settings->GetNCells(), 0.0 );
// Set angle and energies
_angle = Vector( _settings->GetNQuadPoints(), 0.0 );
_energies = Vector( _nEnergies, 0.0 );
// TODO: write meaningfull values for them!
CSDSNSolver::CSDSNSolver( Config* settings ) : SNSolver( settings ) { _dose = std::vector<double>( _settings->GetNCells(), 0.0 ); }
_sigmaS = _physics->GetScatteringXS( _energies, _angle );
// Get patient density
_density = Vector( _nCells, 0.0 );
}
void CSDSNSolver::Solve() {
auto log = spdlog::get( "event" );
......
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