From c1e792984cc9d0ac41fdeb52256189f864ac8a5d Mon Sep 17 00:00:00 2001
From: Baptiste Mouginot <mouginot.baptiste@gmail.com>
Date: Mon, 5 May 2014 14:47:37 +0000
Subject: [PATCH] =?UTF-8?q?Removing=20DecayDataBank=20from=20Storage,=20Fa?=
 =?UTF-8?q?bricationPlant=20and=20Pool,=20and=20including=20it=20into=20th?=
 =?UTF-8?q?e=20CLSSFacility=E2=80=A6.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

git-svn-id: svn+ssh://svn.in2p3.fr/class@246 0e7d625b-0364-4367-a6be-d5be4a48d228
---
 source/trunk/include/CLSSFacility.hxx         | 13 +++++++--
 source/trunk/include/FabricationPlant.hxx     |  9 +-----
 source/trunk/include/IsotopicVector.hxx       |  4 +--
 source/trunk/include/LogFile.hxx              |  2 ++
 source/trunk/include/Pool.hxx                 |  8 -----
 source/trunk/include/Storage.hxx              |  9 ------
 source/trunk/src/CLASS.cxx                    |  6 ++--
 source/trunk/src/CLSSFacility.cxx             | 25 ++++++++++++++++
 source/trunk/src/FabricationPlant.cxx         | 27 -----------------
 .../trunk/src/PWR_THPU_FabricationPlant.cxx   |  9 +++---
 source/trunk/src/PWR_THU_FabricationPlant.cxx |  7 ++---
 source/trunk/src/Pool.cxx                     | 27 -----------------
 source/trunk/src/Storage.cxx                  | 29 +------------------
 13 files changed, 50 insertions(+), 125 deletions(-)

diff --git a/source/trunk/include/CLSSFacility.hxx b/source/trunk/include/CLSSFacility.hxx
index d6f13c562..070deab57 100644
--- a/source/trunk/include/CLSSFacility.hxx
+++ b/source/trunk/include/CLSSFacility.hxx
@@ -14,6 +14,7 @@
 
 #include "CLSSObject.hxx"
 #include "IsotopicVector.hxx"
+#include "DecayDataBank.hxx"
 
 #include "TNamed.h"
 
@@ -56,7 +57,10 @@ public :
 	cSecond		GetCycleTime()		const	{ return fCycleTime; } 		//!< Return the cycle time of the Facility
 	cSecond 	GetCreationTime()	const	{ return fCreationTime; }	//!< Return the creation time of the Facility
 	cSecond 	GetLifeTime()		const	{ return fLifeTime; }		//!< Return the life time of the Facility
-	CLASS*		GetParc()			{ return fParc; }
+	CLASS*		GetParc()			{ return fParc; }		//! retiurn the pointer to the Park
+	DecayDataBank*	GetDecayDataBank()		{ return fDecayDataBase;}	//!< Return the pointer to the decay DataBank
+
+
 	IsotopicVector GetCumulativeIVIn() { return fCumulativeIVIn;}
 	IsotopicVector GetCumulativeIVOut() { return fCumulativeIVOut;}
 	//@}
@@ -75,6 +79,8 @@ public :
 	virtual void SetCycleTime(double cycletime)	{ fCycleTime = (cSecond)cycletime; }	//!< Set the cycle time (Cycle of the loading Plan)
 	void SetInCycleTime(double incycletime)		{ fInCycleTime = (cSecond)incycletime; fIsStarted = true; }	//!< Set the cycle time (Cycle of the loading Plan)
 	void SetInternalTime(double internaltime)	{ fInternalTime = (cSecond)internaltime; }	//!< Set the cycle time (Cycle of the loading Plan)
+
+	void SetDecayDataBank(DecayDataBank* decayDB) {fDecayDataBase = decayDB;} //! Set the Decay DataBank
 	//@}
 
 
@@ -104,12 +110,15 @@ protected :
 	IsotopicVector	fCumulativeIVOut;	///< All IV in the Facility (fuel for reactor, total for all others...)
 
 
