From 48214cb681c8eabb38fabfd52d430e4718fd7324 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot <mouginot.baptiste@gmail.com> Date: Tue, 8 Jul 2014 11:38:43 +0000 Subject: [PATCH] LOG MANAGMENT : MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding CLASSLogger : ERROR << WARNING << INFO << … git-svn-id: svn+ssh://svn.in2p3.fr/class@308 0e7d625b-0364-4367-a6be-d5be4a48d228 --- .../branches/CLASSV3/include/CLASSBackEnd.hxx | 7 +- .../CLASSV3/include/CLASSFacility.hxx | 9 +- .../branches/CLASSV3/include/CLASSHeaders.hxx | 3 +- .../branches/CLASSV3/include/CLASSLogger.hxx | 182 +++++++++++++++++ .../branches/CLASSV3/include/CLASSObject.hxx | 21 +- .../CLASSV3/include/DecayDataBank.hxx | 10 +- .../CLASSV3/include/EQM_LIN_PWR_MOX.hxx | 2 +- .../CLASSV3/include/EquivalenceModel.hxx | 2 +- .../CLASSV3/include/EvolutionData.hxx | 14 +- .../CLASSV3/include/FabricationPlant.hxx | 9 +- source/branches/CLASSV3/include/IM_Matrix.hxx | 4 +- source/branches/CLASSV3/include/IM_RK4.hxx | 4 +- .../CLASSV3/include/IrradiationModel.hxx | 4 +- .../include/PWR_THPU_FabricationPlant.hxx | 4 +- .../include/PWR_THU_FabricationPlant.hxx | 4 +- source/branches/CLASSV3/include/Pool.hxx | 13 +- source/branches/CLASSV3/include/Reactor.hxx | 29 +-- source/branches/CLASSV3/include/Scenario.hxx | 8 +- source/branches/CLASSV3/include/Storage.hxx | 20 +- .../branches/CLASSV3/include/XSM_CLOSEST.hxx | 2 +- .../CLASSV3/include/XSM_MLP_PWR_MOX.hxx | 2 +- source/branches/CLASSV3/include/XSModel.hxx | 2 +- source/branches/CLASSV3/src/CLASSBackEnd.cxx | 6 +- source/branches/CLASSV3/src/CLASSFacility.cxx | 8 +- source/branches/CLASSV3/src/CLASSLogger.cxx | 114 +++++++++++ source/branches/CLASSV3/src/CLASSObject.cxx | 4 +- source/branches/CLASSV3/src/DecayDataBank.cxx | 27 ++- .../branches/CLASSV3/src/EQM_LIN_PWR_MOX.cxx | 19 +- .../branches/CLASSV3/src/EQM_MLP_PWR_MOX.cxx | 7 +- .../branches/CLASSV3/src/EQM_QUAD_PWR_MOX.cxx | 8 +- .../branches/CLASSV3/src/EquivalenceModel.cxx | 14 +- source/branches/CLASSV3/src/EvolutionData.cxx | 47 ++--- .../branches/CLASSV3/src/FabricationPlant.cxx | 38 ++-- source/branches/CLASSV3/src/IM_Matrix.cxx | 12 +- source/branches/CLASSV3/src/IM_RK4.cxx | 13 +- .../branches/CLASSV3/src/IrradiationModel.cxx | 83 +++----- .../branches/CLASSV3/src/IsotopicVector.cxx | 5 +- source/branches/CLASSV3/src/Makefile | 26 +-- source/branches/CLASSV3/src/Makefile_good | 4 +- .../CLASSV3/src/PWR_THPU_FabricationPlant.cxx | 28 +-- .../CLASSV3/src/PWR_THU_FabricationPlant.cxx | 31 +-- source/branches/CLASSV3/src/PhysicModels.cxx | 3 - source/branches/CLASSV3/src/Pool.cxx | 47 ++--- source/branches/CLASSV3/src/Reactor.cxx | 131 +++++------- source/branches/CLASSV3/src/Scenario.cxx | 192 ++++++------------ source/branches/CLASSV3/src/Storage.cxx | 30 +-- source/branches/CLASSV3/src/XSM_CLOSEST.cxx | 87 ++++---- .../branches/CLASSV3/src/XSM_MLP_PWR_MOX.cxx | 22 +- source/branches/CLASSV3/src/XSModel.cxx | 2 +- source/branches/CLASSV3/src/ZAIMass.cxx | 2 +- 50 files changed, 734 insertions(+), 631 deletions(-) create mode 100755 source/branches/CLASSV3/include/CLASSLogger.hxx create mode 100755 source/branches/CLASSV3/src/CLASSLogger.cxx diff --git a/source/branches/CLASSV3/include/CLASSBackEnd.hxx b/source/branches/CLASSV3/include/CLASSBackEnd.hxx index 22f93623a..6ca1a599a 100644 --- a/source/branches/CLASSV3/include/CLASSBackEnd.hxx +++ b/source/branches/CLASSV3/include/CLASSBackEnd.hxx @@ -39,8 +39,8 @@ class CLASSBackEnd : public CLASSFacility public : ///< Normal Constructor. CLASSBackEnd(int type = 0); - CLASSBackEnd(LogFile* log,int type = 0); - CLASSBackEnd(LogFile* log, cSecond cycletime, int type = 0); + CLASSBackEnd(CLASSLogger* log,int type = 0); + CLASSBackEnd(CLASSLogger* log, cSecond cycletime, int type = 0); //********* Get Method *********// /*! @@ -72,6 +72,9 @@ class CLASSBackEnd : public CLASSFacility virtual void SetIVArray(vector<IsotopicVector> ivarray) { fIVArray = ivarray; } //!< Set The isotopicVector Array virtual void SetOutBackEndFacility(CLASSBackEnd* befacility) { fOutBackEndFacility = befacility; fIsStorageType = true; } //! Set a Out Facility for the fuel + + using CLASSFacility::SetName; + //@} diff --git a/source/branches/CLASSV3/include/CLASSFacility.hxx b/source/branches/CLASSV3/include/CLASSFacility.hxx index 445518328..0aa316dda 100644 --- a/source/branches/CLASSV3/include/CLASSFacility.hxx +++ b/source/branches/CLASSV3/include/CLASSFacility.hxx @@ -41,10 +41,10 @@ class CLASSFacility : public CLASSObject public : ///< Normal Constructor. CLASSFacility(int type = 0); - CLASSFacility(LogFile* log, int type = 0); - CLASSFacility(LogFile* log, cSecond cycletime, int type = 0); - CLASSFacility(LogFile* log, cSecond creationtime, cSecond lifetime, int type = 0); - CLASSFacility(LogFile* log, cSecond startingtime, cSecond lifetime, cSecond cycletime, int type = 0); + CLASSFacility(CLASSLogger* log, int type = 0); + CLASSFacility(CLASSLogger* log, cSecond cycletime, int type = 0); + CLASSFacility(CLASSLogger* log, cSecond creationtime, cSecond lifetime, int type = 0); + CLASSFacility(CLASSLogger* log, cSecond startingtime, cSecond lifetime, cSecond cycletime, int type = 0); //********* Get Method *********// /*! @@ -81,6 +81,7 @@ public : /// \li 4 start/End of reactor cycle, /// \li 8 end of Cooling, /// \li 16 fuel Fabrication + using CLASSObject::SetName; void SetInsideIV(IsotopicVector isotopicvector) { fInsideIV = isotopicvector; } //!< Set the IV inside the Facility Core diff --git a/source/branches/CLASSV3/include/CLASSHeaders.hxx b/source/branches/CLASSV3/include/CLASSHeaders.hxx index 6d1a07642..9c322e2ee 100755 --- a/source/branches/CLASSV3/include/CLASSHeaders.hxx +++ b/source/branches/CLASSV3/include/CLASSHeaders.hxx @@ -13,7 +13,7 @@ #include "Storage.hxx" #include "IsotopicVector.hxx" #include "ZAI.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include "EvolutionData.hxx" #include "PhysicModels.hxx" @@ -21,5 +21,4 @@ #include "ZAIMass.hxx" - #endif diff --git a/source/branches/CLASSV3/include/CLASSLogger.hxx b/source/branches/CLASSV3/include/CLASSLogger.hxx new file mode 100755 index 000000000..c47c7d3f2 --- /dev/null +++ b/source/branches/CLASSV3/include/CLASSLogger.hxx @@ -0,0 +1,182 @@ +#ifndef _LOG_CLASS_ +#define _LOG_CLASS_ + + +/*! + \file + \brief Header file for CLASSLogger class. + + + @author BaM + @version 2.0 + */ + +#include <string> +#include <fstream> + +#include <iostream> +#include <cstring> +#include <sstream> +#include "stdlib.h" +using namespace std; + + +#ifndef __CINT__ + +#define ERROR if(fLog->GetMaxOutPutLVL() >= 0) fLog->E() << "!!!ERROR!!! " << "[" << __FILE__ << ":" << __FUNCTION__ << "]" +#define WARNING if(fLog->GetMaxOutPutLVL() >= 1) fLog->W() << "!!WARNING!! " << "[" << __FILE__ << ":" << __FUNCTION__ << "]" +#define INFO if(fLog->GetMaxOutPutLVL() >= 2) fLog->I() << "!!!!INFO!!! " << "[" << __FILE__ << "]" + +#define DBGL if(fLog->GetMaxOutPutLVL() >= 3) fLog->D() << __FILE__ << " : " << __LINE__ << " [" << __FUNCTION__ << "]" << endl; +#define DBGV(x) if(fLog->GetMaxOutPutLVL() >= 3) fLog->D() << __FILE__ << " : " << __LINE__ << " [" << __FUNCTION__ << "]" << endl; + +#else + +#define ERROR cout +#define INFO cout +#define WARNING cout +#define DBGL +#define DBGV(x) + + +#endif + + + +//-----------------------------------------------------------------------------// +/*! + Define a CLASSLogger. + The aim of this class is to centralize the all CLASS software message inside a file. + + + @author BaM + @version 2.0 + */ +//________________________________________________________________________ +#ifndef _LOGTYPE_CLASS +#define _LOGTYPE_CLASS + + + +class LogType +{ +public: + //********* Constructor/Destructor Method *********// + + /*! + \name Constructor/Desctructor + */ + //@{ + + + LogType(ostream &Log) { fLog = &Log; fLog2 = 0; } //!< Normal Constructor + + ~LogType() {} //!< Normal Destructor + + //@} + + //********* In/Out Method *********// + + /*! + \name In/Out + */ + //@{ + string GetCLASSLoggerName() const { return fCLASSLoggerName; } //!w return the CLASSLogger name + + LogType &operator<<(std::ostream& (*manip)(std::ostream &)) + { + manip( *(this->fLog) ); + if(fLog2) + manip( *(this->fLog2) ); + return *this; + } + + + template<typename T> + inline LogType& operator<<(T something) + { + *(this->fLog) << something; + if(fLog2) + *(this->fLog2) << something; + return *this; + } + + + void SetSecondOutput(ostream &log) {fLog2 = &log;} + + private : + + ostream *fLog; + ostream *fLog2; + + string fCLASSLoggerName; //!< Log File name +}; + + +#endif + + +#ifndef _CLASSLogger_CLASS +#define _CLASSLogger_CLASS + + + +class CLASSLogger +{ +public: + + //********* Constructor/Destructor Method *********// + + /*! + \name Constructor/Desctructor + */ + //@{ + + + CLASSLogger(string CLASSLoggerName = "CLASS_OUTPUT.log", int VerboseLvl = 0, int OutputLvl = 1 ); //!< Normal Constructor + + ~CLASSLogger(); //!< Normal Destructor + + //@} + + //********* In/Out Method *********// + + /*! + \name In/Out + */ + //@{ + string GetCLASSLoggerName() const { return fCLASSLoggerName; } //!w return the CLASSLogger name + int GetMaxOutPutLVL() const { return fMaxOutPutLVL; } + int GetVerboseLVL() const { return fVerboseLVL; } + + LogType E() {return *fError;} + LogType W() {return *fWarning;} + LogType D() {return *fDebug;} + LogType I() {return *fInfo;} + +//@} + + + + + private : + int fMaxOutPutLVL; + int fVerboseLVL; + + LogType* fError; + LogType* fInfo; + LogType* fWarning; + LogType* fDebug; + + ofstream fOutPutFile; + string fCLASSLoggerName; //!< Log File name +}; + +#endif + + + +#endif + + + diff --git a/source/branches/CLASSV3/include/CLASSObject.hxx b/source/branches/CLASSV3/include/CLASSObject.hxx index 90f2b039c..9f8217c57 100644 --- a/source/branches/CLASSV3/include/CLASSObject.hxx +++ b/source/branches/CLASSV3/include/CLASSObject.hxx @@ -15,7 +15,7 @@ #include <string> #include <fstream> -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include "TNamed.h" @@ -39,19 +39,24 @@ class CLASSObject : public TNamed public : ///< Normal Constructor. CLASSObject(); - CLASSObject(LogFile* log); + CLASSObject(CLASSLogger* log); + virtual CLASSObject* Clone() { return new CLASSObject(*this); } //!< Correct way to copy a CLASSObject in case of derivation - void SetLog(LogFile* log) { fLog = log; fIsLog = true; } //!< Set the LogFile + void SetLog(CLASSLogger* log) { fLog = log; fIsLog = true; } //!< Set the CLASSLogger + + CLASSLogger* GetLog() { return fLog; } //!< Return the Pointer to the Log + bool IsLog() { return fIsLog; } //!< reutrn true if a CLASSLogger is defined + + using TNamed::SetName; +protected : + CLASSLogger* fLog; //!< Pointer to the Log + - LogFile* GetLog() { return fLog; } //!< Return the Pointer to the Log - bool IsLog() { return fIsLog; } //!< reutrn true if a LogFile is defined - private : - LogFile* fLog; //!< Pointer to the Log - bool fIsLog; //!< Set at true if a LogFile are define + bool fIsLog; //!< Set at true if a CLASSLogger are define ClassDef(CLASSObject,0); }; diff --git a/source/branches/CLASSV3/include/DecayDataBank.hxx b/source/branches/CLASSV3/include/DecayDataBank.hxx index aae4df63c..fdef163ce 100644 --- a/source/branches/CLASSV3/include/DecayDataBank.hxx +++ b/source/branches/CLASSV3/include/DecayDataBank.hxx @@ -21,7 +21,7 @@ using namespace std; typedef long long int cSecond; class ZAI; -class LogFile; +class CLASSLogger; double ReactionRateWeightedDistance(IsotopicVector IV1, EvolutionData DB ); double ReactionRateWeightedDistance(EvolutionData DB, IsotopicVector IV1 ); @@ -60,13 +60,13 @@ class DecayDataBank : public CLASSObject //{ /// Special Constructor. /*! - Use to load a LogFile - \param LogFile LogFile used for the log... + Use to load a CLASSLogger + \param CLASSLogger CLASSLogger used for the log... \param DB_index_file path to the index file - \param setlog if the log are stored in the LogFile + \param setlog if the log are stored in the CLASSLogger \param olfreadmethod true if the old format of EvolutionData are used (ie without the key word such as Inv, XSFiss...) */ - DecayDataBank(LogFile* Log, string DB_index_file, bool setlog = true, bool olfreadmethod = true ); + DecayDataBank(CLASSLogger* Log, string DB_index_file, bool setlog = true, bool olfreadmethod = true ); //} //{ diff --git a/source/branches/CLASSV3/include/EQM_LIN_PWR_MOX.hxx b/source/branches/CLASSV3/include/EQM_LIN_PWR_MOX.hxx index ae84ae30b..e6faa430c 100644 --- a/source/branches/CLASSV3/include/EQM_LIN_PWR_MOX.hxx +++ b/source/branches/CLASSV3/include/EQM_LIN_PWR_MOX.hxx @@ -32,7 +32,7 @@ class EQM_LIN_PWR_MOX : public EquivalenceModel public : EQM_LIN_PWR_MOX(string WeightPath); - EQM_LIN_PWR_MOX(LogFile* log, string WeightPath); + EQM_LIN_PWR_MOX(CLASSLogger* log, string WeightPath); ~EQM_LIN_PWR_MOX(); vector<double> BuildFuel(double BurnUp, double HMMass, vector<IsotopicVector> FissilArray, vector<IsotopicVector> FertilArray ); diff --git a/source/branches/CLASSV3/include/EquivalenceModel.hxx b/source/branches/CLASSV3/include/EquivalenceModel.hxx index 88e25b139..9bd5dfd78 100644 --- a/source/branches/CLASSV3/include/EquivalenceModel.hxx +++ b/source/branches/CLASSV3/include/EquivalenceModel.hxx @@ -35,7 +35,7 @@ class EquivalenceModel : public CLASSObject public : EquivalenceModel(); - EquivalenceModel(LogFile* log); + EquivalenceModel(CLASSLogger* log); virtual ~EquivalenceModel(); diff --git a/source/branches/CLASSV3/include/EvolutionData.hxx b/source/branches/CLASSV3/include/EvolutionData.hxx index ec45b24a9..97fb8b8be 100755 --- a/source/branches/CLASSV3/include/EvolutionData.hxx +++ b/source/branches/CLASSV3/include/EvolutionData.hxx @@ -18,7 +18,7 @@ class TGraph; class EvolutionData; -class LogFile; +class CLASSLogger; using namespace std; typedef long long int cSecond; @@ -65,24 +65,24 @@ public : //{ - /// LogFile Constructor. + /// CLASSLogger Constructor. /*! - Use create an empty EvolutionData loading a LogFile - \param LogFile LogFile used for the log... + Use create an empty EvolutionData loading a CLASSLogger + \param CLASSLogger CLASSLogger used for the log... */ - EvolutionData(LogFile* Log); ///< Make a new Evolutive Product evolution + EvolutionData(CLASSLogger* Log); ///< Make a new Evolutive Product evolution //} //{ /// Special Constructor. /*! Make a new EvolutionData - \param Log LogFile used for the log... + \param Log CLASSLogger used for the log... \param DB_file path to the DataBase file \param oldread true if the oldmethod should be use to read the DatBase File \param zai set the ZAI if you want to add a stable nuclei. */ - EvolutionData(LogFile* Log, string DB_file, bool oldread = true, ZAI zai = ZAI(0,0,0) ); + EvolutionData(CLASSLogger* Log, string DB_file, bool oldread = true, ZAI zai = ZAI(0,0,0) ); //} diff --git a/source/branches/CLASSV3/include/FabricationPlant.hxx b/source/branches/CLASSV3/include/FabricationPlant.hxx index 0932af3fd..1411c7aac 100644 --- a/source/branches/CLASSV3/include/FabricationPlant.hxx +++ b/source/branches/CLASSV3/include/FabricationPlant.hxx @@ -18,7 +18,7 @@ #include "Scenario.hxx" #include "Storage.hxx" #include "Reactor.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include "ZAI.hxx" using namespace std; @@ -63,12 +63,12 @@ public : /// Special Constructor. /*! Make a new FabricationPlant evolution - \param LogFile LogFile used for the log... + \param CLASSLogger CLASSLogger used for the log... \param storage storage used to build the reprocessed fuel \param reusable storage used to store all separated material not used in the fabrication process \param fabricationtime duration of the fabrication process (2 years by default). */ - FabricationPlant(LogFile* log, double fabricationtime = 365.25*24*3600*2); + FabricationPlant(CLASSLogger* log, double fabricationtime = 365.25*24*3600*2); //} ~FabricationPlant(); ///< Normal Destructor. @@ -95,6 +95,9 @@ public : { fReactorNextStep.insert( pair<int,cSecond> (reactorid, (cSecond)creationtime-GetCycleTime() ) ); } //!< Add a new reactor void SetReUsableStorage(Storage* store) { fReUsable = store;} + + using CLASSFacility::SetName; + //@} diff --git a/source/branches/CLASSV3/include/IM_Matrix.hxx b/source/branches/CLASSV3/include/IM_Matrix.hxx index 3b14f64ae..5e107bb7c 100644 --- a/source/branches/CLASSV3/include/IM_Matrix.hxx +++ b/source/branches/CLASSV3/include/IM_Matrix.hxx @@ -17,7 +17,7 @@ using namespace std; -class LogFile; +class CLASSLogger; //-----------------------------------------------------------------------------// /*! @@ -38,7 +38,7 @@ class IM_Matrix : public IrradiationModel, DynamicalSystem public : IM_Matrix(); - IM_Matrix(LogFile* log); + IM_Matrix(CLASSLogger* log); diff --git a/source/branches/CLASSV3/include/IM_RK4.hxx b/source/branches/CLASSV3/include/IM_RK4.hxx index b41738a10..2a8f9a9a2 100644 --- a/source/branches/CLASSV3/include/IM_RK4.hxx +++ b/source/branches/CLASSV3/include/IM_RK4.hxx @@ -17,7 +17,7 @@ using namespace std; -class LogFile; +class CLASSLogger; //-----------------------------------------------------------------------------// /*! @@ -38,7 +38,7 @@ class IM_RK4 : public IrradiationModel, DynamicalSystem public : IM_RK4(); - IM_RK4(LogFile* Log); + IM_RK4(CLASSLogger* Log); diff --git a/source/branches/CLASSV3/include/IrradiationModel.hxx b/source/branches/CLASSV3/include/IrradiationModel.hxx index 4c28397a8..a3f726cec 100644 --- a/source/branches/CLASSV3/include/IrradiationModel.hxx +++ b/source/branches/CLASSV3/include/IrradiationModel.hxx @@ -25,7 +25,7 @@ using namespace std; typedef long long int cSecond; class ZAI; -class LogFile; +class CLASSLogger; //-----------------------------------------------------------------------------// /*! Define a IrradiationModel. @@ -46,7 +46,7 @@ class IrradiationModel : public CLASSObject IrradiationModel(); - IrradiationModel(LogFile* log); + IrradiationModel(CLASSLogger* log); /// virtueal method called to perform the irradiation calculation using a set of cross section. /*! diff --git a/source/branches/CLASSV3/include/PWR_THPU_FabricationPlant.hxx b/source/branches/CLASSV3/include/PWR_THPU_FabricationPlant.hxx index f0b357956..428e367a2 100644 --- a/source/branches/CLASSV3/include/PWR_THPU_FabricationPlant.hxx +++ b/source/branches/CLASSV3/include/PWR_THPU_FabricationPlant.hxx @@ -29,9 +29,9 @@ class PWR_THPU_FabricationPlant : public FabricationPlant //on a besoin de surcherger le constructeur que si public : PWR_THPU_FabricationPlant(); - PWR_THPU_FabricationPlant(LogFile* log); + PWR_THPU_FabricationPlant(CLASSLogger* log); - PWR_THPU_FabricationPlant(LogFile* log, Storage* storage, Storage* reusable, double fabricationtime = 365.25*24*3600*2); + PWR_THPU_FabricationPlant(CLASSLogger* log, Storage* storage, Storage* reusable, double fabricationtime = 365.25*24*3600*2); ///< Normal Destructor. ~PWR_THPU_FabricationPlant(); diff --git a/source/branches/CLASSV3/include/PWR_THU_FabricationPlant.hxx b/source/branches/CLASSV3/include/PWR_THU_FabricationPlant.hxx index 464a47354..2698854ab 100644 --- a/source/branches/CLASSV3/include/PWR_THU_FabricationPlant.hxx +++ b/source/branches/CLASSV3/include/PWR_THU_FabricationPlant.hxx @@ -30,9 +30,9 @@ class PWR_THU_FabricationPlant : public FabricationPlant //on a besoin de surcherger le constructeur que si public : PWR_THU_FabricationPlant(); - PWR_THU_FabricationPlant(LogFile* log); + PWR_THU_FabricationPlant(CLASSLogger* log); - PWR_THU_FabricationPlant(LogFile* log, Storage* storage, Storage* reusable, double fabricationtime = 365.25*24*3600*2); + PWR_THU_FabricationPlant(CLASSLogger* log, Storage* storage, Storage* reusable, double fabricationtime = 365.25*24*3600*2); ///< Normal Destructor. ~PWR_THU_FabricationPlant(); diff --git a/source/branches/CLASSV3/include/Pool.hxx b/source/branches/CLASSV3/include/Pool.hxx index 04bf4b402..20379177a 100755 --- a/source/branches/CLASSV3/include/Pool.hxx +++ b/source/branches/CLASSV3/include/Pool.hxx @@ -15,7 +15,7 @@ using namespace std; typedef long long int cSecond; class CLASSBackEnd; -class LogFile; +class CLASSLogger; class DecayDataBank; //-----------------------------------------------------------------------------// @@ -49,11 +49,11 @@ public : /// Special Constructor. /*! Make a new EvolutionData - \param Log LogFile used for the log... + \param Log CLASSLogger used for the log... \param abstime time to start the Pool \param coolingtime duration of the cooling. */ - Pool(LogFile* Log, cSecond coolingtime = 5*3600.*24.*365.25); //!< + Pool(CLASSLogger* Log, cSecond coolingtime = 5*3600.*24.*365.25); //!< //} @@ -61,12 +61,12 @@ public : /// Special Special Constructor. /*! Make a new EvolutionData - \param Log LogFile used for the log... + \param Log CLASSLogger used for the log... \param Storage storage which get the fuel after the cooling \param abstime time to start the Pool \param coolingtime duration of the cooling. */ - Pool(LogFile* log, CLASSBackEnd* Storage, + Pool(CLASSLogger* log, CLASSBackEnd* Storage, cSecond coolingtime = 5*3600.*24.*365.25); //!< //} @@ -94,6 +94,9 @@ public : void SetIVArray(vector<IsotopicVector> ivarray); //! not use there (Does nothing!!!) void SetIVArray(vector<IsotopicVector> ivarray, vector<cSecond> timearray); //!< Set The isotopicVector Array at the corresponding time + + using CLASSBackEnd::SetName; + //@} diff --git a/source/branches/CLASSV3/include/Reactor.hxx b/source/branches/CLASSV3/include/Reactor.hxx index cf61ff411..a9b8d9338 100755 --- a/source/branches/CLASSV3/include/Reactor.hxx +++ b/source/branches/CLASSV3/include/Reactor.hxx @@ -23,7 +23,7 @@ class EvolutionData; class PhysicModels; class FabricationPlant; class Storage; -class LogFile; +class CLASSLogger; //-----------------------------------------------------------------------------// /*! @@ -53,25 +53,25 @@ public : Reactor(); ///< Normal Constructor. //{ - /// LogFile Constructor. + /// CLASSLogger Constructor. /*! - Use create an empty Reactor loading a LogFile - \param LogFile LogFile used for the log... + Use create an empty Reactor loading a CLASSLogger + \param CLASSLogger CLASSLogger used for the log... */ - Reactor(LogFile* log); + Reactor(CLASSLogger* log); //} //{ /// Special Constructor for reprocessed fuel. /*! Make a new reactor - \param LogFile LogFile used for the log... + \param CLASSLogger CLASSLogger used for the log... \param fueltypeDB Databank describing the evolution of the fuel \param CLASSBAckEnd Pool used facility wich get the fuel after iradiation \param creationtime creation time \param lifetime working time duration. */ - Reactor(LogFile* log, PhysicModels* fueltypeDB, + Reactor(CLASSLogger* log, PhysicModels* fueltypeDB, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, cSecond creationtime , cSecond lifetime); //} @@ -80,7 +80,7 @@ public : /// Special Constructor for reprocessed fuel using cycletime and Burn-Up. /*! Make a new reactor - \param LogFile LogFile used for the log... + \param CLASSLogger CLASSLogger used for the log... \param fueltypeDB Databank describing the evolution of the fuel \param CLASSBAckEnd Pool used facility wich get the fuel after iradiation \param creationtime creation time @@ -89,7 +89,7 @@ public : \param HMMass Mass of Heavy Metal in the Reactor \param BurnUp Burnup reach by the fuel at the end of the cycle */ - Reactor(LogFile* log, PhysicModels* fueltypeDB, + Reactor(CLASSLogger* log, PhysicModels* fueltypeDB, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, cSecond creationtime , cSecond lifetime, cSecond cycletime, double HMMass, double BurnUp); @@ -99,7 +99,7 @@ public : /// Special Constructor for reprocessed fuel using Power and Burn-Up. /*! Make a new reactor - \param LogFile LogFile used for the log... + \param CLASSLogger CLASSLogger used for the log... \param fueltypeDB Databank describing the evolution of the fuel \param CLASSBAckEnd Pool used facility wich get the fuel after iradiation \param creationtime creation time @@ -109,7 +109,7 @@ public : \param BurnUp Burnup reach by the fuel at the end of the cycle \param ChargeFactor effective charge of the reactor. */ - Reactor(LogFile* log, PhysicModels* fueltypeDB, + Reactor(CLASSLogger* log, PhysicModels* fueltypeDB, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, cSecond creationtime , cSecond lifetime, double Power, double HMMass, double BurnUp, double ChargeFactor); @@ -119,7 +119,7 @@ public : /// Special Constructor for fixed fuel using Power and Burn-Up. /*! Make a new reactor - \param LogFile LogFile used for the log... + \param CLASSLogger CLASSLogger used for the log... \param evolutivedb EvolutionData describing the evolution of the fuel \param CLASSBAckEnd Pool used facility wich get the fuel after iradiation \param creationtime creation time @@ -129,7 +129,7 @@ public : \param BurnUp Burnup reach by the fuel at the end of the cycle \param ChargeFactor effective charge of the reactor. */ - Reactor(LogFile* log, EvolutionData evolutivedb, CLASSBackEnd* Pool, + Reactor(CLASSLogger* log, EvolutionData evolutivedb, CLASSBackEnd* Pool, cSecond creationtime, cSecond lifetime, double power, double HMMass, double BurnUp, double ChargeFactor = 1); //} @@ -215,6 +215,9 @@ public : void SetLoadingPlan(map<cSecond, pair<EvolutionData, double> > loadingplan) { fLoadingPlan = loadingplan; fNextPlan = fLoadingPlan.begin(); } //!< Set a LaodingPlan to change the Fuel after some cycle + + using CLASSFacility::SetName; + //@} diff --git a/source/branches/CLASSV3/include/Scenario.hxx b/source/branches/CLASSV3/include/Scenario.hxx index b3ebff30a..ed5b57bdc 100755 --- a/source/branches/CLASSV3/include/Scenario.hxx +++ b/source/branches/CLASSV3/include/Scenario.hxx @@ -54,14 +54,14 @@ public : - Scenario(LogFile* Log); ///< Log Constructor. + Scenario(CLASSLogger* Log= new CLASSLogger(), cSecond abstime = 0); ///< Log Constructor. /*! - Use to load a LogFile - \param LogFile: LogFile used for the log... + Use to load a CLASSLogger + \param CLASSLogger: CLASSLogger used for the log... */ - Scenario(double abstime); ///< Time Constructor. + Scenario(cSecond abstime, CLASSLogger* log = new CLASSLogger()); ///< Time Constructor. /*! Use to set the starting time of the Parc \param abstime: Starting time of the Parc in second diff --git a/source/branches/CLASSV3/include/Storage.hxx b/source/branches/CLASSV3/include/Storage.hxx index 6382a548d..60388f9da 100644 --- a/source/branches/CLASSV3/include/Storage.hxx +++ b/source/branches/CLASSV3/include/Storage.hxx @@ -16,7 +16,7 @@ using namespace std; typedef long long int cSecond; -class LogFile; +class CLASSLogger; class DecayDataBank; //-----------------------------------------------------------------------------// @@ -46,12 +46,12 @@ public : Storage(); ///< Normal Constructor. //{ - /// LogFile Constructor. + /// CLASSLogger Constructor. /*! - Use create an empty Stotarage loading a LogFile - \param LogFile LogFile used for the log... + Use create an empty Stotarage loading a CLASSLogger + \param CLASSLogger CLASSLogger used for the log... */ - Storage(LogFile* log); + Storage(CLASSLogger* log); //} @@ -59,10 +59,10 @@ public : /// Special Constructor. /*! Make a new reactor - \param LogFile LogFile used for the log... + \param CLASSLogger CLASSLogger used for the log... \param evolutivedb DataBank for decay management */ - Storage(LogFile* log, DecayDataBank* evolutivedb); + Storage(CLASSLogger* log, DecayDataBank* evolutivedb); //} @@ -79,6 +79,10 @@ public : \name Set Method */ //@{ + + using CLASSBackEnd::SetName; + using CLASSBackEnd::SetIsStorageType; + //@} @@ -135,7 +139,7 @@ public : /// Write the Isotope composition of all IsotopicVector stored. /*! Make a new reactor - \param filenam LogFile used for the log... + \param filenam CLASSLogger used for the log... \param data only use to srite a date in the file, theyr is not treatment of the date in this method.... */ void Write(string filename,cSecond date = -1); diff --git a/source/branches/CLASSV3/include/XSM_CLOSEST.hxx b/source/branches/CLASSV3/include/XSM_CLOSEST.hxx index a4381a9f7..b6e1666c6 100644 --- a/source/branches/CLASSV3/include/XSM_CLOSEST.hxx +++ b/source/branches/CLASSV3/include/XSM_CLOSEST.hxx @@ -43,7 +43,7 @@ public : */ //@{ - XSM_CLOSEST(LogFile* Log, string DB_index_file, bool oldreadmethod = true ); + XSM_CLOSEST(CLASSLogger* Log, string DB_index_file, bool oldreadmethod = true ); ~XSM_CLOSEST(); //{ diff --git a/source/branches/CLASSV3/include/XSM_MLP_PWR_MOX.hxx b/source/branches/CLASSV3/include/XSM_MLP_PWR_MOX.hxx index cb0c11a38..34c1e730a 100644 --- a/source/branches/CLASSV3/include/XSM_MLP_PWR_MOX.hxx +++ b/source/branches/CLASSV3/include/XSM_MLP_PWR_MOX.hxx @@ -42,7 +42,7 @@ public : */ //@{ - XSM_MLP_PWR_MOX(LogFile* Log,string TMVA_Weight_Directory,string InformationFile="",bool IsTimeStep=true); + XSM_MLP_PWR_MOX(CLASSLogger* Log,string TMVA_Weight_Directory,string InformationFile="",bool IsTimeStep=true); ~XSM_MLP_PWR_MOX(); //{ diff --git a/source/branches/CLASSV3/include/XSModel.hxx b/source/branches/CLASSV3/include/XSModel.hxx index 607a19c8b..3e8fbf15b 100644 --- a/source/branches/CLASSV3/include/XSModel.hxx +++ b/source/branches/CLASSV3/include/XSModel.hxx @@ -43,7 +43,7 @@ class XSModel : public CLASSObject public : XSModel(); - XSModel(LogFile* log); + XSModel(CLASSLogger* log); virtual EvolutionData GetCrossSections(IsotopicVector IV,double t=0) {return 0;} diff --git a/source/branches/CLASSV3/src/CLASSBackEnd.cxx b/source/branches/CLASSV3/src/CLASSBackEnd.cxx index 359f57a2d..2f347d704 100644 --- a/source/branches/CLASSV3/src/CLASSBackEnd.cxx +++ b/source/branches/CLASSV3/src/CLASSBackEnd.cxx @@ -2,7 +2,7 @@ #include "DecayDataBank.hxx" #include "Scenario.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include <sstream> @@ -26,13 +26,13 @@ CLASSBackEnd::CLASSBackEnd(int type):CLASSFacility(type) fDecayDataBase = 0; } -CLASSBackEnd::CLASSBackEnd(LogFile* log, int type):CLASSFacility(log, type) +CLASSBackEnd::CLASSBackEnd(CLASSLogger* log, int type):CLASSFacility(log, type) { fDecayDataBase = 0; } -CLASSBackEnd::CLASSBackEnd(LogFile* log, cSecond cycletime, int type):CLASSFacility(log, cycletime, type) +CLASSBackEnd::CLASSBackEnd(CLASSLogger* log, cSecond cycletime, int type):CLASSFacility(log, cycletime, type) { fDecayDataBase = 0; } diff --git a/source/branches/CLASSV3/src/CLASSFacility.cxx b/source/branches/CLASSV3/src/CLASSFacility.cxx index 6af195a65..bf110feac 100644 --- a/source/branches/CLASSV3/src/CLASSFacility.cxx +++ b/source/branches/CLASSV3/src/CLASSFacility.cxx @@ -28,7 +28,7 @@ CLASSFacility::CLASSFacility(int type):CLASSObject() fCycleTime = -1; } -CLASSFacility::CLASSFacility(LogFile* log, int type):CLASSObject(log) +CLASSFacility::CLASSFacility(CLASSLogger* log, int type):CLASSObject(log) { fParc = 0; @@ -40,7 +40,7 @@ CLASSFacility::CLASSFacility(LogFile* log, int type):CLASSObject(log) } -CLASSFacility::CLASSFacility(LogFile* log, cSecond cycletime, int type):CLASSObject(log) +CLASSFacility::CLASSFacility(CLASSLogger* log, cSecond cycletime, int type):CLASSObject(log) { fParc = 0; @@ -51,7 +51,7 @@ CLASSFacility::CLASSFacility(LogFile* log, cSecond cycletime, int type):CLASSObj fCycleTime = cycletime; } -CLASSFacility::CLASSFacility(LogFile* log, cSecond creationtime, cSecond lifetime, int type):CLASSObject(log) +CLASSFacility::CLASSFacility(CLASSLogger* log, cSecond creationtime, cSecond lifetime, int type):CLASSObject(log) { fParc = 0; @@ -64,7 +64,7 @@ CLASSFacility::CLASSFacility(LogFile* log, cSecond creationtime, cSecond lifetim fLifeTime = lifetime; } -CLASSFacility::CLASSFacility(LogFile* log, cSecond creationtime, cSecond lifetime, cSecond cycletime, int type):CLASSObject(log) +CLASSFacility::CLASSFacility(CLASSLogger* log, cSecond creationtime, cSecond lifetime, cSecond cycletime, int type):CLASSObject(log) { fParc = 0; diff --git a/source/branches/CLASSV3/src/CLASSLogger.cxx b/source/branches/CLASSV3/src/CLASSLogger.cxx new file mode 100755 index 000000000..7ea892371 --- /dev/null +++ b/source/branches/CLASSV3/src/CLASSLogger.cxx @@ -0,0 +1,114 @@ + +#include "CLASSLogger.hxx" + +#include <iostream> +#include <ostream> +#include <algorithm> +using namespace std; + +//________________________________________________________________________ +// +// CLASSLogger +// +// +// +// +//________________________________________________________________________ + +CLASSLogger::CLASSLogger(string CLASSLoggerName, int VerboseLvl, int OutputLvl ) +{ + fCLASSLoggerName = CLASSLoggerName; + fOutPutFile.open(CLASSLoggerName.c_str()); + fVerboseLVL = VerboseLvl; + if(!fOutPutFile) + { + cout << "Could not open the CLASSLogger: " << CLASSLoggerName << " !" << endl; + exit(-1); + } + else + cout << "CLASSLogger: " << CLASSLoggerName << " opened." << endl; + fError = 0; + fWarning = 0; + fDebug = 0; + fInfo = 0; + + if (VerboseLvl <= OutputLvl) + fMaxOutPutLVL = OutputLvl; + else + fMaxOutPutLVL = VerboseLvl; + + if(VerboseLvl >= 0) + { + if (!fError) + fError = new LogType(std::cout); + else + fError->SetSecondOutput(std::cout); + } + + if(VerboseLvl >= 1) + { + if (!fWarning) + fWarning = new LogType(std::cout); + else + fWarning->SetSecondOutput(std::cout); + } + if(VerboseLvl >= 2) + { + if (!fInfo) + fInfo = new LogType(std::cout); + else + fInfo->SetSecondOutput(std::cout); + } + if(VerboseLvl >= 3) + { + if (!fDebug) + fDebug = new LogType(std::cout); + else + fDebug->SetSecondOutput(std::cout); + } + + + if(OutputLvl >= 0) + { + if (!fError) + fError = new LogType(fOutPutFile); + else + fError->SetSecondOutput(fOutPutFile); + } + if(OutputLvl >= 1) + { + if (!fWarning) + fWarning = new LogType(fOutPutFile); + else + fWarning->SetSecondOutput(fOutPutFile); + } + if(OutputLvl >= 2) + { + if (!fInfo) + fInfo = new LogType(fOutPutFile); + else + fInfo->SetSecondOutput(fOutPutFile); + } + if(OutputLvl >= 3) + { + if (!fDebug) + fDebug = new LogType(fOutPutFile); + else + fDebug->SetSecondOutput(fOutPutFile); + } + + + +} + +//________________________________________________________________________ +CLASSLogger::~CLASSLogger() +{ + + fOutPutFile.close(); + +} + + + + diff --git a/source/branches/CLASSV3/src/CLASSObject.cxx b/source/branches/CLASSV3/src/CLASSObject.cxx index 6e3781a03..2fbface2c 100644 --- a/source/branches/CLASSV3/src/CLASSObject.cxx +++ b/source/branches/CLASSV3/src/CLASSObject.cxx @@ -1,6 +1,6 @@ #include "CLASSObject.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" using namespace std; @@ -21,7 +21,7 @@ CLASSObject::CLASSObject() fIsLog = false; } -CLASSObject::CLASSObject(LogFile* log) +CLASSObject::CLASSObject(CLASSLogger* log) { SetLog(log); } \ No newline at end of file diff --git a/source/branches/CLASSV3/src/DecayDataBank.cxx b/source/branches/CLASSV3/src/DecayDataBank.cxx index 8e1ef583b..64172f423 100644 --- a/source/branches/CLASSV3/src/DecayDataBank.cxx +++ b/source/branches/CLASSV3/src/DecayDataBank.cxx @@ -1,7 +1,7 @@ #include "DecayDataBank.hxx" #include "IsotopicVector.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include "StringLine.hxx" #include <TGraph.h> @@ -35,7 +35,7 @@ DecayDataBank::DecayDataBank():CLASSObject() //________________________________________________________________________ //________________________________________________________________________ -DecayDataBank::DecayDataBank(LogFile* Log, string DB_index_file, bool setlog, bool olfreadmethod) +DecayDataBank::DecayDataBank(CLASSLogger* Log, string DB_index_file, bool setlog, bool olfreadmethod) { SetLog(Log); @@ -46,11 +46,8 @@ DecayDataBank::DecayDataBank(LogFile* Log, string DB_index_file, bool setlog, bo // Warning if(IsLog()) { - cout << "!!INFO!! !!!DecayDataBank!!! A EvolutionData has been define :" << endl; - cout << "\t His index is : \"" << DB_index_file << "\"" << endl << endl; - - GetLog()->fLog << "!!INFO!! !!!DecayDataBank!!! A EvolutionData has been define :" << endl; - GetLog()->fLog << "\t His index is : \"" << DB_index_file << "\"" << endl << endl; + INFO << " A EvolutionData has been define :" << endl; + INFO << "\t His index is : \"" << DB_index_file << "\"" << endl << endl; } } @@ -64,7 +61,7 @@ DecayDataBank::~DecayDataBank() //________________________________________________________________________ IsotopicVector DecayDataBank::Evolution(const ZAI& zai, double dt) { - +DBGL IsotopicVector returnIV; map<ZAI ,EvolutionData >::iterator it = fDecayDataBank.find(zai); @@ -74,8 +71,7 @@ IsotopicVector DecayDataBank::Evolution(const ZAI& zai, double dt) ifstream DB_index(fDataBaseIndex.c_str()); if( !DB_index) { - cout << "!!!EVOLUTIVE DB!!!! Can't open \"" << fDataBaseIndex << "\"" << endl; - GetLog()->fLog << "!!!EVOLUTIVE DB!!!! Can't open \"" << fDataBaseIndex << "\"" << endl; + ERROR << " Can't open \"" << fDataBaseIndex << "\"" << endl; exit (1); } bool zaifind = false; @@ -107,8 +103,8 @@ IsotopicVector DecayDataBank::Evolution(const ZAI& zai, double dt) if(!zaifind) { - GetLog()->fLog << "!!Warning!! !!!EVOLUTIVE DB!!! Oups... Can't Find the ZAI : " ; - GetLog()->fLog << zai.Z() << " " << zai.A() << " " << zai.I() << "!!! It will be considered as stable !!" << endl; + WARNING << " Oups... Can't Find the ZAI : " + << zai.Z() << " " << zai.A() << " " << zai.I() << "!!! It will be considered as stable !!" << endl; EvolutionData evolutionproduct = EvolutionData(GetLog()," " , false, zai); {fDecayDataBank.insert( pair<ZAI, EvolutionData >(zai, evolutionproduct) );} @@ -120,7 +116,8 @@ IsotopicVector DecayDataBank::Evolution(const ZAI& zai, double dt) } else returnIV = (*it).second.GetIsotopicVectorAt(dt); - + +DBGL return returnIV; } @@ -142,7 +139,7 @@ bool DecayDataBank::IsDefine(const ZAI& zai) const //________________________________________________________________________ IsotopicVector DecayDataBank::GetDecay(IsotopicVector isotopicvector, cSecond t) { - +DBGL IsotopicVector IV; map<ZAI ,double> isotopicquantity = isotopicvector.GetIsotopicQuantity(); @@ -156,8 +153,8 @@ IsotopicVector DecayDataBank::GetDecay(IsotopicVector isotopicvector, cSecond t) } } +DBGL return IV; - } //________________________________________________________________________ //________________________________________________________________________ diff --git a/source/branches/CLASSV3/src/EQM_LIN_PWR_MOX.cxx b/source/branches/CLASSV3/src/EQM_LIN_PWR_MOX.cxx index f243a91e5..11201cefe 100644 --- a/source/branches/CLASSV3/src/EQM_LIN_PWR_MOX.cxx +++ b/source/branches/CLASSV3/src/EQM_LIN_PWR_MOX.cxx @@ -5,7 +5,7 @@ #include <vector> #include "StringLine.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include "IsotopicVector.hxx" @@ -16,7 +16,7 @@ EQM_LIN_PWR_MOX::EQM_LIN_PWR_MOX(string WeightPath):EquivalenceModel() ifstream DataDB(fWeightPath.c_str()); // Open the File if(!DataDB) - cout << "!!Warning!! !!!EQM QUAD PWR MOX!!! \n Can't open \"" << fWeightPath << "\"\n" << endl; + WARNING << "Can't open \"" << fWeightPath << "\"\n" << endl; string line; int start = 0; // First Get Fuel Parameter @@ -24,13 +24,13 @@ EQM_LIN_PWR_MOX::EQM_LIN_PWR_MOX(string WeightPath):EquivalenceModel() if( StringLine::NextWord(line, start, ' ') != "PARAM") { - cout << "!!Bad Trouble!! !!!EQM QUAD PWR MOX!!! Bad Database file : " << fWeightPath << " Can't find the Parameter of the DataBase"<< endl; + ERROR << " Bad Database file : " << fWeightPath << " Can't find the Parameter of the DataBase " << endl; exit (1); } while(start < (int)line.size()) fFuelParameter.push_back(atof(StringLine::NextWord(line, start, ' ').c_str())); - cout << "!!INFO!! !!!EQM QUAD PWR MOX!!! " << fFuelParameter.size() << " have been read"<< endl; + INFO << fFuelParameter.size() << " have been read " << endl; @@ -62,13 +62,13 @@ EQM_LIN_PWR_MOX::EQM_LIN_PWR_MOX(string WeightPath):EquivalenceModel() } -EQM_LIN_PWR_MOX::EQM_LIN_PWR_MOX(LogFile* log, string WeightPath):EquivalenceModel(log) +EQM_LIN_PWR_MOX::EQM_LIN_PWR_MOX(CLASSLogger* log, string WeightPath):EquivalenceModel(log) { fWeightPath = WeightPath; ifstream DataDB(fWeightPath.c_str()); // Open the File if(!DataDB) - cout << "!!Warning!! !!!EQM QUAD PWR MOX!!! \n Can't open \"" << fWeightPath << "\"\n" << endl; + WARNING << " Can't open \"" << fWeightPath << "\"\n" << endl; string line; int start = 0; // First Get Fuel Parameter @@ -76,13 +76,13 @@ EQM_LIN_PWR_MOX::EQM_LIN_PWR_MOX(LogFile* log, string WeightPath):EquivalenceMod if( StringLine::NextWord(line, start, ' ') != "PARAM") { - cout << "!!Bad Trouble!! !!!EQM QUAD PWR MOX!!! Bad Database file : " << fWeightPath << " Can't find the Parameter of the DataBase"<< endl; + ERROR << " Bad Database file : " << fWeightPath << " Can't find the Parameter of the DataBase"<< endl; exit (1); } while(start < (int)line.size()) fFuelParameter.push_back(atof(StringLine::NextWord(line, start, ' ').c_str())); - cout << "!!INFO!! !!!EQM QUAD PWR MOX!!! " << fFuelParameter.size() << " have been read"<< endl; + INFO << fFuelParameter.size() << " have been read"<< endl; @@ -222,8 +222,7 @@ vector<double> EQM_LIN_PWR_MOX::BuildFuel(double BurnUp, double HMMass,vector<Is if(StockFactionToUse < 0) { - cout << "!!Bad Trouble!! !!!FabricationPlant!!! Oups Bug in calculating stock fraction to use "<< endl; - //GetLog()->fLog << "!!Bad Trouble!! !!!FabricationPlant!!! Oups Bug in calculating stock fraction to use" << endl; + WARNING << "!!!FabricationPlant!!! Oups Bug in calculating stock fraction to use "<< endl; lambda[N_FissilStock_OnCheck] = 0.; N_FissilStock_OnCheck++; FuelBuild = false; diff --git a/source/branches/CLASSV3/src/EQM_MLP_PWR_MOX.cxx b/source/branches/CLASSV3/src/EQM_MLP_PWR_MOX.cxx index c3d0d1f1a..04976d236 100644 --- a/source/branches/CLASSV3/src/EQM_MLP_PWR_MOX.cxx +++ b/source/branches/CLASSV3/src/EQM_MLP_PWR_MOX.cxx @@ -1,6 +1,6 @@ #include "EquivalenceModel.hxx" #include "EQM_MLP_PWR_MOX.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include "StringLine.hxx" #include <string> @@ -16,8 +16,6 @@ #include "TMVA/MethodCuts.h" -#include "CLASSHeaders.hxx" - //________________________________________________________________________ // // EQM_MLP_MOX @@ -100,8 +98,7 @@ TTree* EQM_MLP_MOX::CreateTMVAInputTree(IsotopicVector Fissil,IsotopicVector Fer //cout<<"BU "<<BU<<" U5_enrichment "<<U5_enrichment<<endl; if(Pu8 + Pu9 + Pu10 + Pu11 + Pu12 + Am1 > 1.00001 )//?????1.00001??? I don't know it! goes in condition if =1 !! may be float/double issue ... { - cout<<"!!!!!!!!!!!ERRORR!!!!!!!!!!!!"<<endl; - cout<<Pu8<<" "<<Pu9<<" "<<Pu10<<" "<<Pu11<<" "<<Pu12<<" "<<Am1<<endl; + ERROR << Pu8 << " " << Pu9 << " " << Pu10 << " " << Pu11 << " " << Pu12 << " " << Am1 << endl; exit(0); } // All value are molar (!weight) diff --git a/source/branches/CLASSV3/src/EQM_QUAD_PWR_MOX.cxx b/source/branches/CLASSV3/src/EQM_QUAD_PWR_MOX.cxx index aba54ecba..70bb8fd43 100644 --- a/source/branches/CLASSV3/src/EQM_QUAD_PWR_MOX.cxx +++ b/source/branches/CLASSV3/src/EQM_QUAD_PWR_MOX.cxx @@ -3,7 +3,7 @@ #include <vector> #include "StringLine.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" @@ -14,7 +14,7 @@ EQM_QUAD_PWR_MOX::EQM_QUAD_PWR_MOX(string WeightPath):EquivalenceModel() ifstream DataDB(fWeightPath.c_str()); // Open the File if(!DataDB) - cout << "!!Warning!! !!!EQM QUAD PWR MOX!!! \n Can't open \"" << fWeightPath << "\"\n" << endl; + WARNING << " Can't open \"" << fWeightPath << "\"" << endl; string line; int start = 0; // First Get Fuel Parameter @@ -22,13 +22,13 @@ EQM_QUAD_PWR_MOX::EQM_QUAD_PWR_MOX(string WeightPath):EquivalenceModel() if( StringLine::NextWord(line, start, ' ') != "PARAM") { - cout << "!!Bad Trouble!! !!!EQM QUAD PWR MOX!!! Bad Database file : " << fWeightPath << " Can't find the Parameter of the DataBase"<< endl; + ERROR << "Bad Database file : " << fWeightPath << " Can't find the Parameter of the DataBase " << endl; exit (1); } while(start < (int)line.size()) fFuelParameter.push_back(atof(StringLine::NextWord(line, start, ' ').c_str())); - cout << "!!INFO!! !!!EQM QUAD PWR MOX!!! " << fFuelParameter.size() << " have been read"<< endl; + INFO << fFuelParameter.size() << " have been read " << endl; ZAI U8(92,238,0); diff --git a/source/branches/CLASSV3/src/EquivalenceModel.cxx b/source/branches/CLASSV3/src/EquivalenceModel.cxx index 6fb06a732..4da148d5f 100644 --- a/source/branches/CLASSV3/src/EquivalenceModel.cxx +++ b/source/branches/CLASSV3/src/EquivalenceModel.cxx @@ -10,7 +10,7 @@ EquivalenceModel::EquivalenceModel():CLASSObject() } -EquivalenceModel::EquivalenceModel(LogFile* log):CLASSObject(log) +EquivalenceModel::EquivalenceModel(CLASSLogger* log):CLASSObject(log) { } @@ -89,6 +89,14 @@ vector<double> EquivalenceModel::BuildFuel(double BurnUp, double HMMass,vector<I } AvailableFertilMass=Fertile.GetTotalMass() * 1e6; //in grams + if( j+1 == int( FertilArray.size() ) && FertilMassNeeded > AvailableFertilMass ) //if this is the last stock and it's not enought + { + WARNING <<"You requiere more depleted uranium "<<"("<<DeltaM/1e6<<" t needed) ! Reactor not fill"<<endl; + for(int i=0 ; i<int(lambda.size()) ; i++) + lambda[i]=0; + break; + } + } //cout<<"********FERTILE OK**********"<<endl; /*Calcul the quantity of this composition needed to reach the burnup*/ @@ -113,7 +121,7 @@ void EquivalenceModel::SetLambda(vector<double>& lambda ,int FirstStockID, int L { if(LAMBDA_TOT > LastStockID - FirstStockID + 1 ) { - cout<<"EquivalenceModel::SetLambda FATAL ERROR"<<endl; + ERROR << " FATAL ERROR " <<endl; exit(0); } @@ -246,7 +254,7 @@ void EquivalenceModel::FindLambdaMax(int FirstStockID, int LastStockID, vector<I ID_max++ ; if( ID_max >=(int) Stocks.size()) { - cout<<"EquivalenceModel::FindLambdaMax FATAL ERROR BLG codes like shit"<<endl; + ERROR << " FATAL ERROR BLG codes like shit " << endl; exit(0); } } diff --git a/source/branches/CLASSV3/src/EvolutionData.cxx b/source/branches/CLASSV3/src/EvolutionData.cxx index c6cbbd0ca..e63fda7ea 100755 --- a/source/branches/CLASSV3/src/EvolutionData.cxx +++ b/source/branches/CLASSV3/src/EvolutionData.cxx @@ -1,6 +1,6 @@ #include "EvolutionData.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include "CLASSConstante.hxx" #include "StringLine.hxx" @@ -353,7 +353,7 @@ EvolutionData::EvolutionData():CLASSObject() } //________________________________________________________________________ -EvolutionData::EvolutionData(LogFile* Log) +EvolutionData::EvolutionData(CLASSLogger* Log) { SetLog(Log); @@ -367,7 +367,7 @@ EvolutionData::EvolutionData(LogFile* Log) } //________________________________________________________________________ -EvolutionData::EvolutionData(LogFile* Log, string DB_file, bool oldread, ZAI zai) +EvolutionData::EvolutionData(CLASSLogger* Log, string DB_file, bool oldread, ZAI zai) { SetLog(Log); @@ -533,8 +533,7 @@ double EvolutionData::GetXSForAt(double t, ZAI zai, int ReactionId) break; case 3: XSEvol = Getn2nXS(); break; - default:cout << "!!Error!! !!!EvolutionData!!! \n Wrong ReactionId !!" << endl; - GetLog()->fLog << "!!Error!! !!!EvolutionData!!! \n Wrong ReactionId !!" << endl; + default:ERROR << "!!Error!! !!!EvolutionData!!! \n Wrong ReactionId !!" << endl; exit(1); } @@ -580,8 +579,7 @@ void EvolutionData::ReadDB(string DBfile, bool oldread) ifstream DecayDB(DBfile.c_str()); // Open the File if(!DecayDB) //check if file is correctly open { - cout << "!!Warning!! !!!EvolutionData!!! \n Can't open \"" << DBfile << "\"\n" << endl; - GetLog()->fLog << "!!Warning!! !!!EvolutionData!!! \n Can't open \"" << DBfile << "\"\n" << endl; + INFO << "!!Warning!! !!!EvolutionData!!! \n Can't open \"" << DBfile << "\"\n" << endl; } vector<double> vTime; @@ -591,10 +589,8 @@ void EvolutionData::ReadDB(string DBfile, bool oldread) getline(DecayDB, line); if( tlc(StringLine::NextWord(line, start, ' ')) != "time") { - cout << "!!Bad Trouble!! !!!EvolutionData!!! Bad Database file : " << DBfile << endl; - cout << "!!Bad Trouble!! !!!EvolutionData!!! The first Line MUST be the time line !!!" << endl; - GetLog()->fLog << "!!Bad Trouble!! !!!EvolutionData!!! Bad Database file : " << DBfile << endl; - GetLog()->fLog << "!!Bad Trouble!! !!!EvolutionData!!! The first Line MUST be the time line !!!" << endl; + ERROR << "!!Bad Trouble!! !!!EvolutionData!!! Bad Database file : " << DBfile << endl; + ERROR << "!!Bad Trouble!! !!!EvolutionData!!! The first Line MUST be the time line !!!" << endl; exit (1); } @@ -688,8 +684,7 @@ void EvolutionData::ReadKeff(string line, double* time, int NTimeStep) int start = 0; if( tlc(StringLine::NextWord(line, start, ' ')) != "keff" ) // Check the keyword { - cout << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"keff\" not found !" << endl; - GetLog()->fLog << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"keff\" not found !" << endl; + ERROR << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"keff\" not found !" << endl; exit(1); } @@ -721,8 +716,7 @@ void EvolutionData::ReadFlux(string line, double* time, int NTimeStep) if( tlc(StringLine::NextWord(line, start, ' ')) != "flux" ) // Check the keyword { - cout << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"flux\" not found !" << endl; - GetLog()->fLog << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"flux\" not found !" << endl; + ERROR << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"flux\" not found !" << endl; exit(1); } @@ -750,8 +744,7 @@ void EvolutionData::ReadInv(string line, double* time, int NTimeStep) int start = 0; if( tlc(StringLine::NextWord(line, start, ' ')) != "inv" ) // Check the keyword { - cout << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"inv\" not found !" << endl; - GetLog()->fLog << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"inv\" not found !" << endl; + ERROR << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"inv\" not found !" << endl; exit(1); } // Read the Z A I @@ -784,8 +777,7 @@ void EvolutionData::ReadXSFis(string line, double* time, int NTimeStep) int start = 0; if( tlc(StringLine::NextWord(line, start, ' ')) != "xsfis" ) // Check the keyword { - cout << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"xsfis\" not found !" << endl; - GetLog()->fLog << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"xsfis\" not found !" << endl; + ERROR << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"xsfis\" not found !" << endl; exit(1); } // Read the Z A I @@ -818,8 +810,7 @@ void EvolutionData::ReadXSCap(string line, double* time, int NTimeStep) int start = 0; if( tlc(StringLine::NextWord(line, start, ' ')) != "xscap" ) // Check the keyword { - cout << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"xscap\" not found !" << endl; - GetLog()->fLog << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"xscap\" not found !" << endl; + ERROR << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"xscap\" not found !" << endl; exit(1); } // Read the Z A I @@ -852,8 +843,7 @@ void EvolutionData::ReadXSn2n(string line, double* time, int NTimeStep) int start = 0; if( tlc(StringLine::NextWord(line, start, ' ')) != "xsn2n" ) // Check the keyword { - cout << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"xsn2n\" not found !" << endl; - GetLog()->fLog << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"xsn2n\" not found !" << endl; + ERROR << "!!ERROR!! !!!EvolutionData!!! \n Bad keyword : \"xsn2n\" not found !" << endl; exit(1); } // Read the Z A I @@ -897,8 +887,7 @@ void EvolutionData::ReadInfo() ifstream InfoDB(InfoDBFile.c_str()); // Open the File if(!InfoDB) { - cout << "!!ERROR!! !!!EvolutionData!!! \n Can't open \"" << InfoDBFile << "\"\n" << endl; - GetLog()->fLog << "!!ERROR!! !!!EvolutionData!!! \n Can't open \"" << InfoDBFile << "\"\n" << endl; + ERROR << "!!ERROR!! !!!EvolutionData!!! \n Can't open \"" << InfoDBFile << "\"\n" << endl; exit(1); } @@ -931,8 +920,7 @@ void EvolutionData::OldReadDB(string DBfile) ifstream DecayDB(DBfile.c_str()); // Open the File if(!DecayDB) { - cout << "!!Warning!! !!!EvolutionData!!! \n Can't open \"" << DBfile << "\"\n" << endl; - GetLog()->fLog << "!!Warning!! !!!EvolutionData!!! \n Can't open \"" << DBfile << "\"\n" << endl; + WARNING << "!!Warning!! !!!EvolutionData!!! \n Can't open \"" << DBfile << "\"\n" << endl; } vector<double> vTime; vector<double> vTimeErr; @@ -943,8 +931,7 @@ void EvolutionData::OldReadDB(string DBfile) getline(DecayDB, line); if( StringLine::NextWord(line, start, ' ') != "time") { - cout << "!!Bad Trouble!! !!!EvolutionData!!! Bad Database file : " << DBfile << endl; - GetLog()->fLog << "!!Bad Trouble!! !!!EvolutionData!!! Bad Database file : " << DBfile << endl; + ERROR << "!!Bad Trouble!! !!!EvolutionData!!! Bad Database file : " << DBfile << endl; exit (1); } @@ -1145,7 +1132,7 @@ void EvolutionData::OldReadDB(string DBfile) ifstream InfoDB(InfoDBFile.c_str()); // Open the File if(!InfoDB) { - GetLog()->fLog << "!!Warning!! !!!EvolutionData!!! \n Can't open \"" << InfoDBFile << "\"\n" << endl; + WARNING << "!!Warning!! !!!EvolutionData!!! \n Can't open \"" << InfoDBFile << "\"\n" << endl; return; } diff --git a/source/branches/CLASSV3/src/FabricationPlant.cxx b/source/branches/CLASSV3/src/FabricationPlant.cxx index 380b37f15..2ed215842 100644 --- a/source/branches/CLASSV3/src/FabricationPlant.cxx +++ b/source/branches/CLASSV3/src/FabricationPlant.cxx @@ -7,7 +7,7 @@ #include "PhysicModels.hxx" #include "IsotopicVector.hxx" #include "Scenario.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include "CLASSConstante.hxx" @@ -44,7 +44,7 @@ FabricationPlant::FabricationPlant():CLASSFacility(16) } -FabricationPlant::FabricationPlant(LogFile* log, double fabricationtime):CLASSFacility(log, fabricationtime, 16) +FabricationPlant::FabricationPlant(CLASSLogger* log, double fabricationtime):CLASSFacility(log, fabricationtime, 16) { SetName("F_FabricationPLant."); @@ -52,13 +52,9 @@ FabricationPlant::FabricationPlant(LogFile* log, double fabricationtime):CLASSFa fSubstitutionFuel = false; - cout << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; - cout << "\t Chronological Stock Priority has been set! "<< endl; - cout << "\t Fabrication time set to \t " << (double)(GetCycleTime()/3600/24/365.25) << " year" << endl << endl; - - GetLog()->fLog << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; - GetLog()->fLog << "\t Chronological Stock Priority has been set! "<< endl; - GetLog()->fLog << "\t Fabrication time set to \t " << (double)(GetCycleTime()/3600/24/365.25) << " year" << endl << endl; + INFO << " A FabricationPlant has been define :" << endl; + INFO << "\t Chronological Stock Priority has been set! "<< endl; + INFO << "\t Fabrication time set to \t " << (double)(GetCycleTime()/3600/24/365.25) << " year" << endl << endl; @@ -111,7 +107,7 @@ void FabricationPlant::Evolution(cSecond t) //________________________________________________________________________ void FabricationPlant::FabricationPlantEvolution(cSecond t) { - +DBGL IsotopicVector fInsideIV; @@ -139,19 +135,19 @@ void FabricationPlant::FabricationPlantEvolution(cSecond t) } - +DBGL } //________________________________________________________________________ void FabricationPlant::BuildFuelForReactor(int ReactorId) { - +DBGL if(fFissileStorage.size() == 0) { - cout << "!!Error!! !!!FabricationPlant!!! One need at least one Fissile storage to build fuel " << endl; - cout << "!!Error!! !!!FabricationPlant!!! use AddFissileStorage to add a stock to provide fissil material... " << endl; - GetLog()->fLog << "!!Error!! !!!FabricationPlant!!! One need at least one Fissile storage to build fuel " << endl; + ERROR << " One need at least one Fissile storage to build fuel " << endl; + ERROR << " Use AddFissileStorage to add a stock to provide fissil material... " << endl; + ERROR << " One need at least one Fissile storage to build fuel " << endl; exit(1); } @@ -251,7 +247,7 @@ void FabricationPlant::BuildFuelForReactor(int ReactorId) } return; } - +DBGL } @@ -259,8 +255,6 @@ void FabricationPlant::BuildFuelForReactor(int ReactorId) void FabricationPlant::BuildFissileArray() { - - for(int i = 0; i < (int)fFissileStorage.size(); i++) { vector<IsotopicVector> IVArray = fFissileStorage[i]->GetIVArray(); @@ -451,6 +445,7 @@ EvolutionData FabricationPlant::GetReactorEvolutionDB(int ReactorId) //________________________________________________________________________ IsotopicVector FabricationPlant::BuildFuelFromEqModel(vector<double> LambdaArray) { +DBGL IsotopicVector BuildedFuel; IsotopicVector Lost; @@ -489,16 +484,15 @@ IsotopicVector FabricationPlant::BuildFuelFromEqModel(vector<double> LambdaArray DumpStock(LambdaArray); - +DBGL return BuildedFuel; - } //________________________________________________________________________ void FabricationPlant::DumpStock(vector<double> LambdaArray) { - +DBGL for(int i = 0; i < (int)fFissileArray.size(); i++) { @@ -538,7 +532,7 @@ void FabricationPlant::DumpStock(vector<double> LambdaArray) fFertileList = fFissileList = IsotopicVector(); - +DBGL } //________________________________________________________________________ diff --git a/source/branches/CLASSV3/src/IM_Matrix.cxx b/source/branches/CLASSV3/src/IM_Matrix.cxx index 80c7c0f06..4e6c13fd9 100644 --- a/source/branches/CLASSV3/src/IM_Matrix.cxx +++ b/source/branches/CLASSV3/src/IM_Matrix.cxx @@ -9,7 +9,7 @@ #include "IM_Matrix.hxx" #include "IsotopicVector.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include "StringLine.hxx" #include <TGraph.h> @@ -35,7 +35,7 @@ IM_Matrix::IM_Matrix():DynamicalSystem() } -IM_Matrix::IM_Matrix(LogFile* log):IrradiationModel(log), DynamicalSystem() +IM_Matrix::IM_Matrix(CLASSLogger* log):IrradiationModel(log), DynamicalSystem() { fShorstestHalflife = 3600.*24*160.; //cut by default all nuclei with a shorter liftime than the Cm242 -> remain 33 actinides } @@ -48,7 +48,7 @@ IM_Matrix::IM_Matrix(LogFile* log):IrradiationModel(log), DynamicalSystem() //________________________________________________________________________ EvolutionData IM_Matrix::GenerateEvolutionData(IsotopicVector isotopicvector, EvolutionData XSSet, double Power, double cycletime) { - +DBGL if(fFastDecay.size() == 0) { BuildDecayMatrix(); @@ -150,7 +150,7 @@ EvolutionData IM_Matrix::GenerateEvolutionData(IsotopicVector isotopicvector, Ev vector< TMatrixT<double> > FissionXSMatrix; // Store The Fisison XS Matrix vector< TMatrixT<double> > CaptureXSMatrix; // Store The Capture XS Matrix vector< TMatrixT<double> > n2nXSMatrix; // Store The n2N XS Matrix - +DBGL for(int i = 0; i < NStep-1; i++) { double TStepMax = ( (DBTimeStep[i+1]-DBTimeStep[i] ) ) * Power_ref/M_ref / Power*M ; // Get the next Time step @@ -241,6 +241,7 @@ EvolutionData IM_Matrix::GenerateEvolutionData(IsotopicVector isotopicvector, Ev } +DBGL FissionXSMatrix.push_back(GetFissionXsMatrix(XSSet, DBTimeStep[NStep-1])); //Feel the reaction Matrix CaptureXSMatrix.push_back(GetCaptureXsMatrix(XSSet, DBTimeStep[NStep-1])); //Feel the reaction Matrix n2nXSMatrix.push_back(Getn2nXsMatrix(XSSet, DBTimeStep[NStep-1])); //Feel the reaction Matrix @@ -279,7 +280,6 @@ EvolutionData IM_Matrix::GenerateEvolutionData(IsotopicVector isotopicvector, Ev } GeneratedDB.SetPower(Power ); - // GeneratedDB.SetFuelType(fFuelType ); GeneratedDB.SetReactorType(ReactorType ); GeneratedDB.SetCycleTime(cycletime); @@ -292,7 +292,7 @@ EvolutionData IM_Matrix::GenerateEvolutionData(IsotopicVector isotopicvector, Ev FissionXSMatrix.clear(); CaptureXSMatrix.clear(); n2nXSMatrix.clear(); - +DBGL return GeneratedDB; } diff --git a/source/branches/CLASSV3/src/IM_RK4.cxx b/source/branches/CLASSV3/src/IM_RK4.cxx index 394b44ad5..79fe063ff 100644 --- a/source/branches/CLASSV3/src/IM_RK4.cxx +++ b/source/branches/CLASSV3/src/IM_RK4.cxx @@ -10,7 +10,7 @@ #include "IsotopicVector.hxx" #include "CLASSConstante.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include "StringLine.hxx" @@ -41,7 +41,7 @@ IM_RK4::IM_RK4():IrradiationModel(), DynamicalSystem() } -IM_RK4::IM_RK4(LogFile* log):IrradiationModel(log), DynamicalSystem() +IM_RK4::IM_RK4(CLASSLogger* log):IrradiationModel(log), DynamicalSystem() { fTheNucleiVector = 0; fTheMatrix = 0; @@ -63,7 +63,7 @@ IM_RK4::IM_RK4(LogFile* log):IrradiationModel(log), DynamicalSystem() //________________________________________________________________________ EvolutionData IM_RK4::GenerateEvolutionData(IsotopicVector isotopicvector, EvolutionData XSSet, double Power, double cycletime) { - +DBGL if(fFastDecay.size() == 0) { BuildDecayMatrix(); @@ -168,7 +168,7 @@ EvolutionData IM_RK4::GenerateEvolutionData(IsotopicVector isotopicvector, Evolu vector< TMatrixT<double> > FissionXSMatrix; // Store The Fisison XS Matrix vector< TMatrixT<double> > CaptureXSMatrix; // Store The Capture XS Matrix vector< TMatrixT<double> > n2nXSMatrix; // Store The n2N XS Matrix - +DBGL for(int i = 0; i < NStep-1; i++) { double TStepMax = ( (DBTimeStep[i+1]-DBTimeStep[i] ) ) * Power_ref/M_ref / Power*M ; // Get the next Time step @@ -265,9 +265,8 @@ EvolutionData IM_RK4::GenerateEvolutionData(IsotopicVector isotopicvector, Evolu GeneratedDB.CaptureXSInsert(pair<ZAI, TGraph*> (findex.find(i)->second, new TGraph(NStep, timevector, CaptureXS))); GeneratedDB.n2nXSInsert(pair<ZAI, TGraph*> (findex.find(i)->second, new TGraph(NStep, timevector, n2nXS))); } - +DBGL GeneratedDB.SetPower(Power ); -// GeneratedDB.SetFuelType(fFuelType ); GeneratedDB.SetReactorType(ReactorType ); GeneratedDB.SetCycleTime(cycletime); @@ -283,7 +282,7 @@ EvolutionData IM_RK4::GenerateEvolutionData(IsotopicVector isotopicvector, Evolu FissionXSMatrix.clear(); CaptureXSMatrix.clear(); n2nXSMatrix.clear(); - +DBGL return GeneratedDB; } diff --git a/source/branches/CLASSV3/src/IrradiationModel.cxx b/source/branches/CLASSV3/src/IrradiationModel.cxx index 51599b896..a727720c1 100644 --- a/source/branches/CLASSV3/src/IrradiationModel.cxx +++ b/source/branches/CLASSV3/src/IrradiationModel.cxx @@ -9,7 +9,7 @@ #include "IrradiationModel.hxx" #include "IsotopicVector.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include "StringLine.hxx" #include <TGraph.h> @@ -24,13 +24,6 @@ #include <cmath> - - - - - - - using namespace std; IrradiationModel::IrradiationModel():CLASSObject() @@ -44,7 +37,7 @@ IrradiationModel::IrradiationModel():CLASSObject() fDataFileName = "chart.JEF3T"; } -IrradiationModel::IrradiationModel(LogFile* log):CLASSObject(log) +IrradiationModel::IrradiationModel(CLASSLogger* log):CLASSObject(log) { fShorstestHalflife = 3600.*24*2.; fZAIThreshold = 90; @@ -95,6 +88,7 @@ string IrradiationModel::GetDecay(string DecayModes, double &BR,int &Iso, int &S //________________________________________________________________________ void IrradiationModel::BuildDecayMatrix() { +DBGL fDecayMatrix.Clear(); // List of Decay Time and Properties @@ -116,13 +110,7 @@ void IrradiationModel::BuildDecayMatrix() ifstream infile(DataFullPathName.c_str()); if(!infile) - { - cout << "!!Warning!! !!!IrradiationModel!!! \n Can't open \"" << DataFullPathName << "\"\n" << endl; - GetLog()->fLog << "!!Warning!! !!!IrradiationModel!!! \n Can't open \"" << DataFullPathName<< "\"\n" << endl; - } - - - + WARNING << " Can't open \"" << DataFullPathName<< "\"" << endl; do @@ -278,7 +266,7 @@ void IrradiationModel::BuildDecayMatrix() i++; } } - +DBGL // Fill the Decay Part of the Bateman Matrix Always the same ! bool FastDecayValidation = false; while (!FastDecayValidation) @@ -353,7 +341,7 @@ void IrradiationModel::BuildDecayMatrix() } } } - +DBGL fDecayMatrix.ResizeTo(findex.size(),findex.size()); for(int i = 0; i < (int)findex.size(); i++) @@ -415,7 +403,7 @@ void IrradiationModel::BuildDecayMatrix() } } - +DBGL } //________________________________________________________________________ @@ -435,10 +423,7 @@ void IrradiationModel::SetFissionEnergy(string FissionEnergyFile) { ifstream FissionFile(FissionEnergyFile.c_str()); // Open the File if(!FissionFile) //check if file is correctly open - { - cout << "!!Warning!! !!!IrradiationModel!!! \n Can't open \"" << FissionFile << "\"\n" << endl; - GetLog()->fLog << "!!Warning!! !!!IrradiationModel!!! \n Can't open \"" << FissionFile << "\"\n" << endl; - } + WARNING << " Can't open \"" << FissionEnergyFile << "\"\n" << endl; do { int Z = 0; @@ -458,10 +443,7 @@ map< ZAI,IsotopicVector > IrradiationModel::ReadFPYield(string Yield) ifstream infile(Yield.c_str()); if(!infile) - { - cout << "!!Warning!! !!!IrradiationModel!!! \n Can't open \"" << Yield << "\"\n" << endl; - GetLog()->fLog << "!!Warning!! !!!IrradiationModel!!! \n Can't open \"" << Yield<< "\"\n" << endl; - } + WARNING << " Can't open \"" << Yield<< "\"\n" << endl; string line; @@ -481,8 +463,7 @@ map< ZAI,IsotopicVector > IrradiationModel::ReadFPYield(string Yield) IResult = Yield_map.insert(pair<ZAI,IsotopicVector>(ZAI(Z,A,I),EmptyIV) ); if(!IResult.second) { - cout << "!!Error!! !!!IrradiationModel!!! Many accurance of ZAI " << Z << " " << A; - cout << " in " << Yield << " file!! Please Check it !!!" << endl; + ERROR << " Many accurance of ZAI " << Z << " " << A << " in " << Yield << " file!! " << endl; exit(1); } @@ -502,9 +483,8 @@ map< ZAI,IsotopicVector > IrradiationModel::ReadFPYield(string Yield) { if (it == Yield_map.end()) { - cout << "!!Error!! !!!IrradiationModel!!! Many accurance of the PF " << Z << " " << A; - cout << " in " << Yield << " file!! Please Check it"; - cout << "(Number of yield does not match the number of ZAI that fission !!!" << endl; + ERROR << " Many accurance of the PF " << Z << " " << A << " in " << Yield << " file!! "; + ERROR << "(Number of yield does not match the number of ZAI that fission !!!" << endl; exit(1); } @@ -540,7 +520,7 @@ void IrradiationModel::LoadFPYield(string SponfaneusYield, string ReactionYield) //________________________________________________________________________ TMatrixT<double> IrradiationModel::GetFissionXsMatrix(EvolutionData EvolutionDataStep,double TStep) { - +DBGL map<ZAI ,TGraph* >::iterator it; TMatrixT<double> BatemanMatrix = TMatrixT<double>(findex.size(),findex.size()); for(int i = 0; i < (int)findex.size(); i++) @@ -613,15 +593,14 @@ TMatrixT<double> IrradiationModel::GetFissionXsMatrix(EvolutionData EvolutionDat } +DBGL return BatemanMatrix; - } //________________________________________________________________________ TMatrixT<double> IrradiationModel::GetCaptureXsMatrix(EvolutionData EvolutionDataStep,double TStep) { - - +DBGL map<ZAI ,TGraph* >::iterator it; TMatrixT<double> BatemanMatrix = TMatrixT<double>(findex.size(),findex.size()); for(int i = 0; i < (int)findex.size(); i++) @@ -636,11 +615,7 @@ TMatrixT<double> IrradiationModel::GetCaptureXsMatrix(EvolutionData EvolutionDat toAdd.insert(pair<ZAI, double> ( ZAI(95,242,1) , 0.1267) ); Capture.insert( pair< ZAI, map<ZAI, double> > ( ZAI(95,241,0), toAdd ) ); } - { // 242Am* - map<ZAI, double> toAdd ; - toAdd.insert(pair<ZAI, double> ( ZAI(95,243,0) , 1) ); - Capture.insert( pair< ZAI, map<ZAI, double> > ( ZAI(95,242,1), toAdd ) ); - } + // ---------------- A(n,.)A+1 @@ -659,7 +634,7 @@ TMatrixT<double> IrradiationModel::GetCaptureXsMatrix(EvolutionData EvolutionDat if( it3 == Capture.end() ) { - map<ZAI, int >::iterator it6 = findex_inver.find( ZAI( (*it).first.Z(), (*it).first.A()+1, (*it).first.I()) ); + map<ZAI, int >::iterator it6 = findex_inver.find( ZAI( (*it).first.Z(), (*it).first.A()+1, 0) ); if( it6 != findex_inver.end() ) { @@ -667,7 +642,7 @@ TMatrixT<double> IrradiationModel::GetCaptureXsMatrix(EvolutionData EvolutionDat } else { - map<ZAI, map<ZAI, double> >::iterator it4 = fFastDecay.find( ZAI( (*it).first.Z(), (*it).first.A()+1, (*it).first.I()) ); + map<ZAI, map<ZAI, double> >::iterator it4 = fFastDecay.find( ZAI( (*it).first.Z(), (*it).first.A()+1, 0) ); if( it4 == fFastDecay.end() ) { @@ -705,7 +680,7 @@ TMatrixT<double> IrradiationModel::GetCaptureXsMatrix(EvolutionData EvolutionDat if( it7 == fFastDecay.end() ) { - cout << "CaptureList Problem in FastDecay for nuclei " << (*it7).first.Z() << " " << (*it7).first.A() << " " << (*it7).first.I() << endl; + ERROR << " CaptureList Problem in FastDecay for nuclei " << (*it7).first.Z() << " " << (*it7).first.A() << " " << (*it7).first.I() << endl; exit(1); } @@ -717,7 +692,7 @@ TMatrixT<double> IrradiationModel::GetCaptureXsMatrix(EvolutionData EvolutionDat it6 = findex_inver.find( (*it5).first ); if( it6 == findex_inver.end() ) { - cout << "CaptureList Problem in FastDecay for nuclei " << (*it7).first.Z() << " " << (*it7).first.A() << " " << (*it7).first.I() << endl; + ERROR << " CaptureList Problem in FastDecay for nuclei " << (*it7).first.Z() << " " << (*it7).first.A() << " " << (*it7).first.I() << endl; exit(1); } @@ -731,15 +706,15 @@ TMatrixT<double> IrradiationModel::GetCaptureXsMatrix(EvolutionData EvolutionDat } } +DBGL return BatemanMatrix; - } //________________________________________________________________________ TMatrixT<double> IrradiationModel::Getn2nXsMatrix(EvolutionData EvolutionDataStep,double TStep) { - +DBGL map<ZAI ,TGraph* >::iterator it; TMatrixT<double> BatemanMatrix = TMatrixT<double>(findex.size(),findex.size()); @@ -754,11 +729,6 @@ TMatrixT<double> IrradiationModel::Getn2nXsMatrix(EvolutionData EvolutionDataSte toAdd.insert(pair<ZAI, double> ( ZAI(93,236,1) , 0.8) ); n2n.insert( pair< ZAI, map<ZAI, double> > ( ZAI(93,237,0), toAdd ) ); } - { // 242Am* - map<ZAI, double> toAdd ; - toAdd.insert(pair<ZAI, double> ( ZAI(95,241,0) , 1) ); - n2n.insert( pair< ZAI, map<ZAI, double> > ( ZAI(95,242,1), toAdd ) ); - } // ---------------- A(n,2n)A-1 map<ZAI ,TGraph* > n2nXS = EvolutionDataStep.Getn2nXS(); @@ -776,7 +746,7 @@ TMatrixT<double> IrradiationModel::Getn2nXsMatrix(EvolutionData EvolutionDataSte if( it3 == n2n.end() ) { - map<ZAI, int >::iterator it6 = findex_inver.find( ZAI( (*it).first.Z(), (*it).first.A()-1, (*it).first.I()) ); + map<ZAI, int >::iterator it6 = findex_inver.find( ZAI( (*it).first.Z(), (*it).first.A()-1, 0) ); if( it6 != findex_inver.end() ) { @@ -784,7 +754,7 @@ TMatrixT<double> IrradiationModel::Getn2nXsMatrix(EvolutionData EvolutionDataSte } else { - map<ZAI, map<ZAI, double> >::iterator it4 = fFastDecay.find( ZAI( (*it).first.Z(), (*it).first.A()-1, (*it).first.I()) ); + map<ZAI, map<ZAI, double> >::iterator it4 = fFastDecay.find( ZAI( (*it).first.Z(), (*it).first.A()-1, 0) ); if( it4 == fFastDecay.end() ) { @@ -822,7 +792,7 @@ TMatrixT<double> IrradiationModel::Getn2nXsMatrix(EvolutionData EvolutionDataSte if( it7 == fFastDecay.end() ) { - cout << "n2nList Problem in FastDecay for nuclei " << (*it7).first.Z() << " " << (*it7).first.A() << " " << (*it7).first.I() << endl; + ERROR << " n2nList Problem in FastDecay for nuclei " << (*it7).first.Z() << " " << (*it7).first.A() << " " << (*it7).first.I() << endl; exit(1); } @@ -834,7 +804,7 @@ TMatrixT<double> IrradiationModel::Getn2nXsMatrix(EvolutionData EvolutionDataSte it6 = findex_inver.find( (*it5).first ); if( it6 == findex_inver.end() ) { - cout << "n2nList Problem in FastDecay for nuclei " << (*it7).first.Z() << " " << (*it7).first.A() << " " << (*it7).first.I() << endl; + ERROR << " n2nList Problem in FastDecay for nuclei " << (*it7).first.Z() << " " << (*it7).first.A() << " " << (*it7).first.I() << endl; exit(1); } @@ -848,6 +818,7 @@ TMatrixT<double> IrradiationModel::Getn2nXsMatrix(EvolutionData EvolutionDataSte } } +DBGL return BatemanMatrix; } diff --git a/source/branches/CLASSV3/src/IsotopicVector.cxx b/source/branches/CLASSV3/src/IsotopicVector.cxx index 6c8ad57b1..1a4198ed8 100755 --- a/source/branches/CLASSV3/src/IsotopicVector.cxx +++ b/source/branches/CLASSV3/src/IsotopicVector.cxx @@ -1,6 +1,6 @@ #include "IsotopicVector.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include "CLASSConstante.hxx" @@ -90,8 +90,7 @@ double Distance(IsotopicVector IV1, IsotopicVector IV2 ,int DistanceType, Isotop } else { - cout << "!!ERROR!! !!!Distance!!!" - << " DistanceType defined by the user isn't recognized by the code"<<endl; + cout << " DistanceType defined by the user isn't recognized by the code" << endl; exit(1); } diff --git a/source/branches/CLASSV3/src/Makefile b/source/branches/CLASSV3/src/Makefile index 3755d7b45..ee1a7a9a5 100755 --- a/source/branches/CLASSV3/src/Makefile +++ b/source/branches/CLASSV3/src/Makefile @@ -13,17 +13,17 @@ ROOTGLIBS = `root-config --glibs` ######### nothing to change from here ######### INCLUDES = $(LOCALINC)/*.hxx LIBNAME = CLASSpkg -OBJS = Scenario.o \ +OBJS = CLASSLogger.o \ + ZAI.o ZAIDict.o \ IsotopicVector.o IsotopicVectorDict.o \ ZAIMass.o \ - ZAI.o ZAIDict.o \ CLASSObject.o CLASSObjectDict.o\ CLASSFacility.o CLASSFacilityDict.o\ + FabricationPlant.o FabricationPlantDict.o \ + Reactor.o ReactorDict.o \ CLASSBackEnd.o CLASSBackEndDict.o\ Storage.o StorageDict.o\ - FabricationPlant.o FabricationPlantDict.o \ Pool.o PoolDict.o\ - Reactor.o ReactorDict.o \ DecayDataBank.o \ DynamicalSystem.o\ EvolutionData.o EvolutionDataDict.o \ @@ -31,23 +31,23 @@ OBJS = Scenario.o \ EquivalenceModel.o EQM_MLP_PWR_MOX.o EQM_QUAD_PWR_MOX.o EQM_LIN_PWR_MOX.o \ XSModel.o XSM_MLP_PWR_MOX.o XSM_CLOSEST.o \ PhysicModels.o \ - LogFile.o + Scenario.o -ROOTOBJS = CLASSObject.o CLASSObjectDict.o\ +ROOTOBJS = CLASSLogger.o \ + ZAI.o ZAIDict.o \ + IsotopicVector.o IsotopicVectorDict.o \ + ZAIMass.o \ + CLASSObject.o CLASSObjectDict.o\ CLASSFacility.o CLASSFacilityDict.o\ + Reactor.o ReactorDict.o \ + FabricationPlant.o FabricationPlantDict.o \ CLASSBackEnd.o CLASSBackEndDict.o\ Storage.o StorageDict.o\ Pool.o PoolDict.o\ - Reactor.o ReactorDict.o \ - FabricationPlant.o FabricationPlantDict.o \ - IsotopicVector.o IsotopicVectorDict.o \ - ZAIMass.o \ - ZAI.o ZAIDict.o \ DecayDataBank.o \ DynamicalSystem.o\ EvolutionData.o EvolutionDataDict.o \ - PhysicModels.o \ - LogFile.o + PhysicModels.o CXX = g++ diff --git a/source/branches/CLASSV3/src/Makefile_good b/source/branches/CLASSV3/src/Makefile_good index 50d8b6411..c49e9c6df 100644 --- a/source/branches/CLASSV3/src/Makefile_good +++ b/source/branches/CLASSV3/src/Makefile_good @@ -36,7 +36,7 @@ OBJS = Scenario.o \ EquivalenceModel.o \ XSModel.o \ PhysicModels.o \ - LogFile.o + CLASSLogger.o OBJMODEL = $(EQM)/EQM_MLP_PWR_MOX.o $(EQM)/EQM_QUAD_PWR_MOX.o $(EQM)/EQM_LIN_PWR_MOX.o \ $(XSM)/XSM_MLP_PWR_MOX.o $(XSM)/XSM_CLOSEST.o \ @@ -57,7 +57,7 @@ ROOTOBJS = CLASSObject.o CLASSObjectDict.o\ DynamicalSystem.o\ EvolutionData.o EvolutionDataDict.o \ PhysicModels.o \ - LogFile.o + CLASSLogger.o CXX = g++ diff --git a/source/branches/CLASSV3/src/PWR_THPU_FabricationPlant.cxx b/source/branches/CLASSV3/src/PWR_THPU_FabricationPlant.cxx index 1ce7c45aa..dcb14a30b 100644 --- a/source/branches/CLASSV3/src/PWR_THPU_FabricationPlant.cxx +++ b/source/branches/CLASSV3/src/PWR_THPU_FabricationPlant.cxx @@ -8,7 +8,7 @@ #include "DecayDataBank.hxx" #include "IsotopicVector.hxx" #include "Scenario.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include "TMatrixT.h" @@ -43,7 +43,7 @@ PWR_THPU_FabricationPlant::PWR_THPU_FabricationPlant():FabricationPlant() { } -PWR_THPU_FabricationPlant::PWR_THPU_FabricationPlant(LogFile* log) +PWR_THPU_FabricationPlant::PWR_THPU_FabricationPlant(CLASSLogger* log) { SetFacilityType(16); @@ -58,15 +58,15 @@ PWR_THPU_FabricationPlant::PWR_THPU_FabricationPlant(LogFile* log) cout << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; cout << "\t Chronological Stock Priority set! "<< endl << endl; cout << "!!WARNING!! !!!FabricationPlant!!! You need to set the different stock manually as well as the Fabrication Time Manualy !! " << endl; - GetLog()->fLog << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; - GetLog()->fLog << "\t Chronological Stock Priority set! "<< endl << endl; - GetLog()->fLog << "!!WARNING!! !!!FabricationPlant!!! You need to set the different stock manually as well as the Fabrication Time Manualy !! " << endl; + fLog << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; + fLog << "\t Chronological Stock Priority set! "<< endl << endl; + fLog << "!!WARNING!! !!!FabricationPlant!!! You need to set the different stock manually as well as the Fabrication Time Manualy !! " << endl; } -PWR_THPU_FabricationPlant::PWR_THPU_FabricationPlant(LogFile* log, Storage* storage, Storage* reusable, double fabircationtime) +PWR_THPU_FabricationPlant::PWR_THPU_FabricationPlant(CLASSLogger* log, Storage* storage, Storage* reusable, double fabircationtime) { SetFacilityType(16); @@ -82,13 +82,9 @@ PWR_THPU_FabricationPlant::PWR_THPU_FabricationPlant(LogFile* log, Storage* stor fReUsable = reusable; - cout << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; - cout << "\t Chronological Stock Priority has been set! "<< endl; - cout << "\t Fabrication time set to \t " << (double)(GetCycleTime()/3600/24/365.25) << " year" << endl << endl; - - GetLog()->fLog << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; - GetLog()->fLog << "\t Chronological Stock Priority has been set! "<< endl; - GetLog()->fLog << "\t Fabrication time set to \t " << (double)(GetCycleTime()/3600/24/365.25) << " year" << endl << endl; + INFO << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; + INFO << "\t Chronological Stock Priority has been set! "<< endl; + INFO << "\t Fabrication time set to \t " << (double)(GetCycleTime()/3600/24/365.25) << " year" << endl << endl; @@ -115,8 +111,7 @@ void PWR_THPU_FabricationPlant::BuildFuelForReactor(int ReactorId) string ReactorType ="PWR"; if(FuelType->GetFuelType() != "THPU" || ReactorType !="PWR")//Check if the reactor is the right type and use the right type of fuel { - cout << "!!Bad Trouble!! !!!FabricationPlant!!! Try to do MOX with a not MOXed DB "<< endl; - GetLog()->fLog << "!!Bad Trouble!! !!!FabricationPlant!!! Try to do MOX with a not MOXed DB" << endl; + ERROR << "!!Bad Trouble!! !!!FabricationPlant!!! Try to do MOX with a not MOXed DB" << endl; exit (1); } @@ -236,8 +231,7 @@ void PWR_THPU_FabricationPlant::BuildFuelForReactor(int ReactorId) { stock.GetActinidesComposition().Print(); - cout << "!!Bad Trouble!! !!!FabricationPlant!!! Oups Bug in calculating stock fraction to use "<< endl; - GetLog()->fLog << "!!Bad Trouble!! !!!FabricationPlant!!! Oups Bug in calculating stock fraction to use" << endl; + ERROR << "!!Bad Trouble!! !!!FabricationPlant!!! Oups Bug in calculating stock fraction to use" << endl; RecycleStock(0.); FuelBuild = false; diff --git a/source/branches/CLASSV3/src/PWR_THU_FabricationPlant.cxx b/source/branches/CLASSV3/src/PWR_THU_FabricationPlant.cxx index 351d854f4..6d3ae534f 100644 --- a/source/branches/CLASSV3/src/PWR_THU_FabricationPlant.cxx +++ b/source/branches/CLASSV3/src/PWR_THU_FabricationPlant.cxx @@ -7,7 +7,7 @@ #include "DecayDataBank.hxx" #include "IsotopicVector.hxx" #include "Scenario.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" @@ -43,7 +43,7 @@ PWR_THU_FabricationPlant::PWR_THU_FabricationPlant():FabricationPlant() } -PWR_THU_FabricationPlant::PWR_THU_FabricationPlant(LogFile* log) +PWR_THU_FabricationPlant::PWR_THU_FabricationPlant(CLASSLogger* log) { SetFacilityType(16); @@ -55,18 +55,15 @@ PWR_THU_FabricationPlant::PWR_THU_FabricationPlant(LogFile* log) fStorage = 0; fReUsable = 0; - cout << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; - cout << "\t Chronological Stock Priority set! "<< endl << endl; - cout << "!!WARNING!! !!!FabricationPlant!!! You need to set the different stock manually as well as the Fabrication Time Manualy !! " << endl; - GetLog()->fLog << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; - GetLog()->fLog << "\t Chronological Stock Priority set! "<< endl << endl; - GetLog()->fLog << "!!WARNING!! !!!FabricationPlant!!! You need to set the different stock manually as well as the Fabrication Time Manualy !! " << endl; + INFO << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; + INFO << "\t Chronological Stock Priority set! "<< endl << endl; + INFO << "!!WARNING!! !!!FabricationPlant!!! You need to set the different stock manually as well as the Fabrication Time Manualy !! " << endl; } -PWR_THU_FabricationPlant::PWR_THU_FabricationPlant(LogFile* log, Storage* storage, Storage* reusable, double fabircationtime) +PWR_THU_FabricationPlant::PWR_THU_FabricationPlant(CLASSLogger* log, Storage* storage, Storage* reusable, double fabircationtime) { SetFacilityType(16); @@ -82,13 +79,9 @@ PWR_THU_FabricationPlant::PWR_THU_FabricationPlant(LogFile* log, Storage* storag fReUsable = reusable; - cout << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; - cout << "\t Chronological Stock Priority has been set! "<< endl; - cout << "\t Fabrication time set to \t " << (double)(GetCycleTime()/3600/24/365.25) << " year" << endl << endl; - - GetLog()->fLog << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; - GetLog()->fLog << "\t Chronological Stock Priority has been set! "<< endl; - GetLog()->fLog << "\t Fabrication time set to \t " << (double)(GetCycleTime()/3600/24/365.25) << " year" << endl << endl; + INFO << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; + INFO << "\t Chronological Stock Priority has been set! "<< endl; + INFO << "\t Fabrication time set to \t " << (double)(GetCycleTime()/3600/24/365.25) << " year" << endl << endl; @@ -115,8 +108,7 @@ void PWR_THU_FabricationPlant::BuildFuelForReactor(int ReactorId) string ReactorType ="PWR"; if(FuelType->GetFuelType() != "THU" || ReactorType !="PWR")//Check if the reactor is the right type and use the right type of fuel { - cout << "!!Bad Trouble!! !!!FabricationPlant!!! Try to do MOX with a not MOXed DB "<< endl; - GetLog()->fLog << "!!Bad Trouble!! !!!FabricationPlant!!! Try to do MOX with a not MOXed DB" << endl; + ERROR << "!!Bad Trouble!! !!!FabricationPlant!!! Try to do MOX with a not MOXed DB" << endl; exit (1); } @@ -234,8 +226,7 @@ void PWR_THU_FabricationPlant::BuildFuelForReactor(int ReactorId) { stock.GetActinidesComposition().Print(); - cout << "!!Bad Trouble!! !!!FabricationPlant!!! Oups Bug in calculating stock fraction to use "<< endl; - GetLog()->fLog << "!!Bad Trouble!! !!!FabricationPlant!!! Oups Bug in calculating stock fraction to use" << endl; + ERROR << "!!Bad Trouble!! !!!FabricationPlant!!! Oups Bug in calculating stock fraction to use" << endl; RecycleStock(0.); FuelBuild = false; diff --git a/source/branches/CLASSV3/src/PhysicModels.cxx b/source/branches/CLASSV3/src/PhysicModels.cxx index e9b2bb46b..2823ca5ea 100644 --- a/source/branches/CLASSV3/src/PhysicModels.cxx +++ b/source/branches/CLASSV3/src/PhysicModels.cxx @@ -21,9 +21,6 @@ PhysicModels::PhysicModels(XSModel* XS, EquivalenceModel* EM, IrradiationModel* EvolutionData PhysicModels::GenerateEvolutionData(IsotopicVector IV, double cycletime, double Power) { - return fIrradiationModel->GenerateEvolutionData(IV, fXSModel->GetCrossSections(IV), Power, cycletime); - - } //________________________________________________________________________ diff --git a/source/branches/CLASSV3/src/Pool.cxx b/source/branches/CLASSV3/src/Pool.cxx index 6470040b2..1299771e1 100755 --- a/source/branches/CLASSV3/src/Pool.cxx +++ b/source/branches/CLASSV3/src/Pool.cxx @@ -3,7 +3,7 @@ #include "IsotopicVector.hxx" #include "Storage.hxx" #include "Scenario.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include <sstream> #include <string> @@ -29,7 +29,7 @@ Pool::Pool():CLASSBackEnd(8) } //________________________________________________________________________ -Pool::Pool(LogFile* log, cSecond coolingtime):CLASSBackEnd(log, coolingtime, 8) +Pool::Pool(CLASSLogger* log, cSecond coolingtime):CLASSBackEnd(log, coolingtime, 8) { @@ -42,21 +42,16 @@ Pool::Pool(LogFile* log, cSecond coolingtime):CLASSBackEnd(log, coolingtime, 8) SetName("P_Pool."); - 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; - cout << "\t The Cooling Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; - cout << "!!WARNING!! !!!Pool!!! All Cooled Fuel goes directly to WASTE after cooling !! " << endl; - - GetLog()->fLog << "!!INFO!! !!!Pool!!! A new Pool has been define :" << endl; - GetLog()->fLog << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "\t The Cooling Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "!!WARNING!! !!!Pool!!! All Cooled Fuel goes directly to WASTE after cooling !! " << endl; + INFO << " A new Pool has been define :" << endl; + INFO << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; + INFO << "\t The Cooling Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; + WARNING << " All Cooled Fuel goes directly to WASTE after cooling !! " << endl; } //________________________________________________________________________ -Pool::Pool(LogFile* log, CLASSBackEnd* storage, cSecond coolingtime):CLASSBackEnd(log, coolingtime, 8) +Pool::Pool(CLASSLogger* log, CLASSBackEnd* storage, cSecond coolingtime):CLASSBackEnd(log, coolingtime, 8) { fOutBackEndFacility = storage; @@ -68,15 +63,10 @@ Pool::Pool(LogFile* log, CLASSBackEnd* storage, cSecond coolingtime):CLASSBackEn SetName("P_Pool."); - 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; - - cout << "\t The Cooling Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; - - GetLog()->fLog << "!!INFO!! !!!Pool!!! A new Pool has been define :" << endl; - GetLog()->fLog << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "\t The Cooling Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; + INFO << " A new Pool has been define :" << endl; + INFO << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; + INFO << "\t The Cooling Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; } @@ -92,8 +82,8 @@ Pool::~Pool() //________________________________________________________________________ void Pool::SetIVArray(vector<IsotopicVector> ivarray) { - cout << "this method as no effect !!!" << endl; - cout << "Use SetIVArray(vector<IsotopicVector> ivarray, vector<cSecond>n timearray) unstead!!!!"<<endl; + INFO << "This method as no effect !!!" << endl; + INFO << "Use SetIVArray(vector<IsotopicVector> ivarray, vector<cSecond>n timearray) unstead!!!!"<<endl; } @@ -150,6 +140,7 @@ void Pool::RemoveIVCooling(int i) //!< Remove a Cooling IsotopicVector //________________________________________________________________________ void Pool::CoolingEvolution(cSecond t) { +DBGL if(t == fInternalTime && t!=0) return; int RemainingCoolingTime; @@ -164,11 +155,7 @@ void Pool::CoolingEvolution(cSecond t) { if (t - fIVArrayArrivalTime[i] > fCycleTime) // Warning & Quit { - cout << "!!Warning!! !!!TreamtmentFactory!!! Cooling Step : " << t/3600./24/365.25<< " :" - << " An evolution Step is probably missing ! " << " " << endl; - cout << t << " " << fIVArrayArrivalTime[i] << " " << fCycleTime << endl; - GetLog()->fLog << "!!Warning!! !!!TreamtmentFactory!!! Cooling Step : "<< t << " :" - << " An evolution Step is probably missing ! " << endl; + ERROR << " Cooling Step : " << t/3600./24/365.25<< " :" << " an evolution Step is probably missing ! " << " " << endl; exit (1); } @@ -190,6 +177,7 @@ void Pool::CoolingEvolution(cSecond t) #pragma omp critical(DeleteCoolingIVPB) {sort (fCoolingEndOfCycle.begin(), fCoolingEndOfCycle.end());} +DBGL } @@ -221,6 +209,7 @@ void Pool::Evolution(cSecond t) //________________________________________________________________________ void Pool::Dump() { +DBGL //------ Cooling ------// for(int i = (int)fCoolingEndOfCycle.size()-1; i >=0 ; i--) // IV End Of Cooling { @@ -238,10 +227,10 @@ void Pool::Dump() if((int)fCoolingEndOfCycle.size() != 0 )// Control { - cout << "Problem while Dumping Cooling"<< endl; - GetLog()->fLog << "Problem while Dumping Cooling"<< endl; + ERROR << "Problem while Dumping Cooling"<< endl; exit (1); } +DBGL } diff --git a/source/branches/CLASSV3/src/Reactor.cxx b/source/branches/CLASSV3/src/Reactor.cxx index a8fc20dcb..647234ce7 100755 --- a/source/branches/CLASSV3/src/Reactor.cxx +++ b/source/branches/CLASSV3/src/Reactor.cxx @@ -8,7 +8,7 @@ #include "Scenario.hxx" #include "CLASSConstante.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include <iostream> #include <cmath> @@ -43,26 +43,25 @@ Reactor::Reactor():CLASSFacility() fNextPlan = fLoadingPlan.begin(); } -Reactor::Reactor(LogFile* log):CLASSFacility(log) +Reactor::Reactor(CLASSLogger* log):CLASSFacility(log, 4) { fOutBackEndFacility = 0; fStorage = 0; fFuelTypeDB = 0; fFabricationPlant = 0; - SetFacilityType(4); - SetName("R_Reactor."); + (*this).SetName("R_Reactor."); fNextPlan = fLoadingPlan.begin(); } -Reactor::Reactor(LogFile* log, PhysicModels* fueltypeDB, +Reactor::Reactor(CLASSLogger* log, PhysicModels* fueltypeDB, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, cSecond creationtime, cSecond lifetime):CLASSFacility(log, creationtime, lifetime, 4) { - SetName("R_Reactor."); + (*this).SetName("R_Reactor."); fIsStarted = false; @@ -83,26 +82,21 @@ Reactor::Reactor(LogFile* log, PhysicModels* fueltypeDB, fNextPlan = fLoadingPlan.begin(); - cout << "!!INFO!! !!!Reactor!!! A Reactor has been define :" << endl; - cout << "\t Fuel Composition is not fixed ! "<< endl; - cout << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; - cout << "\t Life time (Operating's Duration) set at \t " << (double)(GetLifeTime()/3600/24/365.25) << " year" << endl << endl; - cout << "!!WARNING!! !!!Reactor!!! You need to set Burn-up/Power/CycleTime (2 of 3) & Heavy Metal Mass Manualy !! " << endl; + INFO << " A Reactor has been define :" << endl; + INFO << "\t Fuel Composition is not fixed ! "<< endl; + INFO << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; + INFO << "\t Life time (Operating's Duration) set at \t " << (double)(GetLifeTime()/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "!!INFO!! !!!Reactor!!! A Reactor has been define :" << endl; - GetLog()->fLog << "\t Fuel Composition is not fixed ! "<< endl; - GetLog()->fLog << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "\t Life time (Operating's Duration) set at \t " << (double)(GetLifeTime()/3600/24/365.25) << " year" << endl << endl; - GetLog()->fLog << "!!WARNING!! !!!Reactor!!! You need to set Burn-up/Power/CycleTime (2 of 3) & Heavy Metal Mass Manualy !! " << endl; + WARNING << " You need to set Burn-up/Power/CycleTime (2 of 3) & Heavy Metal Mass Manualy !! " << endl; } -Reactor::Reactor(LogFile* log, PhysicModels* fueltypeDB, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, +Reactor::Reactor(CLASSLogger* log, PhysicModels* fueltypeDB, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, cSecond creationtime, cSecond lifetime, double Power, double HMMass, double BurnUp, double ChargeFactor):CLASSFacility(log, creationtime, lifetime, 4) { - SetName("R_Reactor."); + (*this).SetName("R_Reactor."); fStorage = 0; @@ -126,35 +120,26 @@ Reactor::Reactor(LogFile* log, PhysicModels* fueltypeDB, FabricationPlant* fabri fNextPlan = fLoadingPlan.begin(); - cout << "!!INFO!! !!!Reactor!!! A Reactor has been define :" << endl; - cout << "\t Fuel Composition is not fixed ! "<< endl; - cout << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; - cout << "\t Life time (Operating's Duration) set at \t " << (double)(GetLifeTime()/3600/24/365.25) << " year" << endl; - cout << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << Power << " and " << ChargeFactor << " Charge Factor)"<< endl; - cout << "\t Burn-Up at end of Cycle set at \t " << (double)(fBurnUp) << " GWj/t" << endl; - cout << "\t The corresponding Cycle Time is\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; - cout << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl; - - GetLog()->fLog << "!!INFO!! !!!Reactor!!! A Reactor has been define :" << endl; - GetLog()->fLog << "\t Fuel Composition is not fixed ! "<< endl; - GetLog()->fLog << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "\t Life time (Operating's Duration) set at \t " << (double)(GetLifeTime()/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << Power << " and " << ChargeFactor << " Charge Factor)"<< endl; - GetLog()->fLog << "\t Burn-Up at end of Cycle set at \t " << (double)(fBurnUp) << " GWj/t" << endl; - GetLog()->fLog << "\t The corresponding Cycle Time is\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl; + INFO << " A Reactor has been define :" << endl; + INFO << "\t Fuel Composition is not fixed ! "<< endl; + INFO << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; + INFO << "\t Life time (Operating's Duration) set at \t " << (double)(GetLifeTime()/3600/24/365.25) << " year" << endl; + INFO << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << Power << " and " << ChargeFactor << " Charge Factor)"<< endl; + INFO << "\t Burn-Up at end of Cycle set at \t " << (double)(fBurnUp) << " GWj/t" << endl; + INFO << "\t The corresponding Cycle Time is\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; + INFO << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl; } -Reactor::Reactor(LogFile* log, PhysicModels* fueltypeDB, +Reactor::Reactor(CLASSLogger* log, PhysicModels* fueltypeDB, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, cSecond creationtime, cSecond lifetime, cSecond cycletime, double HMMass, double BurnUp):CLASSFacility(log, creationtime, lifetime, cycletime, 4) { - SetName("R_Reactor."); + (*this).SetName("R_Reactor."); fIsStarted = false; @@ -176,36 +161,27 @@ Reactor::Reactor(LogFile* log, PhysicModels* fueltypeDB, fNextPlan = fLoadingPlan.begin(); - cout << "!!INFO!! !!!Reactor!!! A Reactor has been define :" << endl; - cout << "\t Fuel Composition is not fixed ! "<< endl; - cout << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; - cout << "\t Life time (Operating's Duration) set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; - cout << "\t The Cycle Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; - cout << "\t Burn-Up at end of Cycle set at \t " << (double)(fBurnUp) << " GWj/t" << endl; - cout << "\t The corresponding Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW" << endl; - cout << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl; - - GetLog()->fLog << "!!INFO!! !!!Reactor!!! A Reactor has been define :" << endl; - GetLog()->fLog << "\t Fuel Composition is not fixed ! "<< endl; - GetLog()->fLog << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "\t Life time (Operating's Duration) set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "\t The Cycle Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "\t Burn-Up at end of Cycle set at \t " << (double)(fBurnUp) << " GWj/t" << endl; - GetLog()->fLog << "\t The corresponding Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW" << endl; - GetLog()->fLog << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl; + INFO << " A Reactor has been define :" << endl; + INFO << "\t Fuel Composition is not fixed ! "<< endl; + INFO << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; + INFO << "\t Life time (Operating's Duration) set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; + INFO << "\t The Cycle Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; + INFO << "\t Burn-Up at end of Cycle set at \t " << (double)(fBurnUp) << " GWj/t" << endl; + INFO << "\t The corresponding Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW" << endl; + INFO << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl; } -Reactor::Reactor(LogFile* log, EvolutionData evolutivedb, +Reactor::Reactor(CLASSLogger* log, EvolutionData evolutivedb, CLASSBackEnd* Pool, cSecond creationtime, cSecond lifetime, double power, double HMMass, double BurnUp, double ChargeFactor ):CLASSFacility(log, creationtime, lifetime, 4) { - SetName("R_Reactor."); + (*this).SetName("R_Reactor."); fIsStarted = false; @@ -244,21 +220,13 @@ Reactor::Reactor(LogFile* log, EvolutionData evolutivedb, fNextPlan = fLoadingPlan.begin(); - cout << "!!INFO!! !!!Reactor!!! A Reactor has been define :" << endl; - cout << "\t Fuel Composition is fixed ! "<< endl; - cout << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; - cout << "\t Life time (Operating's Duration) set at \t " << (double)(GetLifeTime()/3600/24/365.25) << " year" << endl; - cout << "\t The Cycle Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; - cout << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << power << " and " << ChargeFactor << " Charge Factor)"<< endl; - cout << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl; - - GetLog()->fLog << "!!INFO!! !!!Reactor!!! A Reactor has been define :" << endl; - GetLog()->fLog << "\t Fuel Composition is fixed ! "<< endl; - GetLog()->fLog << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "\t Life time (Operating's Duration) set at \t " << (double)(GetLifeTime()/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "\t The Cycle Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << power << " and " << ChargeFactor << " Charge Factor)"<< endl; - GetLog()->fLog << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl; + INFO << " A Reactor has been define :" << endl; + INFO << "\t Fuel Composition is fixed ! "<< endl; + INFO << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; + INFO << "\t Life time (Operating's Duration) set at \t " << (double)(GetLifeTime()/3600/24/365.25) << " year" << endl; + INFO << "\t The Cycle Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; + INFO << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << power << " and " << ChargeFactor << " Charge Factor)"<< endl; + INFO << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl; } @@ -344,6 +312,7 @@ void Reactor::SetNewFuel(EvolutionData ivdb) //________________________________________________________________________ void Reactor::Evolution(cSecond t) { +DBGL if( fIsShutDown || t < GetCreationTime() ) return; // Reactor stop or not started... @@ -355,8 +324,7 @@ void Reactor::Evolution(cSecond t) } else if(fIsStarted==true) { - GetLog()->fLog << "!!Warning!! !!!Reactor!!!" - << " Reactor should be working but there is no Heavy Nucleus Inside. It's not working so have a zero power..." + WARNING << " Reactor should be working but have no Heavy Nucleus Inside. It's not working so have a zero power..." << " Time : "<< t/365.25/3600/24 << " years" << endl; } @@ -405,23 +373,17 @@ void Reactor::Evolution(cSecond t) else { // This is so bad!! You will probably unsynchronize all the reactor.... - cout << "!!Warning!! !!!Reactor!!!" - << " Evolution is too long! This is a Bad way to deal the evolution of the reactor..." - << t/365.25/3600/24 << " :" << endl; - - - GetLog()->fLog << "!!Warning!! !!!Reactor!!!" - << " Evolution is too long! This is a Bad way to deal the evolution of the reactor..." - << t/365.25/3600/24 << " :" << endl; + ERROR << " Evolution is too long! There is a problem in Reactor evolution at " << t/365.25/3600/24 << endl; exit(1); } - +DBGL } //________________________________________________________________________ void Reactor::Dump() { +DBGL if(fInternalTime < GetCreationTime()) return; @@ -496,8 +458,7 @@ void Reactor::Dump() { if(!GetParc()->GetStockManagement()) { - cout << "!!Warning!! !!!Reactor!!! Can't have unfixedFuel without stock management'" << endl; - GetLog()->fLog << "!!Warning!! !!!Reactor!!! Can't have unfixedFuel without stock management" << endl; + ERROR << " Can't have unfixedFuel without stock management" << endl; exit(1); } @@ -544,7 +505,7 @@ void Reactor::Dump() } - +DBGL } diff --git a/source/branches/CLASSV3/src/Scenario.cxx b/source/branches/CLASSV3/src/Scenario.cxx index c657ffff9..541407788 100755 --- a/source/branches/CLASSV3/src/Scenario.cxx +++ b/source/branches/CLASSV3/src/Scenario.cxx @@ -15,7 +15,7 @@ #include "CLASSBackEnd.hxx" #include "Pool.hxx" #include "FabricationPlant.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" //________________________________________________________________________ @@ -43,56 +43,15 @@ string dtoa(double num) return os.str(); } - - //________________________________________________________________________ -Scenario::Scenario() +Scenario::Scenario(CLASSLogger* log, cSecond abstime):CLASSObject(log) { fNewTtree = true; fPrintStep = (cSecond)(3600*24*365.25); // One Step per Year - fAbsoluteTime = 0; - fStartingTime = 0; - - fStockManagement = true; - - fOutputFileName = "CLASS_Default.root"; - fOutputTreeName = "Data"; - fOutFile = 0; - fOutT = 0; - - SetLog(new LogFile("CLASS.log")); - fParcPower = 0; - - - // Warning - - cout << "!!INFO!! !!!Scenario!!! A Parc has been define :" << endl; - cout << "\t Print step at : " << (double)(fPrintStep/3600/24/365.25) << " year" << endl; - cout << "\t Absolute Time set at " << (double)(fAbsoluteTime/3600/24/365.25) << " year" << endl; - cout << "\t StockManagement set at : true" << endl; - cout << "\t OutPut will be in \"" << fOutputFileName << "\" File and \"" << fOutputTreeName << "\" TTree" << endl; - cout << "\t Log will be in " << GetLog()->GetLogFileName() << endl << endl; - - GetLog()->fLog << "!!INFO!! !!!Scenario!!! Parc has been define :" << endl; - GetLog()->fLog << "\t Print set at : " << (double)(fPrintStep/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "\t StockManagement set at : true" << endl; - GetLog()->fLog << "\t OutPut will be in \"" << fOutputFileName << "\" File and \"" << fOutputTreeName << "\" TTree" << endl; - GetLog()->fLog << "\t Log will be in " << GetLog()->GetLogFileName() << endl << endl; - - - -} -//________________________________________________________________________ -Scenario::Scenario(LogFile* Log):CLASSObject(Log) -{ - - - fNewTtree = true; - fPrintStep = (cSecond)(3600*24*365.25); // One Step per Year - fAbsoluteTime = 0; - fStartingTime = 0; + fAbsoluteTime = abstime; + fStartingTime = fAbsoluteTime; fStockManagement = true; @@ -106,29 +65,23 @@ Scenario::Scenario(LogFile* Log):CLASSObject(Log) // Warning - cout << "!!INFO!! !!!Scenario!!! A Parc has been define :" << endl; - cout << "\t Print set at : " << (double)(fPrintStep/3600/24/365.25) << " year" << endl; - cout << "\t Absolute Time set at " << (double)(fAbsoluteTime/3600/24/365.25) << " year" << endl; - cout << "\t StockManagement set at : true" << endl; - cout << "\t OutPut will be in \"" << fOutputFileName << "\" File and \"" << fOutputTreeName << "\" TTree" << endl; - cout << "\t Log will be in " << GetLog()->GetLogFileName() << endl << endl; - GetLog()->fLog << "!!INFO!! !!!Scenario!!! Parc has been define :" << endl; - GetLog()->fLog << "\t Print set at : " << (double)(fPrintStep/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "\t StockManagement set at : true" << endl; - GetLog()->fLog << "\t OutPut will be in \"" << fOutputFileName << "\" File and \"" << fOutputTreeName << "\" TTree" << endl; - GetLog()->fLog << "\t Log will be in " << GetLog()->GetLogFileName() << endl << endl; + INFO << " Parc has been define :" << endl; + INFO << " Print set at : " << (double)(fPrintStep/3600/24/365.25) << " year" << endl; + INFO << " StockManagement set at : true" << endl; + INFO << " OutPut will be in \"" << fOutputFileName << "\" File and \"" << fOutputTreeName << "\" TTree" << endl; + INFO << " Log will be in " << GetLog()->GetCLASSLoggerName() << endl; } //________________________________________________________________________ -Scenario::Scenario(double abstime) +Scenario::Scenario(cSecond abstime, CLASSLogger* log):CLASSObject(log) { fNewTtree = true; fPrintStep = (cSecond)(3600*24*365.25); // One Step per Year - fAbsoluteTime = (cSecond)abstime; + fAbsoluteTime = abstime; fStartingTime = fAbsoluteTime; fStockManagement = true; @@ -137,26 +90,15 @@ Scenario::Scenario(double abstime) fOutputTreeName = "Data"; fOutFile = 0; fOutT = 0; - - SetLog(new LogFile("CLASS.log")); fParcPower = 0; - - - // Warning - cout << "!!INFO!! !!!Scenario!!! A Parc has been define :" << endl; - cout << "\t Print set at : " << (double)(fPrintStep/3600/24/365.25) << " year" << endl; - cout << "\t StockManagement set at : true" << endl; - cout << "\t OutPut will be in \"" << fOutputFileName << "\" File and \"" << fOutputTreeName << "\" TTree" << endl; - cout << "\t Log will be in " << GetLog()->GetLogFileName() << endl; - - GetLog()->fLog << "!!INFO!! !!!Scenario!!! Parc has been define :" << endl; - GetLog()->fLog << "\t Print set at : " << (double)(fPrintStep/3600/24/365.25) << " year" << endl; - GetLog()->fLog << "\t StockManagement set at : true" << endl; - GetLog()->fLog << "\t OutPut will be in \"" << fOutputFileName << "\" File and \"" << fOutputTreeName << "\" TTree" << endl; - GetLog()->fLog << "\t Log will be in " << GetLog()->GetLogFileName() << endl << endl; + INFO << "!!INFO!! !!!Scenario!!! Parc has been define :" << endl; + INFO << "\t Print set at : " << (double)(fPrintStep/3600/24/365.25) << " year" << endl; + INFO << "\t StockManagement set at : true" << endl; + INFO << "\t OutPut will be in \"" << fOutputFileName << "\" File and \"" << fOutputTreeName << "\" TTree" << endl; + INFO << "\t Log will be in " << GetLog()->GetCLASSLoggerName() << endl; @@ -341,6 +283,7 @@ map<cSecond,int> Scenario::GetTheBackEndTimePath(Reactor* reactor) //________________________________________________________________________ void Scenario::BuildTimeVector(cSecond t) { +DBGL fTimeStep.clear(); fTimeStep.insert( pair<cSecond ,int>(t,1) ); //********* Printing Step *********// @@ -430,8 +373,7 @@ void Scenario::BuildTimeVector(cSecond t) } else if( step - FabricationCycleTime < fStartingTime ) { - cout << "!!Warning!! !!!CLASS!!! Can't Build Fuel before Scenario's start\"\n" << endl; - GetLog()->fLog << "!!Warning!! !!!CLASS!!! Can't Build Fuel before Scenario's start\"\n" << endl; + ERROR << " Can't Build Fuel before Scenario's start\"\n" << endl; exit(1); } } @@ -497,8 +439,7 @@ void Scenario::BuildTimeVector(cSecond t) } else { - cout << "!!Warning!! !!!Reactor!!! Be carefull a reactor cycletime is set to 0 second....\"\n" << endl; - GetLog()->fLog << "!!Warning!! !!!Reactor!!! Be carefull a reactor cycletime is set to 0 second....\"\n" << endl; + WARNING << " Be carefull a reactor cycletime is set to 0 second....\"\n" << endl; } } @@ -510,14 +451,13 @@ void Scenario::BuildTimeVector(cSecond t) ofstream TimeStepfile("CLASS_TimeStep", ios_base::app); // Open the File if(!TimeStepfile) - { - cout << "!!Warning!! !!!CLASS!!! Can't open \" CLASS_TimeStep \"\n" << endl; - GetLog()->fLog << "!!Warning!! !!!CLASS!!! Can't open \" CLASS_TimeStep \"\n" << endl; - } + WARNING << " Can't open \" CLASS_TimeStep \"\n" << endl; + map<cSecond ,int >::iterator it; for( it = fTimeStep.begin(); it != fTimeStep.end(); it++) TimeStepfile << (*it).first << " " << (*it).second << endl; +DBGL } //________________________________________________________________________ void Scenario::OldBuildTimeVector(cSecond t) @@ -592,8 +532,7 @@ void Scenario::OldBuildTimeVector(cSecond t) } else if(step - fabricationstep < fStartingTime) { - cout << "!!Warning!! !!!CLASS!!! Can't Build Fuel before Scenario's start\"\n" << endl; - GetLog()->fLog << "!!Warning!! !!!CLASS!!! Can't Build Fuel before Scenario's start\"\n" << endl; + ERROR << " Can't Build Fuel before Scenario's start\"\n" << endl; exit(1); } } @@ -658,13 +597,14 @@ void Scenario::OldBuildTimeVector(cSecond t) if(!TimeStepfile) { - cout << "!!Warning!! !!!CLASS!!! Can't open \" CLASS_TimeStep \"\n" << endl; - GetLog()->fLog << "!!Warning!! !!!CLASS!!! Can't open \" CLASS_TimeStep \"\n" << endl; + WARNING << " Can't open \" CLASS_TimeStep \"\n" << endl; + } + else + { + map<cSecond ,int >::iterator it; + for( it = fTimeStep.begin(); it != fTimeStep.end(); it++) + TimeStepfile << (*it).first << " " << (*it).second << endl; } - map<cSecond ,int >::iterator it; - for( it = fTimeStep.begin(); it != fTimeStep.end(); it++) - TimeStepfile << (*it).first << " " << (*it).second << endl; - } @@ -675,40 +615,40 @@ void Scenario::OldBuildTimeVector(cSecond t) void Scenario::PoolEvolution() { - +DBGL #pragma omp parallel for for(int i = 0; i < (int) fPool.size();i++) fPool[i]->Evolution(fAbsoluteTime); for(int i = 0; i < (int) fPool.size();i++) fPool[i]->Dump(); - +DBGL } void Scenario::StorageEvolution() { - +DBGL #pragma omp parallel for for(int i = 0; i < (int) fStorage.size();i++) fStorage[i]->Evolution(fAbsoluteTime); - +DBGL } void Scenario::FabricationPlantEvolution() { - +DBGL //#pragma omp parallel for for(int i = 0; i < (int) fFabricationPlant.size();i++) fFabricationPlant[i]->Evolution(fAbsoluteTime); - +DBGL } //________________________________________________________________________ void Scenario::ReactorEvolution() { - +DBGL fParcPower = 0; #pragma omp parallel for for(int i = 0; i < (int)fReactor.size(); i++) @@ -718,13 +658,13 @@ void Scenario::ReactorEvolution() for(int i = 0; i < (int)fReactor.size(); i++) fReactor[i]->Dump(); - +DBGL } //________________________________________________________________________ void Scenario::Evolution(double t) { - +DBGL BuildTimeVector( (cSecond)t ); @@ -768,7 +708,7 @@ void Scenario::Evolution(double t) } cout << endl; - +DBGL } void Scenario::ProgressPrintout(cSecond t) @@ -777,7 +717,11 @@ void Scenario::ProgressPrintout(cSecond t) double Time = (fAbsoluteTime-fStartingTime)/3600/24/365.25 ; double Total = (t-fStartingTime)/3600/24/365.25; - cout << " " << flush ; + // Reset the line + for(int i = 0; i < 100; i++) + cout << " "; + cout << flush ; + cout << "\r["; for(int i = 0; i < (int)(Time/Total*100.0); i++) cout << "|"; @@ -788,13 +732,12 @@ void Scenario::ProgressPrintout(cSecond t) cout << " Processed "; if (Time < 10) cout << " "; if (Time < 100) cout << " "; - cout << (int)Time << " / " << (int)Total << " Years \r" << flush; + cout << (int)Time << " / " << (int)Total << " Years \r"; + if(fLog->GetVerboseLVL() < 2) cout << flush; + else cout << endl; - GetLog()->fLog << "Proccessed"; - if (Time < 10) GetLog()->fLog << " "; - if (Time < 100) GetLog()->fLog << " "; - GetLog()->fLog << (int)Time << " / " << (int)Total << " Years \r" << endl; + INFO << " Proccessed" << (int)Time << " / " << (int)Total << " Years \r" << endl; } @@ -844,31 +787,26 @@ void Scenario::OpenOutputTree() { - cout << "Opening OutPut File ...\t"; - GetLog()->fLog << "Opening : " << fOutputFileName << " ...\t"; + INFO << "Opening : " << fOutputFileName << " ...\t"; fOutFile = new TFile(fOutputFileName.c_str(),"UPDATE"); if(!fOutFile) { - cout << "\nCould not open " << fOutputFileName <<endl; - GetLog()->fLog << "\nCould not open " << fOutputFileName <<endl; + ERROR << "\nCould not open " << fOutputFileName <<endl; exit(-1); } cout << "\t ...OK!" << endl; fOutT = new TTree(fOutputTreeName.c_str(), "Data Tree"); - cout << "Creating Data Tree ...\t"; - GetLog()->fLog << "Creating Data Tree ...\t"; + INFO << "Creating Data Tree ...\t"; if(!fOutT) { - cout << "\nCould not create Data Tree in " << fOutputFileName << endl; - GetLog()->fLog << "\nCould not create Data Tree in " << fOutputFileName << endl; + ERROR << "\nCould not create Data Tree in " << fOutputFileName << endl; exit(-1); } fNewTtree = false; - cout << "\t ...OK!" << endl; - GetLog()->fLog << "\t ...OK!" << endl; + INFO << "\t ...OK!" << endl; } void Scenario::CloseOutputTree() @@ -876,21 +814,17 @@ void Scenario::CloseOutputTree() fOutFile->ls(); - cout << "Writing outTree " << fOutputFileName << endl; - GetLog()->fLog << "Writing outTree " << fOutputFileName << endl; + INFO << "Writing outTree " << fOutputFileName << endl; fOutFile->Write(); if(fOutFile->IsOpen()) { - cout << "Deleting outTree : " << endl; - GetLog()->fLog << "Deleting outTree : " << endl; + INFO << "Deleting outTree : " << endl; delete fOutT; - cout << "Closing file : " << fOutputFileName <<endl; - GetLog()->fLog << "Closing file : " << fOutputFileName <<endl; + INFO << "Closing file : " << fOutputFileName <<endl; fOutFile-> Close(); delete fOutFile; } else { - cout << "File was not opened " << fOutputFileName << endl; - GetLog()->fLog << "File was not opened " << fOutputFileName << endl; + ERROR << "File was not opened " << fOutputFileName << endl; exit(-1); } } @@ -953,15 +887,15 @@ void Scenario::Print() for(int i = 0; i < (int) fPool.size();i++) { - cout << "!!!!!!!!!STEP : " << fAbsoluteTime/(int)(3600*24*365.25) << endl; - cout << "Pool : " << endl; - cout << "Cooling "; - cout << fPool[i]->GetIVArray().size()<< endl; + INFO << "!!!!!!!!!STEP : " << fAbsoluteTime/(int)(3600*24*365.25) << endl; + INFO << "Pool : " << endl; + INFO << "Cooling "; + INFO << fPool[i]->GetIVArray().size()<< endl; } for(int i = 0; i < (int)fReactor.size(); i++) { - cout << "Reactor" << endl; + INFO << "Reactor" << endl; fReactor[i]->GetIVReactor().Print(); } diff --git a/source/branches/CLASSV3/src/Storage.cxx b/source/branches/CLASSV3/src/Storage.cxx index 98fd52947..2ce36f408 100644 --- a/source/branches/CLASSV3/src/Storage.cxx +++ b/source/branches/CLASSV3/src/Storage.cxx @@ -1,7 +1,7 @@ #include "Storage.hxx" #include "Scenario.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include <sstream> @@ -27,19 +27,17 @@ Storage::Storage():CLASSBackEnd(-1) } -Storage::Storage(LogFile* log):CLASSBackEnd(log, -1) +Storage::Storage(CLASSLogger* log):CLASSBackEnd(log, -1) { SetIsStorageType(); SetName("S_Storage."); - cout << "!!INFO!! !!!Storage!!! A new Storage has been define." << endl; - - GetLog()->fLog << "!!INFO!! !!!Storage!!! A new Storage has been define." << endl; + INFO << " A new Storage has been define." << endl; } //________________________________________________________________________ -Storage::Storage(LogFile* log, DecayDataBank* evolutivedb):CLASSBackEnd(log, -1) +Storage::Storage(CLASSLogger* log, DecayDataBank* evolutivedb):CLASSBackEnd(log, -1) { SetIsStorageType(); @@ -47,9 +45,7 @@ Storage::Storage(LogFile* log, DecayDataBank* evolutivedb):CLASSBackEnd(log, -1) SetName("S_Storage."); - cout << "!!INFO!! !!!Storage!!! A new Storage has been define." << endl; - - GetLog()->fLog << "!!INFO!! !!!Storage!!! A new Storage has been define." << endl; + INFO << " A new Storage has been define." << endl; } @@ -84,8 +80,7 @@ void Storage::TakeFractionFromStock(int IVId,double fraction) { if(fraction > 1 || fraction < 0) { - cout << "!!Warning!! !!!Storage!!! You try to remove fraction superior than 1 or a negative one..." << endl; - GetLog()->fLog << "!!Warning!! !!!Storage!!! You try to remove fraction superior than 1 or a negative one..." << endl; + WARNING << " You try to remove fraction superior than 1 or a negative one..." << endl; } else { @@ -98,8 +93,7 @@ void Storage::TakeFractionFromStock(int IVId,double fraction) } else { - cout << "!!Warning!! !!!Storage!!! TakeFractionFromStock can't be DEFINE without REAL stock management" << endl; - GetLog()->fLog << "!!Warning!! !!!Storage!!! TakeFractionFromStock can't be DEFINE without REAL stock management" << endl; + ERROR << " TakeFractionFromStock can't be DEFINE without REAL stock management" << endl; exit(1); } @@ -119,8 +113,7 @@ void Storage::TakeFromStock(IsotopicVector isotopicvector) } else { - cout << "!!Warning!! !!!Storage!!! TakeFromStock can't be DEFINE WITH REAL stock management" << endl; - GetLog()->fLog << "!!Warning!! !!!Storage!!! TakeFromStock can't be DEFINE WITH REAL stock management" << endl; + ERROR << " TakeFromStock can't be DEFINE WITH REAL stock management" << endl; exit(1); } @@ -129,7 +122,7 @@ void Storage::TakeFromStock(IsotopicVector isotopicvector) //________________________________________________________________________ void Storage::StorageEvolution(cSecond t) { - +DBGL if(t == fInternalTime && t !=0 ) return; @@ -151,10 +144,7 @@ void Storage::StorageEvolution(cSecond t) { fIVArray[i] = GetDecay(fIVArray[i] , EvolutionTime); } - - - - +DBGL } //________________________________________________________________________ diff --git a/source/branches/CLASSV3/src/XSM_CLOSEST.cxx b/source/branches/CLASSV3/src/XSM_CLOSEST.cxx index dd5a79b80..8d48af58c 100644 --- a/source/branches/CLASSV3/src/XSM_CLOSEST.cxx +++ b/source/branches/CLASSV3/src/XSM_CLOSEST.cxx @@ -1,6 +1,6 @@ #include "XSModel.hxx" #include "XSM_CLOSEST.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include "StringLine.hxx" @@ -27,7 +27,7 @@ // // //________________________________________________________________________ -XSM_CLOSEST::XSM_CLOSEST(LogFile* Log,string DB_index_file, bool oldreadmethod ): XSModel(Log) +XSM_CLOSEST::XSM_CLOSEST(CLASSLogger* Log,string DB_index_file, bool oldreadmethod ): XSModel(Log) { fOldReadMethod = oldreadmethod; fDataBaseIndex = DB_index_file; @@ -39,13 +39,9 @@ XSM_CLOSEST::XSM_CLOSEST(LogFile* Log,string DB_index_file, bool oldreadmethod ) if(IsLog()) { // Warning - cout << "!!INFO!! !!!XSM_CLOSEST!!! A EvolutionData has been define :" << endl; - cout << "\t His index is : \"" << DB_index_file << "\"" << endl; - cout << "\t " << fFuelDataBank.size() << " EvolutionData have been read."<< endl << endl; - - GetLog()->fLog << "!!INFO!! !!!XSM_CLOSEST!!! A EvolutionData has been define :" << endl; - GetLog()->fLog << "\t His index is : \"" << DB_index_file << "\"" << endl; - GetLog()->fLog << "\t " << fFuelDataBank.size() << " EvolutionData have been read."<< endl << endl; + INFO << " A EvolutionData has been define :" << endl; + INFO << "\t His index is : \"" << DB_index_file << "\" " << endl; + INFO << "\t " << fFuelDataBank.size() << " EvolutionData have been read."<< endl << endl; } } @@ -72,10 +68,8 @@ void XSM_CLOSEST::ReadDataBase() ifstream DataDB(fDataBaseIndex.c_str()); // Open the File if(!DataDB) - { - cout << "!!Warning!! !!!FuelDataBank!!! \n Can't open \"" << fDataBaseIndex << "\"\n" << endl; - GetLog()->fLog << "!!Warning!! !!!FuelDataBank!!! \n Can't open \"" << fDataBaseIndex << "\"\n" << endl; - } + WARNING << " Can't open \"" << fDataBaseIndex << "\"\n" << endl; + vector<double> vTime; vector<double> vTimeErr; @@ -87,8 +81,7 @@ void XSM_CLOSEST::ReadDataBase() getline(DataDB, line); if( StringLine::NextWord(line, start, ' ') != "TYPE") { - cout << "!!Bad Trouble!! !!!FuelDataBank!!! Bad Database file : " << fDataBaseIndex << " Can't find the type of the DataBase"<< endl; - GetLog()->fLog << "!!Bad Trouble!! !!!FuelDataBank!!! Bad Database file : " << fDataBaseIndex << " Can't find the type of the DataBase"<< endl; + ERROR << " Bad Database file : " << fDataBaseIndex << " Can't find the type of the DataBase"<< endl; exit (1); } fFuelType = StringLine::NextWord(line, start, ' '); @@ -142,14 +135,14 @@ map<double, int> XSM_CLOSEST::GetDistancesTo(IsotopicVector isotopicvector, doub //________________________________________________________________________ EvolutionData XSM_CLOSEST::GetCrossSections(IsotopicVector isotopicvector, double t) { - +DBGL double distance = 0; int N_BestEvolutionData = 0; if(fWeightedDistance) { - +DBGL IsotopicVector ActinidesCompositionAtT = fFuelDataBank[0].GetIsotopicVectorAt(t).GetActinidesComposition(); IsotopicVector IV_ActinidesComposition = isotopicvector.GetActinidesComposition(); @@ -176,12 +169,12 @@ EvolutionData XSM_CLOSEST::GetCrossSections(IsotopicVector isotopicvector, doubl N_BestEvolutionData = i; } } - +DBGL return fFuelDataBank[N_BestEvolutionData]; } else if (fEvolutionDataInterpolation) { - +DBGL map<double, int> distance_map = GetDistancesTo(isotopicvector, t); map<double, int>::iterator it_distance; int NClose = 64; @@ -227,11 +220,13 @@ EvolutionData XSM_CLOSEST::GetCrossSections(IsotopicVector isotopicvector, doubl EvolInterpolate = Multiply(1/SumOfDistance, Evoltmp); Evoltmp.DeleteEvolutionData(); +DBGL return EvolInterpolate; } else { +DBGL IsotopicVector ActinidesCompositionAtT = fFuelDataBank[0].GetIsotopicVectorAt(t).GetActinidesComposition(); IsotopicVector IV_ActinidesComposition = isotopicvector.GetActinidesComposition(); @@ -261,21 +256,17 @@ EvolutionData XSM_CLOSEST::GetCrossSections(IsotopicVector isotopicvector, doubl } } +DBGL return fFuelDataBank[N_BestEvolutionData]; - } - + } //________________________________________________________________________ void XSM_CLOSEST::CalculateDistanceParameter() { - +DBGL if(fDistanceType!=1){ - cout << "!!Warning!! !!!CalculateDistanceParameter!!!" - << " Distance Parameter will be calculate even if the distance type is not the good one. Any Distance Parameters given by the user will be overwriten"<<endl; - - GetLog()->fLog << "!!Warning!! !!!CalculateDistanceParameter!!!" - << " Distance Parameter will be calculate even if the distance type is not the good one. Any Distance Parameters given by the user will be overwriten"<<endl; + WARNING << " Distance Parameter will be calculate even if the distance type is not the good one. Any Distance Parameters given by the user will be overwriten" << endl; } fDistanceParameter.Clear(); @@ -304,20 +295,20 @@ void XSM_CLOSEST::CalculateDistanceParameter() if(GetLog()) { - GetLog()->fLog <<"!!INFO!! Distance Parameters "<<endl; + INFO <<"!!INFO!! Distance Parameters "<<endl; map<ZAI ,double >::iterator it2; for(it2 = fDistanceParameter.GetIsotopicQuantity().begin();it2 != fDistanceParameter.GetIsotopicQuantity().end(); it2++) { - GetLog()->fLog << (*it2).first.Z() << " "; - GetLog()->fLog << (*it2).first.A() << " "; - GetLog()->fLog << (*it2).first.I() << " "; - GetLog()->fLog << ": " << (*it2).second; - GetLog()->fLog << endl; + INFO << (*it2).first.Z() << " "; + INFO << (*it2).first.A() << " "; + INFO << (*it2).first.I() << " "; + INFO << ": " << (*it2).second; + INFO << endl; } - GetLog()->fLog << endl; + INFO << endl; } - +DBGL } //________________________________________________________________________ void XSM_CLOSEST::SetDistanceParameter(IsotopicVector DistanceParameter) @@ -325,17 +316,17 @@ void XSM_CLOSEST::SetDistanceParameter(IsotopicVector DistanceParameter) fDistanceParameter = DistanceParameter; - GetLog()->fLog <<"!!INFO!! Distance Parameters "<<endl; + INFO <<"!!INFO!! Distance Parameters "<<endl; map<ZAI ,double >::iterator it2; for(it2 = fDistanceParameter.GetIsotopicQuantity().begin();it2 != fDistanceParameter.GetIsotopicQuantity().end(); it2++) { - GetLog()->fLog << (*it2).first.Z() << " "; - GetLog()->fLog << (*it2).first.A() << " "; - GetLog()->fLog << (*it2).first.I() << " "; - GetLog()->fLog << ": " << (*it2).second; - GetLog()->fLog << endl; + INFO << (*it2).first.Z() << " "; + INFO << (*it2).first.A() << " "; + INFO << (*it2).first.I() << " "; + INFO << ": " << (*it2).second; + INFO << endl; } - GetLog()->fLog << endl; + INFO << endl; } @@ -349,19 +340,11 @@ void XSM_CLOSEST::SetDistanceType(int DistanceType) } else if(fDistanceType == 2 && Norme(fDistanceParameter)==0){ // This is so bad!! You will probably unsynchronize all the reactor.... - cout << "!!Warning!! !!!DistanceType!!!" - << " Distance use weight defined by user for each isotope, but no weight have been given" << endl<<"Use SetDistanceParameter()"<<endl; - - GetLog()->fLog << "!!Warning!! !!!DistanceType!!!" - << " Distance use weight defined by user for each isotope, but no weight have been given" << endl<<"Use SetDistanceParameter()"<<endl; + WARNING << " Distance use weight defined by user for each isotope, but no weight have been given" << endl<<"Use SetDistanceParameter()"<<endl; exit(1); } else if (fDistanceType != 0 && fDistanceType != 1 && fDistanceType != 2 ){ - cout << "!!ERROR!! !!!DistanceType!!!" - << " Distancetype defined by the user isn't recognized by the code"<<endl; - - GetLog()->fLog << "!!ERROR!! !!!DistanceType!!!" - << " Distancetype defined by the user isn't recognized by the code"<<endl; + ERROR << " Distancetype defined by the user isn't recognized by the code"<<endl; exit(1); } diff --git a/source/branches/CLASSV3/src/XSM_MLP_PWR_MOX.cxx b/source/branches/CLASSV3/src/XSM_MLP_PWR_MOX.cxx index 6bd02e972..8942bfe93 100644 --- a/source/branches/CLASSV3/src/XSM_MLP_PWR_MOX.cxx +++ b/source/branches/CLASSV3/src/XSM_MLP_PWR_MOX.cxx @@ -1,7 +1,7 @@ #include "XSModel.hxx" #include "XSM_MLP_PWR_MOX.hxx" -#include "LogFile.hxx" +#include "CLASSLogger.hxx" #include "StringLine.hxx" #include "TMVA/Reader.h" @@ -32,8 +32,8 @@ // // //________________________________________________________________________ -XSM_MLP_PWR_MOX::XSM_MLP_PWR_MOX(LogFile* Log,string TMVA_Weight_Directory,string InformationFile, bool IsTimeStep) -{ +XSM_MLP_PWR_MOX::XSM_MLP_PWR_MOX(CLASSLogger* Log,string TMVA_Weight_Directory,string InformationFile, bool IsTimeStep) +{ SetLog(Log); @@ -50,12 +50,8 @@ XSM_MLP_PWR_MOX::XSM_MLP_PWR_MOX(LogFile* Log,string TMVA_Weight_Directory,strin if(IsLog()) { // Warning - cout << "!!INFO!! !!!XSM_MLP_PWR_MOX!!! A EvolutionData has been define :" << endl; - cout << "\t His TMVA folder is : \"" << fTMVAWeightFolder << "\"" << endl; - - - GetLog()->fLog << "!!INFO!! !!!XSM_MLP_PWR_MOX!!! A EvolutionData has been define :" << endl; - GetLog()->fLog <<"\t His TMVA folder is : \"" << fTMVAWeightFolder << "\"" << endl; + INFO << " A EvolutionData has been define : " << endl; + INFO << " \t His TMVA folder is : \" " << fTMVAWeightFolder << "\"" << endl; } } @@ -128,7 +124,7 @@ void XSM_MLP_PWR_MOX::GetDataBaseInformation() } else { - cout<<"Can't find/open file "<<fMLPInformationFile<<endl; + ERROR << "Can't find/open file " << fMLPInformationFile << endl; exit(0); } @@ -215,7 +211,7 @@ void XSM_MLP_PWR_MOX::ReadWeightFile(string Filename, int &Z, int &A, int &I, in if(Z<=0 || A<=0 || I<0 || Reaction==-1) { - cout<<"ERROR in XSM_MLP_PWR_MOX::ReadWeightFile : wrong TMVA weight format"<<endl; + ERROR << " wrong TMVA weight format " << endl; exit(0); } } @@ -416,7 +412,7 @@ void XSM_MLP_PWR_MOX::ReadWeightFileStep(string Filename, int &Z, int &A, int &I if(Z==-1 || A==-1 || I==-1 || Reaction==-1 || TimeStep==-1) { - cout<<"ERROR in XSM_MLP_PWR_MOX::ReadWeightFile : wrong TMVA weight format"<<endl; + ERROR << " wrong TMVA weight format " << endl; exit(0); } } @@ -484,7 +480,7 @@ EvolutionData XSM_MLP_PWR_MOX::GetCrossSectionsStep(IsotopicVector IV) EvolutionData XSM_MLP_PWR_MOX::GetCrossSections(IsotopicVector IV ,double t) { if(t!=0) - {cout<<"WARNING::XSM_MLP_PWR_MOX::GetCrossSections argument t has non effect here "<<endl; } + WARNING << " argument t has non effect here " << endl; EvolutionData EV; if(fIsStepTime) diff --git a/source/branches/CLASSV3/src/XSModel.cxx b/source/branches/CLASSV3/src/XSModel.cxx index 700c79b52..19b7c12ce 100644 --- a/source/branches/CLASSV3/src/XSModel.cxx +++ b/source/branches/CLASSV3/src/XSModel.cxx @@ -17,7 +17,7 @@ XSModel::XSModel(): CLASSObject() -XSModel::XSModel(LogFile* log): CLASSObject(log) +XSModel::XSModel(CLASSLogger* log): CLASSObject(log) { } \ No newline at end of file diff --git a/source/branches/CLASSV3/src/ZAIMass.cxx b/source/branches/CLASSV3/src/ZAIMass.cxx index 621a7104c..8c355e969 100644 --- a/source/branches/CLASSV3/src/ZAIMass.cxx +++ b/source/branches/CLASSV3/src/ZAIMass.cxx @@ -28,7 +28,7 @@ ZAIMass::ZAIMass() if(!infile.good()) { - cout<<"ZAIMass Error.\n can't find/open file "<<MassDataFile<<endl; + cout << " ZAIMass Error.\n can't find/open file " << MassDataFile << endl; exit(1); } -- GitLab