diff --git a/doc/src/fix_adapt.rst b/doc/src/fix_adapt.rst index eab8f92639..b4587caf73 100644 --- a/doc/src/fix_adapt.rst +++ b/doc/src/fix_adapt.rst @@ -288,11 +288,19 @@ Currently *bond* does not support bond_style hybrid nor bond_style hybrid/overlay as bond styles. The only bonds that currently are working with fix_adapt are -+---------------------------------+-------+------------+ -| :doc:`gromos ` | k, r0 | type bonds | -+---------------------------------+-------+------------+ -| :doc:`harmonic ` | k,r0 | type bonds | -+---------------------------------+-------+------------+ ++------------------------------------+-------+------------+ +| :doc:`class2 ` | r0 | type bonds | ++------------------------------------+-------+------------+ +| :doc:`fene ` | k, r0 | type bonds | ++------------------------------------+-------+------------+ +| :doc:`gromos ` | k, r0 | type bonds | ++------------------------------------+-------+------------+ +| :doc:`harmonic ` | k,r0 | type bonds | ++------------------------------------+-------+------------+ +| :doc:`morse ` | r0 | type bonds | ++------------------------------------+-------+------------+ +| :doc:`nonlinear ` | r0 | type bonds | ++------------------------------------+-------+------------+ ---------- diff --git a/src/CLASS2/bond_class2.cpp b/src/CLASS2/bond_class2.cpp index 0651db75fb..097c8fe387 100644 --- a/src/CLASS2/bond_class2.cpp +++ b/src/CLASS2/bond_class2.cpp @@ -15,6 +15,7 @@ Contributing author: Eric Simon (Cray) ------------------------------------------------------------------------- */ +#include #include "bond_class2.h" #include #include @@ -220,3 +221,12 @@ double BondClass2::single(int type, double rsq, int /*i*/, int /*j*/, double &ff else fforce = 0.0; return (k2[type]*dr2 + k3[type]*dr3 + k4[type]*dr4); } + +/* ---------------------------------------------------------------------- */ + +void *BondClass2::extract( char *str, int &dim ) +{ + dim = 1; + if (strcmp(str,"r0")==0) return (void*) r0; + return NULL; +} diff --git a/src/CLASS2/bond_class2.h b/src/CLASS2/bond_class2.h index f0fcc6825e..fb7eb884df 100644 --- a/src/CLASS2/bond_class2.h +++ b/src/CLASS2/bond_class2.h @@ -35,6 +35,7 @@ class BondClass2 : public Bond { virtual void read_restart(FILE *); void write_data(FILE *); double single(int, double, int, int, double &); + virtual void *extract(char *, int &); protected: double *r0,*k2,*k3,*k4; diff --git a/src/MOLECULE/bond_fene.cpp b/src/MOLECULE/bond_fene.cpp index b8e197a344..e3c47b6241 100644 --- a/src/MOLECULE/bond_fene.cpp +++ b/src/MOLECULE/bond_fene.cpp @@ -14,6 +14,7 @@ #include "bond_fene.h" #include #include +#include #include "atom.h" #include "neighbor.h" #include "comm.h" @@ -272,3 +273,13 @@ double BondFENE::single(int type, double rsq, int /*i*/, int /*j*/, return eng; } + +/* ---------------------------------------------------------------------- */ + +void *BondFENE::extract( char *str, int &dim ) +{ + dim = 1; + if (strcmp(str,"kappa")==0) return (void*) k; + if (strcmp(str,"r0")==0) return (void*) r0; + return NULL; +} diff --git a/src/MOLECULE/bond_fene.h b/src/MOLECULE/bond_fene.h index 1963e3ca22..77c7db1200 100644 --- a/src/MOLECULE/bond_fene.h +++ b/src/MOLECULE/bond_fene.h @@ -36,6 +36,7 @@ class BondFENE : public Bond { void read_restart(FILE *); void write_data(FILE *); double single(int, double, int, int, double &); + virtual void *extract(char *, int &); protected: double TWO_1_3; diff --git a/src/MOLECULE/bond_morse.cpp b/src/MOLECULE/bond_morse.cpp index 249f92928f..0a92229879 100644 --- a/src/MOLECULE/bond_morse.cpp +++ b/src/MOLECULE/bond_morse.cpp @@ -18,6 +18,7 @@ #include "bond_morse.h" #include #include +#include #include "atom.h" #include "neighbor.h" #include "comm.h" @@ -205,3 +206,12 @@ double BondMorse::single(int type, double rsq, int /*i*/, int /*j*/, if (r > 0.0) fforce = -2.0*d0[type]*alpha[type]*(1-ralpha)*ralpha/r; return d0[type]*(1-ralpha)*(1-ralpha); } + +/* ---------------------------------------------------------------------- */ + +void *BondMorse::extract(char *str, int &dim ) +{ + dim = 1; + if (strcmp(str,"r0")==0) return (void*) r0; + return NULL; +} diff --git a/src/MOLECULE/bond_morse.h b/src/MOLECULE/bond_morse.h index 030a94a8da..cbab0aed1d 100644 --- a/src/MOLECULE/bond_morse.h +++ b/src/MOLECULE/bond_morse.h @@ -35,6 +35,7 @@ class BondMorse : public Bond { void read_restart(FILE *); void write_data(FILE *); double single(int, double, int, int, double &); + virtual void *extract(char *, int &); protected: double *d0,*alpha,*r0; diff --git a/src/MOLECULE/bond_nonlinear.cpp b/src/MOLECULE/bond_nonlinear.cpp index ee943ad28f..8f0616e03e 100644 --- a/src/MOLECULE/bond_nonlinear.cpp +++ b/src/MOLECULE/bond_nonlinear.cpp @@ -14,6 +14,7 @@ #include "bond_nonlinear.h" #include #include +#include #include "atom.h" #include "neighbor.h" #include "comm.h" @@ -202,3 +203,13 @@ double BondNonlinear::single(int type, double rsq, int /*i*/, int /*j*/, fforce = -epsilon[type]/r * 2.0*dr*lamdasq/denomsq; return epsilon[type] * drsq / denom; } + +/* ---------------------------------------------------------------------- */ + +void *BondNonlinear::extract( char *str, int &dim ) +{ + dim = 1; + if (strcmp(str,"epsilon")==0) return (void*) epsilon; + if (strcmp(str,"r0")==0) return (void*) r0; + return NULL; +} diff --git a/src/MOLECULE/bond_nonlinear.h b/src/MOLECULE/bond_nonlinear.h index 7782b93778..76dffdba31 100644 --- a/src/MOLECULE/bond_nonlinear.h +++ b/src/MOLECULE/bond_nonlinear.h @@ -35,6 +35,7 @@ class BondNonlinear : public Bond { void read_restart(FILE *); void write_data(FILE *); double single(int, double, int, int, double &); + virtual void *extract(char *, int &); protected: double *epsilon,*r0,*lamda;