+	IsotopicVector GetDecay(IsotopicVector isotopicvector, cSecond t);	//!< Get IsotopicVector Decay at the t time
+
 		//********* Internal Parameter *********//
 private :
 	int		fId;			//!< Identity of the Facility inside the Parc
 		
 	CLASS*		fParc;			//!< Pointer to the main Parc
-	
+	DecayDataBank*	fDecayDataBase;		//!< Pointer to the Decay DataBase
+
 	cSecond		fCreationTime;		///< CLASS Universal Time of Creation
 	cSecond		fLifeTime;		///< LifeTime Of the Reactor (Operating's Duration)
 
diff --git a/source/trunk/include/FabricationPlant.hxx b/source/trunk/include/FabricationPlant.hxx
index a0f545a90..f15f22117 100644
--- a/source/trunk/include/FabricationPlant.hxx
+++ b/source/trunk/include/FabricationPlant.hxx
@@ -96,7 +96,6 @@ public :
 
 	void	SetUpdateReferenceDBatEachStep(bool val){ fUpdateReferenceDBatEachStep = val;}	//!< Set fUpdateReferenceDBatEachStep variable
 	void	SetStorage(Storage* storage)		{ fStorage = storage; }			//!< Set the Pointer to the Storage
-	void	SetDecayDataBase(DecayDataBank* ddb)	{ fDecayDataBase = ddb; }	//!< Set the pointer to the Decay DataBase
 	
 	void	SetChronologicalTimePriority(bool bval)	{ fChronologicalTimePriority = bval;}	//!< Set the chronological priority (true for chronological, false unstead)
 	
@@ -121,9 +120,6 @@ public :
 	map<int, IsotopicVector >	GetReactorFuturIncome() const
 						{ return fReactorFuturIV;}	//!< Return the List of the Futur Fuel IV
 
-	DecayDataBank* 	GeDecayDataBase() const
-						{ return fDecayDataBase; }	//!< Return the pointer to the DecayDB
-
 	IsotopicVector GetFullFabrication();					//!< Return the Sum of all Fuel waiting to be put in a reator
 
 	EvolutionData GetReactorEvolutionDB(int ReactorId);			//!< Return the EvolutionData of Reactor ReactorId
@@ -165,8 +161,6 @@ protected :
 	map< int,EvolutionData >	fReactorFuturDB; ///< List of the Futur EvolutionData use in the reactor
 	map< int,IsotopicVector >	fReactorFuturIV; ///< List of the Futur Fuel Isotopic Vector used in the reactor
 
-	DecayDataBank*		fDecayDataBase;	//!< Pointer to the Decay DataBase
-
 	Storage*	fStorage;			//!< Pointer to the Storage to recycle
 	Storage*	fReUsable;			//!< Pointer to the Storage using for recycling unused Product
 
@@ -180,14 +174,13 @@ protected :
 	
 
 //********* Private Method *********//
-	IsotopicVector GetDecay(IsotopicVector isotopicvector, cSecond t);	//!< Get IsotopicVector Decay at the t time
 	void	FabricationPlantEvolution(cSecond t);				//!< Deal the FabricationPlant Evolution
 
 	//{
 	/// Separation Method
 	/*!
 	 Make the Separation
-		\li IV[0] -> To Stock
+		\li IV[0] -> To Keep
 		\li IV[1] -> To Waste
 	 */
 	pair<IsotopicVector, IsotopicVector> Separation(IsotopicVector isotopicvector);
diff --git a/source/trunk/include/IsotopicVector.hxx b/source/trunk/include/IsotopicVector.hxx
index 181884c56..c3c0cb123 100755
--- a/source/trunk/include/IsotopicVector.hxx
+++ b/source/trunk/include/IsotopicVector.hxx
@@ -5,8 +5,6 @@
 /*!
  \file
  \brief Header file for IsotopicVector class. 
-
- @author BaM, Marc
  @version 2.0
  */
 #include "ZAI.hxx"
@@ -23,7 +21,7 @@ typedef long long int cSecond;
  Define a Isotopicvector.
  The aim of this Class is to manage any kind of IsotopicVector, and any operation between them : sum, substraction....
 
- @author BaM
+ @author BaM, MArc
  @version 2.0
  */
 //________________________________________________________________________
