From 5e18b620f36396228b7d4955955c602bb9e65fa8 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 28 Aug 2009 20:28:23 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3128 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/MAKE/Makefile.g++ | 2 +- src/MAKE/Makefile.linux | 2 +- src/Makefile.package | 6 +++--- src/fix.cpp | 5 +++-- src/fix.h | 3 ++- src/group.h | 4 ++-- src/min.cpp | 3 ++- src/modify.cpp | 21 +++++++++++++++++---- src/modify.h | 5 +++-- src/style_user_packages.h | 1 + 10 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/MAKE/Makefile.g++ b/src/MAKE/Makefile.g++ index 744498bab0..7bd8b3fd50 100755 --- a/src/MAKE/Makefile.g++ +++ b/src/MAKE/Makefile.g++ @@ -16,7 +16,7 @@ LINK = g++ LINKFORT = -L/opt/intel/fce/10.0.023/lib #LINKGPU = -L/usr/local/cuda/lib64 LINKFLAGS = -g -O $(PKGPATH) $(LINKFORT) $(LINKGPU) -USRLIB = -lfftw -lmpich $(PKGLIB) +USRLIB = -lfftw -lmpich -llapack $(PKGLIB) FORTLIB = -lifcore -lsvml -lompstub -limf #GPULIB = -lcudart SYSLIB = -lpthread $(FORTLIB) $(GPULIB) diff --git a/src/MAKE/Makefile.linux b/src/MAKE/Makefile.linux index f4eb4af595..20ff2d762a 100755 --- a/src/MAKE/Makefile.linux +++ b/src/MAKE/Makefile.linux @@ -16,7 +16,7 @@ LINK = icc LINKFORT = -L/opt/intel/fce/10.0.023/lib #LINKGPU = -L/usr/local/cuda/lib64// LINKFLAGS = -O $(PKGPATH) $(LINKFORT) $(LINKGPU) -USRLIB = -lfftw -lmpich $(PKGLIB) +USRLIB = -lfftw -lmpich -llapack $(PKGLIB) FORTLIB = -lifcore -lsvml -lompstub -limf #GPULIB = -lcudart SYSLIB = -lpthread -lstdc++ $(FORTLIB) $(GPULIB) diff --git a/src/Makefile.package b/src/Makefile.package index d54a74f2d1..b3b74eeceb 100644 --- a/src/Makefile.package +++ b/src/Makefile.package @@ -1,6 +1,6 @@ # Settings for libraries used by specific LAMMPS packages # this file is auto-edited when those packages are included/excluded -PKGINC = -I../../lib/reax -I../../lib/poems -I../../lib/meam -PKGPATH = -L../../lib/reax -L../../lib/poems -L../../lib/meam -PKGLIB = -lreax -lpoems -lmeam +PKGINC = -I../../lib/reax -I../../lib/meam -I../../lib/poems +PKGPATH = -L../../lib/reax -L../../lib/meam -L../../lib/poems +PKGLIB = -lreax -lmeam -lpoems diff --git a/src/fix.cpp b/src/fix.cpp index 6303e26563..b5a150510f 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -80,8 +80,9 @@ Fix::Fix(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) PRE_FORCE_RESPA = 2048; POST_FORCE_RESPA = 4096; FINAL_INTEGRATE_RESPA = 8192; - MIN_POST_FORCE = 16384; - MIN_ENERGY = 32768; + MIN_PRE_EXCHANGE = 16384; + MIN_POST_FORCE = 32768; + MIN_ENERGY = 65536; } /* ---------------------------------------------------------------------- */ diff --git a/src/fix.h b/src/fix.h index c7f445323b..934eab4e68 100644 --- a/src/fix.h +++ b/src/fix.h @@ -65,7 +65,7 @@ class Fix : protected Pointers { int PRE_FORCE,POST_FORCE,FINAL_INTEGRATE,END_OF_STEP,THERMO_ENERGY; int INITIAL_INTEGRATE_RESPA,POST_INTEGRATE_RESPA; int PRE_FORCE_RESPA,POST_FORCE_RESPA,FINAL_INTEGRATE_RESPA; - int MIN_POST_FORCE,MIN_ENERGY; + int MIN_PRE_EXCHANGE,MIN_POST_FORCE,MIN_ENERGY; Fix(class LAMMPS *, int, char **); virtual ~Fix(); @@ -104,6 +104,7 @@ class Fix : protected Pointers { virtual void post_force_respa(int, int, int) {} virtual void final_integrate_respa(int) {} + virtual void min_pre_exchange() {} virtual void min_post_force(int) {} virtual double min_energy(double *) {return 0.0;} diff --git a/src/group.h b/src/group.h index 0e4e5a6d47..4afe41cf26 100644 --- a/src/group.h +++ b/src/group.h @@ -21,8 +21,10 @@ namespace LAMMPS_NS { class Group : protected Pointers { public: + int ngroup; // # of defined groups char **names; // name of each group int *bitmask; // one-bit mask for each group + int *inversemask; // inverse mask for each group Group(class LAMMPS *); ~Group(); @@ -56,8 +58,6 @@ class Group : protected Pointers { private: int me; - int ngroup; // # of defined groups - int *inversemask; // inverse mask for each group int find_unused(); }; diff --git a/src/min.cpp b/src/min.cpp index 2e57aaf805..951607b710 100644 --- a/src/min.cpp +++ b/src/min.cpp @@ -328,7 +328,7 @@ void Min::run(int nsteps) // account for early exit from iterate loop due to convergence // set niter/nsteps for Finish stats to print // set output->next values to this timestep - // call eng_force to insure vflag is set when forces computed + // call engergy_force() to insure vflag is set when forces computed // output->write does final output for thermo, dump, restart files // add ntimestep to all computes that store invocation times // since are hardwireing call to thermo/dumps and computes may not be ready @@ -392,6 +392,7 @@ double Min::energy_force(int resetflag) comm->communicate(); timer->stamp(TIME_COMM); } else { + if (modify->n_min_pre_exchange) modify->min_pre_exchange(); if (triclinic) domain->x2lamda(atom->nlocal); domain->pbc(); if (domain->box_change) { diff --git a/src/modify.cpp b/src/modify.cpp index fdc008512d..96ee5c1aac 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -50,8 +50,9 @@ using namespace LAMMPS_NS; #define PRE_FORCE_RESPA 2048 #define POST_FORCE_RESPA 4096 #define FINAL_INTEGRATE_RESPA 8192 -#define MIN_POST_FORCE 16384 -#define MIN_ENERGY 32768 +#define MIN_PRE_EXCHANGE 16384 +#define MIN_POST_FORCE 32768 +#define MIN_ENERGY 65536 #define MIN(A,B) ((A) < (B)) ? (A) : (B) #define MAX(A,B) ((A) > (B)) ? (A) : (B) @@ -69,7 +70,7 @@ Modify::Modify(LAMMPS *lmp) : Pointers(lmp) n_final_integrate = n_end_of_step = n_thermo_energy = 0; n_initial_integrate_respa = n_post_integrate_respa = 0; n_pre_force_respa = n_post_force_respa = n_final_integrate_respa = 0; - n_min_post_force = n_min_energy = 0; + n_min_pre_exchange = n_min_post_force = n_min_energy = 0; fix = NULL; fmask = NULL; @@ -81,7 +82,7 @@ Modify::Modify(LAMMPS *lmp) : Pointers(lmp) list_initial_integrate_respa = list_post_integrate_respa = NULL; list_pre_force_respa = list_post_force_respa = NULL; list_final_integrate_respa = NULL; - list_min_post_force = list_min_energy = NULL; + list_min_pre_exchange = list_min_post_force = list_min_energy = NULL; end_of_step_every = NULL; @@ -127,6 +128,7 @@ Modify::~Modify() delete [] list_pre_force_respa; delete [] list_post_force_respa; delete [] list_final_integrate_respa; + delete [] list_min_pre_exchange; delete [] list_min_post_force; delete [] list_min_energy; @@ -171,6 +173,7 @@ void Modify::init() list_init(FINAL_INTEGRATE_RESPA, n_final_integrate_respa,list_final_integrate_respa); + list_init(MIN_PRE_EXCHANGE,n_min_pre_exchange,list_min_pre_exchange); list_init(MIN_POST_FORCE,n_min_post_force,list_min_post_force); list_init(MIN_ENERGY,n_min_energy,list_min_energy); @@ -388,6 +391,16 @@ void Modify::final_integrate_respa(int ilevel) fix[list_final_integrate_respa[i]]->final_integrate_respa(ilevel); } +/* ---------------------------------------------------------------------- + minimizer pre-exchange call, only for relevant fixes +------------------------------------------------------------------------- */ + +void Modify::min_pre_exchange() +{ + for (int i = 0; i < n_min_pre_exchange; i++) + fix[list_min_pre_exchange[i]]->min_pre_exchange(); +} + /* ---------------------------------------------------------------------- minimizer force adjustment call, only for relevant fixes ------------------------------------------------------------------------- */ diff --git a/src/modify.h b/src/modify.h index 4c790d6287..c7dbc16589 100644 --- a/src/modify.h +++ b/src/modify.h @@ -27,7 +27,7 @@ class Modify : protected Pointers { int n_final_integrate,n_end_of_step,n_thermo_energy; int n_initial_integrate_respa,n_post_integrate_respa; int n_pre_force_respa,n_post_force_respa,n_final_integrate_respa; - int n_min_post_force,n_min_energy; + int n_min_pre_exchange,n_min_post_force,n_min_energy; int nfix_restart_peratom; int restart_pbc_any; // 1 if any fix sets restart_pbc @@ -59,6 +59,7 @@ class Modify : protected Pointers { void post_force_respa(int,int,int); void final_integrate_respa(int); + void min_pre_exchange(); void min_post_force(int); double min_energy(double *); @@ -99,7 +100,7 @@ class Modify : protected Pointers { int *list_initial_integrate_respa,*list_post_integrate_respa; int *list_pre_force_respa,*list_post_force_respa; int *list_final_integrate_respa; - int *list_min_post_force,*list_min_energy; + int *list_min_pre_exchange,*list_min_post_force,*list_min_energy; int *end_of_step_every; diff --git a/src/style_user_packages.h b/src/style_user_packages.h index 3dd83cf2be..85a62f7b2a 100644 --- a/src/style_user_packages.h +++ b/src/style_user_packages.h @@ -15,6 +15,7 @@ // see the README files in individual user-package directories for details #include "style_user_ackland.h" +//#include "style_user_atc.h" #include "style_user_cg_cmm.h" #include "style_user_ewaldn.h" #include "style_user_smd.h"