diff --git a/source/branches/CLASSV3/include/CLASSFuelPlan.hxx b/source/branches/CLASSV3/include/CLASSFuelPlan.hxx index 81b8d721b0afd72d15c091dd514592a7b6efcdfa..7fabaedd9535a684ecd78919430edcbd8b379ff8 100644 --- a/source/branches/CLASSV3/include/CLASSFuelPlan.hxx +++ b/source/branches/CLASSV3/include/CLASSFuelPlan.hxx @@ -44,6 +44,7 @@ class CLASSFuelPlan : public CLASSObject CLASSFuelPlan(CLASSLogger* log); void AddFuel(cSecond time, CLASSFuel fuel, double BurnUp); + void AddFuel(cSecond time, EvolutionData* fuel, double BurnUp) {AddFuel( time, CLASSFuel(fuel), BurnUp);} void AddFuel(cSecond time, PhysicsModels* fuel, double BurnUp) {AddFuel( time, CLASSFuel(fuel), BurnUp);} diff --git a/source/branches/CLASSV3/include/CLASSNucleiFiliation.hxx b/source/branches/CLASSV3/include/CLASSNucleiFiliation.hxx new file mode 100644 index 0000000000000000000000000000000000000000..8fff72da2e340b8fe27dd0a9122b49014a259620 --- /dev/null +++ b/source/branches/CLASSV3/include/CLASSNucleiFiliation.hxx @@ -0,0 +1,72 @@ +#ifndef _CLASSNucleiFiliation_ +#define _CLASSNucleiFiliation_ + +/*! + \file + \brief Header file for CLASSNucleiFiliation classes. + */ + +#include "CLASSObject.hxx" +#include "IsotopicVector.hxx" + +using namespace std; + +//-----------------------------------------------------------------------------// +/*! + Define a nuclei as : Z A I. + The aim of this class is to discribe each CLASSNucleiFiliation. + + @author BaM + @version 2.0 + */ +//________________________________________________________________________ + + + +class CLASSNucleiFiliation : public CLASSObject +{ +public: + + + //********* Constructor/Destructor Method *********// + + /*! + \name Constructor/Desctructor + */ + //@{ + + CLASSNucleiFiliation(); ///< Default constructor + //} + + CLASSNucleiFiliation(CLASSNucleiFiliation CNF); + + + ~CLASSNucleiFiliation(); ///< Normal Destructor. + + void AddDaughterToZAI(ZAI Mother, IsotopicVector Daughter ); + + + IsotopicVector GetFiliation(ZAI Mother); + + map<ZAI, IsotopicVector> GetNucleiFIliation() const {return fNucleiFiliation;} + + + void FiliationCleanUp(map<ZAI, int> GoodNuclei, CLASSNucleiFiliation CuttedNuclei); + + void SelfFiliationCleanUp(map<ZAI, int> GoodNuclei); + + void NormalizeBranchingRatio(double Value = 1); + + void NormalizeBranchingRatio(ZAI Mother, double Value); + + + protected : + + map<ZAI, IsotopicVector> fNucleiFiliation; + + + ClassDef(CLASSNucleiFiliation,1); +}; + + +#endif diff --git a/source/branches/CLASSV3/include/IsotopicVector.hxx b/source/branches/CLASSV3/include/IsotopicVector.hxx index 054d7c902badab5acc7866162b71696bf45ca512..92e821dc5c0e38a17ea3ccbcca1991e153a19210 100755 --- a/source/branches/CLASSV3/include/IsotopicVector.hxx +++ b/source/branches/CLASSV3/include/IsotopicVector.hxx @@ -11,6 +11,7 @@ #include "TObject.h" #include <string> +#include <vector> #include <map> using namespace std; @@ -62,8 +63,15 @@ public : IsotopicVector GetThisComposition(IsotopicVector IV) const; //!< Return the composition according the IV list... vector<ZAI> GetZAIList() const; //!< Return the list of ZAI present in the IV IsotopicVector GetActinidesComposition() const; //!< Return the Actinides composition of the "z" atom + double GetZAIIsotopicQuantity(const ZAI& zai) const; ///< Return the quantity of the ZAI double GetZAIIsotopicQuantity(const int z, const int a, const int i) const; ///< Return the quantity of the ZAI + double GetQuantity(const int z, const int a, const int i) const {return GetZAIIsotopicQuantity(z,a,i);} + double GetQuantity(const ZAI& zai) const {return GetZAIIsotopicQuantity(zai);} + + + + double GetTotalMass() const; //!< Return the mass (in tons) of the isotopic vector double MeanMolar() const; //<! Return the mean molar mass of the isotopic vector diff --git a/source/branches/CLASSV3/src/CLASSNucleiFiliation.cxx b/source/branches/CLASSV3/src/CLASSNucleiFiliation.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7bdaa34bda08dbf7c17638fb247514e665d69ea7 --- /dev/null +++ b/source/branches/CLASSV3/src/CLASSNucleiFiliation.cxx @@ -0,0 +1,238 @@ +#include "CLASSNucleiFiliation.hxx" +#include "ZAI.hxx" +#include "IsotopicVector.hxx" + +#include <map> +#include <vector> +#include "stdlib.h" + +using namespace std; + +//const string DEFAULTDATABASE = "DecayBase.dat"; +//________________________________________________________________________ +// +// CLASSNucleiFiliation +// +// +// +// +//________________________________________________________________________ +//____________________________InClass Operator____________________________ +//________________________________________________________________________ +ClassImp(CLASSNucleiFiliation) + + +CLASSNucleiFiliation::CLASSNucleiFiliation():CLASSObject() +{ +} + + +CLASSNucleiFiliation::CLASSNucleiFiliation(CLASSNucleiFiliation CNF):CLASSObject() +{ + fNucleiFIliation = CNF.GetNucleiFIliation(); +} + + + +//________________________________________________________________________ +CLASSNucleiFiliation::~CLASSNucleiFiliation() +{ + +} + + +//________________________________________________________________________ +void CLASSNucleiFiliation::AddDaughterToZAI(ZAI Mother, IsotopicVector Daughter ) +{ + DBGL + + pair< map<ZAI, IsotopicVector>::iterator, bool> IResult; + + + IResult = fNucleiFiliation.insert( pair<ZAI, IsotopicVector> ( Mother, Daughter ) ); + + if( !IResult.second) + (*IResult.first).second += Daughter ; + + + DBGL +} + + +//________________________________________________________________________ +IsotopicVector CLASSNucleiFiliation::GetFiliation(ZAI Mother) +{ + DBGL + map<ZAI, IsotopicVector>::iterator it_Filiation; + + it_Filiation = fNucleiFiliation.find(Mother); + + DBGL + if(it_Filiation != fNucleiFiliation.end()) + return it_Filiation->second; + else + return ZAI(-1,-1,-1)*1; // return -1 -1 _1 ZAI if unknown nuclei.... + +} + +//________________________________________________________________________ +void CLASSNucleiFiliation::FiliationCleanUp(map<ZAI, int> GoodNuclei, CLASSNucleiFiliation CuttedNuclei) +{ + DBGL + map<ZAI, IsotopicVector>::iterator it_Filiation; + for(it_Filiation = fNucleiFiliation.begin(); it_Filiation != fNucleiFiliation.end(); it_Filiation++) + { + vector<ZAI> DautherList = it_Filiation->second.GetZAIList(); + + for (int i = 0; i < (int)DautherList.size(); i++) + { + if(GoodNuclei.find(DautherList[i]) == GoodNuclei.end() ) // if the ZAI is not in a dealed nuclei (cutted or unknown) + { + double Daughter_BR = it_Filiation->second.GetQuantity(DautherList[i]); // Get the quantity of the ZAI + it_Filiation->second -= Daughter_BR * DautherList[i]; // Remove it from the daughter list + + + IsotopicVector FastDecayChain = CuttedNuclei.GetFiliation(DautherList[i]); // Get the fast decay chain of it + + if(FastDecayChain.GetQuantity(-1, -1, -1) != 0) // Check if the FastDecayChain is known + it_Filiation->second += Daughter_BR * FastDecayChain; // Add the FastDecayCHain & apply the BR for the cutted Daughter + else + it_Filiation->second += Daughter_BR * ZAI(-3,-3,-3); // Add a TMP nuclei the daughter nuclei is not known at all... + + } + } + + } + DBGL +} + +//________________________________________________________________________ +void CLASSNucleiFiliation::SelfFiliationCleanUp(map<ZAI, int> GoodNuclei) +{ + DBGL + + bool Cleaned = false; + + while (!Cleaned) + { + + Cleaned = true; + CLASSNucleiFiliation CuttedNuclei(*this); + + map<ZAI, IsotopicVector>::iterator it_Filiation; + for(it_Filiation = fNucleiFiliation.begin(); it_Filiation != fNucleiFiliation.end(); it_Filiation++) + { + vector<ZAI> DautherList = it_Filiation->second.GetZAIList(); + + for (int i = 0; i < (int)DautherList.size(); i++) + { + if(GoodNuclei.find(DautherList[i]) == GoodNuclei.end() ) // if the ZAI is not in a dealed nuclei (cutted or unknown) + { + Cleaned = false; + + double Daughter_BR = it_Filiation->second.GetQuantity(DautherList[i]); // Get the quantity of the ZAI + it_Filiation->second -= Daughter_BR * DautherList[i]; // Remove it from the daughter list + + + IsotopicVector FastDecayChain = CuttedNuclei.GetFiliation(DautherList[i]); // Get the fast decay chain of it + + if(FastDecayChain.GetQuantity(-1, -1, -1) != 0) // Check if the FastDecayChain is known + it_Filiation->second += Daughter_BR * FastDecayChain; // Add the FastDecayCHain & apply the BR for the cutted Daughter + else + it_Filiation->second += Daughter_BR * ZAI(-3,-3,-3); // Add a TMP nuclei the daughter nuclei is not known at all... + + } + } + + } + + } + DBGL +} + + + +//________________________________________________________________________ +void CLASSNucleiFiliation::NormalizeBranchingRatio(double Value) +{ + DBGL + map<ZAI, IsotopicVector>::iterator it_Filiation; + for(it_Filiation = fNucleiFiliation.begin(); it_Filiation != fNucleiFiliation.end(); it_Filiation++) + { + it_Filiation->second *= Value/it_Filiation->second.GetSumOfAll(); + } + + DBGL +} + + +//________________________________________________________________________ +void CLASSNucleiFiliation::NormalizeBranchingRatio(ZAI Mother, double Value) +{ + DBGL + map<ZAI, IsotopicVector>::iterator it_Filiation = fNucleiFiliation.find(Mother); + + if( it_Filiation != fNucleiFiliation.end()) + it_Filiation->second *= Value/it_Filiation->second.GetSumOfAll(); + else + WARNING << "Trying to normaliza a Branching Ratio for a Mother wich are not present in the Filiatiuon List...." << endl; + + DBGL +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/branches/CLASSV3/src/CLASSObject.cxx b/source/branches/CLASSV3/src/CLASSObject.cxx index f0b19abdd91c6299e873fed3a05530e559881f12..85413d5b22caa68b4ebcec264c170ed5cfb5ab47 100644 --- a/source/branches/CLASSV3/src/CLASSObject.cxx +++ b/source/branches/CLASSV3/src/CLASSObject.cxx @@ -1,7 +1,5 @@ #include "CLASSObject.hxx" -#include "CLASSLogger.hxx" - using namespace std; //________________________________________________________________________ diff --git a/source/branches/CLASSV3/src/Reactor.cxx b/source/branches/CLASSV3/src/Reactor.cxx index 7196ed611f505fe656dc31e9c9f5104960f7bed6..adfc85a241bd86a4c624bd5809bf15479627ffba 100755 --- a/source/branches/CLASSV3/src/Reactor.cxx +++ b/source/branches/CLASSV3/src/Reactor.cxx @@ -7,8 +7,6 @@ #include "Scenario.hxx" #include "CLASSConstante.hxx" -#include "CLASSLogger.hxx" - #include <iostream> #include <cmath> #include <omp.h>