diff --git a/source/trunk/include/LogFile.hxx b/source/trunk/include/LogFile.hxx
index 3fca5f567..1915f1373 100755
--- a/source/trunk/include/LogFile.hxx
+++ b/source/trunk/include/LogFile.hxx
@@ -68,3 +68,5 @@ public:
 
 #endif
 
+
+
diff --git a/source/trunk/include/Pool.hxx b/source/trunk/include/Pool.hxx
index 33f424d60..cf567a00a 100755
--- a/source/trunk/include/Pool.hxx
+++ b/source/trunk/include/Pool.hxx
@@ -101,8 +101,6 @@ public :
 	void SetStorage(Storage* storage)	{ fStorage = storage; fPutToWaste = true; }		//!< Set the Pointer to the Storage
 	void SetPutToWaste(bool val)		{ fPutToWaste = val; }		//!< Set True if IV goes to waste after cooling false instead
 
-	void SetDecayDataBase(DecayDataBank* ddb)	{ fDecayDataBase = ddb; }		//!< Set the pointer to the Decay DataBase
-
 	void SetCoolingTime(double time) 		{ SetCycleTime((cSecond)time); }			//!< Set Cooling Time
 
 	//@}
@@ -122,9 +120,6 @@ public :
 
 	cSecond GetCoolingTime() const		{ return GetCycleTime(); }	//!< Return the Cooling Time
 
-	
-	DecayDataBank* 	GeDecayDataBase() const	{ return fDecayDataBase; }	//!< Return the pointer to the Decay DataBase
-
 	//@}
 
 
@@ -170,8 +165,6 @@ protected :
 	Storage*		fStorage;	//!< Pointer to the Stock
 	bool			fPutToWaste;	//!< True if IV goes to waste after cooling false instead
 
-	DecayDataBank*	fDecayDataBase;		//!< Pointer to the Decay DataBase
-
 
 //********* Isotopic Quantity *********//
 //--------- Cooling ---------//
@@ -183,7 +176,6 @@ protected :
 
 
 //********* Private Method *********//
-	IsotopicVector GetDecay(IsotopicVector isotopicvector, cSecond t);	//!< Get IsotopicVector Decay at the t time
 	void	CoolingEvolution(cSecond t);					//!< Deal the cooling and then send it to Separation
 
 
diff --git a/source/trunk/include/Storage.hxx b/source/trunk/include/Storage.hxx
index 5d09476da..6a9a8fd7a 100644
--- a/source/trunk/include/Storage.hxx
+++ b/source/trunk/include/Storage.hxx
@@ -80,8 +80,6 @@ public :
 	 \name Set Method
 	 */
 	//@{
-	
-	void SetDecayDataBase(DecayDataBank* ddb)	{ fDecayDataBase = ddb; }	//!< Set the pointer to the Decay DataBase
 	void SetStock(vector<IsotopicVector> IVsstock)	{ fIVStock = IVsstock; }		//!< Set The Storage isotopicVector
 
 	//@}
@@ -96,7 +94,6 @@ public :
 	 */
 	//@{
 	
-	DecayDataBank* GeDecayDataBase()	const		{ return fDecayDataBase; }	//!< Return the pointer to the Decay DataBase
 	vector<IsotopicVector> GetStock()	const		{ return fIVStock; }		//!< Return the Storage IsotopicVector
 	IsotopicVector GetFullStock()		const		{ return GetInsideIV(); }	//!< Return the Full Storage
 
@@ -162,11 +159,6 @@ public :
 
 protected :
 	
-//********* Internal Parameter *********//
-
-	DecayDataBank*	fDecayDataBase;	//!< Pointer to the Decay DataBase
-
-
 //********* Isotopic Quantity *********//
 
 //---------- Storage ----------//
@@ -175,7 +167,6 @@ protected :
 
 
 //********* Private Method *********//
-	IsotopicVector GetDecay(IsotopicVector isotopicvector, cSecond t);	//!< Get IsotopicVector Decay at the t time
 	void	StorageEvolution(cSecond t);					//!< Deal the Storage Decay Evolution
 
 
diff --git a/source/trunk/src/CLASS.cxx b/source/trunk/src/CLASS.cxx
index a699342ff..152a4dc90 100755
--- a/source/trunk/src/CLASS.cxx
+++ b/source/trunk/src/CLASS.cxx
@@ -179,7 +179,7 @@ void CLASS::AddPool(Pool* Pool)
 	
 	fPool.push_back(Pool);
 	fPool.back()->SetParc(this);
