From cf71aaace6c044bc3a1c190bf31200dbc0ff59df Mon Sep 17 00:00:00 2001
From: marc ernoult <ernoult@ipno.in2p3.fr>
Date: Thu, 19 Jul 2018 17:07:57 +0200
Subject: [PATCH] Add warning when error change the total mass of fuel

---
 example/Example_MultiplicativeError.cxx | 2 +-
 source/src/Reactor.cxx                  | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/example/Example_MultiplicativeError.cxx b/example/Example_MultiplicativeError.cxx
index 3a68b5850..aab7c542a 100644
--- a/example/Example_MultiplicativeError.cxx
+++ b/example/Example_MultiplicativeError.cxx
@@ -106,7 +106,7 @@ int main(int argc, char** argv)
 	//##########################################################################################
 
 	int Std_output_level 	= 0;
-	int File_output_level 	= 0;
+	int File_output_level 	= 2;
 	CLASSLogger *Logger 	= new CLASSLogger("CLASS_OUTPUT.log",Std_output_level,File_output_level);
 
 	//##########################################################################################
diff --git a/source/src/Reactor.cxx b/source/src/Reactor.cxx
index fca30b948..b12af0d8c 100644
--- a/source/src/Reactor.cxx
+++ b/source/src/Reactor.cxx
@@ -542,7 +542,10 @@ void Reactor::Dump() {
     {
 			//here change fInsideIV
 			if(fIVMultiplicativeError.GetZAIQuantity()>0){
+				double MassOfIVbeforeError=fInsideIV.GetTotalMass();
 				fInsideIV=fInsideIV+fIVMultiplicativeError*fInsideIV-fIVMultiplicativeError_with1s*fInsideIV;
+				double MassOfIVafterError=fInsideIV.GetTotalMass();
+    			WARNING << " Taking into account multiplicative error on IV leaving the reactor lead to a change of the mass of the fuel :"<< MassOfIVafterError-MassOfIVbeforeError<<" tons"<< endl;		
 			}
       fOutBackEndFacility->AddIV(fInsideIV);
       AddCumulativeIVOut(fInsideIV);
@@ -553,7 +556,10 @@ void Reactor::Dump() {
   {
 			//here change fIVOutCycle
 		if(fIVMultiplicativeError.GetZAIQuantity()>0){
+			double MassOfIVbeforeError=fInsideIV.GetTotalMass();
 			fIVOutCycle=fIVOutCycle+fIVMultiplicativeError*fIVOutCycle-fIVMultiplicativeError_with1s*fIVOutCycle;
+			double MassOfIVafterError=fInsideIV.GetTotalMass();
+    		WARNING << " Taking into account multiplicative error on IV leaving the reactor lead to a change of the mass of the fuel :"<< MassOfIVafterError-MassOfIVbeforeError<<" tons"<< endl;		
 		}
     fOutBackEndFacility->AddIV(fIVOutCycle);
     AddCumulativeIVOut(fIVOutCycle);
@@ -564,7 +570,10 @@ void Reactor::Dump() {
   {
 		//here change fInsideIV
 		if(fIVMultiplicativeError.GetZAIQuantity()>0){
+			double MassOfIVbeforeError=fInsideIV.GetTotalMass();		
 			fInsideIV=fInsideIV+fIVMultiplicativeError*fInsideIV-fIVMultiplicativeError_with1s*fInsideIV;
+			double MassOfIVafterError=fInsideIV.GetTotalMass();
+   			WARNING << " Taking into account multiplicative error on IV leaving the reactor lead to a change of the mass of the fuel :"<< MassOfIVafterError-MassOfIVbeforeError<<" tons"<< endl;		
 		}
     fOutBackEndFacility->AddIV(fInsideIV);
     AddCumulativeIVOut(fInsideIV);
-- 
GitLab