Merge pull request #1 from akohlmey/angle-mwlc

Small updates to PR #4433
This commit is contained in:
farrelljd-iop
2025-01-11 10:04:12 +08:00
committed by GitHub
4 changed files with 36 additions and 31 deletions

View File

@ -21,9 +21,13 @@ Examples
Description
"""""""""""
The *mwlc* angle style models a meltable wormlike chain and can be used to model non-linear bending elasticity of polymers, e.g. DNA.
*mwlc* uses a potential that is a canonical-ensemble superposition of a non-melted and a melted state :ref:`(Farrell) <Farrell>`.
The potential is
.. versionadded:: TBD
The *mwlc* angle style models a meltable wormlike chain and can be used
to model non-linear bending elasticity of polymers, e.g. DNA. *mwlc*
uses a potential that is a canonical-ensemble superposition of a
non-melted and a melted state :ref:`(Farrell) <Farrell>`. The potential
is
.. math::
@ -58,6 +62,7 @@ or :doc:`read_restart <read_restart>` commands:
* :math:`k_2` (energy)
* :math:`\mu` (energy)
* :math:`T` (temperature)
----------
@ -65,8 +70,8 @@ Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc page
for more info.
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>`
doc page for more info.
Related commands
""""""""""""""""

View File

@ -712,7 +712,6 @@ Dasgupta
dashpot
dat
datafile
dataset
datatype
datums
Davidchack

View File

@ -79,7 +79,7 @@ void AngleMWLC::compute(int eflag, int vflag)
i2 = anglelist[n][1];
i3 = anglelist[n][2];
type = anglelist[n][3];
kbt = temp[type]*force->boltz;
kbt = temp[type] * force->boltz;
v_min = -kbt * log(1 + exp(-mu[type] / kbt));
// 1st bond
@ -113,7 +113,7 @@ void AngleMWLC::compute(int eflag, int vflag)
qm = exp((-k2[type] * (1.0 + c) - mu[type]) / kbt);
Q = q + qm;
if (eflag) eangle = -kbt*log(Q) - v_min;
if (eflag) eangle = -kbt * log(Q) - v_min;
a = (k1[type] * q + k2[type] * qm) / Q;
a11 = a * c / rsq1;
@ -245,7 +245,8 @@ void AngleMWLC::read_restart(FILE *fp)
void AngleMWLC::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nangletypes; i++) fprintf(fp, "%d %g %g %g %g\n", i, k1[i], k2[i], mu[i], temp[i]);
for (int i = 1; i <= atom->nangletypes; i++)
fprintf(fp, "%d %g %g %g %g\n", i, k1[i], k2[i], mu[i], temp[i]);
}
/* ---------------------------------------------------------------------- */
@ -254,7 +255,7 @@ double AngleMWLC::single(int type, int i1, int i2, int i3)
{
double **x = atom->x;
double kbt = temp[type]*force->boltz;
double kbt = temp[type] * force->boltz;
double v_min = -kbt * log(1 + exp(-mu[type] / kbt));
double delx1 = x[i1][0] - x[i2][0];
double dely1 = x[i1][1] - x[i2][1];
@ -283,7 +284,7 @@ double AngleMWLC::single(int type, int i1, int i2, int i3)
void AngleMWLC::born_matrix(int type, int i1, int i2, int i3, double &du, double &du2)
{
double **x = atom->x;
double kbt = temp[type]*force->boltz;
double kbt = temp[type] * force->boltz;
double delx1 = x[i1][0] - x[i2][0];
double dely1 = x[i1][1] - x[i2][1];

View File

@ -24,28 +24,28 @@ AngleStyle(mwlc,AngleMWLC);
namespace LAMMPS_NS {
class AngleMWLC : public Angle {
public:
AngleMWLC(class LAMMPS *);
~AngleMWLC() override;
void compute(int, int) override;
void coeff(int, char **) override;
double equilibrium_angle(int) override;
void write_restart(FILE *) override;
void read_restart(FILE *) override;
void write_data(FILE *) override;
double single(int, int, int, int) override;
void born_matrix(int type, int i1, int i2, int i3, double &du, double &du2) override;
void *extract(const char *, int &) override;
class AngleMWLC : public Angle {
public:
AngleMWLC(class LAMMPS *);
~AngleMWLC() override;
void compute(int, int) override;
void coeff(int, char **) override;
double equilibrium_angle(int) override;
void write_restart(FILE *) override;
void read_restart(FILE *) override;
void write_data(FILE *) override;
double single(int, int, int, int) override;
void born_matrix(int type, int i1, int i2, int i3, double &du, double &du2) override;
void *extract(const char *, int &) override;
protected:
double *k1;
double *k2;
double *mu;
double *temp;
protected:
double *k1;
double *k2;
double *mu;
double *temp;
virtual void allocate();
};
virtual void allocate();
};
} // namespace LAMMPS_NS