-	fPool.back()->SetDecayDataBase( (*this).GetDecayDataBase() );
+	fPool.back()->SetDecayDataBank( (*this).GetDecayDataBase() );
 	fPool.back()->SetLog(GetLog());
 	fPool.back()->SetId((int)fPool.size()-1);
 	
@@ -224,7 +224,7 @@ void CLASS::AddStorage(Storage* storage)
 	
 	fStorage.push_back(storage);
 	fStorage.back()->SetParc(this);
-	fStorage.back()->SetDecayDataBase( (*this).GetDecayDataBase() );
+	fStorage.back()->SetDecayDataBank( (*this).GetDecayDataBase() );
 	fStorage.back()->SetLog(GetLog());
 	fStorage.back()->SetId((int)fStorage.size()-1);
 	
@@ -244,7 +244,7 @@ void CLASS::AddFabricationPlant(FabricationPlant* fabricationplant)
 	
 	fFabricationPlant.push_back(fabricationplant);
 	fFabricationPlant.back()->SetParc(this);
-	fFabricationPlant.back()->SetDecayDataBase( (*this).GetDecayDataBase() );
+	fFabricationPlant.back()->SetDecayDataBank( (*this).GetDecayDataBase() );
 	fFabricationPlant.back()->SetLog(GetLog());
 	fFabricationPlant.back()->SetId((int)fStorage.size()-1);
 	
diff --git a/source/trunk/src/CLSSFacility.cxx b/source/trunk/src/CLSSFacility.cxx
index 40d5e2677..0f026331f 100644
--- a/source/trunk/src/CLSSFacility.cxx
+++ b/source/trunk/src/CLSSFacility.cxx
@@ -21,4 +21,29 @@ CLSSFacility::CLSSFacility()
 	fInternalTime = 0;
 	fInCycleTime = 0;
 	fCycleTime = 0;
+	fDecayDataBase = 0;
+}
+
+
+//________________________________________________________________________
+//	Get Decay
+//________________________________________________________________________
+IsotopicVector CLSSFacility::GetDecay(IsotopicVector isotopicvector, cSecond t)
+{
+
+	IsotopicVector IV;
+
+	map<ZAI ,double> isotopicquantity = isotopicvector.GetIsotopicQuantity();
+	map<ZAI ,double >::iterator it;
+	for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++)
+	{
+		if((*it).second > 0)
+		{
+ 			IsotopicVector ivtmp = fDecayDataBase->Evolution(it->first, t) * (*it).second ;
+			IV += ivtmp;
+		}
+	}
+
+	return IV;
+	
 }
diff --git a/source/trunk/src/FabricationPlant.cxx b/source/trunk/src/FabricationPlant.cxx
index 1094ca6b1..2c17f49a0 100644
--- a/source/trunk/src/FabricationPlant.cxx
+++ b/source/trunk/src/FabricationPlant.cxx
@@ -45,7 +45,6 @@ ClassImp(FabricationPlant)
 
 FabricationPlant::FabricationPlant()
 {
-	fDecayDataBase = 0;
 	fStorage = 0;
 	fReUsable = 0;
 }
@@ -58,7 +57,6 @@ FabricationPlant::FabricationPlant(LogFile* log)
 	SetCycleTime(-1);
 	fUpdateReferenceDBatEachStep = false;
 	fSubstitutionFuel = false;
-	fDecayDataBase = 0;
 	fStorage = 0;
 	fReUsable = 0;
 
@@ -81,7 +79,6 @@ FabricationPlant::FabricationPlant(LogFile* log, Storage* storage, Storage* reus
 	fChronologicalTimePriority = false;
 	fUpdateReferenceDBatEachStep = false;
 	fSubstitutionFuel = false;
-	fDecayDataBase = 0;
 
 
 	SetCycleTime((cSecond)fabircationtime );
@@ -387,30 +384,6 @@ void	FabricationPlant::SetSubstitutionFuel(EvolutionData fuel)
 }
 
 
