diff --git a/doc/src/fix_adapt.rst b/doc/src/fix_adapt.rst index 709a22ad6c..ed611b2c7c 100644 --- a/doc/src/fix_adapt.rst +++ b/doc/src/fix_adapt.rst @@ -464,6 +464,8 @@ sub-style name. The dihedral styles that currently work with fix adapt are: +------------------------------------------------------------------------+----------------+----------------+ | :doc:`cosine/squared/restricted ` | k,phi0 | type dihedrals | +------------------------------------------------------------------------+----------------+----------------+ +| :doc:`helix ` | a,b,c | type dihedrals | ++------------------------------------------------------------------------+----------------+----------------+ | :doc:`multi/harmonic ` | a1,a2,a3,a4,a5 | type dihedrals | +------------------------------------------------------------------------+----------------+----------------+ | :doc:`opls ` | k1,k2,k3,k4 | type dihedrals | diff --git a/src/EXTRA-MOLECULE/dihedral_helix.cpp b/src/EXTRA-MOLECULE/dihedral_helix.cpp index 4693d29cd7..55ac8ee776 100644 --- a/src/EXTRA-MOLECULE/dihedral_helix.cpp +++ b/src/EXTRA-MOLECULE/dihedral_helix.cpp @@ -430,3 +430,16 @@ void DihedralHelix::born_matrix(int nd, int i1, int i2, int i3, int i4, du2 = -(9.0*bphi[type]*cos(3.0*phi) + cphi[type]*cos(phi + MY_PI4))*siinv*siinv + (3.0*bphi[type]*sin(3.0*phi) + cphi[type]*sin(phi + MY_PI4))*c*siinv*siinv*siinv; } + +/* ---------------------------------------------------------------------- + return ptr to internal members upon request + ------------------------------------------------------------------------ */ + + void *DihedralHelix::extract(const char *str, int &dim) + { + dim = 1; + if (strcmp(str, "a") == 0) return (void *) aphi; + if (strcmp(str, "b") == 0) return (void *) bphi; + if (strcmp(str, "c") == 0) return (void *) cphi; + return nullptr; + } diff --git a/src/EXTRA-MOLECULE/dihedral_helix.h b/src/EXTRA-MOLECULE/dihedral_helix.h index 172a8c3469..be7263f900 100644 --- a/src/EXTRA-MOLECULE/dihedral_helix.h +++ b/src/EXTRA-MOLECULE/dihedral_helix.h @@ -34,6 +34,7 @@ class DihedralHelix : public Dihedral { void read_restart(FILE *) override; void write_data(FILE *) override; void born_matrix(int, int, int, int, int, double &, double &) override; + void *extract(const char *, int &) override; protected: double *aphi, *bphi, *cphi; diff --git a/unittest/force-styles/tests/dihedral-helix.yaml b/unittest/force-styles/tests/dihedral-helix.yaml index e2372c8809..a6430b749b 100644 --- a/unittest/force-styles/tests/dihedral-helix.yaml +++ b/unittest/force-styles/tests/dihedral-helix.yaml @@ -16,7 +16,10 @@ dihedral_coeff: ! | 3 56 10 32 4 23 80 61 5 19 90 13 -extract: ! "" +extract: ! | + a 1 + b 1 + c 1 natoms: 29 init_energy: 4634.436545707672 init_stress: ! |-