diff --git a/source/trunk/include/CLSSFacility.hxx b/source/trunk/include/CLSSFacility.hxx index 77780ee81e41b50be9fa773b7a00ea9934151a90..5b9ccaa4b219d51249cb006ccd6f7f158337dd38 100644 --- a/source/trunk/include/CLSSFacility.hxx +++ b/source/trunk/include/CLSSFacility.hxx @@ -29,11 +29,11 @@ class CLSSFacility : public CLSSObject { public : ///< Normal Constructor. - //CLSSFacility(); + CLSSFacility(); //********* Get Method *********// int GetId() const { return fId; } //!< Return the Facility Parc'Is - virtual IsotopicVector GetInsideIV() const { return fInsideIV; } //!< Return the IV contain in the Facility + IsotopicVector GetInsideIV() const { return fInsideIV; } //!< Return the IV contain in the Facility cSecond GetInternalTime() const { return fInternalTime; } //!< Return Creation Time diff --git a/source/trunk/include/CLSSObject.hxx b/source/trunk/include/CLSSObject.hxx index 7ea6d2617c3c314f9ee8dada9f97470f708eef42..66c0d2a3f85091511836272d2e35fcc50ec8a089 100644 --- a/source/trunk/include/CLSSObject.hxx +++ b/source/trunk/include/CLSSObject.hxx @@ -29,7 +29,6 @@ public : CLSSObject(); virtual CLSSObject* Clone() { return new CLSSObject(*this); } //!< Correct way to copy a CLSSObject in case of derivation - virtual ~CLSSObject(){} //!< destructor void SetLog(LogFile* log) { fLog = log; } void IsLog(bool islog) { fNoLog = islog; } diff --git a/source/trunk/include/DataBank.hxx b/source/trunk/include/DataBank.hxx index 7960dc42d1fef36f602e537234b5b3a7717e00be..b1018fdfcb8f5c63709a37b06a4b888dc346b2d1 100755 --- a/source/trunk/include/DataBank.hxx +++ b/source/trunk/include/DataBank.hxx @@ -164,8 +164,8 @@ protected : double *fTheNucleiVector; //!< The evolving atoms copied from Material proportions. double **fTheMatrix; //!< The evolution Matrix - int fNVar; //!< The size of the composition vector and /or number of ZAIs involved. + double fPrecision; //!< Precision of the RungeKutta double fHestimate; //!< RK Step estimation. double fHmin; //!< RK minimum Step. diff --git a/source/trunk/include/EvolutionData.hxx b/source/trunk/include/EvolutionData.hxx index 2fb3861c3c584b28332105985fadd725de303d2e..a546b1b284043bf2fee46832ed9f43c8b6bf661c 100755 --- a/source/trunk/include/EvolutionData.hxx +++ b/source/trunk/include/EvolutionData.hxx @@ -49,6 +49,9 @@ public : ///< Normal Destructor. ~EvolutionData(); + void DeleteEvolutionData(); + + //********* Set Method *********// void SetReactorType(string reactortype) { fReactorType = reactortype; } void SetFuelType(string fueltype) { fFuelType = fueltype; } diff --git a/source/trunk/include/FabricationPlant.hxx b/source/trunk/include/FabricationPlant.hxx index 4b44bf4dd3918a2b8353fb20e7744618e838f377..cde3a296a623592cf18f7f3c6c7aa06c4cbcaee6 100644 --- a/source/trunk/include/FabricationPlant.hxx +++ b/source/trunk/include/FabricationPlant.hxx @@ -108,7 +108,6 @@ protected : DataBank<ZAI>* fDecayDataBase; //!< Pointer to the Decay DataBase - Storage* fStorage; //!< Pointer to the Storage to recycle Storage* fReUsable; //!< Pointer to the Storage using for recycling unused Product diff --git a/source/trunk/include/Pool.hxx b/source/trunk/include/Pool.hxx index 694d91c7bf2a218676d62a84026437dc8682a385..57ccc217562d21045b6a87bd04e1e4b5fe9ff0a3 100755 --- a/source/trunk/include/Pool.hxx +++ b/source/trunk/include/Pool.hxx @@ -82,8 +82,7 @@ public : vector<IsotopicVector> GetIVCooling() const { return fIVCooling; } //!< Return the vector of Cooling IsotopicVector void AddIVCooling(IsotopicVector IV); //!< Add Cooling IsotopicVector void RemoveIVCooling(int i); //!< Remove a Cooling IsotopicVector - IsotopicVector GetFullCooling(); - IsotopicVector GetInsideIV() { return GetFullCooling(); } //!< Return the IV contain in the Facility + IsotopicVector GetFullCooling() {return GetInsideIV(); } //********* Other Method *********// diff --git a/source/trunk/include/ZAI.hxx b/source/trunk/include/ZAI.hxx index 903bb134e51c9bb1f1592644c3185ce7ba2922d7..37749e302417d6f69bb419facf9f853529a2643a 100755 --- a/source/trunk/include/ZAI.hxx +++ b/source/trunk/include/ZAI.hxx @@ -64,7 +64,9 @@ class ZAI : public TObject bool operator ==(const ZAI& zai) const { return ( fZ == zai.Z() && fA == zai.A() && fI == zai.I()); } //!< ZAI Comparator void Print() const { cout << fZ << " " << fA << " " << fI << endl;} - protected : + + +protected : string fName; ///< Name of the ZAI short fZ; ///< number of protons diff --git a/source/trunk/src/CLASS.cxx b/source/trunk/src/CLASS.cxx index 647529d63833937dec9b36d85d412af139e20466..32c70b7a7d9f2d3632e8a82c69f155f62288956d 100755 --- a/source/trunk/src/CLASS.cxx +++ b/source/trunk/src/CLASS.cxx @@ -57,7 +57,9 @@ CLASS::CLASS() fOutputFileName = "CLASS_Default.root"; fOutputTreeName = "Data"; - + fOutFile = 0; + fOutT = 0; + SetLog(new LogFile("CLASS.log")); fParcPower = 0; @@ -94,7 +96,9 @@ CLASS::CLASS(LogFile* Log) fOutputFileName = "CLASS_Default.root"; fOutputTreeName = "Data"; - + fOutFile = 0; + fOutT = 0; + SetLog(Log); fParcPower = 0; @@ -130,7 +134,9 @@ CLASS::CLASS(double abstime) fOutputFileName = "CLASS_Default.root"; fOutputTreeName = "Data"; - + fOutFile = 0; + fOutT = 0; + SetLog(new LogFile("CLASS.log")); fParcPower = 0; @@ -162,6 +168,7 @@ CLASS::~CLASS() #pragma omp single {CloseOutputTree();} + } @@ -411,6 +418,7 @@ void CLASS::BuildTimeVector(cSecond t) void CLASS::PoolEvolution() { +#pragma omp parallel for for(int i = 0; i < (int) fPool.size();i++) fPool[i]->Evolution(fAbsoluteTime); @@ -422,6 +430,7 @@ void CLASS::PoolEvolution() void CLASS::StorageEvolution() { +#pragma omp parallel for for(int i = 0; i < (int) fStorage.size();i++) fStorage[i]->Evolution(fAbsoluteTime); @@ -431,6 +440,7 @@ void CLASS::StorageEvolution() void CLASS::FabricationPlantEvolution() { +#pragma omp parallel for for(int i = 0; i < (int) fFabricationPlant.size();i++) fFabricationPlant[i]->Evolution(fAbsoluteTime); @@ -473,61 +483,21 @@ void CLASS::Evolution(double t) { fAbsoluteTime = (*it).first; - if( (*it).second & 2 || (*it).second & 1 ) - { - if( (*it).second & 1 ) - StorageEvolution(); - - PoolEvolution(); - FabricationPlantEvolution(); - ReactorEvolution(); - - if((*it).second & 2 ) - (*it).second ^= 2; - if((*it).second & 4 ) - (*it).second ^= 4; - if((*it).second & 8 ) - (*it).second ^= 8; - if((*it).second & 16 ) - (*it).second ^= 16; - } - - - if( (*it).second & 4 ) - { + + + if( (*it).second & 1 || (*it).second & 4 || (*it).second & 8 || (*it).second & 16 ) StorageEvolution(); + + if( (*it).second & 1 || (*it).second & 2 || (*it).second & 4 || (*it).second & 8 || (*it).second & 16 ) PoolEvolution(); + + if( (*it).second & 1 || (*it).second & 2 || (*it).second & 4 || (*it).second & 16 ) FabricationPlantEvolution(); + + if( (*it).second & 1 || (*it).second & 2 || (*it).second & 4 ) ReactorEvolution(); - - (*it).second ^= 4; - if((*it).second & 8 ) - (*it).second ^= 8; - } - - if( (*it).second & 16 ) - { - StorageEvolution(); - PoolEvolution(); - FabricationPlantEvolution(); - - (*it).second ^= 16; - if((*it).second & 8 ) - (*it).second ^= 8; - } - - - if( (*it).second & 8 ) - { - StorageEvolution(); - PoolEvolution(); - - (*it).second ^= 8; - } - - - - if( (*it).second & 1 || (*it).first == (*fTimeStep.begin()).first ) + + if( (*it).second & 1 || it == fTimeStep.begin() ) { #pragma omp single { @@ -578,7 +548,7 @@ void CLASS::UpdateParc() ResetQuantity(); - for (int i =0; i < (int)fFabricationPlant.size(); i++) + for(int i =0; i < (int)fFabricationPlant.size(); i++) fFuelFabrication += fFabricationPlant[i]->GetFullFabrication(); for(int i = 0; i < (int) fPool.size();i++) diff --git a/source/trunk/src/CLSSFacility.cxx b/source/trunk/src/CLSSFacility.cxx index d85eb9ac26fb31bd7ca8075147895804a56a6ebf..95b8b389d727ca6651525b4383649f101372c385 100644 --- a/source/trunk/src/CLSSFacility.cxx +++ b/source/trunk/src/CLSSFacility.cxx @@ -15,4 +15,7 @@ using namespace std; ClassImp(CLSSFacility) - +CLSSFacility::CLSSFacility() +{ + fParc = 0; +} diff --git a/source/trunk/src/CLSSObject.cxx b/source/trunk/src/CLSSObject.cxx index 82a31537a6608b4a62112a9694610704ad2458e9..49f7d2ca706ffa7ce5af2b5e6db04f70a8879281 100644 --- a/source/trunk/src/CLSSObject.cxx +++ b/source/trunk/src/CLSSObject.cxx @@ -17,5 +17,6 @@ ClassImp(CLSSObject) CLSSObject::CLSSObject() { - + fLog = 0; } + diff --git a/source/trunk/src/DataBank.cxx b/source/trunk/src/DataBank.cxx index ae0f62f93912940650b419f33bc25ee4745ead24..745449ca3b73499a5e67ee4c9f2fb6a2d49c6f8c 100755 --- a/source/trunk/src/DataBank.cxx +++ b/source/trunk/src/DataBank.cxx @@ -63,6 +63,8 @@ double ReactionRateWeightedDistance(EvolutionData DB, IsotopicVector IV1 ) template<class T> DataBank<T>::DataBank() { + fTheNucleiVector = 0; + fTheMatrix = 0; } //________________________________________________________________________ @@ -81,6 +83,9 @@ DataBank<ZAI>::DataBank(LogFile* Log, string DB_index_file, bool setlog, bool ol fOldReadMethod = olfreadmethod; + fTheNucleiVector = 0; + fTheMatrix = 0; + // Warning if(PrintLog()) { @@ -98,6 +103,25 @@ template<> DataBank<ZAI>::~DataBank() { + if(fTheMatrix) + { + for(int i= 0; i<fNVar; i++) + delete [] fTheMatrix[i]; + delete [] fTheMatrix; + } + if(fTheNucleiVector) + { + delete fTheNucleiVector; + } + + + map<ZAI ,EvolutionData >::iterator it_del; + for( it_del = fDataBank.begin(); it_del != fDataBank.end(); it_del++) + (*it_del).second.DeleteEvolutionData(); + + for( it_del = fDataBankCalculated.begin(); it_del != fDataBankCalculated.end(); it_del++) + (*it_del).second.DeleteEvolutionData(); + } //________________________________________________________________________ @@ -216,6 +240,9 @@ DataBank<IsotopicVector>::DataBank():DynamicalSystem() fDataDirectoryName += "/source/data/"; fDataFileName = "chart.JEF3T"; + fTheNucleiVector = 0; + fTheMatrix = 0; + SetForbidNegativeValue(); } @@ -244,6 +271,9 @@ DataBank<IsotopicVector>::DataBank(LogFile* Log, string DB_index_file, bool setl fShorstestHalflife = 3600.*24*2.; fZAIThreshold = 90; + fTheNucleiVector = 0; + fTheMatrix = 0; + ReadDataBase(); SetForbidNegativeValue(); @@ -265,6 +295,25 @@ DataBank<IsotopicVector>::DataBank(LogFile* Log, string DB_index_file, bool setl template<> DataBank<IsotopicVector>::~DataBank() { + + if(fTheMatrix) + { + for(int i= 0; i<fNVar; i++) + delete [] fTheMatrix[i]; + delete [] fTheMatrix; + } + if(fTheNucleiVector) + { + delete fTheNucleiVector; + } + + map<IsotopicVector ,EvolutionData >::iterator it_del; + for( it_del = fDataBank.begin(); it_del != fDataBank.end(); it_del++) + (*it_del).second.DeleteEvolutionData(); + + for( it_del = fDataBankCalculated.begin(); it_del != fDataBankCalculated.end(); it_del++) + (*it_del).second.DeleteEvolutionData(); + } //________________________________________________________________________ @@ -368,7 +417,6 @@ template<> void DataBank<IsotopicVector>::BuildDecayMatrix() { // List of Decay Time and Properties - map<ZAI, pair<double, map< ZAI, double > > > ZAIDecay; { // TMP @@ -471,7 +519,8 @@ void DataBank<IsotopicVector>::BuildDecayMatrix() daughter_A = daughter_Z = Iso = -3; // not spontaneous fission ZAI DaughterZAI = ZAI(daughter_Z,daughter_A,Iso); - if((BR>1e-10) && (!stable)) + + if((BR>1e-10) && (!stable)) { if(DM <= 15) { @@ -484,7 +533,7 @@ void DataBank<IsotopicVector>::BuildDecayMatrix() { DaughtersMap += 2*BR * ZAI(-2,-2,-2); - branch_test_f += 2*BR; + branch_test_f += BR; } else { @@ -493,7 +542,7 @@ void DataBank<IsotopicVector>::BuildDecayMatrix() if(it_yield != fSpontaneusYield.end()) { DaughtersMap += (BR* (*it_yield).second ); - branch_test_f += (*it_yield).second.GetSumOfAll() / 2.; + branch_test_f += BR* (*it_yield).second.GetSumOfAll() / 2.; } else @@ -558,7 +607,6 @@ void DataBank<IsotopicVector>::BuildDecayMatrix() FD_it_Origin = fFastDecay.find(FD_it->first); - map<ZAI, double> BR = (*FD_it).second; map<ZAI, double>::iterator BR_it; @@ -570,34 +618,41 @@ void DataBank<IsotopicVector>::BuildDecayMatrix() if( it_index == findex_inver.end() ) { map<ZAI, map<ZAI, double> >::iterator FD2_it = FastDecayCopy.find((*BR_it).first); - if( FD2_it == fFastDecay.end() ) - { - (*FD_it_Origin).second.erase((*BR_it).first); - pair<map<ZAI, double>::iterator, bool> IResult; - IResult = (*FD_it_Origin).second.insert( pair<ZAI, double> ( ZAI(-3,-3,-3), (*BR_it).second) ); - if( !IResult.second) - (*IResult.first).second += (*BR_it).second ; - } - else + if( FD2_it != FastDecayCopy.end() ) { map<ZAI, double>::iterator BR2_it; (*FD_it_Origin).second.erase((*BR_it).first); for (BR2_it = (*FD2_it).second.begin(); BR2_it != (*FD2_it).second.end(); BR2_it++) { + pair<map<ZAI, double>::iterator, bool> IResult; IResult = (*FD_it_Origin).second.insert( pair<ZAI, double> ( (*BR2_it).first, (*BR_it).second * (*BR2_it).second ) ); + if( !IResult.second) (*IResult.first).second += (*BR_it).second * (*BR2_it).second ; - } + + } + + } + else + { + (*FD_it_Origin).second.erase( (*BR_it).first ); + pair< map<ZAI, double>::iterator, bool> IResult; + IResult = (*FD_it_Origin).second.insert( pair<ZAI, double> ( ZAI(-3,-3,-3), (*BR_it).second) ); + if( !IResult.second) + (*IResult.first).second += (*BR_it).second ; } + + } } } + FastDecayValidation = true; for(FD_it = fFastDecay.begin(); FD_it != fFastDecay.end(); FD_it++) { @@ -673,6 +728,7 @@ void DataBank<IsotopicVector>::BuildDecayMatrix() } } + //exit(1); } @@ -762,7 +818,7 @@ map< ZAI,IsotopicVector > DataBank<IsotopicVector>::ReadFPYield(string Yield) { cout << "!!Error!! !!!DataBank!!! Many accurance of the PF " << Z << " " << A; cout << " in " << Yield << " file!! Please Check it"; - cout << "(Number of yiled does not match the number of ZAI that fission !!!" << endl; + cout << "(Number of yield does not match the number of ZAI that fission !!!" << endl; exit(1); } @@ -777,7 +833,6 @@ map< ZAI,IsotopicVector > DataBank<IsotopicVector>::ReadFPYield(string Yield) } while (!infile.eof()); - return Yield_map; } @@ -821,22 +876,27 @@ TMatrixT<double> DataBank<IsotopicVector>::GetFissionXsMatrix(EvolutionData Evol else { map<ZAI, IsotopicVector>::iterator it_yield = fReactionYield.find( (*it).first ); + if( it_yield != fReactionYield.end()) { map<ZAI ,double>::iterator it_IVQ; - for( it_IVQ = (*it_yield).second.GetIsotopicQuantity().begin(); it_IVQ != (*it_yield).second.GetIsotopicQuantity().end(); it_IVQ++ ) + map<ZAI ,double> IVQ = (*it_yield).second.GetIsotopicQuantity(); + + for( it_IVQ = IVQ.begin(); it_IVQ != IVQ.end(); it_IVQ++ ) { map<ZAI, int>::iterator findex_it_PF = findex_inver.find( (*it_IVQ).first ); + if(findex_it_PF != findex_inver.end() ) BatemanMatrix[(*findex_it_PF).second][ (*findex_inver_it).second ] += (*it_IVQ).second*y* 1e-24; else { map<ZAI, map<ZAI, double> >::iterator it_FD = fFastDecay.find( (*it_IVQ).first); + if( it_FD == fFastDecay.end() ) { - cout << "Capture Problem in FastDecay for nuclei " << (*it_IVQ).first.Z() << " " << (*it_IVQ).first.A() << " " << (*it_IVQ).first.I() << endl; + //cout << "Fission Problem in FastDecay for nuclei " << (*it_IVQ).first.Z() << " " << (*it_IVQ).first.A() << " " << (*it_IVQ).first.I() << endl; - BatemanMatrix[0][findex_it_PF->second] += (*it_IVQ).second * y * 1e-24 ; + BatemanMatrix[1][ (*findex_inver_it).second ] += (*it_IVQ).second * y * 1e-24 ; } else { @@ -924,8 +984,8 @@ TMatrixT<double> DataBank<IsotopicVector>::GetCaptureXsMatrix(EvolutionData Evol if( it4 == fFastDecay.end() ) { cout << "Capture Problem in FastDecay for nuclei " << (*it).first.Z() << " " << (*it).first.A()+1 << " " << (*it).first.I() << endl; - BatemanMatrix[0][Index_it->second] += y* 1e-24 ; + } else { @@ -1351,13 +1411,12 @@ void DataBank<IsotopicVector>::SetTheMatrixToZero() for(int i= 0; i < fNVar; i++) fTheMatrix[i] = new double[fNVar]; +#pragma omp parallel for for(int i = 0; i < fNVar; i++) - { for(int k = 0; k < fNVar; k++) { fTheMatrix[i][k]=0.0; } - } } @@ -1418,6 +1477,7 @@ void DataBank<IsotopicVector>::BuildEqns(double t, double *N, double *dNdt) template<> void DataBank<IsotopicVector>::SetTheMatrix(TMatrixT<double> BatemanMatrix) { +#pragma omp parallel for for (int k = 0; k < (int)fNVar; k++) for (int l = 0; l < (int)findex_inver.size(); l++) fTheMatrix[l][k] = BatemanMatrix[l][k]; @@ -1428,6 +1488,7 @@ template<> TMatrixT<double> DataBank<IsotopicVector>::GetTheMatrix() { TMatrixT<double> BatemanMatrix = TMatrixT<double>(findex.size(),findex.size()); +#pragma omp parallel for for (int k = 0; k < (int)fNVar; k++) for (int l = 0; l < (int)findex_inver.size(); l++) BatemanMatrix[l][k] = fTheMatrix[l][k]; @@ -1439,6 +1500,7 @@ TMatrixT<double> DataBank<IsotopicVector>::GetTheMatrix() template<> void DataBank<IsotopicVector>::SetTheNucleiVector(TMatrixT<double> NEvolutionMatrix) { +#pragma omp parallel for for (int k = 0; k < (int)fNVar; k++) fTheNucleiVector[k] = NEvolutionMatrix[k][0]; } @@ -1448,6 +1510,7 @@ template<> TMatrixT<double> DataBank<IsotopicVector>::GetTheNucleiVector() { TMatrixT<double> NEvolutionMatrix = TMatrixT<double>(findex.size(),1); +#pragma omp parallel for for (int k = 0; k < (int)fNVar; k++) NEvolutionMatrix[k][0] = fTheNucleiVector[k]; @@ -1461,7 +1524,6 @@ TMatrixT<double> DataBank<IsotopicVector>::GetTheNucleiVector() template<> EvolutionData DataBank<IsotopicVector>::GenerateEvolutionData(IsotopicVector isotopicvector, double cycletime, double Power) { - if(fFastDecay.size() == 0) { BuildDecayMatrix(); diff --git a/source/trunk/src/EvolutionData.cxx b/source/trunk/src/EvolutionData.cxx index 1d6fc58bd878aef649027b08874fefa91a70d929..8ae2ecb05044cae04c9ab9175ae52dd63f2f8a57 100755 --- a/source/trunk/src/EvolutionData.cxx +++ b/source/trunk/src/EvolutionData.cxx @@ -90,6 +90,12 @@ ClassImp(EvolutionData) EvolutionData::EvolutionData() { + fIsCrossSection = false; + fPower = 0; + fCycleTime = 0; + fNormFactor = 0; + fKeff = 0; + fFlux = 0; } //________________________________________________________________________ @@ -101,6 +107,8 @@ EvolutionData::EvolutionData(LogFile* Log) fPower = 0; fCycleTime = 0; fNormFactor = 0; + fKeff = 0; + fFlux = 0; } @@ -115,6 +123,8 @@ EvolutionData::EvolutionData(LogFile* Log, string DB_file, bool oldread, ZAI zai fPower = 0; fCycleTime = 0; fNormFactor = 0; + fKeff = 0; + fFlux = 0; if(zai != ZAI(0,0,0)) AddAsStable(zai); @@ -129,8 +139,47 @@ EvolutionData::EvolutionData(LogFile* Log, string DB_file, bool oldread, ZAI zai //________________________________________________________________________ EvolutionData::~EvolutionData() { - - + +} +//________________________________________________________________________ +void EvolutionData::DeleteEvolutionData() +{ + + map<ZAI ,TGraph* >::iterator it_del; + + for( it_del = fEvolutionData.begin(); it_del != fEvolutionData.end(); it_del++) + { + delete (*it_del).second; + (*it_del).second = 0; + } + for( it_del = fFissionXS.begin(); it_del != fFissionXS.end(); it_del++) + { + delete (*it_del).second; + (*it_del).second = 0; + } + for( it_del = fCaptureXS.begin(); it_del != fCaptureXS.end(); it_del++) + { + delete (*it_del).second; + (*it_del).second = 0; + } + for( it_del = fn2nXS.begin(); it_del != fn2nXS.end(); it_del++) + { + delete (*it_del).second; + (*it_del).second = 0; + } + + + delete fKeff; + delete fFlux; + + fEvolutionData.clear(); + fFissionXS.clear(); + fCaptureXS.clear(); + fn2nXS.clear(); + + fFlux = 0; + fKeff = 0; + } diff --git a/source/trunk/src/FabricationPlant.cxx b/source/trunk/src/FabricationPlant.cxx index 2c554ae228631ae9633d3f6184d41f52b57f0f0f..dcface35cf966e8d6d33d0224cd1fc646498f9f9 100644 --- a/source/trunk/src/FabricationPlant.cxx +++ b/source/trunk/src/FabricationPlant.cxx @@ -44,6 +44,9 @@ ClassImp(FabricationPlant) FabricationPlant::FabricationPlant() { + fDecayDataBase = 0; + fStorage = 0; + fReUsable = 0; } FabricationPlant::FabricationPlant(LogFile* log) @@ -54,8 +57,10 @@ FabricationPlant::FabricationPlant(LogFile* log) SetCycleTime(-1); fUpdateReferenceDBatEachStep = false; fSubstitutionFuel = false; - - + fDecayDataBase = 0; + 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; @@ -75,7 +80,9 @@ FabricationPlant::FabricationPlant(LogFile* log, Storage* storage, Storage* reus fChronologicalTimePriority = false; fUpdateReferenceDBatEachStep = false; fSubstitutionFuel = false; - + fDecayDataBase = 0; + + SetCycleTime((cSecond)fabircationtime ); fStorage = storage; fReUsable = reusable; @@ -151,7 +158,8 @@ void FabricationPlant::FabricationPlantEvolution(cSecond t) { if( (*it).second == t ) { - BuildFuelForReactor( (*it).first ); +#pragma omp critical(FuelBuild) + {BuildFuelForReactor( (*it).first );} (*it).second += GetParc()->GetReactor()[ (*it).first ]->GetCycleTime(); } else if ( (*it).second - GetParc()->GetReactor()[ (*it).first ]->GetCycleTime() + GetCycleTime() > t ) diff --git a/source/trunk/src/Pool.cxx b/source/trunk/src/Pool.cxx index 80c4fa0d0716b6d76e92febe03f1c4cabcbba754..808b682df0d71f72944c45f5f4c1354913f93828 100755 --- a/source/trunk/src/Pool.cxx +++ b/source/trunk/src/Pool.cxx @@ -24,9 +24,8 @@ ClassImp(Pool) Pool::Pool() { - - - + fStorage = 0; + fDecayDataBase = 0; } Pool::Pool(LogFile* log) @@ -40,6 +39,10 @@ Pool::Pool(LogFile* log) fInternalTime = 0 ; SetCreationTime( 0 ); fCoolingLastIndex = 0; + + fStorage = 0; + fDecayDataBase = 0; + cout << "!!INFO!! !!!Pool!!! A new Pool has been define :" << endl; cout << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; @@ -54,8 +57,7 @@ Pool::Pool(LogFile* log) } //________________________________________________________________________ -Pool::Pool(LogFile* log, double creation, - double coolingtime) +Pool::Pool(LogFile* log, double creation, double coolingtime) { SetLog(log); @@ -65,6 +67,10 @@ Pool::Pool(LogFile* log, double creation, fIsStarted = false; fPutToWaste = true; fCoolingLastIndex = 0; + + fStorage = 0; + fDecayDataBase = 0; + cout << "!!INFO!! !!!Pool!!! A new Pool has been define :" << endl; cout << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; @@ -80,9 +86,7 @@ Pool::Pool(LogFile* log, double creation, } //________________________________________________________________________ -Pool::Pool(LogFile* log, Storage* storage, - double creation, - double coolingtime) +Pool::Pool(LogFile* log, Storage* storage, double creation, double coolingtime) { SetLog(log); @@ -93,7 +97,9 @@ Pool::Pool(LogFile* log, Storage* storage, fIsStarted = false; fPutToWaste = false; fCoolingLastIndex = 0; - + + fDecayDataBase = 0; + cout << "!!INFO!! !!!Pool!!! A new Pool has been define :" << endl; cout << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; @@ -149,6 +155,7 @@ void Pool::AddIVCooling(IsotopicVector IV) { fIVCooling.push_back(IV); + fInsideIV += IV; fCoolingStartingTime.push_back(fInternalTime); fCoolingLastIndex++; fCoolingIndex.push_back(fCoolingLastIndex); @@ -165,17 +172,6 @@ void Pool::RemoveIVCooling(int i) //!< Remove a Cooling IsotopicVector } -IsotopicVector Pool::GetFullCooling() -{ - - IsotopicVector tmp = 0*ZAI(0,0,0); - - for(int i =0; i< (int)fIVCooling.size(); i++) - tmp += fIVCooling[i]; - fInsideIV = tmp; - return fInsideIV; - -} @@ -196,6 +192,9 @@ void Pool::CoolingEvolution(cSecond t) if(t == fInternalTime && t!=0) return; int RemainingCoolingTime; cSecond EvolutionTime = t - fInternalTime; + + fInsideIV = IsotopicVector(); + #pragma omp parallel for for ( int i = 0 ; i < (int)fIVCooling.size() ; i++) { @@ -215,6 +214,7 @@ void Pool::CoolingEvolution(cSecond t) //Cooling Decay fIVCooling[i] = GetDecay( fIVCooling[i], RemainingCoolingTime); + #pragma omp critical(DeleteCoolingIVPB) {fCoolingEndOfCycle.push_back(i);} @@ -222,6 +222,7 @@ void Pool::CoolingEvolution(cSecond t) else if ( fCoolingStartingTime[i] != t ) { fIVCooling[i] = GetDecay( fIVCooling[i] , EvolutionTime); + fInsideIV += fIVCooling[i]; } } #pragma omp critical(DeleteCoolingIVPB) @@ -271,7 +272,6 @@ void Pool::Dump() fCoolingEndOfCycle.erase(fCoolingEndOfCycle.begin()+i); // Remove index entry RemoveIVCooling(idx); // Remove IVcooling - } if((int)fCoolingEndOfCycle.size() != 0 )// Control diff --git a/source/trunk/src/Reactor.cxx b/source/trunk/src/Reactor.cxx index a482c6f7f921b02a35ecb61e83b0ea9792995866..79af71ab6c0e6b7ef65ad3bbb0ac5e11ddbaea43 100755 --- a/source/trunk/src/Reactor.cxx +++ b/source/trunk/src/Reactor.cxx @@ -29,17 +29,24 @@ ClassImp(Reactor) Reactor::Reactor() { - + fAssociedPool = 0; + fStorage = 0; + fFuelTypeDB = 0; + fFabricationPlant = 0; } Reactor::Reactor(LogFile* log) { SetLog(log); + fAssociedPool = 0; + fStorage = 0; + fFuelTypeDB = 0; + fFabricationPlant = 0; } -Reactor::Reactor(LogFile* log, DataBank<IsotopicVector>* fueltypeDB, +Reactor::Reactor(LogFile* log, DataBank<IsotopicVector>* fueltypeDB, FabricationPlant* fabricationplant, Pool* Pool, double creationtime, double lifetime) @@ -55,6 +62,7 @@ Reactor::Reactor(LogFile* log, DataBank<IsotopicVector>* fueltypeDB, fFixedFuel = false; fBurnUp = -1.; fHeavyMetalMass = -1.; + fStorage = 0; fAssociedPool = Pool; @@ -85,13 +93,14 @@ Reactor::Reactor(LogFile* log, DataBank<IsotopicVector>* fueltypeDB, } -Reactor::Reactor(LogFile* log, DataBank<IsotopicVector>* fueltypeDB, FabricationPlant* fabricationplant, Pool* Pool, +Reactor::Reactor(LogFile* log, DataBank<IsotopicVector>* fueltypeDB, FabricationPlant* fabricationplant, Pool* Pool, double creationtime, double lifetime, double Power, double HMMass, double BurnUp, double ChargeFactor) { SetLog(log); + fStorage = 0; fIsStarted = false; fShutDown = false; fEndOfCycle = false; @@ -153,6 +162,8 @@ Reactor::Reactor(LogFile* log, DataBank<IsotopicVector>* fueltypeDB, fShutDown = false; fEndOfCycle = false; + fStorage = 0; + fFabricationPlant = fabricationplant; fFixedFuel = false; fBurnUp = BurnUp; @@ -208,7 +219,9 @@ Reactor::Reactor(LogFile* log, EvolutionData evolutivedb, fShutDown = false; fEndOfCycle = false; - + fStorage = 0; + fFuelTypeDB = 0; + fFabricationPlant = 0; fFixedFuel = true; fIsStorage = false; diff --git a/source/trunk/src/Storage.cxx b/source/trunk/src/Storage.cxx index d025ebf2ed656020ec86c5383b15102f02188104..8cd468f0684471a6968c990efee6c5d60f67d9d4 100644 --- a/source/trunk/src/Storage.cxx +++ b/source/trunk/src/Storage.cxx @@ -23,13 +23,15 @@ ClassImp(Storage) Storage::Storage() { + fDecayDataBase = 0; } Storage::Storage(LogFile* log) { SetLog(log); - + fDecayDataBase = 0; + cout << "!!INFO!! !!!Storage!!! A new Storage has been define." << endl; GetLog()->fLog << "!!INFO!! !!!Storage!!! A new Storage has been define." << endl; @@ -153,7 +155,7 @@ void Storage::StorageEvolution(cSecond t) if(t == fInternalTime && t !=0 ) return; - for(int i = (int)fIVStock.size()-1 ; i >=0; i--) + for(int i = (int)fIVStock.size()-1 ; i >=0; i--) //Removing empty Stock if(Norme(fIVStock[i]) == 0) fIVStock.erase(fIVStock.begin()+i);