-	//________________________________________________________________________
-	//_________________________________ Decay ________________________________
-	//________________________________________________________________________
-IsotopicVector FabricationPlant::GetDecay(IsotopicVector isotopicvector, cSecond t)
-{
-	
-	IsotopicVector IV;
-	
-	map<ZAI ,double> isotopicquantity = isotopicvector.GetIsotopicQuantity();
-	
-	map<ZAI ,double >::iterator it;
-	for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ )
-	{
-		if((*it).second > 0)
-		{
- 			IsotopicVector ivtmp = fDecayDataBase->Evolution(it->first, t) * (*it).second ;
-			IV += ivtmp;
-		}
-	}
-	
-	return IV;
-}
-
-
 	//________________________________________________________________________
 	//_____________________________ Reactor & DB _____________________________
 	//________________________________________________________________________
diff --git a/source/trunk/src/PWR_THPU_FabricationPlant.cxx b/source/trunk/src/PWR_THPU_FabricationPlant.cxx
index eec832e95..ca1973507 100644
--- a/source/trunk/src/PWR_THPU_FabricationPlant.cxx
+++ b/source/trunk/src/PWR_THPU_FabricationPlant.cxx
@@ -37,11 +37,12 @@ template <class T>  T random(T a, T b) //peak random numebr between a and b
 	srand(time(NULL)); //initialize the srand
 	return (T)a + (T)(b-a)*rand()/range;
 }
+
+
+
+
 PWR_THPU_FabricationPlant::PWR_THPU_FabricationPlant()
 {
-	fDecayDataBase = 0;
-	fStorage = 0;
-	fReUsable = 0;
 }
 
 PWR_THPU_FabricationPlant::PWR_THPU_FabricationPlant(LogFile* log)
@@ -52,7 +53,6 @@ PWR_THPU_FabricationPlant::PWR_THPU_FabricationPlant(LogFile* log)
 	SetCycleTime(-1);
 	fUpdateReferenceDBatEachStep = false;
 	fSubstitutionFuel = false;
-	fDecayDataBase = 0;
 	fStorage = 0;
 	fReUsable = 0;
 
@@ -75,7 +75,6 @@ PWR_THPU_FabricationPlant::PWR_THPU_FabricationPlant(LogFile* log, Storage* stor
 	fChronologicalTimePriority = false;
 	fUpdateReferenceDBatEachStep = false;
 	fSubstitutionFuel = false;
-	fDecayDataBase = 0;
 
 
 	SetCycleTime((cSecond)fabircationtime );
diff --git a/source/trunk/src/PWR_THU_FabricationPlant.cxx b/source/trunk/src/PWR_THU_FabricationPlant.cxx
index f3e540522..62ecb8a04 100644
--- a/source/trunk/src/PWR_THU_FabricationPlant.cxx
+++ b/source/trunk/src/PWR_THU_FabricationPlant.cxx
@@ -37,11 +37,10 @@ template <class T>  T random(T a, T b) //peak random numebr between a and b
 	srand(time(NULL)); //initialize the srand
 	return (T)a + (T)(b-a)*rand()/range;
 }
+
 PWR_THU_FabricationPlant::PWR_THU_FabricationPlant()
 {
-	fDecayDataBase = 0;
-	fStorage = 0;
-	fReUsable = 0;
+
 }
 
 PWR_THU_FabricationPlant::PWR_THU_FabricationPlant(LogFile* log)
@@ -52,7 +51,6 @@ PWR_THU_FabricationPlant::PWR_THU_FabricationPlant(LogFile* log)
 	SetCycleTime(-1);
 	fUpdateReferenceDBatEachStep = false;
 	fSubstitutionFuel = false;
-	fDecayDataBase = 0;
 	fStorage = 0;
 	fReUsable = 0;
 
