From 3b8298834438b9749d823ee5935bd147709dad04 Mon Sep 17 00:00:00 2001
From: Baptiste LENIAU <baptiste.leniau@subatech.in2p3.fr>
Date: Thu, 9 Jul 2015 16:09:11 +0000
Subject: [PATCH] Add forgotten keywords for file nfo reading and methods to
 read

git-svn-id: svn+ssh://svn.in2p3.fr/class@695 0e7d625b-0364-4367-a6be-d5be4a48d228
---
 .../Model/Equivalence/EQM_PWR_MLP_Kinf.cxx    | 67 ++++++++++++++++++-
 .../Model/Equivalence/EQM_PWR_MLP_Kinf.hxx    | 16 +++++
 2 files changed, 81 insertions(+), 2 deletions(-)

diff --git a/source/branches/BaM_Dev/Model/Equivalence/EQM_PWR_MLP_Kinf.cxx b/source/branches/BaM_Dev/Model/Equivalence/EQM_PWR_MLP_Kinf.cxx
index 3465171c7..59a4d60a1 100644
--- a/source/branches/BaM_Dev/Model/Equivalence/EQM_PWR_MLP_Kinf.cxx
+++ b/source/branches/BaM_Dev/Model/Equivalence/EQM_PWR_MLP_Kinf.cxx
@@ -31,10 +31,18 @@ EQM_PWR_MLP_Kinf::EQM_PWR_MLP_Kinf(string WeightPathAlpha0, string WeightPathAlp
 	fTMVAWeightPath.push_back(WeightPathAlpha1);
 	fTMVAWeightPath.push_back(WeightPathAlpha2);
 	
+	fMaximalBU = 0;
+	fMaximalContent = 0;
 	fInformationFile = InformationFile;
 	LoadKeyword();
 	ReadNFO();//Getting information from fMLPInformationFile
 	
+	if( fMaximalBU == 0 || fMaximalContent == 0 )
+	{
+		ERROR<<"Can't find the k_maxfiscontent and/or k_maxburnup keyword(s) in .nfo file\n this is mandatory"<<endl;
+		exit(0);
+	}
+	
 	fNumberOfBatch = NumOfBatch;
 	fKThreshold = CriticalityThreshold ;
 	SetBurnUpPrecision(0.005);//1 % of the targeted burnup
@@ -58,10 +66,18 @@ EQM_PWR_MLP_Kinf::EQM_PWR_MLP_Kinf(CLASSLogger* log, string WeightPathAlpha0, st
 	fTMVAWeightPath.push_back(WeightPathAlpha1);
 	fTMVAWeightPath.push_back(WeightPathAlpha2);
 	
+	fMaximalBU = 0;
+	fMaximalContent = 0;
 	fInformationFile = InformationFile;
 	LoadKeyword();
 	ReadNFO();//Getting information from fMLPInformationFile
 	
+	if( fMaximalBU == 0 || fMaximalContent == 0 )
+	{
+		ERROR<<"Can't find the k_maxfiscontent and/or k_maxburnup keyword(s) in .nfo file\n this is mandatory"<<endl;
+		exit(0);
+	}
+	
 	fNumberOfBatch = NumOfBatch;
 	fKThreshold = CriticalityThreshold ;
 	SetBurnUpPrecision(0.005);//1 % of the targeted burnup
@@ -88,10 +104,18 @@ EQM_PWR_MLP_Kinf::EQM_PWR_MLP_Kinf(string TMVAWeightPath,  int NumOfBatch, strin
 	if(InformationFile == "")
 		InformationFile = StringLine::ReplaceAll(TMVAWeightPath,".xml",".nfo");
 	
+	fMaximalBU = 0;
+	fMaximalContent = 0;
 	fInformationFile = InformationFile;
 	LoadKeyword();
 	ReadNFO();//Getting information from fMLPInformationFile
 	
+	if( fMaximalBU == 0 || fMaximalContent == 0 )
+	{
+		ERROR<<"Can't find the k_maxfiscontent and/or k_maxburnup keyword(s) in .nfo file\n this is mandatory"<<endl;
+		exit(0);
+	}
+	
 	fNumberOfBatch = NumOfBatch;
 	fKThreshold = CriticalityThreshold ;
 	SetBurnUpPrecision(0.005);//1 % of the targeted burnup
@@ -114,10 +138,18 @@ EQM_PWR_MLP_Kinf::EQM_PWR_MLP_Kinf(CLASSLogger* log, string TMVAWeightPath,  int
 	if(InformationFile == "")
 		InformationFile = StringLine::ReplaceAll(TMVAWeightPath,".xml",".nfo");
 	
+	fMaximalBU = 0;
+	fMaximalContent = 0;
 	fInformationFile = InformationFile;
 	LoadKeyword();
 	ReadNFO();//Getting information from fMLPInformationFile
 	
+	if( fMaximalBU == 0 || fMaximalContent == 0 )
+	{
+		ERROR<<"Can't find the k_maxfiscontent and/or k_maxburnup keyword(s) in .nfo file\n this is mandatory"<<endl;
+		exit(0);
+	}
+	
 	fNumberOfBatch = NumOfBatch;
 	fKThreshold = CriticalityThreshold ;
 	SetBurnUpPrecision(0.005);//1 % of the targeted burnup
@@ -138,7 +170,8 @@ void EQM_PWR_MLP_Kinf::LoadKeyword()
 	DBGL
 	
 	fDKeyword.insert( pair<string, PWR_MLP_KINF_DMthPtr>( "k_zainame", &EQM_PWR_MLP_Kinf::ReadZAIName) );
-	
+	fDKeyword.insert( pair<string, PWR_MLP_KINF_DMthPtr>( "k_maxburnup", &EQM_PWR_MLP_Kinf::ReadMaxBurnUp) );
+	fDKeyword.insert( pair<string, PWR_MLP_KINF_DMthPtr>( "k_maxfiscontent", &EQM_PWR_MLP_Kinf::ReadMaxFisContent) );
 	DBGL
 }
 
@@ -163,8 +196,38 @@ void EQM_PWR_MLP_Kinf::ReadZAIName(const string &line)
 	
 	DBGL
 }
+//________________________________________________________________________
+void EQM_PWR_MLP_Kinf::ReadMaxBurnUp(const string &line)
+{
+	DBGL
+	int pos = 0;
+	string keyword = tlc(StringLine::NextWord(line, pos, ' '));
+	if( keyword != "k_maxburnup" )	// Check the keyword
+	{
+		ERROR << " Bad keyword : \"k_maxburnup\" not found !" << endl;
+		exit(1);
+	}
+	
+	fMaximalBU = atof(StringLine::NextWord(line, pos, ' ').c_str());
 
-
+	DBGL
+}
+//________________________________________________________________________
+void EQM_PWR_MLP_Kinf::ReadMaxFisContent(const string &line)
+{
+	DBGL
+	int pos = 0;
+	string keyword = tlc(StringLine::NextWord(line, pos, ' '));
+	if( keyword != "k_maxfiscontent" )	// Check the keyword
+	{
+		ERROR << " Bad keyword : \"k_maxfiscontent\" not found !" << endl;
+		exit(1);
+	}
+	
+	fMaximalContent = atof(StringLine::NextWord(line, pos, ' ').c_str());
+	
+	DBGL
+}
 //________________________________________________________________________
 void EQM_PWR_MLP_Kinf::ReadLine(string line)
 {
diff --git a/source/branches/BaM_Dev/Model/Equivalence/EQM_PWR_MLP_Kinf.hxx b/source/branches/BaM_Dev/Model/Equivalence/EQM_PWR_MLP_Kinf.hxx
index ab093f15a..23b192ea3 100644
--- a/source/branches/BaM_Dev/Model/Equivalence/EQM_PWR_MLP_Kinf.hxx
+++ b/source/branches/BaM_Dev/Model/Equivalence/EQM_PWR_MLP_Kinf.hxx
@@ -153,6 +153,22 @@ class EQM_PWR_MLP_Kinf : public EquivalenceModel
 	void ReadZAIName(const string &line);
 	//}
 	
+	//{
+	/// ReadMaxBurnUp : read a guessed (very overestimated) maximum burnup a fuel can reach (purpose : algorithm initialization)
+	/*!
+	 \param line : line suppossed to contain the ZAI name  starts with "k_zainame" keyword
+	 */
+	void ReadMaxBurnUp(const string &line);
+	//}
+	
+	//{
+	/// ReadMaxFisContent  : read a guessed (very overestimated) maximum fissile content (purpose : algorithm initialization)
+	/*!
+	 \param line : line suppossed to contain the ZAI name  starts with "k_zainame" keyword
+	 */
+	void ReadMaxFisContent(const string &line);
+	//}
+	
 	//{
 	/// ReadLine : read a line
 	/*!
-- 
GitLab