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p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/dna/models/src/G4DNAUpdateSystemModel.cc (Version 11.3.0) and /processes/electromagnetic/dna/models/src/G4DNAUpdateSystemModel.cc (Version 9.2.p2)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 //                                                
 27 #include "G4DNAUpdateSystemModel.hh"              
 28 #include "G4Molecule.hh"                          
 29 #include "G4DNAMolecularReactionTable.hh"         
 30 #include "G4UnitsTable.hh"                        
 31 #include "G4MoleculeCounter.hh"                   
 32 #include "G4DNAScavengerMaterial.hh"              
 33 #include "G4Scheduler.hh"                         
 34                                                   
 35 G4DNAUpdateSystemModel::G4DNAUpdateSystemModel    
 36                                                   
 37 void G4DNAUpdateSystemModel::SetMesh(G4DNAMesh    
 38 void G4DNAUpdateSystemModel::KillMolecule(cons    
 39 {                                                 
 40   // kill normal molecule                         
 41   auto& node = fpMesh->GetVoxelMapList(index);    
 42   auto iter  = node.find(type);                   
 43   if(iter != node.end())                          
 44   {                                               
 45     if(iter->second <= 0)                         
 46     {                                             
 47       G4ExceptionDescription exceptionDescript    
 48       exceptionDescription                        
 49         << "G4DNAUpdateSystemModel::KillMolecu    
 50         << type->GetName() << " index : " << i    
 51         << " number : " << iter->second << G4e    
 52       G4Exception("G4DNAEventScheduler::Steppi    
 53                   FatalErrorInArgument, except    
 54     }                                             
 55     iter->second--;                               
 56     if(G4VMoleculeCounter::Instance()->InUse()    
 57     {                                             
 58       G4VMoleculeCounter::Instance()->RemoveAM    
 59     }                                             
 60   }                                               
 61   else                                            
 62   {                                               
 63     auto pScavengerMaterial = dynamic_cast<G4D    
 64       G4Scheduler::Instance()->GetScavengerMat    
 65     if(pScavengerMaterial != nullptr)             
 66     {                                             
 67       pScavengerMaterial->ReduceNumberMolecule    
 68         type, fGlobalTime);                       
 69     }                                             
 70     else                                          
 71     {                                             
 72       G4ExceptionDescription exceptionDescript    
 73       exceptionDescription                        
 74         << "index : " << index << " " << type-    
 75         << "  This molecule is not belong scav    
 76         << G4endl;                                
 77       G4Exception("G4DNAEventScheduler::Steppi    
 78                   FatalErrorInArgument, except    
 79     }                                             
 80   }                                               
 81 }                                                 
 82                                                   
 83 void G4DNAUpdateSystemModel::JumpTo(const Inde    
 84 {                                                 
 85   auto& node = fpMesh->GetVoxelMapList(index);    
 86   auto iter  = node.find(type);                   
 87   if(iter != node.end())                          
 88   {                                               
 89     if(iter->second <= 0)                         
 90     {                                             
 91       G4ExceptionDescription exceptionDescript    
 92       exceptionDescription << "G4DNAUpdateSyst    
 93                            << type->GetName()     
 94                            << " number : " <<     
 95       G4Exception("G4DNAUpdateSystemModel::Jum    
 96                   FatalErrorInArgument, except    
 97     }                                             
 98     iter->second--;                               
 99   }                                               
100   else                                            
101   {                                               
102     fpMesh->PrintVoxel(index);                    
103     G4ExceptionDescription exceptionDescriptio    
104     exceptionDescription << "index : " << inde    
105                          << " There is no this    
106     G4Exception("G4DNAUpdateSystemModel::JumpT    
107                 FatalErrorInArgument, exceptio    
108   }                                               
109 }                                                 
110                                                   
111 void G4DNAUpdateSystemModel::CreateMolecule(co    
112 {                                                 
113   // for scavenger                                
114   auto pScavengerMaterial = dynamic_cast<G4DNA    
115     G4Scheduler::Instance()->GetScavengerMater    
116   if(pScavengerMaterial != nullptr && pScaveng    
117   {                                               
118     pScavengerMaterial->AddNumberMoleculePerVo    
119       type, fGlobalTime);                         
120     return;                                       
121   }                                               
122   // for molecule                                 
123   auto& node = fpMesh->GetVoxelMapList(index);    
124   auto iter  = node.find(type);                   
125   if(iter != node.end())                          
126   {                                               
127     iter->second++;                               
128   }                                               
129   else                                            
130   {                                               
131     node[type] = 1;                               
132   }                                               
133                                                   
134   if(G4VMoleculeCounter::Instance()->InUse())     
135   {                                               
136     G4VMoleculeCounter::Instance()->AddAMolecu    
137   }                                               
138 }                                                 
139                                                   
140 void G4DNAUpdateSystemModel::JumpIn(const Inde    
141 {                                                 
142   // for molecule                                 
143   auto& node = fpMesh->GetVoxelMapList(index);    
144   auto iter  = node.find(type);                   
145   if(iter != node.end())                          
146   {                                               
147     iter->second++;                               
148   }                                               
149   else                                            
150   {                                               
151     node[type] = 1;                               
152   }                                               
153 }                                                 
154                                                   
155 void G4DNAUpdateSystemModel::UpdateSystem(cons    
156                                           cons    
157 {                                                 
158   auto reactant1 = data.GetReactant1();           
159   auto reactant2 = data.GetReactant2();           
160 #ifdef G4VERBOSE                                  
161   if(fVerbose != 0)                               
162   {                                               
163     G4cout << "At time : " << std::setw(7) <<     
164            << " Reaction : " << reactant1->Get    
165            << reactant2->GetName() << " -> ";     
166   }                                               
167 #endif                                            
168   const G4int nbProducts = data.GetNbProducts(    
169   if(nbProducts != 0)                             
170   {                                               
171     for(G4int j = 0; j < nbProducts; ++j)         
172     {                                             
173 #ifdef G4VERBOSE                                  
174       if((fVerbose != 0) && j != 0)               
175       {                                           
176         G4cout << " + ";                          
177       }                                           
178       if(fVerbose != 0)                           
179       {                                           
180         G4cout << data.GetProduct(j)->GetName(    
181       }                                           
182 #endif                                            
183       CreateMolecule(index, data.GetProduct(j)    
184     }                                             
185   }                                               
186   else                                            
187   {                                               
188 #ifdef G4VERBOSE                                  
189     if(fVerbose != 0)                             
190     {                                             
191       G4cout << "No product";                     
192     }                                             
193 #endif                                            
194   }                                               
195 #ifdef G4VERBOSE                                  
196   if(fVerbose != 0)                               
197   {                                               
198     G4cout << G4endl;                             
199   }                                               
200 #endif                                            
201   KillMolecule(index, reactant1);                 
202   KillMolecule(index, reactant2);                 
203 }                                                 
204                                                   
205 void G4DNAUpdateSystemModel::UpdateSystem(cons    
206                                           cons    
207 {                                                 
208   auto reactant    = std::get<0>(data);           
209   auto JunpToIndex = std::get<1>(data);           
210 #ifdef G4VERBOSE                                  
211   if(fVerbose > 1)                                
212   {                                               
213     G4cout << "At time : " << std::setw(7) <<     
214            << " Jumping : " << reactant->GetNa    
215            << " -> " << JunpToIndex << G4endl;    
216   }                                               
217 #endif                                            
218   JumpTo(index, reactant);                        
219   JumpIn(JunpToIndex, reactant);                  
220 }                                                 
221