From 971b788a7fed3cc5a3a7d1e7062b7640b44068b1 Mon Sep 17 00:00:00 2001
From: Baptiste LENIAU <baptiste.leniau@subatech.in2p3.fr>
Date: Wed, 29 Apr 2015 13:13:12 +0000
Subject: [PATCH] BuildFuel function rewritten . It is now much more simpler
 and quicker. CLASS execution time is reduce by a factor 2 !

git-svn-id: svn+ssh://svn.in2p3.fr/class@652 0e7d625b-0364-4367-a6be-d5be4a48d228
---
 source/trunk/include/EquivalenceModel.hxx | 46 +++++++++++------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/source/trunk/include/EquivalenceModel.hxx b/source/trunk/include/EquivalenceModel.hxx
index a6799b0ab..81e1ef904 100644
--- a/source/trunk/include/EquivalenceModel.hxx
+++ b/source/trunk/include/EquivalenceModel.hxx
@@ -72,11 +72,7 @@ class EquivalenceModel : public CLASSObject
 	 */
 	virtual	 vector<double> BuildFuel(double BurnUp, double HMMass, vector<IsotopicVector> FissilArray, vector<IsotopicVector> FertilArray );
 	//}
-	
-	virtual void GuessLambda(vector<double>& lambda,
-				 int FirstStockID, int LastStockID, double DeltaM,
-				 vector<IsotopicVector> Stocks, double  HMMass); //!< Guess a portion of IsotopicVectors to take (dichotomy)
-	
+		
 	//@}
 	
 	/*!
@@ -101,13 +97,8 @@ class EquivalenceModel : public CLASSObject
 	void SetRelativMassPrecision( double val)	{ fRelativMassPrecision = val; }	//!< Mass precision
 	void SetMaxInterration(int val)			{ fMaxInterration = val; }		//!< Max iterration in build fueld algorythm
 
-	
 	//@}
 	
-	
-	
-	
-	
 	protected :
 	
 	IsotopicVector fFertileList;	//!< contain the list of zai, needed as fertile, taken in a stock before fabrication
@@ -120,22 +111,31 @@ class EquivalenceModel : public CLASSObject
 	double fActualFissileContent;	//!< fissile content at the actual dichotomy step (usefull for EQM_MLP_Kinf)
 	
 	
-	
 	private :
-	
-	double fOld_Lambda_Tot_Minus;//!< The old (old iteration) guessed lambda_tot (guessed from GuessLambda)
-	double fOld_Lambda_Tot_Plus ;//!< The old (old iteration) guessed lambda_tot (guessed from GuessLambda)
-	double fLambda_max;		//!< Value calculated by FindLambdaMax
-	
-	double fRelativMassPrecision;	//!< Mass precision
-	int fMaxInterration;		//!< Max iterration in build fueld algorythm
-
-	
-
-	double FindLambdaMax( vector<IsotopicVector> Stocks, double  HMMass);	//!< Find the maximum LAMBDA_TOT of Stocks (ie lambda to reach HMass)
-	void SetLambda(vector<double>& lambda ,int FirstStockID, int LastStockID, double LAMBDA_TOT);	//!< Set individual lambda according to the LAMBDA_TOT (lambda of all stocks)
+	/*!
+	 \name Algorithm parameters
+	 */
+	//@{	
+	double 	fRelativMassPrecision;		//!< Mass precision
+	int 	fMaxInterration;			//!< Max iterration in build fueld algorythm
+	//@}
 
+	/*!
+	 \name Algorithm related functions for default BuildFuel function
+	 */
+	//@{
+	void 	SetLambda(vector<double>& lambda ,int FirstStockID, int LastStockID, double LAMBDA_TOT);	//!< Set individual lambda according to the LAMBDA_TOT (lambda of all stocks)
+	double 	LAMBDA_TOT_FOR(double MassNeeded, vector<IsotopicVector> StockArray, string FisOrFer);//!< Calculate the proportion of each stocks in StockArray to take in oder to get a mass of MassNeeded (can be Fer(fertile) or Fis(Fissile))
+	bool 	Build_Fuel_According_Lambda(vector<double> &lambda,vector<IsotopicVector> FissilArray, vector<IsotopicVector> FertilArray, double HMMass,IsotopicVector &Fissile, IsotopicVector &Fertile);
+	//@}
 
+	/*!
+	 \name Others 
+	 */
+	//@{
+	double fTotalFissileMassInStocks;//!< Total mass in fissile stocks
+	double fTotalFertileMassInStocks;//!< Total mass in fertile stocks
+	//@}
 };
 
 #endif
-- 
GitLab