--- trunk/src/applications/nanoparticleBuilder/nanoparticleBuilder.cpp 2013/06/16 15:15:42 1879 +++ trunk/src/applications/nanoparticleBuilder/nanoparticleBuilder.cpp 2015/03/07 21:41:51 2071 @@ -120,7 +120,7 @@ int main(int argc, char *argv []) { vector orientations = nanoParticle.getOrientations(); - std::vector vacancyTargets; + std::vector vacancyTargets; vector isVacancy; Vector3d myLoc; @@ -131,7 +131,8 @@ int main(int argc, char *argv []) { if (args_info.vacancyPercent_given) { if (args_info.vacancyPercent_arg < 0.0 || args_info.vacancyPercent_arg > 100.0) { - sprintf(painCave.errMsg, "vacancyPercent was set to a non-sensical value."); + sprintf(painCave.errMsg, + "vacancyPercent was set to a non-sensical value."); painCave.isFatal = 1; simError(); } else { @@ -150,7 +151,7 @@ int main(int argc, char *argv []) { } if (vIR >= 0.0 && vOR <= particleRadius && vOR >= vIR) { - for (unsigned int i = 0; i < sites.size(); i++) { + for (std::size_t i = 0; i < sites.size(); i++) { myLoc = sites[i]; myR = myLoc.length(); if (myR >= vIR && myR <= vOR) { @@ -167,12 +168,13 @@ int main(int argc, char *argv []) { "\tsites between %lf and %lf.", (int) vacancyTargets.size(), vIR, vOR); painCave.isFatal = 0; + painCave.severity = OPENMD_INFO; simError(); isVacancy.clear(); - for (unsigned int i = 0; i < sites.size(); i++) { + for (std::size_t i = 0; i < sites.size(); i++) { bool vac = false; - for (unsigned int j = 0; j < vacancyTargets.size(); j++) { + for (std::size_t j = 0; j < vacancyTargets.size(); j++) { if (i == vacancyTargets[j]) vac = true; } isVacancy.push_back(vac); @@ -188,7 +190,7 @@ int main(int argc, char *argv []) { } /* Get number of lattice sites */ - int nSites = sites.size() - vacancyTargets.size(); + std::size_t nSites = sites.size() - vacancyTargets.size(); std::vector components = simParams->getComponents(); std::vector molFractions; @@ -269,7 +271,8 @@ int main(int argc, char *argv []) { totalFraction += molFractions.at(i); } if (abs(totalFraction - 1.0) > 1e-6) { - sprintf(painCave.errMsg, "The sum of molFractions was not close enough to 1.0"); + sprintf(painCave.errMsg, + "The sum of molFractions was not close enough to 1.0"); painCave.isFatal = 1; simError(); } @@ -283,14 +286,15 @@ int main(int argc, char *argv []) { // recompute actual mol fractions and perform final sanity check: - int totalMolecules = 0; + std::size_t totalMolecules = 0; for (int i=0; i < nComponents; i++) { molFractions[i] = (RealType)(nMol.at(i))/(RealType)nSites; totalMolecules += nMol.at(i); } if (totalMolecules != nSites) { - sprintf(painCave.errMsg, "Computed total number of molecules is not equal " + sprintf(painCave.errMsg, + "Computed total number of molecules is not equal " "to the number of lattice sites!"); painCave.isFatal = 1; simError(); @@ -299,12 +303,14 @@ int main(int argc, char *argv []) { for (unsigned int i = 0; i < shellRadii.size(); i++) { if (shellRadii.at(i) > particleRadius + 1e-6 ) { - sprintf(painCave.errMsg, "One of the shellRadius values exceeds the particle Radius."); + sprintf(painCave.errMsg, + "One of the shellRadius values exceeds the particle Radius."); painCave.isFatal = 1; simError(); } if (shellRadii.at(i) <= 0.0 ) { - sprintf(painCave.errMsg, "One of the shellRadius values is smaller than zero!"); + sprintf(painCave.errMsg, + "One of the shellRadius values is smaller than zero!"); painCave.isFatal = 1; simError(); } @@ -315,6 +321,7 @@ int main(int argc, char *argv []) { if ((int)args_info.molFraction_given){ sprintf(painCave.errMsg, "Creating a randomized spherical nanoparticle."); painCave.isFatal = 0; + painCave.severity = OPENMD_INFO; simError(); /* Random particle is the default case*/ @@ -326,6 +333,7 @@ int main(int argc, char *argv []) { } else{ sprintf(painCave.errMsg, "Creating a core-shell spherical nanoparticle."); painCave.isFatal = 0; + painCave.severity = OPENMD_INFO; simError(); RealType smallestSoFar; @@ -428,6 +436,7 @@ int main(int argc, char *argv []) { sprintf(painCave.errMsg, "A new OpenMD file called \"%s\" has been " "generated.\n", outputFileName.c_str()); painCave.isFatal = 0; + painCave.severity = OPENMD_INFO; simError(); return 0; }