Commit 564322ce authored by steffen.schotthoefer's avatar steffen.schotthoefer
Browse files

fixed ENDLH reader bug

parent 1a927787
Pipeline #97994 passed with stages
in 34 minutes and 42 seconds
......@@ -15,6 +15,7 @@ class Physics
public:
// prototype data readers
std::tuple<std::vector<VectorVector>, std::vector<VectorVector>> ReadENDL( std::string filename );
VectorVector ReadStoppingPowers( std::string fileName );
// load and prepare data from database
......
......@@ -123,7 +123,6 @@ VectorVector Physics::GetScatteringXS( Vector energies, Vector angle ) {
tmp.push_back( std::vector<double>( { _xsH2O[i][1], _xsH2O[i][2] } ) );
}
}
// perform interpolation at fixed original energy for new energy grid
for( unsigned j = 0; j < angle.size(); ++j ) { // loop over all angles
......@@ -272,6 +271,7 @@ std::tuple<std::vector<VectorVector>, std::vector<VectorVector>> Physics::ReadEN
Vector dataLine( linelist.size() );
bool header = false;
unsigned lineLenght = linelist.size();
// check, if line is a dataline
if( lineLenght == 2 || lineLenght == 3 ) {
dataLine[0] = linelist.front();
......@@ -291,16 +291,6 @@ std::tuple<std::vector<VectorVector>, std::vector<VectorVector>> Physics::ReadEN
header = true;
}
}
// save dataLine in vector;
if( header ) {
headerPack[curr_HeaderLine] = dataLine;
curr_HeaderLine++;
}
else {
dataPackList.push_back( dataLine );
}
// check if line is an endline, then reset indices and save packs
if( lineLenght == 1 ) {
......@@ -316,6 +306,16 @@ std::tuple<std::vector<VectorVector>, std::vector<VectorVector>> Physics::ReadEN
pack_idx++;
curr_HeaderLine = 0;
}
else {
// save dataLine in vector;
if( header ) {
headerPack[curr_HeaderLine] = dataLine;
curr_HeaderLine++;
}
else {
dataPackList.push_back( dataLine );
}
}
}
case_file.close();
return { _headers, _data };
......
......@@ -9,8 +9,8 @@ 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 );
_angle = Vector( _settings->GetNQuadPoints(), 0.0 ); // my
_energies = Vector( _nEnergies, 0.0 ); // equidistant
// TODO: write meaningfull values for them!
_sigmaS = _physics->GetScatteringXS( _energies, _angle );
......
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