ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/brains/SimInfo.cpp
(Generate patch)

Comparing:
trunk/src/brains/SimInfo.cpp (file contents), Revision 334 by tim, Mon Feb 14 17:57:01 2005 UTC vs.
branches/development/src/brains/SimInfo.cpp (file contents), Revision 1874 by gezelter, Wed May 15 15:09:35 2013 UTC

# Line 1 | Line 1
1 < /*
1 > /*
2   * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved.
3   *
4   * The University of Notre Dame grants you ("Licensee") a
# Line 6 | Line 6
6   * redistribute this software in source and binary code form, provided
7   * that the following conditions are met:
8   *
9 < * 1. Acknowledgement of the program authors must be made in any
10 < *    publication of scientific results based in part on use of the
11 < *    program.  An acceptable form of acknowledgement is citation of
12 < *    the article in which the program was described (Matthew
13 < *    A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher
14 < *    J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented
15 < *    Parallel Simulation Engine for Molecular Dynamics,"
16 < *    J. Comput. Chem. 26, pp. 252-271 (2005))
17 < *
18 < * 2. Redistributions of source code must retain the above copyright
9 > * 1. Redistributions of source code must retain the above copyright
10   *    notice, this list of conditions and the following disclaimer.
11   *
12 < * 3. Redistributions in binary form must reproduce the above copyright
12 > * 2. Redistributions in binary form must reproduce the above copyright
13   *    notice, this list of conditions and the following disclaimer in the
14   *    documentation and/or other materials provided with the
15   *    distribution.
# Line 37 | Line 28
28   * arising out of the use of or inability to use software, even if the
29   * University of Notre Dame has been advised of the possibility of
30   * such damages.
31 + *
32 + * SUPPORT OPEN SCIENCE!  If you use OpenMD or its source code in your
33 + * research, please cite the appropriate papers when you publish your
34 + * work.  Good starting points are:
35 + *                                                                      
36 + * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37 + * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38 + * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).          
39 + * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 + * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42  
43   /**
# Line 48 | Line 49
49  
50   #include <algorithm>
51   #include <set>
52 + #include <map>
53  
54   #include "brains/SimInfo.hpp"
55   #include "math/Vector3.hpp"
56   #include "primitives/Molecule.hpp"
57 < #include "UseTheForce/doForces_interface.h"
56 < #include "UseTheForce/notifyCutoffs_interface.h"
57 > #include "primitives/StuntDouble.hpp"
58   #include "utils/MemoryUtils.hpp"
59   #include "utils/simError.h"
60   #include "selection/SelectionManager.hpp"
61 <
61 > #include "io/ForceFieldOptions.hpp"
62 > #include "brains/ForceField.hpp"
63 > #include "nonbonded/SwitchingFunction.hpp"
64   #ifdef IS_MPI
65 < #include "UseTheForce/mpiComponentPlan.h"
66 < #include "UseTheForce/DarkSide/simParallel_interface.h"
64 < #endif
65 > #include <mpi.h>
66 > #endif
67  
68 < namespace oopse {
69 <
70 < SimInfo::SimInfo(std::vector<std::pair<MoleculeStamp*, int> >& molStampPairs,
71 <                                ForceField* ff, Globals* simParams) :
72 <                                forceField_(ff), simParams_(simParams),
73 <                                ndf_(0), ndfRaw_(0), ndfTrans_(0), nZconstraint_(0),
74 <                                nGlobalMols_(0), nGlobalAtoms_(0), nGlobalCutoffGroups_(0),
75 <                                nGlobalIntegrableObjects_(0), nGlobalRigidBodies_(0),
76 <                                nAtoms_(0), nBonds_(0),  nBends_(0), nTorsions_(0), nRigidBodies_(0),
77 <                                nIntegrableObjects_(0),  nCutoffGroups_(0), nConstraints_(0),
78 <                                sman_(NULL), fortranInitialized_(false), selectMan_(NULL) {
79 <
80 <            
79 <    std::vector<std::pair<MoleculeStamp*, int> >::iterator i;
68 > using namespace std;
69 > namespace OpenMD {
70 >  
71 >  SimInfo::SimInfo(ForceField* ff, Globals* simParams) :
72 >    forceField_(ff), simParams_(simParams),
73 >    ndf_(0), fdf_local(0), ndfRaw_(0), ndfTrans_(0), nZconstraint_(0),
74 >    nGlobalMols_(0), nGlobalAtoms_(0), nGlobalCutoffGroups_(0),
75 >    nGlobalIntegrableObjects_(0), nGlobalRigidBodies_(0), nGlobalFluctuatingCharges_(0),
76 >    nAtoms_(0), nBonds_(0),  nBends_(0), nTorsions_(0), nInversions_(0),
77 >    nRigidBodies_(0), nIntegrableObjects_(0), nCutoffGroups_(0),
78 >    nConstraints_(0), nFluctuatingCharges_(0), sman_(NULL), topologyDone_(false),
79 >    calcBoxDipole_(false), useAtomicVirial_(true) {    
80 >    
81      MoleculeStamp* molStamp;
82      int nMolWithSameStamp;
83      int nCutoffAtoms = 0; // number of atoms belong to cutoff groups
84 <    int nGroups = 0;          //total cutoff groups defined in meta-data file
84 >    int nGroups = 0;       //total cutoff groups defined in meta-data file
85      CutoffGroupStamp* cgStamp;    
86      RigidBodyStamp* rbStamp;
87      int nRigidAtoms = 0;
88      
89 <    for (i = molStampPairs.begin(); i !=molStampPairs.end(); ++i) {
90 <        molStamp = i->first;
91 <        nMolWithSameStamp = i->second;
92 <        
93 <        addMoleculeStamp(molStamp, nMolWithSameStamp);
94 <
95 <        //calculate atoms in molecules
96 <        nGlobalAtoms_ += molStamp->getNAtoms() *nMolWithSameStamp;  
97 <
98 <
99 <        //calculate atoms in cutoff groups
100 <        int nAtomsInGroups = 0;
101 <        int nCutoffGroupsInStamp = molStamp->getNCutoffGroups();
102 <        
103 <        for (int j=0; j < nCutoffGroupsInStamp; j++) {
104 <            cgStamp = molStamp->getCutoffGroup(j);
105 <            nAtomsInGroups += cgStamp->getNMembers();
106 <        }
107 <
108 <        nGroups += nCutoffGroupsInStamp * nMolWithSameStamp;
109 <        nCutoffAtoms += nAtomsInGroups * nMolWithSameStamp;            
110 <
111 <        //calculate atoms in rigid bodies
112 <        int nAtomsInRigidBodies = 0;
113 <        int nRigidBodiesInStamp = molStamp->getNRigidBodies();
114 <        
115 <        for (int j=0; j < nRigidBodiesInStamp; j++) {
116 <            rbStamp = molStamp->getRigidBody(j);
117 <            nAtomsInRigidBodies += rbStamp->getNMembers();
118 <        }
119 <
120 <        nGlobalRigidBodies_ += nRigidBodiesInStamp * nMolWithSameStamp;
121 <        nRigidAtoms += nAtomsInRigidBodies * nMolWithSameStamp;            
122 <        
89 >    vector<Component*> components = simParams->getComponents();
90 >    
91 >    for (vector<Component*>::iterator i = components.begin();
92 >         i !=components.end(); ++i) {
93 >      molStamp = (*i)->getMoleculeStamp();
94 >      nMolWithSameStamp = (*i)->getNMol();
95 >      
96 >      addMoleculeStamp(molStamp, nMolWithSameStamp);
97 >      
98 >      //calculate atoms in molecules
99 >      nGlobalAtoms_ += molStamp->getNAtoms() *nMolWithSameStamp;  
100 >      
101 >      //calculate atoms in cutoff groups
102 >      int nAtomsInGroups = 0;
103 >      int nCutoffGroupsInStamp = molStamp->getNCutoffGroups();
104 >      
105 >      for (int j=0; j < nCutoffGroupsInStamp; j++) {
106 >        cgStamp = molStamp->getCutoffGroupStamp(j);
107 >        nAtomsInGroups += cgStamp->getNMembers();
108 >      }
109 >      
110 >      nGroups += nCutoffGroupsInStamp * nMolWithSameStamp;
111 >      
112 >      nCutoffAtoms += nAtomsInGroups * nMolWithSameStamp;            
113 >      
114 >      //calculate atoms in rigid bodies
115 >      int nAtomsInRigidBodies = 0;
116 >      int nRigidBodiesInStamp = molStamp->getNRigidBodies();
117 >      
118 >      for (int j=0; j < nRigidBodiesInStamp; j++) {
119 >        rbStamp = molStamp->getRigidBodyStamp(j);
120 >        nAtomsInRigidBodies += rbStamp->getNMembers();
121 >      }
122 >      
123 >      nGlobalRigidBodies_ += nRigidBodiesInStamp * nMolWithSameStamp;
124 >      nRigidAtoms += nAtomsInRigidBodies * nMolWithSameStamp;            
125 >      
126      }
127 +    
128 +    //every free atom (atom does not belong to cutoff groups) is a cutoff
129 +    //group therefore the total number of cutoff groups in the system is
130 +    //equal to the total number of atoms minus number of atoms belong to
131 +    //cutoff group defined in meta-data file plus the number of cutoff
132 +    //groups defined in meta-data file
133  
124    //every free atom (atom does not belong to cutoff groups) is a cutoff group
125    //therefore the total number of cutoff groups in the system is equal to
126    //the total number of atoms minus number of atoms belong to cutoff group defined in meta-data
127    //file plus the number of cutoff groups defined in meta-data file
134      nGlobalCutoffGroups_ = nGlobalAtoms_ - nCutoffAtoms + nGroups;
135 <
136 <    //every free atom (atom does not belong to rigid bodies) is an integrable object
137 <    //therefore the total number of  integrable objects in the system is equal to
138 <    //the total number of atoms minus number of atoms belong to  rigid body defined in meta-data
139 <    //file plus the number of  rigid bodies defined in meta-data file
140 <    nGlobalIntegrableObjects_ = nGlobalAtoms_ - nRigidAtoms + nGlobalRigidBodies_;
141 <
135 >    
136 >    //every free atom (atom does not belong to rigid bodies) is an
137 >    //integrable object therefore the total number of integrable objects
138 >    //in the system is equal to the total number of atoms minus number of
139 >    //atoms belong to rigid body defined in meta-data file plus the number
140 >    //of rigid bodies defined in meta-data file
141 >    nGlobalIntegrableObjects_ = nGlobalAtoms_ - nRigidAtoms
142 >      + nGlobalRigidBodies_;
143 >    
144      nGlobalMols_ = molStampIds_.size();
137
138 #ifdef IS_MPI    
145      molToProcMap_.resize(nGlobalMols_);
146 < #endif
147 <
148 <    selectMan_ = new SelectionManager(this);
149 <    selectMan_->selectAll();
150 < }
151 <
152 < SimInfo::~SimInfo() {
153 <    //MemoryUtils::deleteVectorOfPointer(molecules_);
154 <
149 <    MemoryUtils::deleteVectorOfPointer(moleculeStamps_);
150 <    
146 >  }
147 >  
148 >  SimInfo::~SimInfo() {
149 >    map<int, Molecule*>::iterator i;
150 >    for (i = molecules_.begin(); i != molecules_.end(); ++i) {
151 >      delete i->second;
152 >    }
153 >    molecules_.clear();
154 >      
155      delete sman_;
156      delete simParams_;
157      delete forceField_;
158 <    delete selectMan_;
155 < }
158 >  }
159  
157 int SimInfo::getNGlobalConstraints() {
158    int nGlobalConstraints;
159 #ifdef IS_MPI
160    MPI_Allreduce(&nConstraints_, &nGlobalConstraints, 1, MPI_INT, MPI_SUM,
161                  MPI_COMM_WORLD);    
162 #else
163    nGlobalConstraints =  nConstraints_;
164 #endif
165    return nGlobalConstraints;
166 }
160  
161 < bool SimInfo::addMolecule(Molecule* mol) {
161 >  bool SimInfo::addMolecule(Molecule* mol) {
162      MoleculeIterator i;
163 <
163 >    
164      i = molecules_.find(mol->getGlobalIndex());
165      if (i == molecules_.end() ) {
166 <
167 <        molecules_.insert(std::make_pair(mol->getGlobalIndex(), mol));
168 <        
169 <        nAtoms_ += mol->getNAtoms();
170 <        nBonds_ += mol->getNBonds();
171 <        nBends_ += mol->getNBends();
172 <        nTorsions_ += mol->getNTorsions();
173 <        nRigidBodies_ += mol->getNRigidBodies();
174 <        nIntegrableObjects_ += mol->getNIntegrableObjects();
175 <        nCutoffGroups_ += mol->getNCutoffGroups();
176 <        nConstraints_ += mol->getNConstraintPairs();
177 <
178 <        addExcludePairs(mol);
179 <        
180 <        return true;
166 >      
167 >      molecules_.insert(make_pair(mol->getGlobalIndex(), mol));
168 >      
169 >      nAtoms_ += mol->getNAtoms();
170 >      nBonds_ += mol->getNBonds();
171 >      nBends_ += mol->getNBends();
172 >      nTorsions_ += mol->getNTorsions();
173 >      nInversions_ += mol->getNInversions();
174 >      nRigidBodies_ += mol->getNRigidBodies();
175 >      nIntegrableObjects_ += mol->getNIntegrableObjects();
176 >      nCutoffGroups_ += mol->getNCutoffGroups();
177 >      nConstraints_ += mol->getNConstraintPairs();
178 >      
179 >      addInteractionPairs(mol);
180 >      
181 >      return true;
182      } else {
183 <        return false;
183 >      return false;
184      }
185 < }
186 <
187 < bool SimInfo::removeMolecule(Molecule* mol) {
185 >  }
186 >  
187 >  bool SimInfo::removeMolecule(Molecule* mol) {
188      MoleculeIterator i;
189      i = molecules_.find(mol->getGlobalIndex());
190  
191      if (i != molecules_.end() ) {
192  
193 <        assert(mol == i->second);
193 >      assert(mol == i->second);
194          
195 <        nAtoms_ -= mol->getNAtoms();
196 <        nBonds_ -= mol->getNBonds();
197 <        nBends_ -= mol->getNBends();
198 <        nTorsions_ -= mol->getNTorsions();
199 <        nRigidBodies_ -= mol->getNRigidBodies();
200 <        nIntegrableObjects_ -= mol->getNIntegrableObjects();
201 <        nCutoffGroups_ -= mol->getNCutoffGroups();
202 <        nConstraints_ -= mol->getNConstraintPairs();
195 >      nAtoms_ -= mol->getNAtoms();
196 >      nBonds_ -= mol->getNBonds();
197 >      nBends_ -= mol->getNBends();
198 >      nTorsions_ -= mol->getNTorsions();
199 >      nInversions_ -= mol->getNInversions();
200 >      nRigidBodies_ -= mol->getNRigidBodies();
201 >      nIntegrableObjects_ -= mol->getNIntegrableObjects();
202 >      nCutoffGroups_ -= mol->getNCutoffGroups();
203 >      nConstraints_ -= mol->getNConstraintPairs();
204  
205 <        removeExcludePairs(mol);
206 <        molecules_.erase(mol->getGlobalIndex());
205 >      removeInteractionPairs(mol);
206 >      molecules_.erase(mol->getGlobalIndex());
207  
208 <        delete mol;
208 >      delete mol;
209          
210 <        return true;
210 >      return true;
211      } else {
212 <        return false;
212 >      return false;
213      }
214 +  }    
215  
220
221 }    
222
216          
217 < Molecule* SimInfo::beginMolecule(MoleculeIterator& i) {
217 >  Molecule* SimInfo::beginMolecule(MoleculeIterator& i) {
218      i = molecules_.begin();
219      return i == molecules_.end() ? NULL : i->second;
220 < }    
220 >  }    
221  
222 < Molecule* SimInfo::nextMolecule(MoleculeIterator& i) {
222 >  Molecule* SimInfo::nextMolecule(MoleculeIterator& i) {
223      ++i;
224      return i == molecules_.end() ? NULL : i->second;    
225 < }
225 >  }
226  
227  
228 < void SimInfo::calcNdf() {
229 <    int ndf_local;
228 >  void SimInfo::calcNdf() {
229 >    int ndf_local, nfq_local;
230      MoleculeIterator i;
231 <    std::vector<StuntDouble*>::iterator j;
231 >    vector<StuntDouble*>::iterator j;
232 >    vector<Atom*>::iterator k;
233 >
234      Molecule* mol;
235 <    StuntDouble* integrableObject;
235 >    StuntDouble* sd;
236 >    Atom* atom;
237  
238      ndf_local = 0;
239 +    nfq_local = 0;
240      
241      for (mol = beginMolecule(i); mol != NULL; mol = nextMolecule(i)) {
245        for (integrableObject = mol->beginIntegrableObject(j); integrableObject != NULL;
246               integrableObject = mol->nextIntegrableObject(j)) {
242  
243 <            ndf_local += 3;
243 >      for (sd = mol->beginIntegrableObject(j); sd != NULL;
244 >           sd = mol->nextIntegrableObject(j)) {
245  
246 <            if (integrableObject->isDirectional()) {
247 <                if (integrableObject->isLinear()) {
248 <                    ndf_local += 2;
249 <                } else {
250 <                    ndf_local += 3;
251 <                }
252 <            }
253 <            
254 <        }//end for (integrableObject)
255 <    }// end for (mol)
246 >        ndf_local += 3;
247 >
248 >        if (sd->isDirectional()) {
249 >          if (sd->isLinear()) {
250 >            ndf_local += 2;
251 >          } else {
252 >            ndf_local += 3;
253 >          }
254 >        }
255 >      }
256 >
257 >      for (atom = mol->beginFluctuatingCharge(k); atom != NULL;
258 >           atom = mol->nextFluctuatingCharge(k)) {
259 >        if (atom->isFluctuatingCharge()) {
260 >          nfq_local++;
261 >        }
262 >      }
263 >    }
264      
265 +    ndfLocal_ = ndf_local;
266 +
267      // n_constraints is local, so subtract them on each processor
268      ndf_local -= nConstraints_;
269  
270   #ifdef IS_MPI
271 <    MPI_Allreduce(&ndf_local,&ndf_,1,MPI_INT,MPI_SUM, MPI_COMM_WORLD);
271 >    MPI::COMM_WORLD.Allreduce(&ndf_local, &ndf_, 1, MPI::INT,MPI::SUM);
272 >    MPI::COMM_WORLD.Allreduce(&nfq_local, &nGlobalFluctuatingCharges_, 1,
273 >                              MPI::INT, MPI::SUM);
274   #else
275      ndf_ = ndf_local;
276 +    nGlobalFluctuatingCharges_ = nfq_local;
277   #endif
278  
279      // nZconstraints_ is global, as are the 3 COM translations for the
280      // entire system:
281      ndf_ = ndf_ - 3 - nZconstraint_;
282  
283 < }
283 >  }
284  
285 < void SimInfo::calcNdfRaw() {
285 >  int SimInfo::getFdf() {
286 > #ifdef IS_MPI
287 >    MPI::COMM_WORLD.Allreduce(&fdf_local, &fdf_, 1, MPI::INT, MPI::SUM);
288 > #else
289 >    fdf_ = fdf_local;
290 > #endif
291 >    return fdf_;
292 >  }
293 >  
294 >  unsigned int SimInfo::getNLocalCutoffGroups(){
295 >    int nLocalCutoffAtoms = 0;
296 >    Molecule* mol;
297 >    MoleculeIterator mi;
298 >    CutoffGroup* cg;
299 >    Molecule::CutoffGroupIterator ci;
300 >    
301 >    for (mol = beginMolecule(mi); mol != NULL; mol  = nextMolecule(mi)) {
302 >      
303 >      for (cg = mol->beginCutoffGroup(ci); cg != NULL;
304 >           cg = mol->nextCutoffGroup(ci)) {
305 >        nLocalCutoffAtoms += cg->getNumAtom();
306 >        
307 >      }        
308 >    }
309 >    
310 >    return nAtoms_ - nLocalCutoffAtoms + nCutoffGroups_;
311 >  }
312 >    
313 >  void SimInfo::calcNdfRaw() {
314      int ndfRaw_local;
315  
316      MoleculeIterator i;
317 <    std::vector<StuntDouble*>::iterator j;
317 >    vector<StuntDouble*>::iterator j;
318      Molecule* mol;
319 <    StuntDouble* integrableObject;
319 >    StuntDouble* sd;
320  
321      // Raw degrees of freedom that we have to set
322      ndfRaw_local = 0;
323      
324      for (mol = beginMolecule(i); mol != NULL; mol = nextMolecule(i)) {
288        for (integrableObject = mol->beginIntegrableObject(j); integrableObject != NULL;
289               integrableObject = mol->nextIntegrableObject(j)) {
325  
326 <            ndfRaw_local += 3;
326 >      for (sd = mol->beginIntegrableObject(j); sd != NULL;
327 >           sd = mol->nextIntegrableObject(j)) {
328  
329 <            if (integrableObject->isDirectional()) {
330 <                if (integrableObject->isLinear()) {
331 <                    ndfRaw_local += 2;
332 <                } else {
333 <                    ndfRaw_local += 3;
334 <                }
335 <            }
329 >        ndfRaw_local += 3;
330 >
331 >        if (sd->isDirectional()) {
332 >          if (sd->isLinear()) {
333 >            ndfRaw_local += 2;
334 >          } else {
335 >            ndfRaw_local += 3;
336 >          }
337 >        }
338              
339 <        }
339 >      }
340      }
341      
342   #ifdef IS_MPI
343 <    MPI_Allreduce(&ndfRaw_local,&ndfRaw_,1,MPI_INT,MPI_SUM, MPI_COMM_WORLD);
343 >    MPI::COMM_WORLD.Allreduce(&ndfRaw_local, &ndfRaw_, 1, MPI::INT, MPI::SUM);
344   #else
345      ndfRaw_ = ndfRaw_local;
346   #endif
347 < }
347 >  }
348  
349 < void SimInfo::calcNdfTrans() {
349 >  void SimInfo::calcNdfTrans() {
350      int ndfTrans_local;
351  
352      ndfTrans_local = 3 * nIntegrableObjects_ - nConstraints_;
353  
354  
355   #ifdef IS_MPI
356 <    MPI_Allreduce(&ndfTrans_local,&ndfTrans_,1,MPI_INT,MPI_SUM, MPI_COMM_WORLD);
356 >    MPI::COMM_WORLD.Allreduce(&ndfTrans_local, &ndfTrans_, 1,
357 >                              MPI::INT, MPI::SUM);
358   #else
359      ndfTrans_ = ndfTrans_local;
360   #endif
361  
362      ndfTrans_ = ndfTrans_ - 3 - nZconstraint_;
363  
364 < }
364 >  }
365  
366 < void SimInfo::addExcludePairs(Molecule* mol) {
367 <    std::vector<Bond*>::iterator bondIter;
368 <    std::vector<Bend*>::iterator bendIter;
369 <    std::vector<Torsion*>::iterator torsionIter;
366 >  void SimInfo::addInteractionPairs(Molecule* mol) {
367 >    ForceFieldOptions& options_ = forceField_->getForceFieldOptions();
368 >    vector<Bond*>::iterator bondIter;
369 >    vector<Bend*>::iterator bendIter;
370 >    vector<Torsion*>::iterator torsionIter;
371 >    vector<Inversion*>::iterator inversionIter;
372      Bond* bond;
373      Bend* bend;
374      Torsion* torsion;
375 +    Inversion* inversion;
376      int a;
377      int b;
378      int c;
379      int d;
380 +
381 +    // atomGroups can be used to add special interaction maps between
382 +    // groups of atoms that are in two separate rigid bodies.
383 +    // However, most site-site interactions between two rigid bodies
384 +    // are probably not special, just the ones between the physically
385 +    // bonded atoms.  Interactions *within* a single rigid body should
386 +    // always be excluded.  These are done at the bottom of this
387 +    // function.
388 +
389 +    map<int, set<int> > atomGroups;
390 +    Molecule::RigidBodyIterator rbIter;
391 +    RigidBody* rb;
392 +    Molecule::IntegrableObjectIterator ii;
393 +    StuntDouble* sd;
394      
395 <    for (bond= mol->beginBond(bondIter); bond != NULL; bond = mol->nextBond(bondIter)) {
396 <        a = bond->getAtomA()->getGlobalIndex();
397 <        b = bond->getAtomB()->getGlobalIndex();        
398 <        exclude_.addPair(a, b);
395 >    for (sd = mol->beginIntegrableObject(ii); sd != NULL;
396 >         sd = mol->nextIntegrableObject(ii)) {
397 >      
398 >      if (sd->isRigidBody()) {
399 >        rb = static_cast<RigidBody*>(sd);
400 >        vector<Atom*> atoms = rb->getAtoms();
401 >        set<int> rigidAtoms;
402 >        for (int i = 0; i < static_cast<int>(atoms.size()); ++i) {
403 >          rigidAtoms.insert(atoms[i]->getGlobalIndex());
404 >        }
405 >        for (int i = 0; i < static_cast<int>(atoms.size()); ++i) {
406 >          atomGroups.insert(map<int, set<int> >::value_type(atoms[i]->getGlobalIndex(), rigidAtoms));
407 >        }      
408 >      } else {
409 >        set<int> oneAtomSet;
410 >        oneAtomSet.insert(sd->getGlobalIndex());
411 >        atomGroups.insert(map<int, set<int> >::value_type(sd->getGlobalIndex(), oneAtomSet));        
412 >      }
413 >    }  
414 >          
415 >    for (bond= mol->beginBond(bondIter); bond != NULL;
416 >         bond = mol->nextBond(bondIter)) {
417 >
418 >      a = bond->getAtomA()->getGlobalIndex();
419 >      b = bond->getAtomB()->getGlobalIndex();  
420 >    
421 >      if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) {
422 >        oneTwoInteractions_.addPair(a, b);
423 >      } else {
424 >        excludedInteractions_.addPair(a, b);
425 >      }
426      }
427  
428 <    for (bend= mol->beginBend(bendIter); bend != NULL; bend = mol->nextBend(bendIter)) {
429 <        a = bend->getAtomA()->getGlobalIndex();
347 <        b = bend->getAtomB()->getGlobalIndex();        
348 <        c = bend->getAtomC()->getGlobalIndex();
428 >    for (bend= mol->beginBend(bendIter); bend != NULL;
429 >         bend = mol->nextBend(bendIter)) {
430  
431 <        exclude_.addPair(a, b);
432 <        exclude_.addPair(a, c);
433 <        exclude_.addPair(b, c);        
431 >      a = bend->getAtomA()->getGlobalIndex();
432 >      b = bend->getAtomB()->getGlobalIndex();        
433 >      c = bend->getAtomC()->getGlobalIndex();
434 >      
435 >      if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) {
436 >        oneTwoInteractions_.addPair(a, b);      
437 >        oneTwoInteractions_.addPair(b, c);
438 >      } else {
439 >        excludedInteractions_.addPair(a, b);
440 >        excludedInteractions_.addPair(b, c);
441 >      }
442 >
443 >      if (options_.havevdw13scale() || options_.haveelectrostatic13scale()) {
444 >        oneThreeInteractions_.addPair(a, c);      
445 >      } else {
446 >        excludedInteractions_.addPair(a, c);
447 >      }
448      }
449  
450 <    for (torsion= mol->beginTorsion(torsionIter); torsion != NULL; torsion = mol->nextTorsion(torsionIter)) {
451 <        a = torsion->getAtomA()->getGlobalIndex();
357 <        b = torsion->getAtomB()->getGlobalIndex();        
358 <        c = torsion->getAtomC()->getGlobalIndex();        
359 <        d = torsion->getAtomD()->getGlobalIndex();        
450 >    for (torsion= mol->beginTorsion(torsionIter); torsion != NULL;
451 >         torsion = mol->nextTorsion(torsionIter)) {
452  
453 <        exclude_.addPair(a, b);
454 <        exclude_.addPair(a, c);
455 <        exclude_.addPair(a, d);
456 <        exclude_.addPair(b, c);
457 <        exclude_.addPair(b, d);
458 <        exclude_.addPair(c, d);        
453 >      a = torsion->getAtomA()->getGlobalIndex();
454 >      b = torsion->getAtomB()->getGlobalIndex();        
455 >      c = torsion->getAtomC()->getGlobalIndex();        
456 >      d = torsion->getAtomD()->getGlobalIndex();      
457 >
458 >      if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) {
459 >        oneTwoInteractions_.addPair(a, b);      
460 >        oneTwoInteractions_.addPair(b, c);
461 >        oneTwoInteractions_.addPair(c, d);
462 >      } else {
463 >        excludedInteractions_.addPair(a, b);
464 >        excludedInteractions_.addPair(b, c);
465 >        excludedInteractions_.addPair(c, d);
466 >      }
467 >
468 >      if (options_.havevdw13scale() || options_.haveelectrostatic13scale()) {
469 >        oneThreeInteractions_.addPair(a, c);      
470 >        oneThreeInteractions_.addPair(b, d);      
471 >      } else {
472 >        excludedInteractions_.addPair(a, c);
473 >        excludedInteractions_.addPair(b, d);
474 >      }
475 >
476 >      if (options_.havevdw14scale() || options_.haveelectrostatic14scale()) {
477 >        oneFourInteractions_.addPair(a, d);      
478 >      } else {
479 >        excludedInteractions_.addPair(a, d);
480 >      }
481      }
482  
483 <    
484 < }
483 >    for (inversion= mol->beginInversion(inversionIter); inversion != NULL;
484 >         inversion = mol->nextInversion(inversionIter)) {
485  
486 < void SimInfo::removeExcludePairs(Molecule* mol) {
487 <    std::vector<Bond*>::iterator bondIter;
488 <    std::vector<Bend*>::iterator bendIter;
489 <    std::vector<Torsion*>::iterator torsionIter;
486 >      a = inversion->getAtomA()->getGlobalIndex();
487 >      b = inversion->getAtomB()->getGlobalIndex();        
488 >      c = inversion->getAtomC()->getGlobalIndex();        
489 >      d = inversion->getAtomD()->getGlobalIndex();        
490 >
491 >      if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) {
492 >        oneTwoInteractions_.addPair(a, b);      
493 >        oneTwoInteractions_.addPair(a, c);
494 >        oneTwoInteractions_.addPair(a, d);
495 >      } else {
496 >        excludedInteractions_.addPair(a, b);
497 >        excludedInteractions_.addPair(a, c);
498 >        excludedInteractions_.addPair(a, d);
499 >      }
500 >
501 >      if (options_.havevdw13scale() || options_.haveelectrostatic13scale()) {
502 >        oneThreeInteractions_.addPair(b, c);    
503 >        oneThreeInteractions_.addPair(b, d);    
504 >        oneThreeInteractions_.addPair(c, d);      
505 >      } else {
506 >        excludedInteractions_.addPair(b, c);
507 >        excludedInteractions_.addPair(b, d);
508 >        excludedInteractions_.addPair(c, d);
509 >      }
510 >    }
511 >
512 >    for (rb = mol->beginRigidBody(rbIter); rb != NULL;
513 >         rb = mol->nextRigidBody(rbIter)) {
514 >      vector<Atom*> atoms = rb->getAtoms();
515 >      for (int i = 0; i < static_cast<int>(atoms.size()) -1 ; ++i) {
516 >        for (int j = i + 1; j < static_cast<int>(atoms.size()); ++j) {
517 >          a = atoms[i]->getGlobalIndex();
518 >          b = atoms[j]->getGlobalIndex();
519 >          excludedInteractions_.addPair(a, b);
520 >        }
521 >      }
522 >    }        
523 >
524 >  }
525 >
526 >  void SimInfo::removeInteractionPairs(Molecule* mol) {
527 >    ForceFieldOptions& options_ = forceField_->getForceFieldOptions();
528 >    vector<Bond*>::iterator bondIter;
529 >    vector<Bend*>::iterator bendIter;
530 >    vector<Torsion*>::iterator torsionIter;
531 >    vector<Inversion*>::iterator inversionIter;
532      Bond* bond;
533      Bend* bend;
534      Torsion* torsion;
535 +    Inversion* inversion;
536      int a;
537      int b;
538      int c;
539      int d;
540 +
541 +    map<int, set<int> > atomGroups;
542 +    Molecule::RigidBodyIterator rbIter;
543 +    RigidBody* rb;
544 +    Molecule::IntegrableObjectIterator ii;
545 +    StuntDouble* sd;
546      
547 <    for (bond= mol->beginBond(bondIter); bond != NULL; bond = mol->nextBond(bondIter)) {
548 <        a = bond->getAtomA()->getGlobalIndex();
549 <        b = bond->getAtomB()->getGlobalIndex();        
550 <        exclude_.removePair(a, b);
547 >    for (sd = mol->beginIntegrableObject(ii); sd != NULL;
548 >         sd = mol->nextIntegrableObject(ii)) {
549 >      
550 >      if (sd->isRigidBody()) {
551 >        rb = static_cast<RigidBody*>(sd);
552 >        vector<Atom*> atoms = rb->getAtoms();
553 >        set<int> rigidAtoms;
554 >        for (int i = 0; i < static_cast<int>(atoms.size()); ++i) {
555 >          rigidAtoms.insert(atoms[i]->getGlobalIndex());
556 >        }
557 >        for (int i = 0; i < static_cast<int>(atoms.size()); ++i) {
558 >          atomGroups.insert(map<int, set<int> >::value_type(atoms[i]->getGlobalIndex(), rigidAtoms));
559 >        }      
560 >      } else {
561 >        set<int> oneAtomSet;
562 >        oneAtomSet.insert(sd->getGlobalIndex());
563 >        atomGroups.insert(map<int, set<int> >::value_type(sd->getGlobalIndex(), oneAtomSet));        
564 >      }
565 >    }  
566 >
567 >    for (bond= mol->beginBond(bondIter); bond != NULL;
568 >         bond = mol->nextBond(bondIter)) {
569 >      
570 >      a = bond->getAtomA()->getGlobalIndex();
571 >      b = bond->getAtomB()->getGlobalIndex();  
572 >    
573 >      if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) {
574 >        oneTwoInteractions_.removePair(a, b);
575 >      } else {
576 >        excludedInteractions_.removePair(a, b);
577 >      }
578      }
579  
580 <    for (bend= mol->beginBend(bendIter); bend != NULL; bend = mol->nextBend(bendIter)) {
581 <        a = bend->getAtomA()->getGlobalIndex();
392 <        b = bend->getAtomB()->getGlobalIndex();        
393 <        c = bend->getAtomC()->getGlobalIndex();
580 >    for (bend= mol->beginBend(bendIter); bend != NULL;
581 >         bend = mol->nextBend(bendIter)) {
582  
583 <        exclude_.removePair(a, b);
584 <        exclude_.removePair(a, c);
585 <        exclude_.removePair(b, c);        
583 >      a = bend->getAtomA()->getGlobalIndex();
584 >      b = bend->getAtomB()->getGlobalIndex();        
585 >      c = bend->getAtomC()->getGlobalIndex();
586 >      
587 >      if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) {
588 >        oneTwoInteractions_.removePair(a, b);      
589 >        oneTwoInteractions_.removePair(b, c);
590 >      } else {
591 >        excludedInteractions_.removePair(a, b);
592 >        excludedInteractions_.removePair(b, c);
593 >      }
594 >
595 >      if (options_.havevdw13scale() || options_.haveelectrostatic13scale()) {
596 >        oneThreeInteractions_.removePair(a, c);      
597 >      } else {
598 >        excludedInteractions_.removePair(a, c);
599 >      }
600      }
601  
602 <    for (torsion= mol->beginTorsion(torsionIter); torsion != NULL; torsion = mol->nextTorsion(torsionIter)) {
603 <        a = torsion->getAtomA()->getGlobalIndex();
402 <        b = torsion->getAtomB()->getGlobalIndex();        
403 <        c = torsion->getAtomC()->getGlobalIndex();        
404 <        d = torsion->getAtomD()->getGlobalIndex();        
602 >    for (torsion= mol->beginTorsion(torsionIter); torsion != NULL;
603 >         torsion = mol->nextTorsion(torsionIter)) {
604  
605 <        exclude_.removePair(a, b);
606 <        exclude_.removePair(a, c);
607 <        exclude_.removePair(a, d);
608 <        exclude_.removePair(b, c);
609 <        exclude_.removePair(b, d);
610 <        exclude_.removePair(c, d);        
605 >      a = torsion->getAtomA()->getGlobalIndex();
606 >      b = torsion->getAtomB()->getGlobalIndex();        
607 >      c = torsion->getAtomC()->getGlobalIndex();        
608 >      d = torsion->getAtomD()->getGlobalIndex();      
609 >  
610 >      if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) {
611 >        oneTwoInteractions_.removePair(a, b);      
612 >        oneTwoInteractions_.removePair(b, c);
613 >        oneTwoInteractions_.removePair(c, d);
614 >      } else {
615 >        excludedInteractions_.removePair(a, b);
616 >        excludedInteractions_.removePair(b, c);
617 >        excludedInteractions_.removePair(c, d);
618 >      }
619 >
620 >      if (options_.havevdw13scale() || options_.haveelectrostatic13scale()) {
621 >        oneThreeInteractions_.removePair(a, c);      
622 >        oneThreeInteractions_.removePair(b, d);      
623 >      } else {
624 >        excludedInteractions_.removePair(a, c);
625 >        excludedInteractions_.removePair(b, d);
626 >      }
627 >
628 >      if (options_.havevdw14scale() || options_.haveelectrostatic14scale()) {
629 >        oneFourInteractions_.removePair(a, d);      
630 >      } else {
631 >        excludedInteractions_.removePair(a, d);
632 >      }
633      }
634  
635 < }
635 >    for (inversion= mol->beginInversion(inversionIter); inversion != NULL;
636 >         inversion = mol->nextInversion(inversionIter)) {
637  
638 +      a = inversion->getAtomA()->getGlobalIndex();
639 +      b = inversion->getAtomB()->getGlobalIndex();        
640 +      c = inversion->getAtomC()->getGlobalIndex();        
641 +      d = inversion->getAtomD()->getGlobalIndex();        
642  
643 < void SimInfo::addMoleculeStamp(MoleculeStamp* molStamp, int nmol) {
644 <    int curStampId;
643 >      if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) {
644 >        oneTwoInteractions_.removePair(a, b);      
645 >        oneTwoInteractions_.removePair(a, c);
646 >        oneTwoInteractions_.removePair(a, d);
647 >      } else {
648 >        excludedInteractions_.removePair(a, b);
649 >        excludedInteractions_.removePair(a, c);
650 >        excludedInteractions_.removePair(a, d);
651 >      }
652  
653 +      if (options_.havevdw13scale() || options_.haveelectrostatic13scale()) {
654 +        oneThreeInteractions_.removePair(b, c);    
655 +        oneThreeInteractions_.removePair(b, d);    
656 +        oneThreeInteractions_.removePair(c, d);      
657 +      } else {
658 +        excludedInteractions_.removePair(b, c);
659 +        excludedInteractions_.removePair(b, d);
660 +        excludedInteractions_.removePair(c, d);
661 +      }
662 +    }
663 +
664 +    for (rb = mol->beginRigidBody(rbIter); rb != NULL;
665 +         rb = mol->nextRigidBody(rbIter)) {
666 +      vector<Atom*> atoms = rb->getAtoms();
667 +      for (int i = 0; i < static_cast<int>(atoms.size()) -1 ; ++i) {
668 +        for (int j = i + 1; j < static_cast<int>(atoms.size()); ++j) {
669 +          a = atoms[i]->getGlobalIndex();
670 +          b = atoms[j]->getGlobalIndex();
671 +          excludedInteractions_.removePair(a, b);
672 +        }
673 +      }
674 +    }        
675 +    
676 +  }
677 +  
678 +  
679 +  void SimInfo::addMoleculeStamp(MoleculeStamp* molStamp, int nmol) {
680 +    int curStampId;
681 +    
682      //index from 0
683      curStampId = moleculeStamps_.size();
684  
685      moleculeStamps_.push_back(molStamp);
686      molStampIds_.insert(molStampIds_.end(), nmol, curStampId);
687 < }
687 >  }
688  
427 void SimInfo::update() {
689  
690 <    setupSimType();
691 <
692 < #ifdef IS_MPI
693 <    setupFortranParallel();
694 < #endif
695 <
696 <    setupFortranSim();
697 <
698 <    //setup fortran force field
438 <    /** @deprecate */    
439 <    int isError = 0;
440 <    initFortranFF( &fInfo_.SIM_uses_RF , &isError );
441 <    if(isError){
442 <        sprintf( painCave.errMsg,
443 <         "ForceField error: There was an error initializing the forceField in fortran.\n" );
444 <        painCave.isFatal = 1;
445 <        simError();
446 <    }
447 <  
448 <    
449 <    setupCutoff();
450 <
690 >  /**
691 >   * update
692 >   *
693 >   *  Performs the global checks and variable settings after the
694 >   *  objects have been created.
695 >   *
696 >   */
697 >  void SimInfo::update() {  
698 >    setupSimVariables();
699      calcNdf();
700      calcNdfRaw();
701      calcNdfTrans();
702 <
703 <    fortranInitialized_ = true;
704 < }
705 <
706 < std::set<AtomType*> SimInfo::getUniqueAtomTypes() {
702 >  }
703 >  
704 >  /**
705 >   * getSimulatedAtomTypes
706 >   *
707 >   * Returns an STL set of AtomType* that are actually present in this
708 >   * simulation.  Must query all processors to assemble this information.
709 >   *
710 >   */
711 >  set<AtomType*> SimInfo::getSimulatedAtomTypes() {
712      SimInfo::MoleculeIterator mi;
713      Molecule* mol;
714      Molecule::AtomIterator ai;
715      Atom* atom;
716 <    std::set<AtomType*> atomTypes;
717 <
716 >    set<AtomType*> atomTypes;
717 >    
718      for(mol = beginMolecule(mi); mol != NULL; mol = nextMolecule(mi)) {
719 +      for(atom = mol->beginAtom(ai); atom != NULL;
720 +          atom = mol->nextAtom(ai)) {
721 +        atomTypes.insert(atom->getAtomType());
722 +      }      
723 +    }    
724 +    
725 + #ifdef IS_MPI
726  
727 <        for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) {
728 <            atomTypes.insert(atom->getAtomType());
729 <        }
730 <        
731 <    }
727 >    // loop over the found atom types on this processor, and add their
728 >    // numerical idents to a vector:
729 >    
730 >    vector<int> foundTypes;
731 >    set<AtomType*>::iterator i;
732 >    for (i = atomTypes.begin(); i != atomTypes.end(); ++i)
733 >      foundTypes.push_back( (*i)->getIdent() );
734  
735 <    return atomTypes;        
736 < }
735 >    // count_local holds the number of found types on this processor
736 >    int count_local = foundTypes.size();
737  
738 < void SimInfo::setupSimType() {
477 <    std::set<AtomType*>::iterator i;
478 <    std::set<AtomType*> atomTypes;
479 <    atomTypes = getUniqueAtomTypes();
480 <    
481 <    int useLennardJones = 0;
482 <    int useElectrostatic = 0;
483 <    int useEAM = 0;
484 <    int useCharge = 0;
485 <    int useDirectional = 0;
486 <    int useDipole = 0;
487 <    int useGayBerne = 0;
488 <    int useSticky = 0;
489 <    int useShape = 0;
490 <    int useFLARB = 0; //it is not in AtomType yet
491 <    int useDirectionalAtom = 0;    
492 <    int useElectrostatics = 0;
493 <    //usePBC and useRF are from simParams
494 <    int usePBC = simParams_->getPBC();
495 <    int useRF = simParams_->getUseRF();
738 >    int nproc = MPI::COMM_WORLD.Get_size();
739  
740 <    //loop over all of the atom types
741 <    for (i = atomTypes.begin(); i != atomTypes.end(); ++i) {
742 <        useLennardJones |= (*i)->isLennardJones();
743 <        useElectrostatic |= (*i)->isElectrostatic();
501 <        useEAM |= (*i)->isEAM();
502 <        useCharge |= (*i)->isCharge();
503 <        useDirectional |= (*i)->isDirectional();
504 <        useDipole |= (*i)->isDipole();
505 <        useGayBerne |= (*i)->isGayBerne();
506 <        useSticky |= (*i)->isSticky();
507 <        useShape |= (*i)->isShape();
508 <    }
740 >    // we need arrays to hold the counts and displacement vectors for
741 >    // all processors
742 >    vector<int> counts(nproc, 0);
743 >    vector<int> disps(nproc, 0);
744  
745 <    if (useSticky || useDipole || useGayBerne || useShape) {
746 <        useDirectionalAtom = 1;
745 >    // fill the counts array
746 >    MPI::COMM_WORLD.Allgather(&count_local, 1, MPI::INT, &counts[0],
747 >                              1, MPI::INT);
748 >  
749 >    // use the processor counts to compute the displacement array
750 >    disps[0] = 0;    
751 >    int totalCount = counts[0];
752 >    for (int iproc = 1; iproc < nproc; iproc++) {
753 >      disps[iproc] = disps[iproc-1] + counts[iproc-1];
754 >      totalCount += counts[iproc];
755      }
756  
757 <    if (useCharge || useDipole) {
758 <        useElectrostatics = 1;
759 <    }
757 >    // we need a (possibly redundant) set of all found types:
758 >    vector<int> ftGlobal(totalCount);
759 >    
760 >    // now spray out the foundTypes to all the other processors:    
761 >    MPI::COMM_WORLD.Allgatherv(&foundTypes[0], count_local, MPI::INT,
762 >                               &ftGlobal[0], &counts[0], &disps[0],
763 >                               MPI::INT);
764  
765 < #ifdef IS_MPI    
519 <    int temp;
765 >    vector<int>::iterator j;
766  
767 <    temp = usePBC;
768 <    MPI_Allreduce(&temp, &usePBC, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);    
767 >    // foundIdents is a stl set, so inserting an already found ident
768 >    // will have no effect.
769 >    set<int> foundIdents;
770  
771 <    temp = useDirectionalAtom;
772 <    MPI_Allreduce(&temp, &useDirectionalAtom, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);    
771 >    for (j = ftGlobal.begin(); j != ftGlobal.end(); ++j)
772 >      foundIdents.insert((*j));
773 >    
774 >    // now iterate over the foundIdents and get the actual atom types
775 >    // that correspond to these:
776 >    set<int>::iterator it;
777 >    for (it = foundIdents.begin(); it != foundIdents.end(); ++it)
778 >      atomTypes.insert( forceField_->getAtomType((*it)) );
779 >
780 > #endif
781  
782 <    temp = useLennardJones;
783 <    MPI_Allreduce(&temp, &useLennardJones, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);    
782 >    return atomTypes;        
783 >  }
784  
530    temp = useElectrostatics;
531    MPI_Allreduce(&temp, &useElectrostatics, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);    
785  
786 <    temp = useCharge;
787 <    MPI_Allreduce(&temp, &useCharge, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);    
786 >  int getGlobalCountOfType(AtomType* atype) {
787 >    /*
788 >    set<AtomType*> atypes = getSimulatedAtomTypes();
789 >    map<AtomType*, int> counts_;
790  
791 <    temp = useDipole;
792 <    MPI_Allreduce(&temp, &useDipole, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);    
791 >    for(mol = beginMolecule(mi); mol != NULL; mol = nextMolecule(mi)) {
792 >      for(atom = mol->beginAtom(ai); atom != NULL;
793 >          atom = mol->nextAtom(ai)) {
794 >        atom->getAtomType();
795 >      }      
796 >    }    
797 >    */
798 >    return 0;
799 >  }
800  
801 <    temp = useSticky;
802 <    MPI_Allreduce(&temp, &useSticky, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);    
801 >  void SimInfo::setupSimVariables() {
802 >    useAtomicVirial_ = simParams_->getUseAtomicVirial();
803 >    // we only call setAccumulateBoxDipole if the accumulateBoxDipole
804 >    // parameter is true
805 >    calcBoxDipole_ = false;
806 >    if ( simParams_->haveAccumulateBoxDipole() )
807 >      if ( simParams_->getAccumulateBoxDipole() ) {
808 >        calcBoxDipole_ = true;      
809 >      }
810 >    
811 >    set<AtomType*>::iterator i;
812 >    set<AtomType*> atomTypes;
813 >    atomTypes = getSimulatedAtomTypes();    
814 >    bool usesElectrostatic = false;
815 >    bool usesMetallic = false;
816 >    bool usesDirectional = false;
817 >    bool usesFluctuatingCharges =  false;
818 >    //loop over all of the atom types
819 >    for (i = atomTypes.begin(); i != atomTypes.end(); ++i) {
820 >      usesElectrostatic |= (*i)->isElectrostatic();
821 >      usesMetallic |= (*i)->isMetal();
822 >      usesDirectional |= (*i)->isDirectional();
823 >      usesFluctuatingCharges |= (*i)->isFluctuatingCharge();
824 >    }
825  
826 <    temp = useGayBerne;
827 <    MPI_Allreduce(&temp, &useGayBerne, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);    
826 > #ifdef IS_MPI
827 >    bool temp;
828 >    temp = usesDirectional;
829 >    MPI::COMM_WORLD.Allreduce(&temp, &usesDirectionalAtoms_, 1, MPI::BOOL,
830 >                              MPI::LOR);
831 >        
832 >    temp = usesMetallic;
833 >    MPI::COMM_WORLD.Allreduce(&temp, &usesMetallicAtoms_, 1, MPI::BOOL,
834 >                              MPI::LOR);
835 >    
836 >    temp = usesElectrostatic;
837 >    MPI::COMM_WORLD.Allreduce(&temp, &usesElectrostaticAtoms_, 1, MPI::BOOL,
838 >                              MPI::LOR);
839  
840 <    temp = useEAM;
841 <    MPI_Allreduce(&temp, &useEAM, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);    
840 >    temp = usesFluctuatingCharges;
841 >    MPI::COMM_WORLD.Allreduce(&temp, &usesFluctuatingCharges_, 1, MPI::BOOL,
842 >                              MPI::LOR);
843 > #else
844  
845 <    temp = useShape;
846 <    MPI_Allreduce(&temp, &useShape, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);  
845 >    usesDirectionalAtoms_ = usesDirectional;
846 >    usesMetallicAtoms_ = usesMetallic;
847 >    usesElectrostaticAtoms_ = usesElectrostatic;
848 >    usesFluctuatingCharges_ = usesFluctuatingCharges;
849  
551    temp = useFLARB;
552    MPI_Allreduce(&temp, &useFLARB, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);    
553
554    temp = useRF;
555    MPI_Allreduce(&temp, &useRF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);    
556    
850   #endif
851 +    
852 +    requiresPrepair_ = usesMetallicAtoms_ ? true : false;
853 +    requiresSkipCorrection_ = usesElectrostaticAtoms_ ? true : false;
854 +    requiresSelfCorrection_ = usesElectrostaticAtoms_ ? true : false;    
855 +  }
856  
559    fInfo_.SIM_uses_PBC = usePBC;    
560    fInfo_.SIM_uses_DirectionalAtoms = useDirectionalAtom;
561    fInfo_.SIM_uses_LennardJones = useLennardJones;
562    fInfo_.SIM_uses_Electrostatics = useElectrostatics;    
563    fInfo_.SIM_uses_Charges = useCharge;
564    fInfo_.SIM_uses_Dipoles = useDipole;
565    fInfo_.SIM_uses_Sticky = useSticky;
566    fInfo_.SIM_uses_GayBerne = useGayBerne;
567    fInfo_.SIM_uses_EAM = useEAM;
568    fInfo_.SIM_uses_Shapes = useShape;
569    fInfo_.SIM_uses_FLARB = useFLARB;
570    fInfo_.SIM_uses_RF = useRF;
857  
858 <    if( fInfo_.SIM_uses_Dipoles && fInfo_.SIM_uses_RF) {
858 >  vector<int> SimInfo::getGlobalAtomIndices() {
859 >    SimInfo::MoleculeIterator mi;
860 >    Molecule* mol;
861 >    Molecule::AtomIterator ai;
862 >    Atom* atom;
863  
864 <        if (simParams_->haveDielectric()) {
865 <            fInfo_.dielect = simParams_->getDielectric();
866 <        } else {
867 <            sprintf(painCave.errMsg,
868 <                    "SimSetup Error: No Dielectric constant was set.\n"
869 <                    "\tYou are trying to use Reaction Field without"
870 <                    "\tsetting a dielectric constant!\n");
581 <            painCave.isFatal = 1;
582 <            simError();
583 <        }
584 <        
585 <    } else {
586 <        fInfo_.dielect = 0.0;
864 >    vector<int> GlobalAtomIndices(getNAtoms(), 0);
865 >    
866 >    for (mol = beginMolecule(mi); mol != NULL; mol  = nextMolecule(mi)) {
867 >      
868 >      for (atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) {
869 >        GlobalAtomIndices[atom->getLocalIndex()] = atom->getGlobalIndex();
870 >      }
871      }
872 +    return GlobalAtomIndices;
873 +  }
874  
589 }
875  
876 < void SimInfo::setupFortranSim() {
877 <    int isError;
878 <    int nExclude;
879 <    std::vector<int> fortranGlobalGroupMembership;
880 <    
596 <    nExclude = exclude_.getSize();
597 <    isError = 0;
876 >  vector<int> SimInfo::getGlobalGroupIndices() {
877 >    SimInfo::MoleculeIterator mi;
878 >    Molecule* mol;
879 >    Molecule::CutoffGroupIterator ci;
880 >    CutoffGroup* cg;
881  
882 <    //globalGroupMembership_ is filled by SimCreator    
883 <    for (int i = 0; i < nGlobalAtoms_; i++) {
884 <        fortranGlobalGroupMembership.push_back(globalGroupMembership_[i] + 1);
882 >    vector<int> GlobalGroupIndices;
883 >    
884 >    for (mol = beginMolecule(mi); mol != NULL; mol  = nextMolecule(mi)) {
885 >      
886 >      //local index of cutoff group is trivial, it only depends on the
887 >      //order of travesing
888 >      for (cg = mol->beginCutoffGroup(ci); cg != NULL;
889 >           cg = mol->nextCutoffGroup(ci)) {
890 >        GlobalGroupIndices.push_back(cg->getGlobalIndex());
891 >      }        
892      }
893 +    return GlobalGroupIndices;
894 +  }
895  
896 +
897 +  void SimInfo::prepareTopology() {
898 +
899      //calculate mass ratio of cutoff group
605    std::vector<double> mfact;
900      SimInfo::MoleculeIterator mi;
901      Molecule* mol;
902      Molecule::CutoffGroupIterator ci;
903      CutoffGroup* cg;
904      Molecule::AtomIterator ai;
905      Atom* atom;
906 <    double totalMass;
906 >    RealType totalMass;
907  
908 <    //to avoid memory reallocation, reserve enough space for mfact
909 <    mfact.reserve(getNCutoffGroups());
908 >    /**
909 >     * The mass factor is the relative mass of an atom to the total
910 >     * mass of the cutoff group it belongs to.  By default, all atoms
911 >     * are their own cutoff groups, and therefore have mass factors of
912 >     * 1.  We need some special handling for massless atoms, which
913 >     * will be treated as carrying the entire mass of the cutoff
914 >     * group.
915 >     */
916 >    massFactors_.clear();
917 >    massFactors_.resize(getNAtoms(), 1.0);
918      
919      for(mol = beginMolecule(mi); mol != NULL; mol = nextMolecule(mi)) {        
920 <        for (cg = mol->beginCutoffGroup(ci); cg != NULL; cg = mol->nextCutoffGroup(ci)) {
920 >      for (cg = mol->beginCutoffGroup(ci); cg != NULL;
921 >           cg = mol->nextCutoffGroup(ci)) {
922  
923 <            totalMass = cg->getMass();
924 <            for(atom = cg->beginAtom(ai); atom != NULL; atom = cg->nextAtom(ai)) {
925 <                        mfact.push_back(atom->getMass()/totalMass);
926 <            }
927 <
928 <        }      
923 >        totalMass = cg->getMass();
924 >        for(atom = cg->beginAtom(ai); atom != NULL; atom = cg->nextAtom(ai)) {
925 >          // Check for massless groups - set mfact to 1 if true
926 >          if (totalMass != 0)
927 >            massFactors_[atom->getLocalIndex()] = atom->getMass()/totalMass;
928 >          else
929 >            massFactors_[atom->getLocalIndex()] = 1.0;
930 >        }
931 >      }      
932      }
933  
934 <    //fill ident array of local atoms (it is actually ident of AtomType, it is so confusing !!!)
629 <    std::vector<int> identArray;
934 >    // Build the identArray_
935  
936 <    //to avoid memory reallocation, reserve enough space identArray
937 <    identArray.reserve(getNAtoms());
633 <    
936 >    identArray_.clear();
937 >    identArray_.reserve(getNAtoms());    
938      for(mol = beginMolecule(mi); mol != NULL; mol = nextMolecule(mi)) {        
939 <        for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) {
940 <            identArray.push_back(atom->getIdent());
941 <        }
939 >      for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) {
940 >        identArray_.push_back(atom->getIdent());
941 >      }
942      }    
943 +    
944 +    topologyDone_ = true;
945 +  }
946  
947 <    //fill molMembershipArray
641 <    //molMembershipArray is filled by SimCreator    
642 <    std::vector<int> molMembershipArray(nGlobalAtoms_);
643 <    for (int i = 0; i < nGlobalAtoms_; i++) {
644 <        molMembershipArray[i] = globalMolMembership_[i] + 1;
645 <    }
646 <    
647 <    //setup fortran simulation
648 <    //gloalExcludes and molMembershipArray should go away (They are never used)
649 <    //why the hell fortran need to know molecule?
650 <    //OOPSE = Object-Obfuscated Parallel Simulation Engine
651 <    int nGlobalExcludes = 0;
652 <    int* globalExcludes = NULL;
653 <    int* excludeList = exclude_.getExcludeList();
654 <    setFortranSim( &fInfo_, &nGlobalAtoms_, &nAtoms_, &identArray[0], &nExclude, excludeList ,
655 <                  &nGlobalExcludes, globalExcludes, &molMembershipArray[0],
656 <                  &mfact[0], &nCutoffGroups_, &fortranGlobalGroupMembership[0], &isError);
657 <
658 <    if( isError ){
659 <
660 <        sprintf( painCave.errMsg,
661 <                 "There was an error setting the simulation information in fortran.\n" );
662 <        painCave.isFatal = 1;
663 <        painCave.severity = OOPSE_ERROR;
664 <        simError();
665 <    }
666 <
667 < #ifdef IS_MPI
668 <    sprintf( checkPointMsg,
669 <       "succesfully sent the simulation information to fortran.\n");
670 <    MPIcheckPoint();
671 < #endif // is_mpi
672 < }
673 <
674 <
675 < #ifdef IS_MPI
676 < void SimInfo::setupFortranParallel() {
677 <    
678 <    //SimInfo is responsible for creating localToGlobalAtomIndex and localToGlobalGroupIndex
679 <    std::vector<int> localToGlobalAtomIndex(getNAtoms(), 0);
680 <    std::vector<int> localToGlobalCutoffGroupIndex;
681 <    SimInfo::MoleculeIterator mi;
682 <    Molecule::AtomIterator ai;
683 <    Molecule::CutoffGroupIterator ci;
684 <    Molecule* mol;
685 <    Atom* atom;
686 <    CutoffGroup* cg;
687 <    mpiSimData parallelData;
688 <    int isError;
689 <
690 <    for (mol = beginMolecule(mi); mol != NULL; mol  = nextMolecule(mi)) {
691 <
692 <        //local index(index in DataStorge) of atom is important
693 <        for (atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) {
694 <            localToGlobalAtomIndex[atom->getLocalIndex()] = atom->getGlobalIndex() + 1;
695 <        }
696 <
697 <        //local index of cutoff group is trivial, it only depends on the order of travesing
698 <        for (cg = mol->beginCutoffGroup(ci); cg != NULL; cg = mol->nextCutoffGroup(ci)) {
699 <            localToGlobalCutoffGroupIndex.push_back(cg->getGlobalIndex() + 1);
700 <        }        
701 <        
702 <    }
703 <
704 <    //fill up mpiSimData struct
705 <    parallelData.nMolGlobal = getNGlobalMolecules();
706 <    parallelData.nMolLocal = getNMolecules();
707 <    parallelData.nAtomsGlobal = getNGlobalAtoms();
708 <    parallelData.nAtomsLocal = getNAtoms();
709 <    parallelData.nGroupsGlobal = getNGlobalCutoffGroups();
710 <    parallelData.nGroupsLocal = getNCutoffGroups();
711 <    parallelData.myNode = worldRank;
712 <    MPI_Comm_size(MPI_COMM_WORLD, &(parallelData.nProcessors));
713 <
714 <    //pass mpiSimData struct and index arrays to fortran
715 <    setFsimParallel(&parallelData, &(parallelData.nAtomsLocal),
716 <                    &localToGlobalAtomIndex[0],  &(parallelData.nGroupsLocal),
717 <                    &localToGlobalCutoffGroupIndex[0], &isError);
718 <
719 <    if (isError) {
720 <        sprintf(painCave.errMsg,
721 <                "mpiRefresh errror: fortran didn't like something we gave it.\n");
722 <        painCave.isFatal = 1;
723 <        simError();
724 <    }
725 <
726 <    sprintf(checkPointMsg, " mpiRefresh successful.\n");
727 <    MPIcheckPoint();
728 <
729 <
730 < }
731 <
732 < #endif
733 <
734 < double SimInfo::calcMaxCutoffRadius() {
735 <
736 <
737 <    std::set<AtomType*> atomTypes;
738 <    std::set<AtomType*>::iterator i;
739 <    std::vector<double> cutoffRadius;
740 <
741 <    //get the unique atom types
742 <    atomTypes = getUniqueAtomTypes();
743 <
744 <    //query the max cutoff radius among these atom types
745 <    for (i = atomTypes.begin(); i != atomTypes.end(); ++i) {
746 <        cutoffRadius.push_back(forceField_->getRcutFromAtomType(*i));
747 <    }
748 <
749 <    double maxCutoffRadius = *(std::max_element(cutoffRadius.begin(), cutoffRadius.end()));
750 < #ifdef IS_MPI
751 <    //pick the max cutoff radius among the processors
752 < #endif
753 <
754 <    return maxCutoffRadius;
755 < }
756 <
757 < void SimInfo::getCutoff(double& rcut, double& rsw) {
758 <    
759 <    if (fInfo_.SIM_uses_Charges | fInfo_.SIM_uses_Dipoles | fInfo_.SIM_uses_RF) {
760 <        
761 <        if (!simParams_->haveRcut()){
762 <            sprintf(painCave.errMsg,
763 <                "SimCreator Warning: No value was set for the cutoffRadius.\n"
764 <                "\tOOPSE will use a default value of 15.0 angstroms"
765 <                "\tfor the cutoffRadius.\n");
766 <            painCave.isFatal = 0;
767 <            simError();
768 <            rcut = 15.0;
769 <        } else{
770 <            rcut = simParams_->getRcut();
771 <        }
772 <
773 <        if (!simParams_->haveRsw()){
774 <            sprintf(painCave.errMsg,
775 <                "SimCreator Warning: No value was set for switchingRadius.\n"
776 <                "\tOOPSE will use a default value of\n"
777 <                "\t0.95 * cutoffRadius for the switchingRadius\n");
778 <            painCave.isFatal = 0;
779 <            simError();
780 <            rsw = 0.95 * rcut;
781 <        } else{
782 <            rsw = simParams_->getRsw();
783 <        }
784 <
785 <    } else {
786 <        // if charge, dipole or reaction field is not used and the cutofff radius is not specified in
787 <        //meta-data file, the maximum cutoff radius calculated from forcefiled will be used
788 <        
789 <        if (simParams_->haveRcut()) {
790 <            rcut = simParams_->getRcut();
791 <        } else {
792 <            //set cutoff radius to the maximum cutoff radius based on atom types in the whole system
793 <            rcut = calcMaxCutoffRadius();
794 <        }
795 <
796 <        if (simParams_->haveRsw()) {
797 <            rsw  = simParams_->getRsw();
798 <        } else {
799 <            rsw = rcut;
800 <        }
801 <    
802 <    }
803 < }
804 <
805 < void SimInfo::setupCutoff() {
806 <    getCutoff(rcut_, rsw_);    
807 <    double rnblist = rcut_ + 1; // skin of neighbor list
808 <
809 <    //Pass these cutoff radius etc. to fortran. This function should be called once and only once
810 <    notifyFortranCutoffs(&rcut_, &rsw_, &rnblist);
811 < }
812 <
813 < void SimInfo::addProperty(GenericData* genData) {
947 >  void SimInfo::addProperty(GenericData* genData) {
948      properties_.addProperty(genData);  
949 < }
949 >  }
950  
951 < void SimInfo::removeProperty(const std::string& propName) {
951 >  void SimInfo::removeProperty(const string& propName) {
952      properties_.removeProperty(propName);  
953 < }
953 >  }
954  
955 < void SimInfo::clearProperties() {
955 >  void SimInfo::clearProperties() {
956      properties_.clearProperties();
957 < }
957 >  }
958  
959 < std::vector<std::string> SimInfo::getPropertyNames() {
959 >  vector<string> SimInfo::getPropertyNames() {
960      return properties_.getPropertyNames();  
961 < }
961 >  }
962        
963 < std::vector<GenericData*> SimInfo::getProperties() {
963 >  vector<GenericData*> SimInfo::getProperties() {
964      return properties_.getProperties();
965 < }
965 >  }
966  
967 < GenericData* SimInfo::getPropertyByName(const std::string& propName) {
967 >  GenericData* SimInfo::getPropertyByName(const string& propName) {
968      return properties_.getPropertyByName(propName);
969 < }
969 >  }
970  
971 < void SimInfo::setSnapshotManager(SnapshotManager* sman) {
972 <    //if (sman_ == sman_) {
973 <    //    return;
974 <    //}
975 <    
842 <    //delete sman_;
971 >  void SimInfo::setSnapshotManager(SnapshotManager* sman) {
972 >    if (sman_ == sman) {
973 >      return;
974 >    }    
975 >    delete sman_;
976      sman_ = sman;
977  
978      Molecule* mol;
979      RigidBody* rb;
980      Atom* atom;
981 +    CutoffGroup* cg;
982      SimInfo::MoleculeIterator mi;
983      Molecule::RigidBodyIterator rbIter;
984 <    Molecule::AtomIterator atomIter;;
984 >    Molecule::AtomIterator atomIter;
985 >    Molecule::CutoffGroupIterator cgIter;
986  
987      for (mol = beginMolecule(mi); mol != NULL; mol = nextMolecule(mi)) {
988          
989 <        for (atom = mol->beginAtom(atomIter); atom != NULL; atom = mol->nextAtom(atomIter)) {
990 <            atom->setSnapshotManager(sman_);
991 <        }
989 >      for (atom = mol->beginAtom(atomIter); atom != NULL;
990 >           atom = mol->nextAtom(atomIter)) {
991 >        atom->setSnapshotManager(sman_);
992 >      }
993          
994 <        for (rb = mol->beginRigidBody(rbIter); rb != NULL; rb = mol->nextRigidBody(rbIter)) {
995 <            rb->setSnapshotManager(sman_);
996 <        }
994 >      for (rb = mol->beginRigidBody(rbIter); rb != NULL;
995 >           rb = mol->nextRigidBody(rbIter)) {
996 >        rb->setSnapshotManager(sman_);
997 >      }
998 >
999 >      for (cg = mol->beginCutoffGroup(cgIter); cg != NULL;
1000 >           cg = mol->nextCutoffGroup(cgIter)) {
1001 >        cg->setSnapshotManager(sman_);
1002 >      }
1003      }    
1004      
1005 < }
1005 >  }
1006  
865 Vector3d SimInfo::getComVel(){
866    SimInfo::MoleculeIterator i;
867    Molecule* mol;
1007  
1008 <    Vector3d comVel(0.0);
870 <    double totalMass = 0.0;
871 <    
872 <
873 <    for (mol = beginMolecule(i); mol != NULL; mol = nextMolecule(i)) {
874 <        double mass = mol->getMass();
875 <        totalMass += mass;
876 <        comVel += mass * mol->getComVel();
877 <    }  
1008 >  ostream& operator <<(ostream& o, SimInfo& info) {
1009  
1010 < #ifdef IS_MPI
1011 <    double tmpMass = totalMass;
1012 <    Vector3d tmpComVel(comVel);    
1013 <    MPI_Allreduce(&tmpMass,&totalMass,1,MPI_DOUBLE,MPI_SUM, MPI_COMM_WORLD);
1014 <    MPI_Allreduce(tmpComVel.getArrayPointer(), comVel.getArrayPointer(),3,MPI_DOUBLE,MPI_SUM, MPI_COMM_WORLD);
1015 < #endif
1010 >    return o;
1011 >  }
1012 >  
1013 >  
1014 >  StuntDouble* SimInfo::getIOIndexToIntegrableObject(int index) {
1015 >    if (index >= int(IOIndexToIntegrableObject.size())) {
1016 >      sprintf(painCave.errMsg,
1017 >              "SimInfo::getIOIndexToIntegrableObject Error: Integrable Object\n"
1018 >              "\tindex exceeds number of known objects!\n");
1019 >      painCave.isFatal = 1;
1020 >      simError();
1021 >      return NULL;
1022 >    } else
1023 >      return IOIndexToIntegrableObject.at(index);
1024 >  }
1025 >  
1026 >  void SimInfo::setIOIndexToIntegrableObject(const vector<StuntDouble*>& v) {
1027 >    IOIndexToIntegrableObject= v;
1028 >  }
1029  
1030 <    comVel /= totalMass;
1031 <
888 <    return comVel;
889 < }
890 <
891 < Vector3d SimInfo::getCom(){
892 <    SimInfo::MoleculeIterator i;
893 <    Molecule* mol;
894 <
895 <    Vector3d com(0.0);
896 <    double totalMass = 0.0;
897 <    
898 <    for (mol = beginMolecule(i); mol != NULL; mol = nextMolecule(i)) {
899 <        double mass = mol->getMass();
900 <        totalMass += mass;
901 <        com += mass * mol->getCom();
902 <    }  
903 <
1030 >  int SimInfo::getNGlobalConstraints() {
1031 >    int nGlobalConstraints;
1032   #ifdef IS_MPI
1033 <    double tmpMass = totalMass;
1034 <    Vector3d tmpCom(com);    
1035 <    MPI_Allreduce(&tmpMass,&totalMass,1,MPI_DOUBLE,MPI_SUM, MPI_COMM_WORLD);
1036 <    MPI_Allreduce(tmpCom.getArrayPointer(), com.getArrayPointer(),3,MPI_DOUBLE,MPI_SUM, MPI_COMM_WORLD);
1033 >    MPI::COMM_WORLD.Allreduce(&nConstraints_, &nGlobalConstraints, 1,
1034 >                              MPI::INT, MPI::SUM);
1035 > #else
1036 >    nGlobalConstraints =  nConstraints_;
1037   #endif
1038 +    return nGlobalConstraints;
1039 +  }
1040  
1041 <    com /= totalMass;
1041 > }//end namespace OpenMD
1042  
913    return com;
914
915 }        
916
917 std::ostream& operator <<(std::ostream& o, SimInfo& info) {
918
919    return o;
920 }
921
922 }//end namespace oopse
923

Comparing:
trunk/src/brains/SimInfo.cpp (property svn:keywords), Revision 334 by tim, Mon Feb 14 17:57:01 2005 UTC vs.
branches/development/src/brains/SimInfo.cpp (property svn:keywords), Revision 1874 by gezelter, Wed May 15 15:09:35 2013 UTC

# Line 0 | Line 1
1 + Author Id Revision Date

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines