Skip to content
Snippets Groups Projects
Commit 585c5769 authored by BaM's avatar BaM
Browse files

debug

add new read on Equivalence model

git-svn-id: svn+ssh://svn.in2p3.fr/class@682 0e7d625b-0364-4367-a6be-d5be4a48d228
parent bac814da
No related branches found
No related tags found
No related merge requests found
......@@ -14,11 +14,17 @@
#include "IsotopicVector.hxx"
#include <math.h>
#include <map>
#include "CLASSObject.hxx"
using namespace std;
class EquivalenceModel;
#ifndef __CINT__
typedef void (EquivalenceModel::*EQMthPtr)( const string & );
#endif
//-----------------------------------------------------------------------------//
//! Determines how to build a fresh fuel
......@@ -97,6 +103,11 @@ class EquivalenceModel : public CLASSObject
void SetRelativMassPrecision( double val) { fRelativMassPrecision = val; } //!< Mass precision
void SetMaxInterration(int val) { fMaxInterration = val; } //!< Max iterration in build fueld algorythm
virtual void LoadKeyword();
void ReadNFO();
virtual void ReadLine(string line);
void ReadZAIlimits(const string &line);
void ReadType(const string &line);
//@}
protected :
......@@ -131,6 +142,17 @@ class EquivalenceModel : public CLASSObject
//@}
#ifndef __CINT__
map<string, EQMthPtr> fKeyword;
#endif
bool freaded;
map< ZAI, pair<double,double> > fZAILimits; //!< Fresh fuel range : map<ZAI<min edge ,max edge >>
string fInformationFile; //!< file containing Reactor Type, Fuel type, HM mass, Power, time vector, and TMVA input variables names (looks the manual for format details)
string fDBFType; //!< Fuel Type (e.g MOX, UOX, ThU, ThPu ...)
string fDBRType; //!< Reactor Type (e.g PWR, FBR-Na, ADS..)
/*!
\name Others
*/
......
#include "EquivalenceModel.hxx"
#include "StringLine.hxx"
#include "CLASSMethod.hxx"
EquivalenceModel::EquivalenceModel():CLASSObject()
{
fRelativMassPrecision = 1/10000.; // Mass precision
fMaxInterration = 100; // Max iterration in build fueld algorythum
fFirstGuessFissilContent = 0.02;
freaded = false;
}
EquivalenceModel::EquivalenceModel(CLASSLogger* log):CLASSObject(log)
......@@ -14,6 +16,7 @@ EquivalenceModel::EquivalenceModel(CLASSLogger* log):CLASSObject(log)
fRelativMassPrecision = 1/10000.; // Mass precision
fMaxInterration = 100; // Max iterration in build fueld algorythm
fFirstGuessFissilContent = 0.02;
freaded = false;
}
......@@ -21,6 +24,119 @@ EquivalenceModel::~EquivalenceModel()
{
}
void EquivalenceModel::ReadNFO()
{
DBGL
ifstream NFO(fInformationFile.c_str());
if(!NFO)
{
ERROR << "Can't find/open file " << fInformationFile << endl;
exit(0);
}
do
{
string line;
getline(NFO,line);
EquivalenceModel::ReadLine(line);
} while(!NFO.eof());
DBGL
}
//________________________________________________________________________
void EquivalenceModel::ReadLine(string line)
{
DBGL
if (!freaded)
{
int pos = 0;
string keyword = tlc(StringLine::NextWord(line, pos, ' '));
map<string, EQMthPtr>::iterator it = fKeyword.find(keyword);
if(it != fKeyword.end())
(this->*(it->second))( line );
freaded = true;
ReadLine(line);
}
freaded = false;
DBGL
}
void EquivalenceModel::LoadKeyword()
{
DBGL
fKeyword.insert( pair<string, EQMthPtr>( "k_zail", & EquivalenceModel::ReadZAIlimits));
fKeyword.insert( pair<string, EQMthPtr>( "k_reactor", & EquivalenceModel::ReadType) );
fKeyword.insert( pair<string, EQMthPtr>( "k_fuel", & EquivalenceModel::ReadType) );
DBGL
}
void EquivalenceModel::ReadType(const string &line)
{
DBGL
int pos = 0;
string keyword = tlc(StringLine::NextWord(line, pos, ' '));
if( keyword != "k_fuel" && keyword != "k_reactor" ) // Check the keyword
{
ERROR << " Bad keyword : " << keyword << " Not found !" << endl;
exit(1);
}
if( keyword == "k_fuel" )
fDBFType = StringLine::NextWord(line, pos, ' ');
else if( keyword == "k_reactor" )
fDBRType = StringLine::NextWord(line, pos, ' ');
DBGL
}
void EquivalenceModel::ReadZAIlimits(const string &line)
{
DBGL
int pos = 0;
string keyword = tlc(StringLine::NextWord(line, pos, ' '));
if( keyword != "k_zail" ) // Check the keyword
{
ERROR << " Bad keyword : \"k_zail\" not found !" << endl;
exit(1);
}
int Z = atoi(StringLine::NextWord(line, pos, ' ').c_str());
int A = atoi(StringLine::NextWord(line, pos, ' ').c_str());
int I = atoi(StringLine::NextWord(line, pos, ' ').c_str());
double downLimit = atof(StringLine::NextWord(line, pos, ' ').c_str());
double upLimit = atof(StringLine::NextWord(line, pos, ' ').c_str());
if (upLimit < downLimit)
{
double tmp = upLimit;
upLimit = downLimit;
downLimit = tmp;
}
fZAILimits.insert(pair<ZAI, pair<double, double> >(ZAI(Z,A,I), pair<double,double>(downLimit, upLimit)));
DBGL
}
//________________________________________________________________________
double EquivalenceModel::LAMBDA_TOT_FOR(double MassNeeded, vector<IsotopicVector> Stocks, string FisOrFer)
{
......
......@@ -19,7 +19,7 @@ using namespace std;
XSModel::XSModel():CLASSObject()
{
XSModel::LoadKeyword();
// freaded = false;
freaded = false;
}
......@@ -28,7 +28,7 @@ XSModel::XSModel(CLASSLogger* log):CLASSObject(log)
{
XSModel::LoadKeyword();
// freaded = false;
freaded = false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment