From 0680636555a7ec8d3c789c3cde2730e6859f5d05 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 18 Sep 2013 14:05:57 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@10804 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/MANYBODY/pair_tersoff_mod.h | 1 + src/fix.cpp | 6 ++++++ src/fix_ave_correlate.cpp | 1 + src/fix_ave_spatial.cpp | 5 +++++ src/fix_ave_time.cpp | 5 +++++ src/pair_zbl.cpp | 4 ++-- 6 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/MANYBODY/pair_tersoff_mod.h b/src/MANYBODY/pair_tersoff_mod.h index 6c75742d53..466b7a1789 100644 --- a/src/MANYBODY/pair_tersoff_mod.h +++ b/src/MANYBODY/pair_tersoff_mod.h @@ -10,6 +10,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ + #ifdef PAIR_CLASS PairStyle(tersoff/mod,PairTersoffMOD) diff --git a/src/fix.cpp b/src/fix.cpp index 1fb1c43f77..fc9786d060 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -66,6 +66,12 @@ Fix::Fix(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) comm_forward = comm_reverse = comm_border = 0; restart_reset = 0; + // reasonable defaults + // however, each fix that uses these values should explicitly set them + + nevery = 1; + + maxvatom = 0; vatom = NULL; diff --git a/src/fix_ave_correlate.cpp b/src/fix_ave_correlate.cpp index f9c3cac235..b3b3e416fb 100644 --- a/src/fix_ave_correlate.cpp +++ b/src/fix_ave_correlate.cpp @@ -55,6 +55,7 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): nfreq = force->inumeric(FLERR,arg[5]); global_freq = nfreq; + // parse values until one isn't recognized which = new int[narg-6]; diff --git a/src/fix_ave_spatial.cpp b/src/fix_ave_spatial.cpp index e83115f029..e3e2b03e86 100644 --- a/src/fix_ave_spatial.cpp +++ b/src/fix_ave_spatial.cpp @@ -17,6 +17,7 @@ #include "stdlib.h" #include "string.h" +#include "unistd.h" #include "fix_ave_spatial.h" #include "atom.h" #include "update.h" @@ -824,6 +825,10 @@ void FixAveSpatial::end_of_step() } fflush(fp); + if (overwrite) { + long fileend = ftell(fp); + ftruncate(fileno(fp),fileend); + } } } diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp index ed6a47539e..eb6cb9e14c 100644 --- a/src/fix_ave_time.cpp +++ b/src/fix_ave_time.cpp @@ -17,6 +17,7 @@ #include "stdlib.h" #include "string.h" +#include "unistd.h" #include "fix_ave_time.h" #include "update.h" #include "modify.h" @@ -636,6 +637,10 @@ void FixAveTime::invoke_scalar(bigint ntimestep) for (i = 0; i < nvalues; i++) fprintf(fp," %g",vector_total[i]/norm); fprintf(fp,"\n"); fflush(fp); + if (overwrite) { + long fileend = ftell(fp); + ftruncate(fileno(fp),fileend); + } } } diff --git a/src/pair_zbl.cpp b/src/pair_zbl.cpp index a1f0f9a5ff..0adef4f40b 100644 --- a/src/pair_zbl.cpp +++ b/src/pair_zbl.cpp @@ -215,8 +215,8 @@ void PairZBL::coeff(int narg, char **arg) double z_one = force->numeric(FLERR,arg[2]); - // Set flag for each i-j pair - // Set z-parameter only for i-i pairs + // set flag for each i-j pair + // set z-parameter only for i-i pairs int count = 0; for (int i = ilo; i <= ihi; i++) {