diff --git a/src/CLASS2/dihedral_class2.cpp b/src/CLASS2/dihedral_class2.cpp index 36e826a339..7b03fbbec1 100644 --- a/src/CLASS2/dihedral_class2.cpp +++ b/src/CLASS2/dihedral_class2.cpp @@ -212,7 +212,7 @@ void DihedralClass2::compute(int eflag, int vflag) sprintf(str,"Dihedral problem: %d %d %d %d %d %d", me,update->ntimestep, atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); - error->warning(str); + error->warning(str,0); fprintf(screen," 1st atom: %d %g %g %g\n", me,x[i1][0],x[i1][1],x[i1][2]); fprintf(screen," 2nd atom: %d %g %g %g\n", diff --git a/src/CLASS2/improper_class2.cpp b/src/CLASS2/improper_class2.cpp index 1f02b25500..37f7f9aeaf 100644 --- a/src/CLASS2/improper_class2.cpp +++ b/src/CLASS2/improper_class2.cpp @@ -159,7 +159,7 @@ void ImproperClass2::compute(int eflag, int vflag) sprintf(str,"Improper problem: %d %d %d %d %d %d", me,update->ntimestep, atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); - error->warning(str); + error->warning(str,0); fprintf(screen," 1st atom: %d %g %g %g\n", me,x[i1][0],x[i1][1],x[i1][2]); fprintf(screen," 2nd atom: %d %g %g %g\n", diff --git a/src/DSMC/pair_dsmc.cpp b/src/DSMC/pair_dsmc.cpp index 6e8e8a44bc..090f2af796 100644 --- a/src/DSMC/pair_dsmc.cpp +++ b/src/DSMC/pair_dsmc.cpp @@ -158,9 +158,9 @@ void PairDSMC::compute(int eflag, int vflag) convert_double_to_equivalent_int(num_of_collisions_double); if (num_of_collisions > number_of_A) - error->warning("Pair dsmc: num_of_collisions > number_of_A"); + error->warning("Pair dsmc: num_of_collisions > number_of_A",0); if (num_of_collisions > number_of_B) - error->warning("Pair dsmc: num_of_collisions > number_of_B"); + error->warning("Pair dsmc: num_of_collisions > number_of_B",0); // perform collisions on pairs of particles in icell diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index 69d9e72233..8b00fde01b 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -416,7 +416,7 @@ void FixPour::pre_exchange() ninserted += nnear-nprevious; if (nnear - nprevious < nnew && me == 0) - error->warning("Less insertions than requested"); + error->warning("Less insertions than requested",0); // check if new atom is in my sub-box or above it if I'm highest proc // if so, add to my list via create_atom() diff --git a/src/MANYBODY/pair_comb.cpp b/src/MANYBODY/pair_comb.cpp index 83eebfae7e..96f8159aa7 100644 --- a/src/MANYBODY/pair_comb.cpp +++ b/src/MANYBODY/pair_comb.cpp @@ -1781,14 +1781,14 @@ double PairComb::qfo_self(Param *param, double qi, double selfpot) char str[128]; sprintf(str,"Pair COMB charge %.10f with force %.10f hit min barrier", qi,self_d); - error->warning(str); + error->warning(str,0); self_d += 4.0 * cmin * pow((qi-qmin),3); } if (qi > qmax) { char str[128]; sprintf(str,"Pair COMB charge %.10f with force %.10f hit max barrier", qi,self_d); - error->warning(str); + error->warning(str,0); self_d += 4.0 * cmax * pow((qi-qmax),3); } */ diff --git a/src/MOLECULE/bond_fene.cpp b/src/MOLECULE/bond_fene.cpp index baa147a234..babb22689b 100644 --- a/src/MOLECULE/bond_fene.cpp +++ b/src/MOLECULE/bond_fene.cpp @@ -88,7 +88,7 @@ void BondFENE::compute(int eflag, int vflag) char str[128]; sprintf(str,"FENE bond too long: %d %d %d %g", update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq)); - error->warning(str); + error->warning(str,0); if (rlogarg <= -3.0) error->one("Bad FENE bond"); rlogarg = 0.1; } @@ -244,7 +244,7 @@ double BondFENE::single(int type, double rsq, int i, int j) if (rlogarg < 0.1) { char str[128]; sprintf(str,"FENE bond too long: %d %g",update->ntimestep,sqrt(rsq)); - error->warning(str); + error->warning(str,0); if (rlogarg <= -3.0) error->one("Bad FENE bond"); rlogarg = 0.1; } diff --git a/src/MOLECULE/bond_fene_expand.cpp b/src/MOLECULE/bond_fene_expand.cpp index 44a9aba998..9607861569 100644 --- a/src/MOLECULE/bond_fene_expand.cpp +++ b/src/MOLECULE/bond_fene_expand.cpp @@ -93,7 +93,7 @@ void BondFENEExpand::compute(int eflag, int vflag) char str[128]; sprintf(str,"FENE bond too long: %d %d %d %g", update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq)); - error->warning(str); + error->warning(str,0); if (rlogarg <= -3.0) error->one("Bad FENE bond"); rlogarg = 0.1; } @@ -258,7 +258,7 @@ double BondFENEExpand::single(int type, double rsq, int i, int j) if (rlogarg < 0.1) { char str[128]; sprintf(str,"FENE bond too long: %d %g",update->ntimestep,sqrt(rsq)); - error->warning(str); + error->warning(str,0); if (rlogarg <= -3.0) error->one("Bad FENE bond"); rlogarg = 0.1; } diff --git a/src/MOLECULE/dihedral_charmm.cpp b/src/MOLECULE/dihedral_charmm.cpp index 183ee4f1d4..a92d261bc8 100644 --- a/src/MOLECULE/dihedral_charmm.cpp +++ b/src/MOLECULE/dihedral_charmm.cpp @@ -150,7 +150,7 @@ void DihedralCharmm::compute(int eflag, int vflag) sprintf(str,"Dihedral problem: %d %d %d %d %d %d", me,update->ntimestep, atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); - error->warning(str); + error->warning(str,0); fprintf(screen," 1st atom: %d %g %g %g\n", me,x[i1][0],x[i1][1],x[i1][2]); fprintf(screen," 2nd atom: %d %g %g %g\n", diff --git a/src/MOLECULE/dihedral_harmonic.cpp b/src/MOLECULE/dihedral_harmonic.cpp index 67a7e50e30..17f7dbf9cb 100644 --- a/src/MOLECULE/dihedral_harmonic.cpp +++ b/src/MOLECULE/dihedral_harmonic.cpp @@ -140,7 +140,7 @@ void DihedralHarmonic::compute(int eflag, int vflag) sprintf(str,"Dihedral problem: %d %d %d %d %d %d", me,update->ntimestep, atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); - error->warning(str); + error->warning(str,0); fprintf(screen," 1st atom: %d %g %g %g\n", me,x[i1][0],x[i1][1],x[i1][2]); fprintf(screen," 2nd atom: %d %g %g %g\n", diff --git a/src/MOLECULE/dihedral_helix.cpp b/src/MOLECULE/dihedral_helix.cpp index b45e956f67..ce12bcca16 100644 --- a/src/MOLECULE/dihedral_helix.cpp +++ b/src/MOLECULE/dihedral_helix.cpp @@ -172,7 +172,7 @@ void DihedralHelix::compute(int eflag, int vflag) sprintf(str,"Dihedral problem: %d %d %d %d %d %d", me,update->ntimestep, atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); - error->warning(str); + error->warning(str,0); fprintf(screen," 1st atom: %d %g %g %g\n", me,x[i1][0],x[i1][1],x[i1][2]); fprintf(screen," 2nd atom: %d %g %g %g\n", diff --git a/src/MOLECULE/dihedral_multi_harmonic.cpp b/src/MOLECULE/dihedral_multi_harmonic.cpp index 470bebc9cc..4eb323ba85 100644 --- a/src/MOLECULE/dihedral_multi_harmonic.cpp +++ b/src/MOLECULE/dihedral_multi_harmonic.cpp @@ -163,7 +163,7 @@ void DihedralMultiHarmonic::compute(int eflag, int vflag) sprintf(str,"Dihedral problem: %d %d %d %d %d %d", comm->me,update->ntimestep, atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); - error->warning(str); + error->warning(str,0); fprintf(screen," 1st atom: %d %g %g %g\n", comm->me,x[i1][0],x[i1][1],x[i1][2]); fprintf(screen," 2nd atom: %d %g %g %g\n", diff --git a/src/MOLECULE/dihedral_opls.cpp b/src/MOLECULE/dihedral_opls.cpp index 68c23dcf47..e4d0e5327b 100644 --- a/src/MOLECULE/dihedral_opls.cpp +++ b/src/MOLECULE/dihedral_opls.cpp @@ -169,7 +169,7 @@ void DihedralOPLS::compute(int eflag, int vflag) sprintf(str,"Dihedral problem: %d %d %d %d %d %d", comm->me,update->ntimestep, atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); - error->warning(str); + error->warning(str,0); fprintf(screen," 1st atom: %d %g %g %g\n", comm->me,x[i1][0],x[i1][1],x[i1][2]); fprintf(screen," 2nd atom: %d %g %g %g\n", diff --git a/src/MOLECULE/improper_cvff.cpp b/src/MOLECULE/improper_cvff.cpp index 09d16071d9..6cbf7e8876 100644 --- a/src/MOLECULE/improper_cvff.cpp +++ b/src/MOLECULE/improper_cvff.cpp @@ -154,7 +154,7 @@ void ImproperCvff::compute(int eflag, int vflag) sprintf(str,"Improper problem: %d %d %d %d %d %d", me,update->ntimestep, atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); - error->warning(str); + error->warning(str,0); fprintf(screen," 1st atom: %d %g %g %g\n", me,x[i1][0],x[i1][1],x[i1][2]); fprintf(screen," 2nd atom: %d %g %g %g\n", diff --git a/src/MOLECULE/improper_harmonic.cpp b/src/MOLECULE/improper_harmonic.cpp index b7eb2b9190..008b73e8d1 100644 --- a/src/MOLECULE/improper_harmonic.cpp +++ b/src/MOLECULE/improper_harmonic.cpp @@ -125,7 +125,7 @@ void ImproperHarmonic::compute(int eflag, int vflag) sprintf(str,"Improper problem: %d %d %d %d %d %d", me,update->ntimestep, atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]); - error->warning(str); + error->warning(str,0); fprintf(screen," 1st atom: %d %g %g %g\n", me,x[i1][0],x[i1][1],x[i1][2]); fprintf(screen," 2nd atom: %d %g %g %g\n", diff --git a/src/compute_cna_atom.cpp b/src/compute_cna_atom.cpp index 06a51b5844..4416671d5c 100644 --- a/src/compute_cna_atom.cpp +++ b/src/compute_cna_atom.cpp @@ -191,7 +191,7 @@ void ComputeCNAAtom::compute_peratom() if (nerrorall && comm->me == 0) { char str[128]; sprintf(str,"Too many neighbors in CNA for %d atoms",nerrorall); - error->warning(str); + error->warning(str,0); } // compute CNA for each atom in group diff --git a/src/error.cpp b/src/error.cpp index b63b8a895e..c2226c1ab7 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -106,7 +106,8 @@ void Error::one(const char *str) only write to screen if non-NULL on this proc since could be file ------------------------------------------------------------------------- */ -void Error::warning(const char *str) +void Error::warning(const char *str, int logflag) { if (screen) fprintf(screen,"WARNING: %s\n",str); + if (logflag && logfile) fprintf(logfile,"WARNING: %s\n",str); } diff --git a/src/error.h b/src/error.h index 6b279cbf9a..b578d4ba50 100644 --- a/src/error.h +++ b/src/error.h @@ -27,7 +27,7 @@ class Error : protected Pointers { void all(const char *); void one(const char *); - void warning(const char *); + void warning(const char *, int = 1); }; } diff --git a/src/fix_deposit.cpp b/src/fix_deposit.cpp index 4e02e59d1c..60fc34ed65 100644 --- a/src/fix_deposit.cpp +++ b/src/fix_deposit.cpp @@ -324,7 +324,7 @@ void FixDeposit::pre_exchange() if (comm->me == 0) if (success == 0) - error->warning("Particle deposition was unsuccessful"); + error->warning("Particle deposition was unsuccessful",0); // set tag # of new particle beyond all previous atoms // reset global natoms diff --git a/src/fix_ttm.cpp b/src/fix_ttm.cpp index 0d5bb506fe..0cc1a191f5 100644 --- a/src/fix_ttm.cpp +++ b/src/fix_ttm.cpp @@ -431,7 +431,7 @@ void FixTTM::end_of_step() num_inner_timesteps = static_cast(update->dt/inner_dt) + 1; inner_dt = update->dt/double(num_inner_timesteps); if (num_inner_timesteps > 1000000) - error->warning("Too many inner timesteps in fix ttm"); + error->warning("Too many inner timesteps in fix ttm",0); } for (int ith_inner_timestep = 0; ith_inner_timestep < num_inner_timesteps; diff --git a/src/thermo.cpp b/src/thermo.cpp index aa7ab7eeb6..e31fd8a8e2 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -359,7 +359,7 @@ double Thermo::lost_check() char str[128]; sprintf(str,"Lost atoms: original %.15g current %.15g",atom->natoms,ntotal); - if (me == 0) error->warning(str); + if (me == 0) error->warning(str,0); lostbefore = 1; return ntotal; }