add support for angle cosine

This commit is contained in:
Steve Plimpton
2022-04-22 09:12:12 -06:00
parent 3f3c481554
commit b4e2e2ec34
3 changed files with 21 additions and 7 deletions

View File

@ -297,17 +297,17 @@ means all types from 1 to N. A leading asterisk means all types from
(inclusive).
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
hybrid/overlay as bond styles. The bond styles that currently work
with fix_adapt are
+------------------------------------+-------+-----------------+
| :doc:`class2 <bond_class2>` | r0 | type bonds |
+------------------------------------+-------+-----------------+
| :doc:`fene <bond_fene>` | k, r0 | type bonds |
| :doc:`fene <bond_fene>` | k,r0 | type bonds |
+------------------------------------+-------+-----------------+
| :doc:`fene/nm <bond_fene_nm>` | k, r0 | type bonds |
| :doc:`fene/nm <bond_fene_nm>` | k,r0 | type bonds |
+------------------------------------+-------+-----------------+
| :doc:`gromos <bond_gromos>` | k, r0 | type bonds |
| :doc:`gromos <bond_gromos>` | k,r0 | type bonds |
+------------------------------------+-------+-----------------+
| :doc:`harmonic <bond_harmonic>` | k,r0 | type bonds |
+------------------------------------+-------+-----------------+
@ -333,12 +333,14 @@ means all types from 1 to N. A leading asterisk means all types from
(inclusive).
Currently *angle* does not support angle_style hybrid nor angle_style
hybrid/overlay as angle styles. The only angles that currently are
working with fix_adapt are
hybrid/overlay as angle styles. The angle styles that currently work
with fix_adapt are
+------------------------------------+-------+-----------------+
| :doc:`harmonic <angle_harmonic>` | k,theta0 | type angles |
+------------------------------------+-------+-----------------+
| :doc:`cosine <angle_cosine>` | k | type angles |
+------------------------------------+-------+-----------------+
Note that internally, theta0 is stored in radians, so the variable
this fix uses to reset theta0 needs to generate values in radians.

View File

@ -234,3 +234,14 @@ double AngleCosine::single(int type, int i1, int i2, int i3)
return k[type] * (1.0 + c);
}
/* ----------------------------------------------------------------------
return ptr to internal members upon request
------------------------------------------------------------------------ */
void *AngleCosine::extract(const char *str, int &dim)
{
dim = 1;
if (strcmp(str, "k") == 0) return (void *) k;
return nullptr;
}

View File

@ -35,6 +35,7 @@ class AngleCosine : public Angle {
void read_restart(FILE *) override;
void write_data(FILE *) override;
double single(int, int, int, int) override;
void *extract(const char *, int &) override;
protected:
double *k;