ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/applications/nanoparticleBuilder/nanoparticleBuilder.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/applications/nanoparticleBuilder/nanoparticleBuilder.cpp (file contents):
Revision 2678 by chuckv, Wed Mar 29 19:17:20 2006 UTC vs.
Revision 2679 by chuckv, Thu Mar 30 19:37:48 2006 UTC

# Line 171 | Line 171 | int main(int argc, char *argv []) {
171    if (!args_info.ShellRadius_given){
172      std::cout << "Creating a random nanoparticle" << std::endl;
173      /* Check to see if we have enough components */
174 <    if (nComponents != args_info.molFraction_given + 1){
174 >    if (nComponents != args_info.molFraction_given && nComponents != 1){
175        std::cerr << "Number of components does not equal molFraction occurances." << std::endl;
176        exit(1);
177      }
178      /* Build the mole fractions and number of molecules of each type */  
179      int totComponents = 0;
180 <    for (int i = 0;i<nComponents-2;i++){ /* Figure out Percent for each component */
180 >    for (int i = 0;i<nComponents-1;i++){ /* Figure out Percent for each component */
181        numMol[i] = int((double)numSites * args_info.molFraction_arg[i]);
182 +      std::cout<<numMol[i]<<std::endl;
183        totComponents += numMol[i];
184      }
185      numMol[nComponents-1] = numSites - totComponents;
186 +  
187          /* do the iPod thing, Shuffle da vector */
188          std::random_shuffle(nanoParticleSites.begin(), nanoParticleSites.end());
189    } else{ /*Handle core-shell with multiple components.*/
# Line 217 | Line 219 | std::cout<<latticeOrt.size()<< std::endl;
219    // We need to read in new siminfo object.    
220    //parse md file and set up the system
221    //SimCreator NewCreator;
222 +   SimCreator newCreator;
223 +  SimInfo* NewInfo = newCreator.createSim(outMdFileName, false);
224    
221  SimInfo* NewInfo = oldCreator.createSim(outMdFileName, false);
225    
223  
226    // Place molecules
227    Molecule* mol;
228    SimInfo::MoleculeIterator mi;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines