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

Comparing branches/development/src/brains/MoleculeCreator.cpp (file contents):
Revision 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC vs.
Revision 1850 by gezelter, Wed Feb 20 15:39:39 2013 UTC

# Line 35 | Line 35
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, 24107 (2008).          
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   */
# Line 44 | Line 44
44   * @file MoleculeCreator.cpp
45   * @author tlin
46   * @date 11/04/2004
47 * @time 13:44am
47   * @version 1.0
48   */
49  
# Line 55 | Line 54
54   #include "brains/MoleculeCreator.hpp"
55   #include "primitives/GhostBend.hpp"
56   #include "primitives/GhostTorsion.hpp"
57 < #include "types/DirectionalAtomType.hpp"
57 > #include "types/AtomType.hpp"
58   #include "types/FixedBondType.hpp"
59   #include "utils/simError.h"
60   #include "utils/StringUtils.hpp"
# Line 67 | Line 66 | namespace OpenMD {
66                                              int stampId, int globalIndex,
67                                              LocalIndexManager* localIndexMan) {
68      Molecule* mol = new Molecule(stampId, globalIndex, molStamp->getName());
69 <    
69 >
70      //create atoms
71      Atom* atom;
72      AtomStamp* currentAtomStamp;
# Line 177 | Line 176 | namespace OpenMD {
176      createConstraintPair(mol);
177      createConstraintElem(mol);
178      
179 +    // Does this molecule stamp define a total constrained charge value?
180 +    // If so, let the created molecule know about it.
181 +
182 +    if (molStamp->haveConstrainTotalCharge() ) {
183 +      mol->setConstrainTotalCharge( molStamp->getConstrainTotalCharge() );
184 +    }
185 +
186      //the construction of this molecule is finished
187      mol->complete();
188      
# Line 199 | Line 205 | namespace OpenMD {
205        painCave.isFatal = 1;
206        simError();
207      }
208 <    
208 >
209      //below code still have some kind of hard-coding smell
210      if (atomType->isDirectional()){
205    
206      DirectionalAtomType* dAtomType = dynamic_cast<DirectionalAtomType*>(atomType);
207        
208      if (dAtomType == NULL) {
209        sprintf(painCave.errMsg, "Can not cast AtomType to DirectionalAtomType");
211  
212 <        painCave.isFatal = 1;
213 <        simError();
213 <      }
214 <
215 <      DirectionalAtom* dAtom;
216 <      dAtom = new DirectionalAtom(dAtomType);
212 >      DirectionalAtom* dAtom;
213 >      dAtom = new DirectionalAtom(atomType);
214        atom = dAtom;    
215      }
216      else{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines