From 6ec332feea4b59eca58c7dae05955acf53449d8e Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 22 Oct 2010 21:27:16 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5105 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/pair_soft.cpp | 41 +++++++++-------------------------------- src/pair_soft.h | 3 +-- src/respa.cpp | 3 ++- src/verlet.cpp | 7 +++++++ src/verlet.h | 1 + 5 files changed, 20 insertions(+), 35 deletions(-) diff --git a/src/pair_soft.cpp b/src/pair_soft.cpp index 8add30e678..e9e6bd0d8e 100644 --- a/src/pair_soft.cpp +++ b/src/pair_soft.cpp @@ -289,38 +289,6 @@ void PairSoft::read_restart_settings(FILE *fp) MPI_Bcast(&mix_flag,1,MPI_INT,0,world); } -/* ---------------------------------------------------------------------- - check if name is recognized, return integer index for that name - if name not recognized, return -1 - if type pair setting, return -2 if no type pairs are set -------------------------------------------------------------------------- */ - -int PairSoft::pre_adapt(char *name, int ilo, int ihi, int jlo, int jhi) -{ - int count = 0; - for (int i = ilo; i <= ihi; i++) - for (int j = MAX(jlo,i); j <= jhi; j++) - count++; - if (count == 0) return -2; - - if (strcmp(name,"a") == 0) return 0; - return -1; -} - -/* ---------------------------------------------------------------------- - adapt parameter indexed by which - change all pair variables affected by the reset parameter - if type pair setting, set I-J and J-I coeffs -------------------------------------------------------------------------- */ - -void PairSoft::adapt(int which, int ilo, int ihi, int jlo, int jhi, - double value) -{ - for (int i = ilo; i <= ihi; i++) - for (int j = MAX(jlo,i); j <= jhi; j++) - prefactor[i][j] = prefactor[j][i] = value; -} - /* ---------------------------------------------------------------------- */ double PairSoft::single(int i, int j, int itype, int jtype, double rsq, @@ -337,3 +305,12 @@ double PairSoft::single(int i, int j, int itype, int jtype, double rsq, philj = prefactor[itype][jtype] * (1.0+cos(arg)); return factor_lj*philj; } + +/* ---------------------------------------------------------------------- */ + +void *PairSoft::extract(char *str, int &dim) +{ + dim = 2; + if (strcmp(str,"a") == 0) return (void *) prefactor; + return NULL; +} diff --git a/src/pair_soft.h b/src/pair_soft.h index eceb98ec6f..fbfd3ca43d 100644 --- a/src/pair_soft.h +++ b/src/pair_soft.h @@ -38,9 +38,8 @@ class PairSoft : public Pair { void read_restart(FILE *); void write_restart_settings(FILE *); void read_restart_settings(FILE *); - int pre_adapt(char *, int, int, int, int); - void adapt(int, int, int, int, int, double); double single(int, int, int, int, double, double, double, double &); + void *extract(char *, int &); private: double PI; diff --git a/src/respa.cpp b/src/respa.cpp index 708b0ec754..209c7dd163 100644 --- a/src/respa.cpp +++ b/src/respa.cpp @@ -466,11 +466,12 @@ void Respa::run(int n) } /* ---------------------------------------------------------------------- - delete fix at end of run, so its atom arrays won't persist + delete rRESPA fix at end of run, so its atom arrays won't persist ------------------------------------------------------------------------- */ void Respa::cleanup() { + modify->post_run(); modify->delete_fix("RESPA"); } diff --git a/src/verlet.cpp b/src/verlet.cpp index 844234171f..c7a6180d64 100644 --- a/src/verlet.cpp +++ b/src/verlet.cpp @@ -286,6 +286,13 @@ void Verlet::run(int n) } } +/* ---------------------------------------------------------------------- */ + +void Verlet::cleanup() +{ + modify->post_run(); +} + /* ---------------------------------------------------------------------- clear force on own & ghost atoms setup and clear other arrays as needed diff --git a/src/verlet.h b/src/verlet.h index 02a5c1704e..211b5653f6 100644 --- a/src/verlet.h +++ b/src/verlet.h @@ -32,6 +32,7 @@ class Verlet : public Integrate { void setup(); void setup_minimal(int); void run(int); + void cleanup(); private: int triclinic; // 0 if domain is orthog, 1 if triclinic