From 7e5fec4f3d3a649f1131fd77dfc374aabd99181c Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 8 May 2013 15:31:10 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9835 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/USER-CG-CMM/pair_lj_sdk.cpp | 23 +++++++++++++++++++++++ src/USER-CG-CMM/pair_lj_sdk.h | 2 ++ src/USER-CG-CMM/pair_lj_sdk_coul_long.cpp | 23 +++++++++++++++++++++++ src/USER-CG-CMM/pair_lj_sdk_coul_long.h | 2 ++ 4 files changed, 50 insertions(+) diff --git a/src/USER-CG-CMM/pair_lj_sdk.cpp b/src/USER-CG-CMM/pair_lj_sdk.cpp index c6063f3e0f..3ea0092d16 100644 --- a/src/USER-CG-CMM/pair_lj_sdk.cpp +++ b/src/USER-CG-CMM/pair_lj_sdk.cpp @@ -45,6 +45,7 @@ PairLJSDK::PairLJSDK(LAMMPS *lmp) : Pair(lmp) { respa_enable = 0; single_enable = 1; + writedata = 1; } /* ---------------------------------------------------------------------- */ @@ -428,6 +429,28 @@ void PairLJSDK::read_restart_settings(FILE *fp) MPI_Bcast(&tail_flag,1,MPI_INT,0,world); } +/* ---------------------------------------------------------------------- + lj/sdk does not support per atom type output with mixing +------------------------------------------------------------------------- */ + +void PairLJSDK::write_data(FILE *) +{ + error->one(FLERR, "Pair style lj/sdk requires using " + "write_data with the 'pair ij' option"); +} + +/* ---------------------------------------------------------------------- + proc 0 writes all pairs to data file +------------------------------------------------------------------------- */ + +void PairLJSDK::write_data_all(FILE *fp) +{ + for (int i = 1; i <= atom->ntypes; i++) + for (int j = i; j <= atom->ntypes; j++) + fprintf(fp,"%d %d %s %g %g %g\n",i,j,lj_type_list[lj_type[i][j]], + epsilon[i][j],sigma[i][j],cut[i][j]); +} + /* ---------------------------------------------------------------------- */ double PairLJSDK::single(int, int, int itype, int jtype, double rsq, diff --git a/src/USER-CG-CMM/pair_lj_sdk.h b/src/USER-CG-CMM/pair_lj_sdk.h index fd764c6e83..2f733e7c2b 100644 --- a/src/USER-CG-CMM/pair_lj_sdk.h +++ b/src/USER-CG-CMM/pair_lj_sdk.h @@ -42,6 +42,8 @@ class PairLJSDK : public Pair { void read_restart(FILE *); void write_restart_settings(FILE *); void read_restart_settings(FILE *); + void write_data(FILE *); + void write_data_all(FILE *); double single(int, int, int, int, double, double, double, double &); void *extract(const char *, int &); virtual double memory_usage(); diff --git a/src/USER-CG-CMM/pair_lj_sdk_coul_long.cpp b/src/USER-CG-CMM/pair_lj_sdk_coul_long.cpp index 0f2466ac02..0a19f00581 100644 --- a/src/USER-CG-CMM/pair_lj_sdk_coul_long.cpp +++ b/src/USER-CG-CMM/pair_lj_sdk_coul_long.cpp @@ -54,6 +54,7 @@ PairLJSDKCoulLong::PairLJSDKCoulLong(LAMMPS *lmp) : Pair(lmp) { ewaldflag = pppmflag = 1; respa_enable = 0; + writedata = 1; ftable = NULL; } @@ -636,6 +637,28 @@ void PairLJSDKCoulLong::read_restart_settings(FILE *fp) MPI_Bcast(&tabinner,1,MPI_DOUBLE,0,world); } +/* ---------------------------------------------------------------------- + lj/sdk does not support per atom type output with mixing +------------------------------------------------------------------------- */ + +void PairLJSDKCoulLong::write_data(FILE *) +{ + error->one(FLERR, "Pair style lj/sdk/coul/* requires using " + "write_data with the 'pair ij' option"); +} + +/* ---------------------------------------------------------------------- + proc 0 writes all pairs to data file +------------------------------------------------------------------------- */ + +void PairLJSDKCoulLong::write_data_all(FILE *fp) +{ + for (int i = 1; i <= atom->ntypes; i++) + for (int j = i; j <= atom->ntypes; j++) + fprintf(fp,"%d %d %s %g %g %g\n",i,j,lj_type_list[lj_type[i][j]], + epsilon[i][j],sigma[i][j],cut_lj[i][j]); +} + /* ---------------------------------------------------------------------- free memory for tables used in pair computations ------------------------------------------------------------------------- */ diff --git a/src/USER-CG-CMM/pair_lj_sdk_coul_long.h b/src/USER-CG-CMM/pair_lj_sdk_coul_long.h index 8000507e2d..acd3ac3422 100644 --- a/src/USER-CG-CMM/pair_lj_sdk_coul_long.h +++ b/src/USER-CG-CMM/pair_lj_sdk_coul_long.h @@ -40,6 +40,8 @@ class PairLJSDKCoulLong : public Pair { double init_one(int, int); void write_restart(FILE *); void read_restart(FILE *); + void write_data(FILE *); + void write_data_all(FILE *); virtual void write_restart_settings(FILE *); virtual void read_restart_settings(FILE *); virtual double single(int, int, int, int, double, double, double, double &);