CLASS  1.1
src/EvolutionDataBase.cxx
Aller à la documentation de ce fichier.
00001 #include "EvolutionDataBase.hxx"
00002 #include "IsotopicVector.hxx"
00003 #include "EvolutiveProduct.hxx"
00004 #include "LogFile.hxx"
00005 #include "Defines.hxx"
00006 
00007 #include <fstream>
00008 #include <sstream>
00009 #include <iostream>
00010 
00011 using namespace std;
00012 //________________________________________________________________________
00013 //
00014 //              EvolutionDataBase
00015 //
00016 //
00017 //
00018 //
00019 //________________________________________________________________________
00020 
00021 EvolutionDataBase::EvolutionDataBase(LogFile* Log, string DB_index_file)
00022 {
00023         DBGL;
00024         fLog = Log;
00025         fDataBaseIndex = DB_index_file;
00026         DBGL;
00027 }
00028 
00029 //________________________________________________________________________
00030 EvolutionDataBase::~EvolutionDataBase()
00031 {       
00032         DBGL;
00033 }
00034 
00035 
00036 //________________________________________________________________________
00037 //________________________________________________________________________
00038 //________________________________________________________________________
00039 IsotopicVector  EvolutionDataBase::DecayProduction(const ZAI& zai, double dt)
00040 {
00041         DBGL;
00042         IsotopicVector  returnIV;
00043         map<ZAI ,EvolutiveProduct* >::iterator it;
00044                 it = fEvolutionDataBase.find(zai);
00045 
00046                 if (it == fEvolutionDataBase.end() )
00047                 {
00048                 
00049                         EvolutiveProduct* evolutionproduct = new EvolutiveProduct(fLog, zai.Z(), zai.A(), zai.I(), fDataBaseIndex);
00050                         #pragma omp critical(DBupdate)
00051                         {fEvolutionDataBase.insert( pair<ZAI ,EvolutiveProduct *>(zai, evolutionproduct) );}
00052                         returnIV = evolutionproduct->GetIsotopicVectorAt(dt);
00053                 }
00054                 else    returnIV = (*it).second->GetIsotopicVectorAt(dt);
00055         
00056         return returnIV;
00057 }
00058 
00059 //________________________________________________________________________
00060 bool EvolutionDataBase::IsDefine(const ZAI& zai) const
00061 {
00062         DBGL;
00063         map<ZAI ,EvolutiveProduct* > evolutiondb = (*this).GetEvolutionDataBase();
00064         if (evolutiondb.find(zai) != evolutiondb.end()) 
00065                 return true;
00066         else    
00067                 return false;
00068 
00069 }
00070 
00071 //________________________________________________________________________
00072 bool EvolutionDataBase::AddEvolutiveProduct(const ZAI& zai)
00073 {
00074         DBGL;
00075         pair<map<ZAI, EvolutiveProduct *>::iterator, bool> IResult;
00076         
00077         IResult = fEvolutionDataBase.insert(
00078                 pair<ZAI ,EvolutiveProduct *>(zai, new EvolutiveProduct(fLog, zai.Z(), zai.A(), zai.I(), GetDataBaseIndex())) );
00079         
00080         DBGL;
00081         return IResult.second;
00082         
00083 }
00084 
00085 //________________________________________________________________________
00086 void EvolutionDataBase::Print() const 
00087 {
00088 
00089 
00090 }
00091 
00092 
 Tout Classes Fichiers Fonctions Variables Macros