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

Comparing branches/development/src/applications/randomBuilder/randomBuilder.cpp (file contents):
Revision 1465 by chuckv, Fri Jul 9 23:08:25 2010 UTC vs.
Revision 1850 by gezelter, Wed Feb 20 15:39:39 2013 UTC

# Line 34 | Line 34
34   *                                                                      
35   * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
36   * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
37 < * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
38 < * [4]  Vardeman & Gezelter, in progress (2009).                        
37 > * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).          
38 > * [4] Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
39 > * [4] , Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). *
40   *
40 *
41   *  randomBuilder.cpp
42   *
43   *  Created by Charles F. Vardeman II on 10 Apr 2006.
# Line 77 | Line 77 | int main(int argc, char *argv []) {
77  
78   int main(int argc, char *argv []) {
79  
80  // register force fields
81  registerForceFields();
80    registerLattice();
81      
82    gengetopt_args_info args_info;
# Line 233 | Line 231 | int main(int argc, char *argv []) {
231    for (int i=0; i < nComponents; i++) {
232      molFractions[i] = (RealType)(nMol.at(i))/(RealType)nSites;
233      totalMolecules += nMol.at(i);
234 <    molecularMasses.push_back(getMolMass(oldInfo->getMoleculeStamp(i),
235 <                                         oldInfo->getForceField()));
234 >    molecularMasses.push_back(MoLocator::getMolMass(oldInfo->getMoleculeStamp(i),
235 >                                                    oldInfo->getForceField()));
236      totalMass += (RealType)(nMol.at(i)) * molecularMasses.at(i);
237    }
238    RealType avgMass = totalMass / (RealType) totalMolecules;
# Line 317 | Line 315 | int main(int argc, char *argv []) {
315    // Randomize a vector of ints:
316  
317    vector<int> ids;
318 <  for (int i = 0; i < sites.size(); i++) ids.push_back(i);
318 >  for (unsigned int i = 0; i < sites.size(); i++) ids.push_back(i);
319    std::random_shuffle(ids.begin(), ids.end());
320  
321    Molecule* mol;
# Line 370 | Line 368 | void createMdFile(const std::string&oldMdFileName,
368    
369    oldMdFile.getline(buffer, MAXLEN);
370  
371 <  int i = 0;
371 >  unsigned int i = 0;
372    while (!oldMdFile.eof()) {
373      
374      //correct molecule number
375      if (strstr(buffer, "nMol") != NULL) {
376 <      if(i<nMol.size()){
376 >      if (i<nMol.size()){
377          sprintf(buffer, "\tnMol = %i;", nMol.at(i));
378          newMdFile << buffer << std::endl;
379          i++;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines