diff --git a/src/compute_temp_com.cpp b/src/compute_temp_com.cpp index 6bf71d6cb1..ef51d122d4 100644 --- a/src/compute_temp_com.cpp +++ b/src/compute_temp_com.cpp @@ -159,7 +159,7 @@ void ComputeTempCOM::compute_vector() remove velocity bias from atom I to leave thermal velocity ------------------------------------------------------------------------- */ -void ComputeTempCOM::remove_bias(int i, double *v) +void ComputeTempCOM::remove_bias(int, double *v) { v[0] -= vbias[0]; v[1] -= vbias[1]; @@ -189,7 +189,7 @@ void ComputeTempCOM::remove_bias_all() assume remove_bias() was previously called ------------------------------------------------------------------------- */ -void ComputeTempCOM::restore_bias(int i, double *v) +void ComputeTempCOM::restore_bias(int, double *v) { v[0] += vbias[0]; v[1] += vbias[1]; diff --git a/src/compute_temp_com.h b/src/compute_temp_com.h index 762f7988e7..f940ba22f5 100644 --- a/src/compute_temp_com.h +++ b/src/compute_temp_com.h @@ -1,4 +1,4 @@ -/* ---------------------------------------------------------------------- +/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov @@ -40,9 +40,9 @@ class ComputeTempCOM : public Compute { private: int fix_dof; double tfactor,masstotal; - double vbias[3]; // stored velocity bias for one atom void dof_compute(); + }; } diff --git a/src/compute_temp_deform.cpp b/src/compute_temp_deform.cpp index 48e3a488f4..611cbdd3be 100644 --- a/src/compute_temp_deform.cpp +++ b/src/compute_temp_deform.cpp @@ -83,7 +83,8 @@ void ComputeTempDeform::init() break; } if (i == modify->nfix && comm->me == 0) - error->warning(FLERR,"Using compute temp/deform with no fix deform defined"); + error->warning(FLERR, + "Using compute temp/deform with no fix deform defined"); } /* ---------------------------------------------------------------------- */ @@ -281,6 +282,6 @@ void ComputeTempDeform::restore_bias_all() double ComputeTempDeform::memory_usage() { - double bytes = maxbias * sizeof(double); + double bytes = 3*maxbias * sizeof(double); return bytes; } diff --git a/src/compute_temp_deform.h b/src/compute_temp_deform.h index c7afaa97de..3400ed6db4 100644 --- a/src/compute_temp_deform.h +++ b/src/compute_temp_deform.h @@ -1,4 +1,4 @@ -/* ---------------------------------------------------------------------- +/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov @@ -41,9 +41,6 @@ class ComputeTempDeform : public Compute { protected: int fix_dof; double tfactor; - double vbias[3]; // stored velocity bias for one atom - double **vbiasall; // stored velocity bias for all atoms - int maxbias; // size of vbiasall array virtual void dof_compute(); }; diff --git a/src/compute_temp_partial.cpp b/src/compute_temp_partial.cpp index 31a55671dd..dbc81bfe0d 100644 --- a/src/compute_temp_partial.cpp +++ b/src/compute_temp_partial.cpp @@ -262,6 +262,6 @@ void ComputeTempPartial::restore_bias_all() double ComputeTempPartial::memory_usage() { - double bytes = maxbias * sizeof(double); + double bytes = 3*maxbias * sizeof(double); return bytes; } diff --git a/src/compute_temp_profile.cpp b/src/compute_temp_profile.cpp index e5e2ba6240..6e0470020c 100644 --- a/src/compute_temp_profile.cpp +++ b/src/compute_temp_profile.cpp @@ -140,9 +140,6 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) : maxatom = 0; bin = NULL; - - maxbias = 0; - vbiasall = NULL; } /* ---------------------------------------------------------------------- */ @@ -152,7 +149,6 @@ ComputeTempProfile::~ComputeTempProfile() memory->destroy(vbin); memory->destroy(binave); memory->destroy(bin); - memory->destroy(vbiasall); if (outflag == TENSOR) delete [] vector; else { memory->destroy(tbin); @@ -348,18 +344,9 @@ void ComputeTempProfile::compute_array() void ComputeTempProfile::remove_bias(int i, double *v) { int ibin = bin[i]; - if (xflag) { - vbias[0] = binave[ibin][ivx]; - v[0] -= vbias[0]; - } - if (yflag) { - vbias[1] = binave[ibin][ivy]; - v[1] -= vbias[1]; - } - if (zflag) { - vbias[2] = binave[ibin][ivz]; - v[2] -= vbias[2]; - } + if (xflag) v[0] -= binave[ibin][ivx]; + if (yflag) v[1] -= binave[ibin][ivy]; + if (zflag) v[2] -= binave[ibin][ivz]; } /* ---------------------------------------------------------------------- @@ -372,28 +359,13 @@ void ComputeTempProfile::remove_bias_all() int *mask = atom->mask; int nlocal = atom->nlocal; - if (nlocal > maxbias) { - memory->destroy(vbiasall); - maxbias = atom->nmax; - memory->create(vbiasall,maxbias,3,"temp/profile:vbiasall"); - } - int ibin; for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) { ibin = bin[i]; - if (xflag) { - vbiasall[i][0] = binave[ibin][ivx]; - v[i][0] -= vbiasall[i][0]; - } - if (yflag) { - vbiasall[i][1] = binave[ibin][ivy]; - v[i][1] -= vbiasall[i][1]; - } - if (zflag) { - vbiasall[i][2] = binave[ibin][ivz]; - v[i][2] -= vbiasall[i][2]; - } + if (xflag) v[i][0] -= binave[ibin][ivx]; + if (yflag) v[i][1] -= binave[ibin][ivy]; + if (zflag) v[i][2] -= binave[ibin][ivz]; } } @@ -404,9 +376,10 @@ void ComputeTempProfile::remove_bias_all() void ComputeTempProfile::restore_bias(int i, double *v) { - if (xflag) v[0] += vbias[0]; - if (yflag) v[1] += vbias[1]; - if (zflag) v[2] += vbias[2]; + int ibin = bin[i]; + if (xflag) v[0] += binave[ibin][ivx]; + if (yflag) v[1] += binave[ibin][ivy]; + if (zflag) v[2] += binave[ibin][ivz]; } /* ---------------------------------------------------------------------- @@ -420,21 +393,14 @@ void ComputeTempProfile::restore_bias_all() int *mask = atom->mask; int nlocal = atom->nlocal; - if (xflag) { - for (int i = 0; i < nlocal; i++) - if (mask[i] & groupbit) - v[i][0] += vbiasall[i][0]; - } - if (yflag) { - for (int i = 0; i < nlocal; i++) - if (mask[i] & groupbit) - v[i][1] += vbiasall[i][1]; - } - if (zflag) { - for (int i = 0; i < nlocal; i++) - if (mask[i] & groupbit) - v[i][2] += vbiasall[i][2]; - } + int ibin; + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + ibin = bin[i]; + if (xflag) v[i][0] += binave[ibin][ivx]; + if (yflag) v[i][1] += binave[ibin][ivy]; + if (zflag) v[i][2] += binave[ibin][ivz]; + } } /* ---------------------------------------------------------------------- @@ -563,8 +529,7 @@ void ComputeTempProfile::bin_assign() double ComputeTempProfile::memory_usage() { - double bytes = maxbias * sizeof(double); - bytes += maxatom * sizeof(int); + double bytes = maxatom * sizeof(int); bytes += nbins*(ncount+1) * sizeof(double); return bytes; } diff --git a/src/compute_temp_ramp.cpp b/src/compute_temp_ramp.cpp index a28bcc8995..4bd073d642 100644 --- a/src/compute_temp_ramp.cpp +++ b/src/compute_temp_ramp.cpp @@ -294,6 +294,6 @@ void ComputeTempRamp::restore_bias_all() double ComputeTempRamp::memory_usage() { - double bytes = maxbias * sizeof(double); + double bytes = 3*maxbias * sizeof(double); return bytes; } diff --git a/src/compute_temp_region.cpp b/src/compute_temp_region.cpp index ba74fc0077..69f5f3909e 100644 --- a/src/compute_temp_region.cpp +++ b/src/compute_temp_region.cpp @@ -245,6 +245,6 @@ void ComputeTempRegion::restore_bias_all() double ComputeTempRegion::memory_usage() { - double bytes = maxbias * sizeof(double); + double bytes = 3*maxbias * sizeof(double); return bytes; } diff --git a/src/verlet.cpp b/src/verlet.cpp index 8e1bccc362..c94757731e 100644 --- a/src/verlet.cpp +++ b/src/verlet.cpp @@ -243,6 +243,7 @@ void Verlet::run(int n) comm->forward_comm(); timer->stamp(TIME_COMM); } else { + printf("RENEIGH %ld\n",ntimestep); if (n_pre_exchange) modify->pre_exchange(); if (triclinic) domain->x2lamda(atom->nlocal); domain->pbc();