@@ -75,7 +73,6 @@ PWR_THU_FabricationPlant::PWR_THU_FabricationPlant(LogFile* log, Storage* storag
 	fChronologicalTimePriority = false;
 	fUpdateReferenceDBatEachStep = false;
 	fSubstitutionFuel = false;
-	fDecayDataBase = 0;
 
 
 	SetCycleTime((cSecond)fabircationtime );
diff --git a/source/trunk/src/Pool.cxx b/source/trunk/src/Pool.cxx
index 343f0dc97..984a502f0 100755
--- a/source/trunk/src/Pool.cxx
+++ b/source/trunk/src/Pool.cxx
@@ -25,7 +25,6 @@ ClassImp(Pool)
 Pool::Pool()
 {
 	fStorage = 0;
-	fDecayDataBase = 0;
 }
 
 Pool::Pool(LogFile* log)
@@ -40,7 +39,6 @@ Pool::Pool(LogFile* log)
 	fCoolingLastIndex = 0;
 
 	fStorage = 0;
-	fDecayDataBase = 0;
 
 	
 	cout	<< "!!INFO!! !!!Pool!!! A new Pool has been define :" << endl;
@@ -67,7 +65,6 @@ Pool::Pool(LogFile* log, double creation, double coolingtime)
 	fCoolingLastIndex = 0;
 
 	fStorage = 0;
-	fDecayDataBase = 0;
 
 	
 	cout	<< "!!INFO!! !!!Pool!!! A new Pool has been define :" << endl;
@@ -95,8 +92,6 @@ Pool::Pool(LogFile* log, Storage* storage, double creation, double coolingtime)
 	fPutToWaste = false;
 	fCoolingLastIndex = 0;
 
-	fDecayDataBase = 0;
-
 	
 	cout	<< "!!INFO!! !!!Pool!!! A new Pool has been define :" << endl;
 	cout	<< "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl;
@@ -121,28 +116,6 @@ Pool::~Pool()
 
 
 
-//________________________________________________________________________
-//	Get Decay
-//________________________________________________________________________
-IsotopicVector Pool::GetDecay(IsotopicVector isotopicvector, cSecond t)
-{
-
-	IsotopicVector IV;
-	map<ZAI ,double> isotopicquantity = isotopicvector.GetIsotopicQuantity();
-	map<ZAI ,double >::iterator it;
-	for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++)
-	{
-		if((*it).second > 0)
-		{
- 			IsotopicVector ivtmp = fDecayDataBase->Evolution(it->first, t) * (*it).second ;
-			IV += ivtmp;
-		}
-	}
-
-	return IV;
-}
-
-
 //________________________________________________________________________
 //	Add Temporary IV : 
 //		Cooling
diff --git a/source/trunk/src/Storage.cxx b/source/trunk/src/Storage.cxx
index 41ddb0bc5..1f9e9cc09 100644
--- a/source/trunk/src/Storage.cxx
+++ b/source/trunk/src/Storage.cxx
@@ -23,15 +23,12 @@ ClassImp(Storage)
 
 Storage::Storage()
 {
-	fDecayDataBase = 0;
-
 }
 
 Storage::Storage(LogFile* log)
 {
 	
 	SetLog(log);
-	fDecayDataBase = 0;
 	cout	<< "!!INFO!! !!!Storage!!! A new Storage has been define." << endl;
 	
 	GetLog()->fLog	<< "!!INFO!! !!!Storage!!! A new Storage has been define." << endl;
@@ -42,7 +39,7 @@ Storage::Storage(LogFile* log, DecayDataBank* evolutivedb)
 {
 
 	SetLog(log);
-	fDecayDataBase = evolutivedb;
+	SetDecayDataBank(evolutivedb);
 	
 	cout	<< "!!INFO!! !!!Storage!!! A new Storage has been define." << endl;
 	
@@ -58,30 +55,6 @@ Storage::~Storage()
 
 }
 
-
-//________________________________________________________________________
-//	Get Decay
-//________________________________________________________________________
-IsotopicVector Storage::GetDecay(IsotopicVector isotopicvector, cSecond t)
-{
-
-	IsotopicVector IV;
-
-	map<ZAI ,double> isotopicquantity = isotopicvector.GetIsotopicQuantity();
-	map<ZAI ,double >::iterator it;
-	for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++)
-	{
-		if((*it).second > 0)
-		{
- 			IsotopicVector ivtmp = fDecayDataBase->Evolution(it->first, t) * (*it).second ;
-			IV += ivtmp;
-		}
-	}
-
-	return IV;
-
-}
-
 //________________________________________________________________________
 void Storage::ClearStock()
 {
-- 
GitLab