forked from lijiext/lammps
Added source code and documentation for USER-CGDNA
This commit is contained in:
parent
c31f1e9f22
commit
96259ea2d2
|
@ -0,0 +1,9 @@
|
|||
\documentclass[12pt]{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
$$
|
||||
E = - \frac{\epsilon}{2} \ln \left[ 1 - \left(\frac{r-r0}{\Delta}\right)^2\right]
|
||||
$$
|
||||
|
||||
\end{document}
|
Binary file not shown.
|
@ -84,7 +84,6 @@ Package, Description, Author(s), Doc page, Example, Library
|
|||
"PERI"_#PERI, Peridynamics models, Mike Parks (Sandia), "pair_style peri"_pair_peri.html, peri, -
|
||||
"POEMS"_#POEMS, coupled rigid body motion, Rudra Mukherjee (JPL), "fix poems"_fix_poems.html, rigid, lib/poems
|
||||
"PYTHON"_#PYTHON, embed Python code in an input script, -, "python"_python.html, python, lib/python
|
||||
"REAX"_#REAX, ReaxFF potential, Aidan Thompson (Sandia), "pair_style reax"_pair_reax.html, reax, lib/reax
|
||||
"REPLICA"_#REPLICA, multi-replica methods, -, "Section 6.6.5"_Section_howto.html#howto_5, tad, -
|
||||
"RIGID"_#RIGID, rigid bodies, -, "fix rigid"_fix_rigid.html, rigid, -
|
||||
"SHOCK"_#SHOCK, shock loading methods, -, "fix msst"_fix_msst.html, -, -
|
||||
|
@ -1140,6 +1139,7 @@ Package, Description, Author(s), Doc page, Example, Pic/movie, Library
|
|||
"USER-ATC"_#USER-ATC, atom-to-continuum coupling, Jones & Templeton & Zimmerman (1), "fix atc"_fix_atc.html, USER/atc, "atc"_atc, lib/atc
|
||||
"USER-AWPMD"_#USER-AWPMD, wave-packet MD, Ilya Valuev (JIHT), "pair_style awpmd/cut"_pair_awpmd.html, USER/awpmd, -, lib/awpmd
|
||||
"USER-CG-CMM"_#USER-CG-CMM, coarse-graining model, Axel Kohlmeyer (Temple U), "pair_style lj/sdk"_pair_sdk.html, USER/cg-cmm, "cg"_cg, -
|
||||
"USER-CGDNA"_#USER-CGDNA, coarse-grained DNA force fields, Oliver Henrich (U Edinburgh), src/USER-CGDNA/README, USER/cgdna, -, -
|
||||
"USER-COLVARS"_#USER-COLVARS, collective variables, Fiorin & Henin & Kohlmeyer (2), "fix colvars"_fix_colvars.html, USER/colvars, "colvars"_colvars, lib/colvars
|
||||
"USER-DIFFRACTION"_#USER-DIFFRACTION, virutal x-ray and electron diffraction, Shawn Coleman (ARL),"compute xrd"_compute_xrd.html, USER/diffraction, -, -
|
||||
"USER-DPD"_#USER-DPD, reactive dissipative particle dynamics (DPD), Larentzos & Mattox & Brennan (5), src/USER-DPD/README, USER/dpd, -, -
|
||||
|
@ -1284,6 +1284,32 @@ him directly if you have questions.
|
|||
|
||||
:line
|
||||
|
||||
USER-CGDNA package :link(USER-CGDNA),h5
|
||||
|
||||
Contents: The CGDNA package implements coarse-grained force fields
|
||||
for single- and double-stranded DNA. This is at the moment mainly
|
||||
the oxDNA model, developed by Doye, Louis and Ouldridge at the
|
||||
University of Oxford.
|
||||
The package also contains Langevin-type rigid-body integrators
|
||||
with improved stability.
|
||||
|
||||
See these doc pages to get started:
|
||||
|
||||
"bond_style oxdna_fene"_bond_oxdna_fene.html
|
||||
|
||||
"pair_style oxdna_excv"_pair_oxdna_excv.html
|
||||
|
||||
"fix nve/dotc/langevin"_fix_nve_dotc_langevin.html
|
||||
|
||||
Supporting info: /src/USER-CGDNA/README, "bond_style oxdna_fene"_bond_oxdna_fene.html,
|
||||
"pair_style oxdna_excv"_pair_oxdna_excv.html, "fix nve/dotc/langevin"_fix_nve_dotc_langevin.html
|
||||
|
||||
Author: Oliver Henrich at the University of Edinburgh, UK (o.henrich
|
||||
at epcc.ed.ac.uk or ohenrich at ph.ed.ac.uk). Contact him directly
|
||||
if you have any questions.
|
||||
|
||||
:line
|
||||
|
||||
USER-COLVARS package :link(USER-COLVARS),h5
|
||||
|
||||
Contents: COLVARS stands for collective variables which can be used to
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
|
||||
|
||||
:link(lws,http://lammps.sandia.gov)
|
||||
:link(ld,Manual.html)
|
||||
:link(lc,Section_commands.html#comm)
|
||||
|
||||
:line
|
||||
|
||||
bond_style oxdna_fene command :h3
|
||||
|
||||
[Syntax:]
|
||||
|
||||
bond_style oxdna_fene :pre
|
||||
|
||||
[Examples:]
|
||||
|
||||
bond_style oxdna_fene
|
||||
bond_coeff * 2.0 0.25 0.7525 :pre
|
||||
|
||||
[Description:]
|
||||
|
||||
The {oxdna_fene} bond style uses the potential
|
||||
|
||||
:c,image(Eqs/bond_oxdna_fene.jpg)
|
||||
|
||||
to define a modified finite extensible nonlinear elastic (FENE) potential
|
||||
"(Ouldridge)"_#oxdna_fene to model the connectivity of the phosphate backbone
|
||||
in the oxDNA force field for coarse-grained modelling of DNA.
|
||||
|
||||
The following coefficients must be defined for the bond type via the
|
||||
"bond_coeff"_bond_coeff.html command as given in the above example, or in
|
||||
the data file or restart files read by the "read_data"_read_data.html
|
||||
or "read_restart"_read_restart.html commands:
|
||||
|
||||
epsilon (energy)
|
||||
Delta (distance)
|
||||
r0 (distance) :ul
|
||||
|
||||
NOTE: This bond style has to be used together with the corresponding oxDNA pair styles
|
||||
for excluded volume interaction {oxdna_excv}, stacking {oxdna_stk}, cross-stacking {oxdna_xstk}
|
||||
and coaxial stacking interaction {oxdna_coaxstk} as well as hydrogen-bonding interaction {oxdna_hbond} (see also documentation of
|
||||
"pair_style oxdna_excv"_pair_oxdna_excv.html). The coefficients
|
||||
in the above example have to be kept fixed and cannot be changed without reparametrizing the entire model.
|
||||
|
||||
Example input and data files can be found in /examples/USER/cgdna/examples/duplex1/ and /duplex2/.
|
||||
A simple python setup tool which creates single straight or helical DNA strands,
|
||||
DNA duplexes or arrays of DNA duplexes can be found in /examples/USER/cgdna/util/.
|
||||
A technical report with more information on the model, the structure of the input file,
|
||||
the setup tool and the performance of the LAMMPS-implementation of oxDNA
|
||||
can be found "here"_PDF/USER-CGDNA-overview.pdf.
|
||||
|
||||
:line
|
||||
|
||||
[Restrictions:]
|
||||
|
||||
This bond style can only be used if LAMMPS was built with the
|
||||
USER-CGDNA package and the MOLECULE and ASPHERE package. See the "Making
|
||||
LAMMPS"_Section_start.html#start_3 section for more info on packages.
|
||||
|
||||
|
||||
[Related commands:]
|
||||
|
||||
"pair_style oxdna_excv"_pair_oxdna_excv.html, "fix nve/dotc/langevin"_fix_nve_dotc_langevin.html, "bond_coeff"_bond_coeff.html
|
||||
|
||||
[Default:] none
|
||||
|
||||
:line
|
||||
|
||||
:link(oxdna_fene)
|
||||
[(Ouldridge)] T.E. Ouldridge, A.A. Louis, J.P.K. Doye, J. Chem. Phys. 134, 085101 (2011).
|
|
@ -0,0 +1,61 @@
|
|||
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
|
||||
|
||||
:link(lws,http://lammps.sandia.gov)
|
||||
:link(ld,Manual.html)
|
||||
:link(lc,Section_commands.html#comm)
|
||||
|
||||
:line
|
||||
|
||||
fix nve/dot command :h3
|
||||
|
||||
[Syntax:]
|
||||
|
||||
fix ID group-ID nve/dot :pre
|
||||
|
||||
ID, group-ID are documented in "fix"_fix.html command :ulb,l
|
||||
nve/dot = style name of this fix command :l
|
||||
:ule
|
||||
|
||||
[Examples:]
|
||||
|
||||
fix 1 all nve/dot :pre
|
||||
|
||||
[Description:]
|
||||
|
||||
Apply a rigid-body integrator as described in "(Davidchack)"_#Davidchack
|
||||
to a group of atoms, but without Langevin dynamics.
|
||||
This command performs Molecular dynamics (MD)
|
||||
via a velocity-Verlet algorithm and an evolution operator that rotates
|
||||
the quaternion degrees of freedom, similar to the scheme outlined in "(Miller)"_#Miller.
|
||||
|
||||
This command is the equivalent of the "fix nve/dotc/langevin"_fix_nve_dotc_langevin.html
|
||||
without damping and noise and can be used to determine the stability range
|
||||
in a NVE ensemble prior to using the Langevin-type DOTC-integrator
|
||||
(see also "fix nve/dotc/langevin"_fix_nve_dotc_langevin.html).
|
||||
The command is equivalent to the "fix nve"_fix_nve.html.
|
||||
The particles are always considered to have a finite size.
|
||||
|
||||
An example input file can be found in /examples/USER/cgdna/examples/duplex1/.
|
||||
A technical report with more information on this integrator can be found
|
||||
"here"_PDF/USER-CGDNA-overview.pdf.
|
||||
|
||||
:line
|
||||
|
||||
[Restrictions:]
|
||||
|
||||
These pair styles can only be used if LAMMPS was built with the
|
||||
USER-CGDNA package and the MOLECULE and ASPHERE package. See the "Making
|
||||
LAMMPS"_Section_start.html#start_3 section for more info on packages.
|
||||
|
||||
[Related commands:]
|
||||
|
||||
"fix nve/dotc/langevin"_fix_nve_dotc_langevin.html, "fix nve"_fix_nve.html
|
||||
|
||||
[Default:] none
|
||||
|
||||
:line
|
||||
|
||||
:link(Davidchack)
|
||||
[(Davidchack)] R.L Davidchack, T.E. Ouldridge, and M.V. Tretyakov. J. Chem. Phys. 142, 144114 (2015).
|
||||
:link(Miller)
|
||||
[(Miller)] T. F. Miller III, M. Eleftheriou, P. Pattnaik, A. Ndirango, G. J. Martyna, J. Chem. Phys., 116, 8649-8659 (2002).
|
|
@ -0,0 +1,134 @@
|
|||
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
|
||||
|
||||
:link(lws,http://lammps.sandia.gov)
|
||||
:link(ld,Manual.html)
|
||||
:link(lc,Section_commands.html#comm)
|
||||
|
||||
:line
|
||||
|
||||
fix nve/dotc/langevin command :h3
|
||||
|
||||
[Syntax:]
|
||||
|
||||
fix ID group-ID nve/dotc/langevin Tstart Tstop damp seed keyword value :pre
|
||||
|
||||
ID, group-ID are documented in "fix"_fix.html command :ulb,l
|
||||
nve/dotc/langevin = style name of this fix command :l
|
||||
Tstart,Tstop = desired temperature at start/end of run (temperature units) :l
|
||||
damp = damping parameter (time units) :l
|
||||
seed = random number seed to use for white noise (positive integer) :l
|
||||
keyword = {angmom} :l
|
||||
{angmom} value = factor
|
||||
factor = do thermostat rotational degrees of freedom via the angular momentum and apply numeric scale factor as discussed below :pre
|
||||
:ule
|
||||
|
||||
[Examples:]
|
||||
|
||||
fix 1 all nve/dotc/langevin 1.0 1.0 0.03 457145 angmom 10 :pre
|
||||
|
||||
[Description:]
|
||||
|
||||
Apply a rigid-body Langevin-type integrator of the kind "Langevin C"
|
||||
as described in "(Davidchack)"_#Davidchack
|
||||
to a group of atoms, which models an interaction with an implicit background
|
||||
solvent. This command performs Brownian dynamics (BD)
|
||||
via a technique that splits the integration into a deterministic Hamiltonian
|
||||
part and the Ornstein-Uhlenbeck process for noise and damping.
|
||||
The quaternion degrees of freedom are updated though an evolution
|
||||
operator which performs a rotation in quaternion space, preserves
|
||||
the quaternion norm and is akin to "(Miller)"_#Miller.
|
||||
|
||||
In terms of syntax this command has been closely modelled on the
|
||||
"fix langevin"_fix_langevin.html and its {angmom} option. But it combines
|
||||
the "fix nve"_fix_nve.html and the "fix langevin"_fix_langevin.html in
|
||||
one single command. The main feature is improved stability
|
||||
over the standard integrator, permitting slightly larger timestep sizes.
|
||||
|
||||
NOTE: Unlike the "fix langevin"_fix_langevin.html this command performs
|
||||
also time integration of the translational and quaternion degrees of freedom.
|
||||
|
||||
The total force on each atom will have the form:
|
||||
|
||||
F = Fc + Ff + Fr
|
||||
Ff = - (m / damp) v
|
||||
Fr is proportional to sqrt(Kb T m / (dt damp)) :pre
|
||||
|
||||
Fc is the conservative force computed via the usual inter-particle
|
||||
interactions ("pair_style"_pair_style.html,
|
||||
"bond_style"_bond_style.html, etc).
|
||||
|
||||
The Ff and Fr terms are implicitly taken into account by this fix
|
||||
on a per-particle basis.
|
||||
|
||||
Ff is a frictional drag or viscous damping term proportional to the
|
||||
particle's velocity. The proportionality constant for each atom is
|
||||
computed as m/damp, where m is the mass of the particle and damp is
|
||||
the damping factor specified by the user.
|
||||
|
||||
Fr is a force due to solvent atoms at a temperature T randomly bumping
|
||||
into the particle. As derived from the fluctuation/dissipation
|
||||
theorem, its magnitude as shown above is proportional to sqrt(Kb T m /
|
||||
dt damp), where Kb is the Boltzmann constant, T is the desired
|
||||
temperature, m is the mass of the particle, dt is the timestep size,
|
||||
and damp is the damping factor. Random numbers are used to randomize
|
||||
the direction and magnitude of this force as described in
|
||||
"(Dunweg)"_#Dunweg, where a uniform random number is used (instead of
|
||||
a Gaussian random number) for speed.
|
||||
|
||||
:line
|
||||
|
||||
{Tstart} and {Tstop} have to be constant values, i.e. they cannot
|
||||
be variables.
|
||||
|
||||
The {damp} parameter is specified in time units and determines how
|
||||
rapidly the temperature is relaxed. For example, a value of 0.03
|
||||
means to relax the temperature in a timespan of (roughly) 0.03 time
|
||||
units tau (see the "units"_units.html command).
|
||||
The damp factor can be thought of as inversely related to the
|
||||
viscosity of the solvent, i.e. a small relaxation time implies a
|
||||
hi-viscosity solvent and vice versa. See the discussion about gamma
|
||||
and viscosity in the documentation for the "fix
|
||||
viscous"_fix_viscous.html command for more details.
|
||||
|
||||
The random # {seed} must be a positive integer. A Marsaglia random
|
||||
number generator is used. Each processor uses the input seed to
|
||||
generate its own unique seed and its own stream of random numbers.
|
||||
Thus the dynamics of the system will not be identical on two runs on
|
||||
different numbers of processors.
|
||||
|
||||
The keyword/value option has to be used in the following way:
|
||||
|
||||
This fix has to be used together with the {angmom} keyword. The
|
||||
particles are always considered to have a finite size.
|
||||
The keyword {angmom} enables thermostatting of the rotational degrees of
|
||||
freedom in addition to the usual translational degrees of freedom.
|
||||
|
||||
The scale factor after the {angmom} keyword gives the ratio of the rotational to
|
||||
the translational friction coefficient.
|
||||
|
||||
An example input file can be found in /examples/USER/cgdna/examples/duplex2/.
|
||||
A technical report with more information on this integrator can be found
|
||||
"here"_PDF/USER-CGDNA-overview.pdf.
|
||||
|
||||
:line
|
||||
|
||||
[Restrictions:]
|
||||
|
||||
These pair styles can only be used if LAMMPS was built with the
|
||||
USER-CGDNA package and the MOLECULE and ASPHERE package. See the "Making
|
||||
LAMMPS"_Section_start.html#start_3 section for more info on packages.
|
||||
|
||||
[Related commands:]
|
||||
|
||||
"fix nve"_fix_nve.html, "fix langevin"_fix_langevin.html, "fix nve/dot"_fix_nve_dot.html,
|
||||
|
||||
[Default:] none
|
||||
|
||||
:line
|
||||
|
||||
:link(Davidchack)
|
||||
[(Davidchack)] R.L Davidchack, T.E. Ouldridge, M.V. Tretyakov. J. Chem. Phys. 142, 144114 (2015).
|
||||
:link(Miller)
|
||||
[(Miller)] T. F. Miller III, M. Eleftheriou, P. Pattnaik, A. Ndirango, G. J. Martyna, J. Chem. Phys., 116, 8649-8659 (2002).
|
||||
:link(Dunweg)
|
||||
[(Dunweg)] B. Dunweg, W. Paul, Int. J. Mod. Phys. C, 2, 817-27 (1991).
|
|
@ -192,7 +192,6 @@ fix_meso.html
|
|||
fix_meso_stationary.html
|
||||
fix_momentum.html
|
||||
fix_move.html
|
||||
fix_mscg.html
|
||||
fix_msst.html
|
||||
fix_neb.html
|
||||
fix_nh.html
|
||||
|
@ -208,6 +207,8 @@ fix_nve.html
|
|||
fix_nve_asphere.html
|
||||
fix_nve_asphere_noforce.html
|
||||
fix_nve_body.html
|
||||
fix_nve_dot.html
|
||||
fix_nve_dotc_langevin.html
|
||||
fix_nve_eff.html
|
||||
fix_nve_limit.html
|
||||
fix_nve_line.html
|
||||
|
@ -215,7 +216,6 @@ fix_nve_manifold_rattle.html
|
|||
fix_nve_noforce.html
|
||||
fix_nve_sphere.html
|
||||
fix_nve_tri.html
|
||||
fix_nvk.html
|
||||
fix_nvt_asphere.html
|
||||
fix_nvt_body.html
|
||||
fix_nvt_manifold_rattle.html
|
||||
|
@ -456,6 +456,7 @@ pair_multi_lucy_rx.html
|
|||
pair_nb3b_harmonic.html
|
||||
pair_nm.html
|
||||
pair_none.html
|
||||
pair_oxdna_excv.html
|
||||
pair_peri.html
|
||||
pair_polymorphic.html
|
||||
pair_quip.html
|
||||
|
@ -494,6 +495,7 @@ pair_zero.html
|
|||
bond_class2.html
|
||||
bond_fene.html
|
||||
bond_fene_expand.html
|
||||
bond_oxdna_fene.html
|
||||
bond_harmonic.html
|
||||
bond_harmonic_shift.html
|
||||
bond_harmonic_shift_cut.html
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
|
||||
|
||||
:link(lws,http://lammps.sandia.gov)
|
||||
:link(ld,Manual.html)
|
||||
:link(lc,Section_commands.html#comm)
|
||||
|
||||
:line
|
||||
|
||||
pair_style oxdna_excv command :h3
|
||||
pair_style oxdna_stk command :h3
|
||||
pair_style oxdna_hbond command :h3
|
||||
pair_style oxdna_xstk command :h3
|
||||
pair_style oxdna_coaxstk command :h3
|
||||
|
||||
[Syntax:]
|
||||
|
||||
pair_style style :pre
|
||||
|
||||
style = {hybrid/overlay oxdna_excv oxdna_stk oxdna_hbond oxdna_xstk oxdna_coaxstk} :ul
|
||||
|
||||
[Examples:]
|
||||
|
||||
pair_style hybrid/overlay oxdna_excv oxdna_stk oxdna_hbond oxdna_xstk oxdna_coaxstk
|
||||
pair_coeff * * oxdna_excv 2.0 0.7 0.675 2.0 0.515 0.5 2.0 0.33 0.32
|
||||
pair_coeff * * oxdna_stk 1.61048 6.0 0.4 0.9 0.32 0.6 1.3 0 0.8 0.9 0 0.95 0.9 0 0.95 2.0 0.65 2.0 0.65
|
||||
pair_coeff * * oxdna_hbond 0.0 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45
|
||||
pair_coeff 1 4 oxdna_hbond 1.077 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45
|
||||
pair_coeff 2 3 oxdna_hbond 1.077 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45
|
||||
pair_coeff * * oxdna_xstk 47.5 0.575 0.675 0.495 0.655 2.25 0.791592653589793 0.58 1.7 1.0 0.68 1.7 1.0 0.68 1.5 0 0.65 1.7 0.875 0.68 1.7 0.875 0.68
|
||||
pair_coeff * * oxdna_coaxstk 46.0 0.4 0.6 0.22 0.58 2.0 2.541592653589793 0.65 1.3 0 0.8 0.9 0 0.95 0.9 0 0.95 2.0 -0.65 2.0 -0.65 :pre
|
||||
|
||||
[Description:]
|
||||
|
||||
The {oxdna} pair styles compute the pairwise-additive parts of the oxDNA force field
|
||||
for coarse-grained modelling of DNA. The effective interaction between the nucleotides consists of potentials for the
|
||||
excluded volume interaction {oxdna_excv}, the stacking {oxdna_stk}, cross-stacking {oxdna_xstk}
|
||||
and coaxial stacking interaction {oxdna_coaxstk} as well
|
||||
as the hydrogen-bonding interaction {oxdna_hbond} between complementary pairs of nucleotides on
|
||||
opposite strands.
|
||||
|
||||
The exact functional form of the pair styles is rather complex, which manifests itself in the 144 coefficients
|
||||
in the above example. The individual potentials consist of products of modulation factors,
|
||||
which themselves are constructed from a number of more basic potentials
|
||||
(Morse, Lennard-Jones, harmonic angle and distance) as well as quadratic smoothing and modulation terms.
|
||||
We refer to "(Ouldridge-DPhil)"_#Ouldridge-DPhil and "(Ouldridge)"_#Ouldridge
|
||||
for a detailed description of the oxDNA force field.
|
||||
|
||||
NOTE: These pair styles have to be used together with the related oxDNA bond style
|
||||
{oxdna_fene} for the connectivity of the phosphate backbone (see also documentation of
|
||||
"bond_style oxdna_fene"_bond_oxdna_fene.html). The coefficients
|
||||
in the above example have to be kept fixed and cannot be changed without reparametrizing the entire model.
|
||||
|
||||
Example input and data files can be found in /examples/USER/cgdna/examples/duplex1/ and /duplex2/.
|
||||
A simple python setup tool which creates single straight or helical DNA strands,
|
||||
DNA duplexes or arrays of DNA duplexes can be found in /examples/USER/cgdna/util/.
|
||||
A technical report with more information on the model, the structure of the input file,
|
||||
the setup tool and the performance of the LAMMPS-implementation of oxDNA
|
||||
can be found "here"_PDF/USER-CGDNA-overview.pdf.
|
||||
|
||||
:line
|
||||
|
||||
[Restrictions:]
|
||||
|
||||
These pair styles can only be used if LAMMPS was built with the
|
||||
USER-CGDNA package and the MOLECULE and ASPHERE package. See the "Making
|
||||
LAMMPS"_Section_start.html#start_3 section for more info on packages.
|
||||
|
||||
[Related commands:]
|
||||
|
||||
"bond_style oxdna_fene"_bond_oxdna_fene.html, "fix nve/dotc/langevin"_fix_nve_dotc_langevin.html, "pair_coeff"_pair_coeff.html
|
||||
|
||||
[Default:] none
|
||||
|
||||
:line
|
||||
|
||||
:link(Ouldridge-DPhil)
|
||||
[(Ouldrigde-DPhil)] T.E. Ouldridge, Coarse-grained modelling of DNA and DNA self-assembly, DPhil. University of Oxford (2011).
|
||||
|
||||
:link(Ouldridge)
|
||||
[(Ouldridge)] T.E. Ouldridge, A.A. Louis, J.P.K. Doye, J. Chem. Phys. 134, 085101 (2011).
|
|
@ -0,0 +1,28 @@
|
|||
This directory contains example data and input files
|
||||
and utility scripts for the oxDNA coarse-grained model
|
||||
for DNA.
|
||||
|
||||
/examples/duplex1:
|
||||
Input, data and log files for a DNA duplex (double-stranded DNA)
|
||||
consisiting of 5 base pairs. The duplex contains two strands with
|
||||
complementary base pairs. The topology is
|
||||
|
||||
A - A - A - A - A
|
||||
| | | | |
|
||||
T - T - T - T - T
|
||||
|
||||
/examples/duplex2:
|
||||
Input, data and log files for a nicked DNA duplex (double-stranded DNA)
|
||||
consisiting of 8 base pairs. The duplex contains strands with
|
||||
complementary base pairs, but the backbone on one side is not continuous:
|
||||
two individual strands on one side form a duplex with a longer single
|
||||
strand on the other side. The topology is
|
||||
|
||||
A - A - A - A - A - A - A - A
|
||||
| | | | | | | |
|
||||
T - T - T T - T - T - T - T
|
||||
|
||||
/util:
|
||||
This directory contains a simple python setup tool which creates
|
||||
single straight or helical DNA strands, DNA duplexes or arrays of DNA
|
||||
duplexes.
|
|
@ -0,0 +1,74 @@
|
|||
# LAMMPS data file
|
||||
10 atoms
|
||||
10 ellipsoids
|
||||
8 bonds
|
||||
|
||||
4 atom types
|
||||
1 bond types
|
||||
|
||||
# System size
|
||||
-20.000000 20.000000 xlo xhi
|
||||
-20.000000 20.000000 ylo yhi
|
||||
-20.000000 20.000000 zlo zhi
|
||||
|
||||
# Atom masses for each atom type
|
||||
Masses
|
||||
|
||||
1 3.1575
|
||||
2 3.1575
|
||||
3 3.1575
|
||||
4 3.1575
|
||||
|
||||
# Atom-ID, type, position, molecule-ID, ellipsoid flag, density
|
||||
Atoms
|
||||
|
||||
1 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 1 1 1
|
||||
2 1 1.3274493266864451e-01 -4.2912827978022683e-01 3.7506163469402809e-01 1 1 1
|
||||
3 1 4.8460810659772807e-01 -7.0834970533509178e-01 7.5012326938805618e-01 1 1 1
|
||||
4 1 9.3267359196674593e-01 -7.4012419946742802e-01 1.1251849040820843e+00 1 1 1
|
||||
5 1 1.3204192238113461e+00 -5.1335201721887447e-01 1.5002465387761124e+00 1 1 1
|
||||
6 4 1.9958077618865377e-01 5.1335201721887447e-01 1.5002465387761124e+00 1 1 1
|
||||
7 4 5.8732640803325409e-01 7.4012419946742802e-01 1.1251849040820843e+00 1 1 1
|
||||
8 4 1.0353918934022719e+00 7.0834970533509178e-01 7.5012326938805618e-01 1 1 1
|
||||
9 4 1.3872550673313555e+00 4.2912827978022683e-01 3.7506163469402809e-01 1 1 1
|
||||
10 4 1.5200000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 1 1 1
|
||||
|
||||
# Atom-ID, translational, rotational velocity
|
||||
Velocities
|
||||
|
||||
1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
3 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
6 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
7 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
8 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
9 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
10 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
|
||||
# Atom-ID, shape, quaternion
|
||||
Ellipsoids
|
||||
|
||||
1 1.1739845031423408e+00 1.1739845031423408e+00 1.1739845031423408e+00 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
2 1.1739845031423408e+00 1.1739845031423408e+00 1.1739845031423408e+00 9.5533648912560598e-01 0.0000000000000000e+00 0.0000000000000000e+00 2.9552020666133955e-01
|
||||
3 1.1739845031423408e+00 1.1739845031423408e+00 1.1739845031423408e+00 8.2533561490967822e-01 0.0000000000000000e+00 0.0000000000000000e+00 5.6464247339503526e-01
|
||||
4 1.1739845031423408e+00 1.1739845031423408e+00 1.1739845031423408e+00 6.2160996827066439e-01 0.0000000000000000e+00 0.0000000000000000e+00 7.8332690962748319e-01
|
||||
5 1.1739845031423408e+00 1.1739845031423408e+00 1.1739845031423408e+00 3.6235775447667351e-01 0.0000000000000000e+00 0.0000000000000000e+00 9.3203908596722607e-01
|
||||
6 1.1739845031423408e+00 1.1739845031423408e+00 1.1739845031423408e+00 0.0000000000000000e+00 9.3203908596722607e-01 -3.6235775447667351e-01 0.0000000000000000e+00
|
||||
7 1.1739845031423408e+00 1.1739845031423408e+00 1.1739845031423408e+00 0.0000000000000000e+00 7.8332690962748319e-01 -6.2160996827066439e-01 0.0000000000000000e+00
|
||||
8 1.1739845031423408e+00 1.1739845031423408e+00 1.1739845031423408e+00 0.0000000000000000e+00 5.6464247339503526e-01 -8.2533561490967822e-01 0.0000000000000000e+00
|
||||
9 1.1739845031423408e+00 1.1739845031423408e+00 1.1739845031423408e+00 0.0000000000000000e+00 2.9552020666133955e-01 -9.5533648912560598e-01 0.0000000000000000e+00
|
||||
10 1.1739845031423408e+00 1.1739845031423408e+00 1.1739845031423408e+00 0.0000000000000000e+00 0.0000000000000000e+00 -1.0000000000000000e+00 0.0000000000000000e+00
|
||||
|
||||
# Bond topology
|
||||
Bonds
|
||||
|
||||
1 1 1 2
|
||||
2 1 2 3
|
||||
3 1 3 4
|
||||
4 1 4 5
|
||||
5 1 6 7
|
||||
6 1 7 8
|
||||
7 1 8 9
|
||||
8 1 9 10
|
|
@ -0,0 +1,77 @@
|
|||
variable number equal 1
|
||||
variable ofreq equal 1000
|
||||
variable efreq equal 1000
|
||||
|
||||
units lj
|
||||
|
||||
dimension 3
|
||||
|
||||
newton off
|
||||
|
||||
processors 1 1 1
|
||||
|
||||
boundary p p p
|
||||
|
||||
atom_style hybrid bond ellipsoid
|
||||
atom_modify sort 0 1.0
|
||||
|
||||
# Pair interactions require lists of neighbours to be calculated
|
||||
neighbor 1.0 bin
|
||||
neigh_modify every 1 delay 0 check yes
|
||||
|
||||
read_data data.duplex1
|
||||
|
||||
set atom * mass 3.1575
|
||||
|
||||
group all type 1 4
|
||||
|
||||
# oxDNA bond interactions - FENE backbone
|
||||
bond_style oxdna_fene
|
||||
bond_coeff * 2.0 0.25 0.7525
|
||||
|
||||
# oxDNA pair interactions
|
||||
pair_style hybrid/overlay oxdna_excv oxdna_stk oxdna_hbond oxdna_xstk oxdna_coaxstk
|
||||
pair_coeff * * oxdna_excv 2.0 0.7 0.675 2.0 0.515 0.5 2.0 0.33 0.32
|
||||
pair_coeff * * oxdna_stk 1.61048 6.0 0.4 0.9 0.32 0.6 1.3 0 0.8 0.9 0 0.95 0.9 0 0.95 2.0 0.65 2.0 0.65
|
||||
pair_coeff * * oxdna_hbond 0.0 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45
|
||||
pair_coeff 1 4 oxdna_hbond 1.077 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45
|
||||
pair_coeff 2 3 oxdna_hbond 1.077 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45
|
||||
pair_coeff * * oxdna_xstk 47.5 0.575 0.675 0.495 0.655 2.25 0.791592653589793 0.58 1.7 1.0 0.68 1.7 1.0 0.68 1.5 0 0.65 1.7 0.875 0.68 1.7 0.875 0.68
|
||||
pair_coeff * * oxdna_coaxstk 46.0 0.4 0.6 0.22 0.58 2.0 2.541592653589793 0.65 1.3 0 0.8 0.9 0 0.95 0.9 0 0.95 2.0 -0.65 2.0 -0.65
|
||||
|
||||
# NVE ensemble
|
||||
#fix 1 all nve/dotc/langevin 0.1 0.1 0.03 457145 angmom 10
|
||||
fix 1 all nve/dot
|
||||
|
||||
timestep 1e-5
|
||||
|
||||
#comm_style tiled
|
||||
#fix 3 all balance 10000 1.1 rcb
|
||||
|
||||
#compute mol all chunk/atom molecule
|
||||
#compute mychunk all vcm/chunk mol
|
||||
#fix 4 all ave/time 10000 1 10000 c_mychunk[1] c_mychunk[2] c_mychunk[3] file vcm.txt mode vector
|
||||
|
||||
dump pos all xyz ${ofreq} traj.${number}.xyz
|
||||
|
||||
compute quat all property/atom quatw quati quatj quatk
|
||||
dump quat all custom ${ofreq} quat.${number}.txt id c_quat[1] c_quat[2] c_quat[3] c_quat[4]
|
||||
dump_modify quat sort id
|
||||
dump_modify quat format line "%d %13.6le %13.6le %13.6le %13.6le"
|
||||
|
||||
compute erot all erotate/asphere
|
||||
compute ekin all ke
|
||||
compute epot all pe
|
||||
variable erot equal c_erot
|
||||
variable ekin equal c_ekin
|
||||
variable epot equal c_epot
|
||||
variable etot equal c_erot+c_ekin+c_epot
|
||||
fix 5 all print ${efreq} "$(step) ekin = ${ekin} | erot = ${erot} | epot = ${epot} | etot = ${etot}" screen yes
|
||||
|
||||
dump out all custom ${ofreq} out.${number}.txt id x y z vx vy vz fx fy fz tqx tqy tqz
|
||||
dump_modify out sort id
|
||||
dump_modify out format line "%d %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le"
|
||||
|
||||
run 1000000
|
||||
|
||||
#write_restart config.${number}.*
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,97 @@
|
|||
# LAMMPS data file
|
||||
16 atoms
|
||||
16 ellipsoids
|
||||
13 bonds
|
||||
|
||||
4 atom types
|
||||
1 bond types
|
||||
|
||||
# System size
|
||||
-20.0 20.0 xlo xhi
|
||||
-20.0 20.0 ylo yhi
|
||||
-20.0 20.0 zlo zhi
|
||||
|
||||
# Atom masses for each atom type
|
||||
Masses
|
||||
|
||||
1 3.1575
|
||||
2 3.1575
|
||||
3 3.1575
|
||||
4 3.1575
|
||||
|
||||
# Atom-ID, type, position, molecule-ID, ellipsoid flag, density
|
||||
Atoms
|
||||
|
||||
1 1 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 1 1 1
|
||||
2 1 1.327449326686445e-01 -4.291282797802268e-01 3.750616346940281e-01 1 1 1
|
||||
3 1 4.846081065977281e-01 -7.083497053350921e-01 7.501232693880562e-01 1 1 1
|
||||
4 1 9.326735919667459e-01 -7.401241994674285e-01 1.125184904082084e+00 1 1 1
|
||||
5 1 1.320419223811347e+00 -5.133520172188747e-01 1.500246538776112e+00 1 1 1
|
||||
6 1 1.512394297416339e+00 -1.072512061254991e-01 1.875308173470140e+00 1 1 1
|
||||
7 1 1.441536396413952e+00 3.363155369040876e-01 2.250369808164169e+00 1 1 1
|
||||
8 1 1.132598224218932e+00 6.623975870343269e-01 2.625431442858197e+00 1 1 1
|
||||
9 4 5.873264080332541e-01 7.401241994674285e-01 1.125184904082084e+00 1 1 1
|
||||
10 4 1.035391893402272e+00 7.083497053350921e-01 7.501232693880562e-01 1 1 1
|
||||
11 4 1.387255067331356e+00 4.291282797802267e-01 3.750616346940281e-01 1 1 1
|
||||
12 4 1.520000000000000e+00 1.260981291332700e-33 0.000000000000000e+00 1 1 1
|
||||
13 4 3.874017757810680e-01 -6.623975870343268e-01 2.625431442858197e+00 1 1 1
|
||||
14 4 7.846360358604798e-02 -3.363155369040874e-01 2.250369808164169e+00 1 1 1
|
||||
15 4 7.605702583661333e-03 1.072512061254995e-01 1.875308173470140e+00 1 1 1
|
||||
16 4 1.995807761886533e-01 5.133520172188748e-01 1.500246538776112e+00 1 1 1
|
||||
|
||||
# Atom-ID, translational, rotational velocity
|
||||
Velocities
|
||||
|
||||
1 0.0 0.0 0.0 0.0 0.0 0.0
|
||||
2 0.0 0.0 0.0 0.0 0.0 0.0
|
||||
3 0.0 0.0 0.0 0.0 0.0 0.0
|
||||
4 0.0 0.0 0.0 0.0 0.0 0.0
|
||||
5 0.0 0.0 0.0 0.0 0.0 0.0
|
||||
6 0.0 0.0 0.0 0.0 0.0 0.0
|
||||
7 0.0 0.0 0.0 0.0 0.0 0.0
|
||||
8 0.0 0.0 0.0 0.0 0.0 0.0
|
||||
9 0.0 0.0 0.0 0.0 0.0 0.0
|
||||
10 0.0 0.0 0.0 0.0 0.0 0.0
|
||||
11 0.0 0.0 0.0 0.0 0.0 0.0
|
||||
12 0.0 0.0 0.0 0.0 0.0 0.0
|
||||
13 0.0 0.0 0.0 0.0 0.0 0.0
|
||||
14 0.0 0.0 0.0 0.0 0.0 0.0
|
||||
15 0.0 0.0 0.0 0.0 0.0 0.0
|
||||
16 0.0 0.0 0.0 0.0 0.0 0.0
|
||||
|
||||
# Atom-ID, shape, quaternion
|
||||
Ellipsoids
|
||||
|
||||
1 1.1739845031423408 1.1739845031423408 1.1739845031423408 1.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
|
||||
2 1.1739845031423408 1.1739845031423408 1.1739845031423408 9.553364891256060e-01 0.000000000000000e+00 0.000000000000000e+00 2.955202066613395e-01
|
||||
3 1.1739845031423408 1.1739845031423408 1.1739845031423408 8.253356149096783e-01 0.000000000000000e+00 0.000000000000000e+00 5.646424733950354e-01
|
||||
4 1.1739845031423408 1.1739845031423408 1.1739845031423408 6.216099682706646e-01 0.000000000000000e+00 0.000000000000000e+00 7.833269096274833e-01
|
||||
5 1.1739845031423408 1.1739845031423408 1.1739845031423408 3.623577544766736e-01 0.000000000000000e+00 0.000000000000000e+00 9.320390859672263e-01
|
||||
6 1.1739845031423408 1.1739845031423408 1.1739845031423408 7.073720166770291e-02 0.000000000000000e+00 0.000000000000000e+00 9.974949866040544e-01
|
||||
7 1.1739845031423408 1.1739845031423408 1.1739845031423408 -2.272020946930869e-01 -0.000000000000000e+00 0.000000000000000e+00 9.738476308781953e-01
|
||||
8 1.1739845031423408 1.1739845031423408 1.1739845031423408 -5.048461045998575e-01 -0.000000000000000e+00 0.000000000000000e+00 8.632093666488738e-01
|
||||
9 1.1739845031423408 1.1739845031423408 1.1739845031423408 4.796493962806427e-17 7.833269096274833e-01 -6.216099682706646e-01 3.806263289803786e-17
|
||||
10 1.1739845031423408 1.1739845031423408 1.1739845031423408 5.707093416549944e-17 5.646424733950354e-01 -8.253356149096784e-01 2.218801320830406e-17
|
||||
11 1.1739845031423408 1.1739845031423408 1.1739845031423408 6.107895212550935e-17 2.955202066613394e-01 -9.553364891256061e-01 4.331404380149668e-18
|
||||
12 1.1739845031423408 1.1739845031423408 1.1739845031423408 5.963096920061075e-17 0.000000000000000e+00 -1.000000000000000e+00 -1.391211590127312e-17
|
||||
13 1.1739845031423408 1.1739845031423408 1.1739845031423408 5.285632939302787e-17 8.632093666488739e-01 5.048461045998572e-01 -3.091290830301125e-17
|
||||
14 1.1739845031423408 1.1739845031423408 1.1739845031423408 4.136019110019290e-17 9.738476308781953e-01 2.272020946930868e-01 -4.515234267244800e-17
|
||||
15 1.1739845031423408 1.1739845031423408 1.1739845031423408 2.616947011741696e-17 9.974949866040544e-01 -7.073720166770313e-02 -5.535845274597425e-17
|
||||
16 1.1739845031423408 1.1739845031423408 1.1739845031423408 8.641108308308281e-18 9.320390859672264e-01 -3.623577544766736e-01 -6.061955710708163e-17
|
||||
|
||||
# Bond-ID, type, atom pairs
|
||||
Bonds
|
||||
|
||||
1 1 1 2
|
||||
2 1 2 3
|
||||
3 1 3 4
|
||||
4 1 4 5
|
||||
5 1 5 6
|
||||
6 1 6 7
|
||||
7 1 7 8
|
||||
8 1 13 14
|
||||
9 1 14 15
|
||||
10 1 15 16
|
||||
11 1 9 10
|
||||
12 1 10 11
|
||||
13 1 11 12
|
|
@ -0,0 +1,77 @@
|
|||
variable number equal 2
|
||||
variable ofreq equal 1000
|
||||
variable efreq equal 1000
|
||||
|
||||
units lj
|
||||
|
||||
dimension 3
|
||||
|
||||
newton off
|
||||
|
||||
processors 1 1 1
|
||||
|
||||
boundary p p p
|
||||
|
||||
atom_style hybrid bond ellipsoid
|
||||
atom_modify sort 0 1.0
|
||||
|
||||
# Pair interactions require lists of neighbours to be calculated
|
||||
neighbor 1.0 bin
|
||||
neigh_modify every 1 delay 0 check yes
|
||||
|
||||
read_data data.duplex2
|
||||
|
||||
set atom * mass 3.1575
|
||||
|
||||
group all type 1 4
|
||||
|
||||
# oxDNA bond interactions - FENE backbone
|
||||
bond_style oxdna_fene
|
||||
bond_coeff * 2.0 0.25 0.7525
|
||||
|
||||
# oxDNA pair interactions
|
||||
pair_style hybrid/overlay oxdna_excv oxdna_stk oxdna_hbond oxdna_xstk oxdna_coaxstk
|
||||
pair_coeff * * oxdna_excv 2.0 0.7 0.675 2.0 0.515 0.5 2.0 0.33 0.32
|
||||
pair_coeff * * oxdna_stk 1.61048 6.0 0.4 0.9 0.32 0.6 1.3 0 0.8 0.9 0 0.95 0.9 0 0.95 2.0 0.65 2.0 0.65
|
||||
pair_coeff * * oxdna_hbond 0.0 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45
|
||||
pair_coeff 1 4 oxdna_hbond 1.077 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45
|
||||
pair_coeff 2 3 oxdna_hbond 1.077 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45
|
||||
pair_coeff * * oxdna_xstk 47.5 0.575 0.675 0.495 0.655 2.25 0.791592653589793 0.58 1.7 1.0 0.68 1.7 1.0 0.68 1.5 0 0.65 1.7 0.875 0.68 1.7 0.875 0.68
|
||||
pair_coeff * * oxdna_coaxstk 46.0 0.4 0.6 0.22 0.58 2.0 2.541592653589793 0.65 1.3 0 0.8 0.9 0 0.95 0.9 0 0.95 2.0 -0.65 2.0 -0.65
|
||||
|
||||
# NVE ensemble
|
||||
fix 1 all nve/dotc/langevin 0.1 0.1 0.03 457145 angmom 10
|
||||
#fix 1 all nve/dot
|
||||
|
||||
timestep 1e-5
|
||||
|
||||
#comm_style tiled
|
||||
#fix 3 all balance 10000 1.1 rcb
|
||||
|
||||
#compute mol all chunk/atom molecule
|
||||
#compute mychunk all vcm/chunk mol
|
||||
#fix 4 all ave/time 10000 1 10000 c_mychunk[1] c_mychunk[2] c_mychunk[3] file vcm.txt mode vector
|
||||
|
||||
dump pos all xyz ${ofreq} traj.${number}.xyz
|
||||
|
||||
compute quat all property/atom quatw quati quatj quatk
|
||||
dump quat all custom ${ofreq} quat.${number}.txt id c_quat[1] c_quat[2] c_quat[3] c_quat[4]
|
||||
dump_modify quat sort id
|
||||
dump_modify quat format line "%d %13.6le %13.6le %13.6le %13.6le"
|
||||
|
||||
compute erot all erotate/asphere
|
||||
compute ekin all ke
|
||||
compute epot all pe
|
||||
variable erot equal c_erot
|
||||
variable ekin equal c_ekin
|
||||
variable epot equal c_epot
|
||||
variable etot equal c_erot+c_ekin+c_epot
|
||||
fix 5 all print ${efreq} "$(step) ekin = ${ekin} | erot = ${erot} | epot = ${epot} | etot = ${etot}" screen yes
|
||||
|
||||
dump out all custom ${ofreq} out.${number}.txt id x y z vx vy vz fx fy fz tqx tqy tqz
|
||||
dump_modify out sort id
|
||||
dump_modify out format line "%d %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le"
|
||||
|
||||
run 1000000
|
||||
|
||||
#write_restart config.${number}.*
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,388 @@
|
|||
# Setup tool for oxDNA input in LAMMPS format.
|
||||
|
||||
import math,numpy as np,sys,os
|
||||
|
||||
# system size
|
||||
lxmin = -115.0
|
||||
lxmax = +115.0
|
||||
lymin = -115.0
|
||||
lymax = +115.0
|
||||
lzmin = -115.0
|
||||
lzmax = +115.0
|
||||
|
||||
# rise in z-direction
|
||||
r0 = 0.7
|
||||
|
||||
# definition of single untwisted strand
|
||||
def single():
|
||||
|
||||
strand = inp[1].split(':')
|
||||
|
||||
com_start=strand[0].split(',')
|
||||
|
||||
posx=float(com_start[0])
|
||||
posy=float(com_start[1])
|
||||
posz=float(com_start[2])
|
||||
risex=0
|
||||
risey=0
|
||||
risez=r0
|
||||
|
||||
strandstart=len(nucleotide)+1
|
||||
|
||||
for letter in strand[2]:
|
||||
temp=[]
|
||||
|
||||
temp.append(nt2num[letter])
|
||||
temp.append([posx,posy,posz])
|
||||
vel=[0,0,0,0,0,0]
|
||||
temp.append(vel)
|
||||
temp.append(shape)
|
||||
|
||||
quat=[1,0,0,0]
|
||||
temp.append(quat)
|
||||
|
||||
posx=posx+risex
|
||||
posy=posy+risey
|
||||
posz=posz+risez
|
||||
|
||||
if (len(nucleotide)+1 > strandstart):
|
||||
topology.append([1,len(nucleotide),len(nucleotide)+1])
|
||||
|
||||
nucleotide.append(temp)
|
||||
|
||||
return
|
||||
|
||||
# definition of single twisted strand
|
||||
def single_helix():
|
||||
|
||||
strand = inp[1].split(':')
|
||||
|
||||
com_start=strand[0].split(',')
|
||||
twist=float(strand[1])
|
||||
|
||||
posx = float(com_start[0])
|
||||
posy = float(com_start[1])
|
||||
posz = float(com_start[2])
|
||||
risex=0
|
||||
risey=0
|
||||
risez=math.sqrt(r0**2-4.0*math.sin(0.5*twist)**2)
|
||||
|
||||
dcomh=0.76
|
||||
axisx=dcomh + posx
|
||||
axisy=posy
|
||||
|
||||
strandstart=len(nucleotide)+1
|
||||
quat=[1,0,0,0]
|
||||
|
||||
qrot0=math.cos(0.5*twist)
|
||||
qrot1=0
|
||||
qrot2=0
|
||||
qrot3=math.sin(0.5*twist)
|
||||
|
||||
for letter in strand[2]:
|
||||
temp=[]
|
||||
|
||||
temp.append(nt2num[letter])
|
||||
temp.append([posx,posy,posz])
|
||||
vel=[0,0,0,0,0,0]
|
||||
temp.append(vel)
|
||||
temp.append(shape)
|
||||
|
||||
temp.append(quat)
|
||||
|
||||
quat0 = quat[0]*qrot0 - quat[1]*qrot1 - quat[2]*qrot2 - quat[3]*qrot3
|
||||
quat1 = quat[0]*qrot1 + quat[1]*qrot0 + quat[2]*qrot3 - quat[3]*qrot2
|
||||
quat2 = quat[0]*qrot2 + quat[2]*qrot0 + quat[3]*qrot1 - quat[1]*qrot3
|
||||
quat3 = quat[0]*qrot3 + quat[3]*qrot0 + quat[1]*qrot2 + quat[2]*qrot1
|
||||
|
||||
quat = [quat0,quat1,quat2,quat3]
|
||||
|
||||
posx=axisx - dcomh*(quat[0]**2+quat[1]**2-quat[2]**2-quat[3]**2)
|
||||
posy=axisy - dcomh*(2*(quat[1]*quat[2]+quat[0]*quat[3]))
|
||||
posz=posz+risez
|
||||
|
||||
if (len(nucleotide)+1 > strandstart):
|
||||
topology.append([1,len(nucleotide),len(nucleotide)+1])
|
||||
|
||||
nucleotide.append(temp)
|
||||
|
||||
return
|
||||
|
||||
# definition of twisted duplex
|
||||
def duplex():
|
||||
|
||||
strand = inp[1].split(':')
|
||||
|
||||
com_start=strand[0].split(',')
|
||||
twist=float(strand[1])
|
||||
|
||||
compstrand=[]
|
||||
comptopo=[]
|
||||
|
||||
posx1 = float(com_start[0])
|
||||
posy1 = float(com_start[1])
|
||||
posz1 = float(com_start[2])
|
||||
|
||||
risex=0
|
||||
risey=0
|
||||
risez=math.sqrt(r0**2-4.0*math.sin(0.5*twist)**2)
|
||||
|
||||
dcomh=0.76
|
||||
axisx=dcomh + posx1
|
||||
axisy=posy1
|
||||
|
||||
posx2 = axisx + dcomh
|
||||
posy2 = posy1
|
||||
posz2 = posz1
|
||||
|
||||
strandstart=len(nucleotide)+1
|
||||
|
||||
quat1=[1,0,0,0]
|
||||
quat2=[0,0,-1,0]
|
||||
|
||||
qrot0=math.cos(0.5*twist)
|
||||
qrot1=0
|
||||
qrot2=0
|
||||
qrot3=math.sin(0.5*twist)
|
||||
|
||||
for letter in strand[2]:
|
||||
temp1=[]
|
||||
temp2=[]
|
||||
|
||||
temp1.append(nt2num[letter])
|
||||
temp2.append(compnt2num[letter])
|
||||
|
||||
temp1.append([posx1,posy1,posz1])
|
||||
temp2.append([posx2,posy2,posz2])
|
||||
|
||||
vel=[0,0,0,0,0,0]
|
||||
temp1.append(vel)
|
||||
temp2.append(vel)
|
||||
|
||||
temp1.append(shape)
|
||||
temp2.append(shape)
|
||||
|
||||
temp1.append(quat1)
|
||||
temp2.append(quat2)
|
||||
|
||||
quat1_0 = quat1[0]*qrot0 - quat1[1]*qrot1 - quat1[2]*qrot2 - quat1[3]*qrot3
|
||||
quat1_1 = quat1[0]*qrot1 + quat1[1]*qrot0 + quat1[2]*qrot3 - quat1[3]*qrot2
|
||||
quat1_2 = quat1[0]*qrot2 + quat1[2]*qrot0 + quat1[3]*qrot1 - quat1[1]*qrot3
|
||||
quat1_3 = quat1[0]*qrot3 + quat1[3]*qrot0 + quat1[1]*qrot2 + quat1[2]*qrot1
|
||||
|
||||
quat1 = [quat1_0,quat1_1,quat1_2,quat1_3]
|
||||
|
||||
posx1=axisx - dcomh*(quat1[0]**2+quat1[1]**2-quat1[2]**2-quat1[3]**2)
|
||||
posy1=axisy - dcomh*(2*(quat1[1]*quat1[2]+quat1[0]*quat1[3]))
|
||||
posz1=posz1+risez
|
||||
|
||||
quat2_0 = quat2[0]*qrot0 - quat2[1]*qrot1 - quat2[2]*qrot2 + quat2[3]*qrot3
|
||||
quat2_1 = quat2[0]*qrot1 + quat2[1]*qrot0 - quat2[2]*qrot3 - quat2[3]*qrot2
|
||||
quat2_2 = quat2[0]*qrot2 + quat2[2]*qrot0 + quat2[3]*qrot1 + quat2[1]*qrot3
|
||||
quat2_3 =-quat2[0]*qrot3 + quat2[3]*qrot0 + quat2[1]*qrot2 + quat2[2]*qrot1
|
||||
|
||||
quat2 = [quat2_0,quat2_1,quat2_2,quat2_3]
|
||||
|
||||
posx2=axisx + dcomh*(quat1[0]**2+quat1[1]**2-quat1[2]**2-quat1[3]**2)
|
||||
posy2=axisy + dcomh*(2*(quat1[1]*quat1[2]+quat1[0]*quat1[3]))
|
||||
posz2=posz1
|
||||
|
||||
if (len(nucleotide)+1 > strandstart):
|
||||
topology.append([1,len(nucleotide),len(nucleotide)+1])
|
||||
comptopo.append([1,len(nucleotide)+len(strand[2]),len(nucleotide)+len(strand[2])+1])
|
||||
|
||||
nucleotide.append(temp1)
|
||||
compstrand.append(temp2)
|
||||
|
||||
for ib in range(len(compstrand)):
|
||||
nucleotide.append(compstrand[len(compstrand)-1-ib])
|
||||
|
||||
for ib in range(len(comptopo)):
|
||||
topology.append(comptopo[ib])
|
||||
|
||||
return
|
||||
|
||||
# definition of array of duplexes
|
||||
def duplex_array():
|
||||
|
||||
strand = inp[1].split(':')
|
||||
number=strand[0].split(',')
|
||||
posz1_0 = float(strand[1])
|
||||
twist=float(strand[2])
|
||||
|
||||
nx = int(number[0])
|
||||
ny = int(number[1])
|
||||
|
||||
dx = (lxmax-lxmin)/nx
|
||||
dy = (lymax-lymin)/ny
|
||||
|
||||
risex=0
|
||||
risey=0
|
||||
risez=math.sqrt(r0**2-4.0*math.sin(0.5*twist)**2)
|
||||
dcomh=0.76
|
||||
|
||||
for ix in range(nx):
|
||||
|
||||
axisx=lxmin + dx/2 + ix * dx
|
||||
|
||||
for iy in range(ny):
|
||||
|
||||
axisy=lymin + dy/2 + iy * dy
|
||||
|
||||
compstrand=[]
|
||||
comptopo=[]
|
||||
|
||||
posx1 = axisx - dcomh
|
||||
posy1 = axisy
|
||||
posz1 = posz1_0
|
||||
|
||||
posx2 = axisx + dcomh
|
||||
posy2 = posy1
|
||||
posz2 = posz1
|
||||
|
||||
strandstart=len(nucleotide)+1
|
||||
quat1=[1,0,0,0]
|
||||
quat2=[0,0,-1,0]
|
||||
|
||||
qrot0=math.cos(0.5*twist)
|
||||
qrot1=0
|
||||
qrot2=0
|
||||
qrot3=math.sin(0.5*twist)
|
||||
|
||||
for letter in strand[3]:
|
||||
temp1=[]
|
||||
temp2=[]
|
||||
|
||||
temp1.append(nt2num[letter])
|
||||
temp2.append(compnt2num[letter])
|
||||
|
||||
temp1.append([posx1,posy1,posz1])
|
||||
temp2.append([posx2,posy2,posz2])
|
||||
|
||||
vel=[0,0,0,0,0,0]
|
||||
temp1.append(vel)
|
||||
temp2.append(vel)
|
||||
|
||||
temp1.append(shape)
|
||||
temp2.append(shape)
|
||||
|
||||
temp1.append(quat1)
|
||||
temp2.append(quat2)
|
||||
|
||||
quat1_0 = quat1[0]*qrot0 - quat1[1]*qrot1 - quat1[2]*qrot2 - quat1[3]*qrot3
|
||||
quat1_1 = quat1[0]*qrot1 + quat1[1]*qrot0 + quat1[2]*qrot3 - quat1[3]*qrot2
|
||||
quat1_2 = quat1[0]*qrot2 + quat1[2]*qrot0 + quat1[3]*qrot1 - quat1[1]*qrot3
|
||||
quat1_3 = quat1[0]*qrot3 + quat1[3]*qrot0 + quat1[1]*qrot2 + quat1[2]*qrot1
|
||||
|
||||
quat1 = [quat1_0,quat1_1,quat1_2,quat1_3]
|
||||
|
||||
posx1=axisx - dcomh*(quat1[0]**2+quat1[1]**2-quat1[2]**2-quat1[3]**2)
|
||||
posy1=axisy - dcomh*(2*(quat1[1]*quat1[2]+quat1[0]*quat1[3]))
|
||||
posz1=posz1+risez
|
||||
|
||||
quat2_0 = quat2[0]*qrot0 - quat2[1]*qrot1 - quat2[2]*qrot2 + quat2[3]*qrot3
|
||||
quat2_1 = quat2[0]*qrot1 + quat2[1]*qrot0 - quat2[2]*qrot3 - quat2[3]*qrot2
|
||||
quat2_2 = quat2[0]*qrot2 + quat2[2]*qrot0 + quat2[3]*qrot1 + quat2[1]*qrot3
|
||||
quat2_3 =-quat2[0]*qrot3 + quat2[3]*qrot0 + quat2[1]*qrot2 + quat2[2]*qrot1
|
||||
|
||||
quat2 = [quat2_0,quat2_1,quat2_2,quat2_3]
|
||||
|
||||
posx2=axisx + dcomh*(quat1[0]**2+quat1[1]**2-quat1[2]**2-quat1[3]**2)
|
||||
posy2=axisy + dcomh*(2*(quat1[1]*quat1[2]+quat1[0]*quat1[3]))
|
||||
posz2=posz1
|
||||
|
||||
if (len(nucleotide)+1 > strandstart):
|
||||
topology.append([1,len(nucleotide),len(nucleotide)+1])
|
||||
comptopo.append([1,len(nucleotide)+len(strand[3]),len(nucleotide)+len(strand[3])+1])
|
||||
|
||||
nucleotide.append(temp1)
|
||||
compstrand.append(temp2)
|
||||
|
||||
for ib in range(len(compstrand)):
|
||||
nucleotide.append(compstrand[len(compstrand)-1-ib])
|
||||
|
||||
for ib in range(len(comptopo)):
|
||||
topology.append(comptopo[ib])
|
||||
|
||||
return
|
||||
|
||||
# main part
|
||||
nt2num = {'A':1, 'C':2, 'G':3, 'T':4}
|
||||
compnt2num = {'T':1, 'G':2, 'C':3, 'A':4}
|
||||
shape = [1.1739845031423408,1.1739845031423408,1.1739845031423408]
|
||||
|
||||
nucleotide=[]
|
||||
topology=[]
|
||||
|
||||
seqfile = open(sys.argv[1],'r')
|
||||
|
||||
# process sequence file line by line
|
||||
for line in seqfile:
|
||||
|
||||
inp = line.split()
|
||||
if inp[0] == 'single':
|
||||
single()
|
||||
if inp[0] == 'single_helix':
|
||||
single_helix()
|
||||
if inp[0] == 'duplex':
|
||||
duplex()
|
||||
if inp[0] == 'duplex_array':
|
||||
duplex_array()
|
||||
|
||||
# output atom data in LAMMPS format
|
||||
out = open(sys.argv[2],'w')
|
||||
|
||||
out.write('# LAMMPS data file\n')
|
||||
out.write('%d atoms\n' % len(nucleotide))
|
||||
out.write('%d ellipsoids\n' % len(nucleotide))
|
||||
out.write('%d bonds\n' % len(topology))
|
||||
out.write('\n')
|
||||
out.write('4 atom types\n')
|
||||
out.write('1 bond types\n')
|
||||
out.write('\n')
|
||||
out.write('# System size\n')
|
||||
out.write('%f %f xlo xhi\n' % (lxmin,lxmax))
|
||||
out.write('%f %f ylo yhi\n' % (lymin,lymax))
|
||||
out.write('%f %f zlo zhi\n' % (lzmin,lzmax))
|
||||
out.write('\n')
|
||||
out.write('Masses\n')
|
||||
out.write('\n')
|
||||
out.write('1 3.1575\n')
|
||||
out.write('2 3.1575\n')
|
||||
out.write('3 3.1575\n')
|
||||
out.write('4 3.1575\n')
|
||||
|
||||
out.write('\n')
|
||||
out.write('# Atom-ID, type, position, molecule-ID, ellipsoid flag, density\n')
|
||||
out.write('Atoms\n')
|
||||
out.write('\n')
|
||||
for ib in range(len(nucleotide)):
|
||||
out.write("%d %d %22.16le %22.16le %22.16le 1 1 1\n" % (ib+1,nucleotide[ib][0],nucleotide[ib][1][0],nucleotide[ib][1][1],nucleotide[ib][1][2]))
|
||||
|
||||
out.write('\n')
|
||||
out.write('# Atom-ID, translational, rotational velocity\n')
|
||||
out.write('Velocities\n')
|
||||
out.write('\n')
|
||||
for ib in range(len(nucleotide)):
|
||||
out.write("%d %22.16le %22.16le %22.16le %22.16le %22.16le %22.16le\n" % (ib+1,nucleotide[ib][2][0],nucleotide[ib][2][1],nucleotide[ib][2][2],nucleotide[ib][2][3],nucleotide[ib][2][4],nucleotide[ib][2][5]))
|
||||
|
||||
out.write('\n')
|
||||
out.write('# Atom-ID, shape, quaternion\n')
|
||||
out.write('Ellipsoids\n')
|
||||
out.write('\n')
|
||||
for ib in range(len(nucleotide)):
|
||||
out.write("%d %22.16le %22.16le %22.16le %22.16le %22.16le %22.16le %22.16le\n" % (ib+1,nucleotide[ib][3][0],nucleotide[ib][3][1],nucleotide[ib][3][2],nucleotide[ib][4][0],nucleotide[ib][4][1],nucleotide[ib][4][2],nucleotide[ib][4][3]))
|
||||
|
||||
out.write('\n')
|
||||
out.write('# Bond topology\n')
|
||||
out.write('Bonds\n')
|
||||
out.write('\n')
|
||||
for ib in range(len(topology)):
|
||||
out.write("%d %d %d %d\n" % (ib+1,topology[ib][0],topology[ib][1],topology[ib][2]))
|
||||
|
||||
out.close()
|
||||
|
||||
seqfile.close()
|
||||
sys.exit(0)
|
||||
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
variable number equal 8
|
||||
variable ofreq equal 1000
|
||||
variable efreq equal 1000
|
||||
|
||||
units lj
|
||||
|
||||
dimension 3
|
||||
|
||||
newton off
|
||||
|
||||
processors 1 1 1
|
||||
|
||||
boundary p p p
|
||||
|
||||
atom_style hybrid bond ellipsoid
|
||||
atom_modify sort 0 1.0
|
||||
|
||||
# Pair interactions require lists of neighbours to be calculated
|
||||
neighbor 1.0 bin
|
||||
neigh_modify every 1 delay 0 check yes
|
||||
|
||||
read_data data.duplex2
|
||||
|
||||
set atom * mass 3.1575
|
||||
|
||||
group all type 1 4
|
||||
|
||||
# oxDNA bond interactions - FENE backbone
|
||||
bond_style oxdna_fene
|
||||
bond_coeff * 2.0 0.25 0.7525
|
||||
|
||||
# oxDNA pair interactions
|
||||
pair_style hybrid/overlay oxdna_excv oxdna_stk oxdna_hbond oxdna_xstk oxdna_coaxstk
|
||||
pair_coeff * * oxdna_excv 2.0 0.7 0.675 2.0 0.515 0.5 2.0 0.33 0.32
|
||||
pair_coeff * * oxdna_stk 1.61048 6.0 0.4 0.9 0.32 0.6 1.3 0 0.8 0.9 0 0.95 0.9 0 0.95 2.0 0.65 2.0 0.65
|
||||
pair_coeff * * oxdna_hbond 0.0 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45
|
||||
pair_coeff 1 4 oxdna_hbond 1.077 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45
|
||||
pair_coeff 2 3 oxdna_hbond 1.077 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45
|
||||
pair_coeff * * oxdna_xstk 47.5 0.575 0.675 0.495 0.655 2.25 0.791592653589793 0.58 1.7 1.0 0.68 1.7 1.0 0.68 1.5 0 0.65 1.7 0.875 0.68 1.7 0.875 0.68
|
||||
pair_coeff * * oxdna_coaxstk 46.0 0.4 0.6 0.22 0.58 2.0 2.541592653589793 0.65 1.3 0 0.8 0.9 0 0.95 0.9 0 0.95 2.0 -0.65 2.0 -0.65
|
||||
|
||||
# NVE ensemble
|
||||
#fix 1 all nve/dotc/langevin 0.1 0.1 0.03 457145 angmom 10
|
||||
fix 1 all nve/dot
|
||||
|
||||
timestep 1e-5
|
||||
|
||||
#comm_style tiled
|
||||
#fix 3 all balance 10000 1.1 rcb
|
||||
|
||||
#compute mol all chunk/atom molecule
|
||||
#compute mychunk all vcm/chunk mol
|
||||
#fix 4 all ave/time 10000 1 10000 c_mychunk[1] c_mychunk[2] c_mychunk[3] file vcm.txt mode vector
|
||||
|
||||
#dump pos all xyz ${ofreq} traj.${number}.xyz
|
||||
|
||||
#compute quat all property/atom quatw quati quatj quatk
|
||||
#dump quat all custom ${ofreq} quat.${number}.txt id c_quat[1] c_quat[2] c_quat[3] c_quat[4]
|
||||
#dump_modify quat sort id
|
||||
#dump_modify quat format line "%d %13.6le %13.6le %13.6le %13.6le"
|
||||
|
||||
compute erot all erotate/asphere
|
||||
compute ekin all ke
|
||||
compute epot all pe
|
||||
variable erot equal c_erot
|
||||
variable ekin equal c_ekin
|
||||
variable epot equal c_epot
|
||||
variable etot equal c_erot+c_ekin+c_epot
|
||||
fix 5 all print ${efreq} "$(step) ekin = ${ekin} | erot = ${erot} | epot = ${epot} | etot = ${etot}" screen yes
|
||||
|
||||
dump out all custom ${ofreq} out.${number}.txt id x y z vx vy vz fx fy fz tqx tqy tqz
|
||||
dump_modify out sort id
|
||||
dump_modify out format line "%d %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le %13.6le"
|
||||
|
||||
run 1000000
|
||||
|
||||
#write_restart config.${number}.*
|
|
@ -0,0 +1,4 @@
|
|||
single 0,0,0:0.6:AAAAA
|
||||
single_helix 0,0,0:0.6:AAAAA
|
||||
duplex 0,0,0:0.6:AAAAA
|
||||
duplex_array 10,10:-112.0:0.6:AAAAA
|
|
@ -0,0 +1,69 @@
|
|||
This package contains a LAMMPS implementation of coarse-grained
|
||||
models of DNA, which can be used to model sequence-specific
|
||||
DNA strands.
|
||||
|
||||
See the doc pages and [1,2] for the individual bond and pair styles.
|
||||
The packages contains also a new Langevin-type rigid-body integrator,
|
||||
which has also its own doc page and is explained in [3].
|
||||
|
||||
[1] T. Ouldridge, A. Louis, J. Doye, "Structural, mechanical,
|
||||
and thermodynamic properties of a coarse-grained DNA model",
|
||||
J. Chem. Phys. 134, 085101 (2011).
|
||||
|
||||
[2] T.E. Ouldridge, Coarse-grained modelling of DNA and DNA
|
||||
self-assembly, DPhil. University of Oxford (2011).
|
||||
|
||||
[3] R. Davidchack, T. Ouldridge, M. Tretyakov, "New Langevin and
|
||||
gradient thermostats for rigid body dynamics", J. Chem. Phys. 142,
|
||||
144114 (2015).
|
||||
|
||||
Example input and data files can be found in
|
||||
/examples/USER/cgdna/examples/duplex1/ and /duplex2/.
|
||||
A simple python setup tool which creates single straight or helical DNA
|
||||
strands as well as DNA duplexes and arrays of duplexes can be found in
|
||||
/examples/USER/cgdna/util/.
|
||||
A technical report with more information on the model, the structure
|
||||
of the input and data file, the setup tool and the performance of the
|
||||
LAMMPS-implementation of oxDNA can be found in
|
||||
/doc/src/PDF/USER-CGDNA-overview.pdf.
|
||||
|
||||
IMPORTANT NOTE: This package can only be used if LAMMPS is compiled
|
||||
with the MOLECULE and ASPHERE packages. These should be included
|
||||
in the LAMMPS build by typing "make yes-asphere yes-molecule" prior
|
||||
to the usual compilation (see the "Including/excluding packages"
|
||||
section of the LAMMPS manual).
|
||||
|
||||
The creator of this package is:
|
||||
|
||||
Dr Oliver Henrich
|
||||
University of Edinburgh, UK
|
||||
ohenrich@ph.ed.ac.uk
|
||||
o.henrich@epcc.ed.ac.uk
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
Bond styles provided by this package:
|
||||
|
||||
bond_oxdna_fene.cpp: backbone connectivity, a modified FENE potential
|
||||
|
||||
|
||||
Pair styles provided by this package:
|
||||
|
||||
pair_oxdna_excv.cpp: excluded volume interaction between the nucleotides
|
||||
|
||||
pair_oxdna_stk.cpp: stacking interaction between consecutive nucleotides
|
||||
on the same strand
|
||||
|
||||
pair_oxdna_hbond.cpp: hydrogen-bonding interaction between complementary
|
||||
nucleotides on different strands, e.g. A-T and C-G
|
||||
|
||||
pair_oxdna_xstk.cpp: cross-stacking interaction between nucleotides
|
||||
|
||||
pair_oxdna_coaxstk.cpp: coaxial stacking interaction between nucleotides
|
||||
|
||||
|
||||
Fixes provided by this package:
|
||||
|
||||
fix_nve_dotc_langevin.cpp: fix for Langevin-type rigid body integrator "C"
|
||||
in above Ref. [3]
|
||||
|
||||
fix_nve_dot.cpp: NVE-type rigid body integrator without noise
|
|
@ -0,0 +1,335 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing author: Oliver Henrich (EPCC, University of Edinburgh)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "math.h"
|
||||
#include "stdlib.h"
|
||||
#include "bond_oxdna_fene.h"
|
||||
#include "atom.h"
|
||||
#include "neighbor.h"
|
||||
#include "domain.h"
|
||||
#include "comm.h"
|
||||
#include "update.h"
|
||||
#include "force.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
#include "atom_vec_ellipsoid.h"
|
||||
#include "math_extra.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
BondOxdnaFene::BondOxdnaFene(LAMMPS *lmp) : Bond(lmp)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
BondOxdnaFene::~BondOxdnaFene()
|
||||
{
|
||||
if (allocated) {
|
||||
|
||||
memory->destroy(setflag);
|
||||
memory->destroy(k);
|
||||
memory->destroy(Delta);
|
||||
memory->destroy(r0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
compute function for oxDNA FENE-bond interaction
|
||||
s=sugar-phosphate backbone site, b=base site, st=stacking site
|
||||
------------------------------------------------------------------------- */
|
||||
void BondOxdnaFene::compute(int eflag, int vflag)
|
||||
{
|
||||
int a,b,in,type;
|
||||
double delf[3],delta[3],deltb[3]; // force, torque increment;;
|
||||
double delr[3],ebond,fbond;
|
||||
double rsq,Deltasq,rlogarg;
|
||||
double r,rr0,rr0sq;
|
||||
// distances COM-backbone site
|
||||
double d_cs=-0.24;
|
||||
// vectors COM-backbone site in lab frame
|
||||
double ra_cs[3],rb_cs[3];
|
||||
|
||||
double *qa,ax[3],ay[3],az[3];
|
||||
double *qb,bx[3],by[3],bz[3];
|
||||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
double **torque = atom->torque;
|
||||
|
||||
AtomVecEllipsoid *avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
|
||||
AtomVecEllipsoid::Bonus *bonus = avec->bonus;
|
||||
|
||||
int **bondlist = neighbor->bondlist;
|
||||
int nbondlist = neighbor->nbondlist;
|
||||
int nlocal = atom->nlocal;
|
||||
int newton_bond = force->newton_bond;
|
||||
|
||||
ebond = 0.0;
|
||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
||||
else evflag = 0;
|
||||
|
||||
// loop over FENE bonds
|
||||
|
||||
for (in = 0; in < nbondlist; in++) {
|
||||
|
||||
a = bondlist[in][1];
|
||||
b = bondlist[in][0];
|
||||
type = bondlist[in][2];
|
||||
|
||||
qa=bonus[a].quat;
|
||||
MathExtra::q_to_exyz(qa,ax,ay,az);
|
||||
qb=bonus[b].quat;
|
||||
MathExtra::q_to_exyz(qb,bx,by,bz);
|
||||
|
||||
// vector COM-backbone site a and b
|
||||
ra_cs[0] = d_cs*ax[0];
|
||||
ra_cs[1] = d_cs*ax[1];
|
||||
ra_cs[2] = d_cs*ax[2];
|
||||
rb_cs[0] = d_cs*bx[0];
|
||||
rb_cs[1] = d_cs*bx[1];
|
||||
rb_cs[2] = d_cs*bx[2];
|
||||
|
||||
// vector backbone site b to a
|
||||
delr[0] = x[a][0] + ra_cs[0] - x[b][0] - rb_cs[0];
|
||||
delr[1] = x[a][1] + ra_cs[1] - x[b][1] - rb_cs[1];
|
||||
delr[2] = x[a][2] + ra_cs[2] - x[b][2] - rb_cs[2];
|
||||
rsq = delr[0]*delr[0] + delr[1]*delr[1] + delr[2]*delr[2];
|
||||
r = sqrt(rsq);
|
||||
|
||||
rr0 = r - r0[type];
|
||||
rr0sq = rr0*rr0;
|
||||
Deltasq = Delta[type] * Delta[type];
|
||||
rlogarg = 1.0 - rr0sq/Deltasq;
|
||||
|
||||
// if r -> Delta, then rlogarg < 0.0 which is an error
|
||||
// issue a warning and reset rlogarg = epsilon
|
||||
// if r > 2*Delta something serious is wrong, abort
|
||||
|
||||
if (rlogarg < 0.1) {
|
||||
char str[128];
|
||||
sprintf(str,"FENE bond too long: " BIGINT_FORMAT " "
|
||||
TAGINT_FORMAT " " TAGINT_FORMAT " %g",
|
||||
update->ntimestep,atom->tag[a],atom->tag[b],r);
|
||||
error->warning(FLERR,str,0);
|
||||
if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
|
||||
}
|
||||
|
||||
fbond = -k[type]*rr0/rlogarg/Deltasq/r;
|
||||
delf[0] = delr[0]*fbond;
|
||||
delf[1] = delr[1]*fbond;
|
||||
delf[2] = delr[2]*fbond;
|
||||
|
||||
// energy
|
||||
|
||||
if (eflag) {
|
||||
ebond = -0.5 * k[type]*log(rlogarg);
|
||||
}
|
||||
|
||||
// apply force and torque to each of 2 atoms
|
||||
|
||||
if (newton_bond || a < nlocal) {
|
||||
|
||||
f[a][0] += delf[0];
|
||||
f[a][1] += delf[1];
|
||||
f[a][2] += delf[2];
|
||||
|
||||
MathExtra::cross3(ra_cs,delf,delta);
|
||||
|
||||
torque[a][0] += delta[0];
|
||||
torque[a][1] += delta[1];
|
||||
torque[a][2] += delta[2];
|
||||
|
||||
}
|
||||
|
||||
if (newton_bond || b < nlocal) {
|
||||
|
||||
f[b][0] -= delf[0];
|
||||
f[b][1] -= delf[1];
|
||||
f[b][2] -= delf[2];
|
||||
|
||||
MathExtra::cross3(rb_cs,delf,deltb);
|
||||
|
||||
torque[b][0] -= deltb[0];
|
||||
torque[b][1] -= deltb[1];
|
||||
torque[b][2] -= deltb[2];
|
||||
|
||||
}
|
||||
|
||||
// increment energy and virial
|
||||
if (evflag) ev_tally(a,b,nlocal,newton_bond,ebond,fbond,delr[0],delr[1],delr[2]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void BondOxdnaFene::allocate()
|
||||
{
|
||||
allocated = 1;
|
||||
int n = atom->nbondtypes;
|
||||
|
||||
memory->create(k,n+1,"bond:k");
|
||||
memory->create(Delta,n+1,"bond:Delta");
|
||||
memory->create(r0,n+1,"bond:r0");
|
||||
memory->create(setflag,n+1,"bond:setflag");
|
||||
|
||||
for (int i = 1; i <= n; i++) setflag[i] = 0;
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
set coeffs for one type
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void BondOxdnaFene::coeff(int narg, char **arg)
|
||||
{
|
||||
if (narg != 4) error->all(FLERR,"Incorrect args for bond coefficients in oxdna_fene");
|
||||
if (!allocated) allocate();
|
||||
|
||||
int ilo,ihi;
|
||||
force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi);
|
||||
|
||||
double k_one = force->numeric(FLERR,arg[1]);
|
||||
double Delta_one = force->numeric(FLERR,arg[2]);
|
||||
double r0_one = force->numeric(FLERR,arg[3]);
|
||||
|
||||
int count = 0;
|
||||
|
||||
for (int i = ilo; i <= ihi; i++) {
|
||||
k[i] = k_one;
|
||||
Delta[i] = Delta_one;
|
||||
r0[i] = r0_one;
|
||||
setflag[i] = 1;
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients in oxdna_fene");
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
set special_bond settings and check if valid
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void BondOxdnaFene::init_style()
|
||||
{
|
||||
/* special bonds have to be lj = 0 1 1 and coul = 1 1 1 to exclude
|
||||
the ss excluded volume interaction between nearest neighbours */
|
||||
|
||||
force->special_lj[1] = 0.0;
|
||||
force->special_lj[2] = 1.0;
|
||||
force->special_lj[3] = 1.0;
|
||||
force->special_coul[1] = 1.0;
|
||||
force->special_coul[2] = 1.0;
|
||||
force->special_coul[3] = 1.0;
|
||||
|
||||
fprintf(screen,"Finding 1-2 1-3 1-4 neighbors ...\n"
|
||||
" Special bond factors lj: %-10g %-10g %-10g\n"
|
||||
" Special bond factors coul: %-10g %-10g %-10g\n",
|
||||
force->special_lj[1],force->special_lj[2],force->special_lj[3],
|
||||
force->special_coul[1],force->special_coul[2],force->special_coul[3]);
|
||||
|
||||
if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 || force->special_lj[3] != 1.0 ||
|
||||
force->special_coul[1] != 1.0 || force->special_coul[2] != 1.0 || force->special_coul[3] != 1.0)
|
||||
{
|
||||
if (comm->me == 0)
|
||||
error->warning(FLERR,"Use special bonds lj = 0,1,1 and coul = 1,1,1 with bond style oxdna_fene");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
double BondOxdnaFene::equilibrium_distance(int i)
|
||||
{
|
||||
return r0[i];
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes to restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void BondOxdnaFene::write_restart(FILE *fp)
|
||||
{
|
||||
fwrite(&k[1],sizeof(double),atom->nbondtypes,fp);
|
||||
fwrite(&Delta[1],sizeof(double),atom->nbondtypes,fp);
|
||||
fwrite(&r0[1],sizeof(double),atom->nbondtypes,fp);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 reads from restart file, bcasts
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void BondOxdnaFene::read_restart(FILE *fp)
|
||||
{
|
||||
allocate();
|
||||
|
||||
if (comm->me == 0) {
|
||||
fread(&k[1],sizeof(double),atom->nbondtypes,fp);
|
||||
fread(&Delta[1],sizeof(double),atom->nbondtypes,fp);
|
||||
fread(&r0[1],sizeof(double),atom->nbondtypes,fp);
|
||||
}
|
||||
MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&Delta[1],atom->nbondtypes,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world);
|
||||
|
||||
for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes to data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void BondOxdnaFene::write_data(FILE *fp)
|
||||
{
|
||||
for (int i = 1; i <= atom->nbondtypes; i++)
|
||||
fprintf(fp,"%d %g %g %g\n",i,k[i],r0[i],Delta[i]);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
double BondOxdnaFene::single(int type, double rsq, int i, int j,
|
||||
double &fforce)
|
||||
{
|
||||
double r = sqrt(rsq);
|
||||
double rr0 = r - r0[type];
|
||||
double rr0sq = rr0*rr0;
|
||||
double Deltasq = Delta[type] * Delta[type];
|
||||
double rlogarg = 1.0 - rr0sq/Deltasq;
|
||||
|
||||
// if r -> Delta, then rlogarg < 0.0 which is an error
|
||||
// issue a warning and reset rlogarg = epsilon
|
||||
// if r > 2*Delta something serious is wrong, abort
|
||||
|
||||
if (rlogarg < 0.1) {
|
||||
char str[128];
|
||||
sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %g",
|
||||
update->ntimestep,sqrt(rsq));
|
||||
error->warning(FLERR,str,0);
|
||||
if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
|
||||
}
|
||||
|
||||
double eng = -0.5 * k[type]*log(rlogarg);
|
||||
fforce = -k[type]*rr0/rlogarg/Deltasq/r;
|
||||
|
||||
return eng;
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
/* -*- c++ -*- ----------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing author: Oliver Henrich (EPCC, University of Edinburgh)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef BOND_CLASS
|
||||
|
||||
BondStyle(oxdna_fene,BondOxdnaFene)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_BOND_OXDNA_FENE_H
|
||||
#define LMP_BOND_OXDNA_FENE_H
|
||||
|
||||
#include "stdio.h"
|
||||
#include "bond.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class BondOxdnaFene : public Bond {
|
||||
public:
|
||||
BondOxdnaFene(class LAMMPS *);
|
||||
virtual ~BondOxdnaFene();
|
||||
virtual void compute(int, int);
|
||||
void coeff(int, char **);
|
||||
void init_style();
|
||||
double equilibrium_distance(int);
|
||||
void write_restart(FILE *);
|
||||
void read_restart(FILE *);
|
||||
void write_data(FILE *);
|
||||
double single(int, double, int, int, double &);
|
||||
|
||||
protected:
|
||||
double *k,*Delta,*r0; // FENE
|
||||
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ERROR/WARNING messages:
|
||||
|
||||
W: FENE bond too long: %ld %d %d %g
|
||||
|
||||
A FENE bond has stretched dangerously far. It's interaction strength
|
||||
will be truncated to attempt to prevent the bond from blowing up.
|
||||
|
||||
E: Bad FENE bond
|
||||
|
||||
Two atoms in a FENE bond have become so far apart that the bond cannot
|
||||
be computed.
|
||||
|
||||
E: Incorrect args for bond coefficients
|
||||
|
||||
Self-explanatory. Check the input script or data file.
|
||||
|
||||
W: Use special bonds = 0,1,1 with bond style oxdna
|
||||
|
||||
Most FENE models need this setting for the special_bonds command.
|
||||
|
||||
W: FENE bond too long: %ld %g
|
||||
|
||||
A FENE bond has stretched dangerously far. It's interaction strength
|
||||
will be truncated to attempt to prevent the bond from blowing up.
|
||||
|
||||
*/
|
|
@ -0,0 +1,212 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing author: Oliver Henrich (EPCC, University of Edinburgh)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "fix_nve_dot.h"
|
||||
#include "math_extra.h"
|
||||
#include "atom.h"
|
||||
#include "atom_vec_ellipsoid.h"
|
||||
#include "force.h"
|
||||
#include "update.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace FixConst;
|
||||
using namespace MathExtra;
|
||||
|
||||
#define INERTIA 0.2 // moment of inertia prefactor for ellipsoid
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixNVEDot::FixNVEDot(LAMMPS *lmp, int narg, char **arg) :
|
||||
FixNVE(lmp, narg, arg) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixNVEDot::init()
|
||||
{
|
||||
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
|
||||
if (!avec)
|
||||
error->all(FLERR,"Compute nve/dot requires atom style ellipsoid");
|
||||
|
||||
// check that all particles are finite-size ellipsoids
|
||||
// no point particles allowed, spherical is OK
|
||||
|
||||
int *ellipsoid = atom->ellipsoid;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
for (int i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit)
|
||||
if (ellipsoid[i] < 0)
|
||||
error->one(FLERR,"Fix nve/dot requires extended particles");
|
||||
|
||||
FixNVE::init();
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixNVEDot::initial_integrate(int vflag)
|
||||
{
|
||||
double *shape,*quat;
|
||||
double fquat[4],conjqm[4],inertia[3];
|
||||
|
||||
AtomVecEllipsoid::Bonus *bonus = avec->bonus;
|
||||
int *ellipsoid = atom->ellipsoid;
|
||||
double **x = atom->x;
|
||||
double **v = atom->v;
|
||||
double **f = atom->f;
|
||||
double **angmom = atom->angmom;
|
||||
double **torque = atom->torque;
|
||||
double *rmass = atom->rmass;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
|
||||
|
||||
// set timestep here since dt may have changed or come via rRESPA
|
||||
|
||||
dt = update->dt;
|
||||
dthlf = 0.5 * dt;
|
||||
|
||||
for (int i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit) {
|
||||
|
||||
dthlfm = dthlf / rmass[i];
|
||||
quat = bonus[ellipsoid[i]].quat;
|
||||
shape = bonus[ellipsoid[i]].shape;
|
||||
|
||||
// update momentum by 1/2 step
|
||||
v[i][0] += dthlfm * f[i][0];
|
||||
v[i][1] += dthlfm * f[i][1];
|
||||
v[i][2] += dthlfm * f[i][2];
|
||||
|
||||
// update position by full step
|
||||
x[i][0] += dt * v[i][0];
|
||||
x[i][1] += dt * v[i][1];
|
||||
x[i][2] += dt * v[i][2];
|
||||
|
||||
// convert angular momentum and torque in space frame into
|
||||
// quaternion 4-momentum and 1/2 of 4-torque in body frame
|
||||
vec3_to_vec4(quat,angmom[i],conjqm);
|
||||
conjqm[0] *= 2.0;
|
||||
conjqm[1] *= 2.0;
|
||||
conjqm[2] *= 2.0;
|
||||
conjqm[3] *= 2.0;
|
||||
vec3_to_vec4(quat,torque[i],fquat);
|
||||
|
||||
// update quaternion 4-momentum by 1/2 step
|
||||
conjqm[0] += dt * fquat[0];
|
||||
conjqm[1] += dt * fquat[1];
|
||||
conjqm[2] += dt * fquat[2];
|
||||
conjqm[3] += dt * fquat[3];
|
||||
|
||||
// principal moments of inertia
|
||||
inertia[0] = INERTIA*rmass[i] * (shape[1]*shape[1]+shape[2]*shape[2]);
|
||||
inertia[1] = INERTIA*rmass[i] * (shape[0]*shape[0]+shape[2]*shape[2]);
|
||||
inertia[2] = INERTIA*rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]);
|
||||
|
||||
// rotate quaternion and quaternion 4-momentum by full step
|
||||
no_squish_rotate(3,conjqm,quat,inertia,dthlf);
|
||||
no_squish_rotate(2,conjqm,quat,inertia,dthlf);
|
||||
no_squish_rotate(1,conjqm,quat,inertia,dt);
|
||||
no_squish_rotate(2,conjqm,quat,inertia,dthlf);
|
||||
no_squish_rotate(3,conjqm,quat,inertia,dthlf);
|
||||
|
||||
qnormalize(quat);
|
||||
|
||||
// convert quaternion 4-momentum in body frame back to angular momentum in space frame
|
||||
vec4_to_vec3(quat,conjqm,angmom[i]);
|
||||
|
||||
angmom[i][0] *= 0.5;
|
||||
angmom[i][1] *= 0.5;
|
||||
angmom[i][2] *= 0.5;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixNVEDot::final_integrate()
|
||||
{
|
||||
|
||||
double *shape,*quat;
|
||||
double fquat[4],conjqm[4];
|
||||
double conjqm_dot_quat;
|
||||
|
||||
AtomVecEllipsoid::Bonus *bonus = avec->bonus;
|
||||
int *ellipsoid = atom->ellipsoid;
|
||||
double **v = atom->v;
|
||||
double **f = atom->f;
|
||||
double **angmom = atom->angmom;
|
||||
double **torque = atom->torque;
|
||||
double *rmass = atom->rmass;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
|
||||
|
||||
// set timestep here since dt may have changed or come via rRESPA
|
||||
|
||||
dt = update->dt;
|
||||
dthlf = 0.5 * dt;
|
||||
|
||||
for (int i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit) {
|
||||
|
||||
dthlfm = dthlf / rmass[i];
|
||||
quat = bonus[ellipsoid[i]].quat;
|
||||
shape = bonus[ellipsoid[i]].shape;
|
||||
|
||||
// update momentum
|
||||
v[i][0] += dthlfm * f[i][0];
|
||||
v[i][1] += dthlfm * f[i][1];
|
||||
v[i][2] += dthlfm * f[i][2];
|
||||
|
||||
// convert angular momentum and torque in space frame into
|
||||
// quaternion 4-momentum and 1/2 of 4-torque in body frame
|
||||
vec3_to_vec4(quat,angmom[i],conjqm);
|
||||
conjqm[0] *= 2.0;
|
||||
conjqm[1] *= 2.0;
|
||||
conjqm[2] *= 2.0;
|
||||
conjqm[3] *= 2.0;
|
||||
vec3_to_vec4(quat,torque[i],fquat);
|
||||
|
||||
// update quaternion 4-momentum by 1/2 step
|
||||
conjqm[0] += dt * fquat[0];
|
||||
conjqm[1] += dt * fquat[1];
|
||||
conjqm[2] += dt * fquat[2];
|
||||
conjqm[3] += dt * fquat[3];
|
||||
|
||||
// subtract component parallel to quaternion for improved numerical accuracy
|
||||
conjqm_dot_quat = conjqm[0]*quat[0] + conjqm[1]*quat[1] + conjqm[2]*quat[2] + conjqm[3]*quat[3];
|
||||
|
||||
conjqm[0] -= conjqm_dot_quat * quat[0];
|
||||
conjqm[1] -= conjqm_dot_quat * quat[1];
|
||||
conjqm[2] -= conjqm_dot_quat * quat[2];
|
||||
conjqm[3] -= conjqm_dot_quat * quat[3];
|
||||
|
||||
// convert quaternion 4-momentum in body frame back to angular momentum in space frame
|
||||
vec4_to_vec3(quat,conjqm,angmom[i]);
|
||||
|
||||
angmom[i][0] *= 0.5;
|
||||
angmom[i][1] *= 0.5;
|
||||
angmom[i][2] *= 0.5;
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
/* -*- c++ -*- ----------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef FIX_CLASS
|
||||
|
||||
FixStyle(nve/dot,FixNVEDot)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_FIX_NVE_DOT_H
|
||||
#define LMP_FIX_NVE_DOT_H
|
||||
|
||||
#include "fix_nve.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class FixNVEDot : public FixNVE {
|
||||
public:
|
||||
FixNVEDot(class LAMMPS *, int, char **);
|
||||
void init();
|
||||
void initial_integrate(int);
|
||||
void final_integrate();
|
||||
|
||||
private:
|
||||
double dt,dthlf,dthlfm;
|
||||
class AtomVecEllipsoid *avec;
|
||||
// conversion from 3-vector in space frame to 4-vector in body frame
|
||||
inline void vec3_to_vec4(const double * q, const double * v3, double * v4)
|
||||
{
|
||||
v4[0] = -q[1]*v3[0] - q[2]*v3[1] - q[3]*v3[2];
|
||||
v4[1] = q[0]*v3[0] + q[3]*v3[1] - q[2]*v3[2];
|
||||
v4[2] = -q[3]*v3[0] + q[0]*v3[1] + q[1]*v3[2];
|
||||
v4[3] = q[2]*v3[0] - q[1]*v3[1] + q[0]*v3[2];
|
||||
}
|
||||
// conversion from 4-vector in body frame to 3-vector in space frame
|
||||
inline void vec4_to_vec3(const double * q, const double * v4, double * v3)
|
||||
{
|
||||
v3[0] = -q[1]*v4[0] + q[0]*v4[1] - q[3]*v4[2] + q[2]*v4[3];
|
||||
v3[1] = -q[2]*v4[0] + q[3]*v4[1] + q[0]*v4[2] - q[1]*v4[3];
|
||||
v3[2] = -q[3]*v4[0] - q[2]*v4[1] + q[1]*v4[2] + q[0]*v4[3];
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ERROR/WARNING messages:
|
||||
|
||||
E: Compute nve/dot requires atom style ellipsoid
|
||||
|
||||
Self-explanatory.
|
||||
|
||||
E: Fix nve/dot requires extended particles
|
||||
|
||||
This fix can only be used for particles with a shape setting.
|
||||
|
||||
*/
|
|
@ -0,0 +1,330 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing author: Oliver Henrich (EPCC, University of Edinburgh)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "fix_nve_dotc_langevin.h"
|
||||
#include "math_extra.h"
|
||||
#include "atom.h"
|
||||
#include "atom_vec_ellipsoid.h"
|
||||
#include "force.h"
|
||||
#include "update.h"
|
||||
#include "comm.h"
|
||||
#include "random_mars.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace FixConst;
|
||||
using namespace MathExtra;
|
||||
|
||||
#define INERTIA 0.2 // moment of inertia prefactor for ellipsoid
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixNVEDotcLangevin::FixNVEDotcLangevin(LAMMPS *lmp, int narg, char **arg) :
|
||||
FixNVE(lmp, narg, arg)
|
||||
{
|
||||
if (narg != 9) error->all(FLERR,"Illegal fix nve/dotc/langevin command");
|
||||
|
||||
t_start = force->numeric(FLERR,arg[3]);
|
||||
t_target = t_start;
|
||||
t_stop = force->numeric(FLERR,arg[4]);
|
||||
t_period = force->numeric(FLERR,arg[5]);
|
||||
if (t_period <= 0.0) error->all(FLERR,"Fix nve/dotc/langevin period must be > 0.0");
|
||||
gamma = 1.0/t_period;
|
||||
seed = force->inumeric(FLERR,arg[6]);
|
||||
if (seed <= 0) error->all(FLERR,"Illegal fix nve/dotc/langevin command");
|
||||
|
||||
if (strcmp(arg[7],"angmom") == 0) {
|
||||
if (9 > narg) error->all(FLERR,"Illegal fix nve/dotc/langevin command");
|
||||
if (strcmp(arg[8],"no") == 0) {
|
||||
ascale = 0.0;
|
||||
Gamma = 0.0;
|
||||
}
|
||||
else {
|
||||
ascale = force->numeric(FLERR,arg[8]);
|
||||
Gamma = gamma * ascale;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// initialize Marsaglia RNG with processor-unique seed
|
||||
|
||||
random = new RanMars(lmp,seed + comm->me);
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixNVEDotcLangevin::~FixNVEDotcLangevin()
|
||||
{
|
||||
|
||||
delete random;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixNVEDotcLangevin::init()
|
||||
{
|
||||
|
||||
int *ellipsoid = atom->ellipsoid;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
|
||||
|
||||
if (!avec)
|
||||
error->all(FLERR,"Fix nve/dotc/langevin requires atom style ellipsoid");
|
||||
|
||||
for (int i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit)
|
||||
if (ellipsoid[i] < 0)
|
||||
error->one(FLERR,"Fix nve/dotc/langevin requires extended particles");
|
||||
|
||||
|
||||
// set prefactor
|
||||
gfactor1 = exp(-gamma*update->dt);
|
||||
|
||||
// set square root of temperature
|
||||
compute_target();
|
||||
|
||||
FixNVE::init();
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
set current t_target and t_sqrt
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixNVEDotcLangevin::compute_target()
|
||||
{
|
||||
double delta = update->ntimestep - update->beginstep;
|
||||
if (delta != 0.0) delta /= update->endstep - update->beginstep;
|
||||
|
||||
// Only homogeneous temperature supported
|
||||
t_target = t_start + delta * (t_stop-t_start);
|
||||
tsqrt = sqrt(t_target);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixNVEDotcLangevin::initial_integrate(int vflag)
|
||||
{
|
||||
double *shape,*quat;
|
||||
double fquat[4],conjqm[4],inertia[3];
|
||||
double slq_conjqm[3];
|
||||
|
||||
AtomVecEllipsoid::Bonus *bonus = avec->bonus;
|
||||
int *ellipsoid = atom->ellipsoid;
|
||||
double **x = atom->x;
|
||||
double **v = atom->v;
|
||||
double **f = atom->f;
|
||||
double **angmom = atom->angmom;
|
||||
double **torque = atom->torque;
|
||||
double *rmass = atom->rmass;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
|
||||
|
||||
// set timestep here since dt may have changed or come via rRESPA
|
||||
|
||||
dt = update->dt;
|
||||
dthlf = 0.5 * dt;
|
||||
dtqrt = 0.25 * dt;
|
||||
|
||||
// set square root of temperature
|
||||
compute_target();
|
||||
|
||||
for (int i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit) {
|
||||
|
||||
dthlfm = dthlf / rmass[i];
|
||||
quat = bonus[ellipsoid[i]].quat;
|
||||
shape = bonus[ellipsoid[i]].shape;
|
||||
|
||||
// update momentum by 1/2 step
|
||||
v[i][0] += dthlfm * f[i][0];
|
||||
v[i][1] += dthlfm * f[i][1];
|
||||
v[i][2] += dthlfm * f[i][2];
|
||||
|
||||
// update position by 1/2 step
|
||||
x[i][0] += dthlf * v[i][0];
|
||||
x[i][1] += dthlf * v[i][1];
|
||||
x[i][2] += dthlf * v[i][2];
|
||||
|
||||
// convert angular momentum and torque in space frame into
|
||||
// quaternion 4-momentum and 1/2 of 4-torque in body frame
|
||||
vec3_to_vec4(quat,angmom[i],conjqm);
|
||||
conjqm[0] *= 2.0;
|
||||
conjqm[1] *= 2.0;
|
||||
conjqm[2] *= 2.0;
|
||||
conjqm[3] *= 2.0;
|
||||
vec3_to_vec4(quat,torque[i],fquat);
|
||||
|
||||
// update quaternion 4-momentum by 1/2 step
|
||||
conjqm[0] += dt * fquat[0];
|
||||
conjqm[1] += dt * fquat[1];
|
||||
conjqm[2] += dt * fquat[2];
|
||||
conjqm[3] += dt * fquat[3];
|
||||
|
||||
// principal moments of inertia
|
||||
inertia[0] = INERTIA*rmass[i] * (shape[1]*shape[1]+shape[2]*shape[2]);
|
||||
inertia[1] = INERTIA*rmass[i] * (shape[0]*shape[0]+shape[2]*shape[2]);
|
||||
inertia[2] = INERTIA*rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]);
|
||||
|
||||
M = inertia[0]*inertia[1]*inertia[2];
|
||||
M /= inertia[1]*inertia[2]+inertia[0]*inertia[2]+inertia[0]*inertia[1];
|
||||
|
||||
// set prefactors
|
||||
// factors 12 and 48 reflect the variance of the uniform distribution:
|
||||
// var = 1/12*(b-a)^2
|
||||
gfactor2 = sqrt(12.0*(1.0-gfactor1*gfactor1)/rmass[i])*tsqrt;
|
||||
|
||||
gfactor3[0] = exp(-Gamma*M*dt/inertia[0]);
|
||||
gfactor3[1] = exp(-Gamma*M*dt/inertia[1]);
|
||||
gfactor3[2] = exp(-Gamma*M*dt/inertia[2]);
|
||||
|
||||
gfactor4[0] = sqrt(48.0*inertia[0]*(1.0-gfactor3[0]*gfactor3[0]))*tsqrt;
|
||||
gfactor4[1] = sqrt(48.0*inertia[1]*(1.0-gfactor3[1]*gfactor3[1]))*tsqrt;
|
||||
gfactor4[2] = sqrt(48.0*inertia[2]*(1.0-gfactor3[2]*gfactor3[2]))*tsqrt;
|
||||
|
||||
// rotate quaternion and quaternion 4-momentum by 1/2 step
|
||||
no_squish_rotate(3,conjqm,quat,inertia,dtqrt);
|
||||
no_squish_rotate(2,conjqm,quat,inertia,dtqrt);
|
||||
no_squish_rotate(1,conjqm,quat,inertia,dthlf);
|
||||
no_squish_rotate(2,conjqm,quat,inertia,dtqrt);
|
||||
no_squish_rotate(3,conjqm,quat,inertia,dtqrt);
|
||||
|
||||
// apply stochastic force to velocities
|
||||
v[i][0] = v[i][0] * gfactor1 + gfactor2 * (random->uniform()-0.5);
|
||||
v[i][1] = v[i][1] * gfactor1 + gfactor2 * (random->uniform()-0.5);
|
||||
v[i][2] = v[i][2] * gfactor1 + gfactor2 * (random->uniform()-0.5);
|
||||
|
||||
// update position by 1/2 step
|
||||
x[i][0] += dthlf * v[i][0];
|
||||
x[i][1] += dthlf * v[i][1];
|
||||
x[i][2] += dthlf * v[i][2];
|
||||
|
||||
// apply stochastic force to quaternion 4-momentum
|
||||
slq_conjqm[0] = -quat[1]*conjqm[0] + quat[0]*conjqm[1] + quat[3]*conjqm[2] - quat[2]*conjqm[3];
|
||||
slq_conjqm[1] = -quat[2]*conjqm[0] - quat[3]*conjqm[1] + quat[0]*conjqm[2] + quat[1]*conjqm[3];
|
||||
slq_conjqm[2] = -quat[3]*conjqm[0] + quat[2]*conjqm[1] - quat[1]*conjqm[2] + quat[0]*conjqm[3];
|
||||
|
||||
gfactor5[0] = gfactor3[0] * slq_conjqm[0] + gfactor4[0] * (random->uniform()-0.5);
|
||||
gfactor5[1] = gfactor3[1] * slq_conjqm[1] + gfactor4[1] * (random->uniform()-0.5);
|
||||
gfactor5[2] = gfactor3[2] * slq_conjqm[2] + gfactor4[2] * (random->uniform()-0.5);
|
||||
|
||||
conjqm[0] = -quat[1] * gfactor5[0] - quat[2] * gfactor5[1] - quat[3] * gfactor5[2];
|
||||
conjqm[1] = quat[0] * gfactor5[0] - quat[3] * gfactor5[1] + quat[2] * gfactor5[2];
|
||||
conjqm[2] = quat[3] * gfactor5[0] + quat[0] * gfactor5[1] - quat[1] * gfactor5[2];
|
||||
conjqm[3] = -quat[2] * gfactor5[0] + quat[1] * gfactor5[1] + quat[0] * gfactor5[2];
|
||||
|
||||
// rotate quaternion and quaternion 4-momentum by 1/2 step
|
||||
no_squish_rotate(3,conjqm,quat,inertia,dtqrt);
|
||||
no_squish_rotate(2,conjqm,quat,inertia,dtqrt);
|
||||
no_squish_rotate(1,conjqm,quat,inertia,dthlf);
|
||||
no_squish_rotate(2,conjqm,quat,inertia,dtqrt);
|
||||
no_squish_rotate(3,conjqm,quat,inertia,dtqrt);
|
||||
qnormalize(quat);
|
||||
|
||||
// convert quaternion 4-momentum in body frame back to angular momentum in space frame
|
||||
vec4_to_vec3(quat,conjqm,angmom[i]);
|
||||
|
||||
angmom[i][0] *= 0.5;
|
||||
angmom[i][1] *= 0.5;
|
||||
angmom[i][2] *= 0.5;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixNVEDotcLangevin::final_integrate()
|
||||
{
|
||||
|
||||
double *shape,*quat;
|
||||
double fquat[4],conjqm[4];
|
||||
double conjqm_dot_quat;
|
||||
|
||||
AtomVecEllipsoid::Bonus *bonus = avec->bonus;
|
||||
int *ellipsoid = atom->ellipsoid;
|
||||
double **v = atom->v;
|
||||
double **f = atom->f;
|
||||
double **angmom = atom->angmom;
|
||||
double **torque = atom->torque;
|
||||
double *rmass = atom->rmass;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
|
||||
|
||||
// set timestep here since dt may have changed or come via rRESPA
|
||||
|
||||
dt = update->dt;
|
||||
dthlf = 0.5 * dt;
|
||||
|
||||
for (int i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit) {
|
||||
|
||||
dthlfm = dthlf / rmass[i];
|
||||
quat = bonus[ellipsoid[i]].quat;
|
||||
shape = bonus[ellipsoid[i]].shape;
|
||||
|
||||
// update momentum by 1/2 step
|
||||
v[i][0] += dthlfm * f[i][0];
|
||||
v[i][1] += dthlfm * f[i][1];
|
||||
v[i][2] += dthlfm * f[i][2];
|
||||
|
||||
// convert angular momentum and torque in space frame into
|
||||
// quaternion 4-momentum and 1/2 of 4-torque in body frame
|
||||
vec3_to_vec4(quat,angmom[i],conjqm);
|
||||
conjqm[0] *= 2.0;
|
||||
conjqm[1] *= 2.0;
|
||||
conjqm[2] *= 2.0;
|
||||
conjqm[3] *= 2.0;
|
||||
vec3_to_vec4(quat,torque[i],fquat);
|
||||
|
||||
// update quaternion 4-momentum by 1/2 step
|
||||
conjqm[0] += dt * fquat[0];
|
||||
conjqm[1] += dt * fquat[1];
|
||||
conjqm[2] += dt * fquat[2];
|
||||
conjqm[3] += dt * fquat[3];
|
||||
|
||||
// subtract component parallel to quaternion for improved numerical accuracy
|
||||
|
||||
conjqm_dot_quat = conjqm[0]*quat[0] + conjqm[1]*quat[1] + conjqm[2]*quat[2] + conjqm[3]*quat[3];
|
||||
|
||||
conjqm[0] -= conjqm_dot_quat * quat[0];
|
||||
conjqm[1] -= conjqm_dot_quat * quat[1];
|
||||
conjqm[2] -= conjqm_dot_quat * quat[2];
|
||||
conjqm[3] -= conjqm_dot_quat * quat[3];
|
||||
|
||||
// convert quaternion 4-momentum in body frame back to angular momentum in space frame
|
||||
vec4_to_vec3(quat,conjqm,angmom[i]);
|
||||
|
||||
angmom[i][0] *= 0.5;
|
||||
angmom[i][1] *= 0.5;
|
||||
angmom[i][2] *= 0.5;
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
/* -*- c++ -*- ----------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef FIX_CLASS
|
||||
|
||||
FixStyle(nve/dotc/langevin,FixNVEDotcLangevin)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_FIX_NVE_DOTC_LANGEVIN_H
|
||||
#define LMP_FIX_NVE_DOTC_LANGEVIN_H
|
||||
|
||||
#include "fix_nve.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class FixNVEDotcLangevin : public FixNVE {
|
||||
public:
|
||||
FixNVEDotcLangevin(class LAMMPS *, int, char **);
|
||||
virtual ~FixNVEDotcLangevin();
|
||||
void init();
|
||||
void initial_integrate(int);
|
||||
void final_integrate();
|
||||
|
||||
private:
|
||||
double dt,dthlf,dthlfm,dtqrt;
|
||||
// conversion from 3-vector in space frame to 4-vector in body frame
|
||||
inline void vec3_to_vec4(const double * q, const double * v3, double * v4)
|
||||
{
|
||||
v4[0] = -q[1]*v3[0] - q[2]*v3[1] - q[3]*v3[2];
|
||||
v4[1] = q[0]*v3[0] + q[3]*v3[1] - q[2]*v3[2];
|
||||
v4[2] = -q[3]*v3[0] + q[0]*v3[1] + q[1]*v3[2];
|
||||
v4[3] = q[2]*v3[0] - q[1]*v3[1] + q[0]*v3[2];
|
||||
}
|
||||
// conversion from 4-vector in body frame to 3-vector in space frame
|
||||
inline void vec4_to_vec3(const double * q, const double * v4, double * v3)
|
||||
{
|
||||
v3[0] = -q[1]*v4[0] + q[0]*v4[1] - q[3]*v4[2] + q[2]*v4[3];
|
||||
v3[1] = -q[2]*v4[0] + q[3]*v4[1] + q[0]*v4[2] - q[1]*v4[3];
|
||||
v3[2] = -q[3]*v4[0] - q[2]*v4[1] + q[1]*v4[2] + q[0]*v4[3];
|
||||
}
|
||||
protected:
|
||||
int seed;
|
||||
class AtomVecEllipsoid *avec;
|
||||
double t_start,t_stop,t_period,t_target,tsqrt;
|
||||
double gamma,Gamma,ascale;
|
||||
double M,gfactor1,gfactor2;
|
||||
double gfactor3[3],gfactor4[3],gfactor5[3];
|
||||
class RanMars *random;
|
||||
void compute_target();
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ERROR/WARNING messages:
|
||||
|
||||
E: Compute nve/dotc/langevin requires atom style ellipsoid
|
||||
|
||||
Self-explanatory.
|
||||
|
||||
E: Fix nve/dotc/langevin requires extended particles
|
||||
|
||||
This fix can only be used for particles with a shape setting.
|
||||
|
||||
*/
|
|
@ -0,0 +1,261 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing author: Oliver Henrich (EPCC, University of Edinburgh)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifndef MF_OXDNA_H
|
||||
#define MF_OXDNA_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include "math_extra.h"
|
||||
|
||||
namespace MFOxdna {
|
||||
|
||||
inline double F1(double, double, double, double, double, double, double, double, double, double, double);
|
||||
inline double DF1(double, double, double, double, double, double, double, double, double, double);
|
||||
inline double F2(double, double, double, double, double, double, double, double, double, double);
|
||||
inline double DF2(double, double, double, double, double, double, double, double, double);
|
||||
inline double F3(double, double, double, double, double, double, double, double &);
|
||||
inline double F4(double, double, double, double, double, double);
|
||||
inline double DF4(double, double, double, double, double, double);
|
||||
inline double F5(double, double, double, double, double);
|
||||
inline double DF5(double, double, double, double, double);
|
||||
inline double is_3pto5p(const double *, const double *);
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
f1 modulation factor
|
||||
------------------------------------------------------------------------- */
|
||||
inline double MFOxdna::F1(double r, double eps, double a, double cut_0,
|
||||
double cut_lc, double cut_hc, double cut_lo, double cut_hi,
|
||||
double b_lo, double b_hi, double shift)
|
||||
{
|
||||
|
||||
if (r > cut_hc) {
|
||||
return 0.0;
|
||||
}
|
||||
else if (r > cut_hi) {
|
||||
return eps * b_hi * (r-cut_hc) * (r-cut_hc);
|
||||
}
|
||||
else if (r > cut_lo) {
|
||||
double tmp = 1 - exp(-(r-cut_0) * a);
|
||||
return eps * tmp * tmp - shift;
|
||||
}
|
||||
else if (r > cut_lc) {
|
||||
return eps * b_lo * (r-cut_lc) * (r-cut_lc);
|
||||
}
|
||||
else {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
derivative of f1 modulation factor
|
||||
------------------------------------------------------------------------- */
|
||||
inline double MFOxdna::DF1(double r, double eps, double a, double cut_0,
|
||||
double cut_lc, double cut_hc, double cut_lo, double cut_hi,
|
||||
double b_lo, double b_hi)
|
||||
{
|
||||
|
||||
if (r > cut_hc) {
|
||||
return 0.0;
|
||||
}
|
||||
else if (r > cut_hi) {
|
||||
return 2 * eps * b_hi * (1 - cut_hc / r);
|
||||
}
|
||||
else if (r > cut_lo) {
|
||||
double tmp = exp(-(r-cut_0) * a);
|
||||
return 2 * eps * (1 - tmp) * tmp * a / r;
|
||||
}
|
||||
else if (r > cut_lc) {
|
||||
return 2 * eps * b_lo * (1 - cut_lc / r);
|
||||
}
|
||||
else {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
f2 modulation factor
|
||||
------------------------------------------------------------------------- */
|
||||
inline double MFOxdna::F2(double r, double k, double cut_0,
|
||||
double cut_lc, double cut_hc, double cut_lo, double cut_hi,
|
||||
double b_lo, double b_hi, double cut_c)
|
||||
{
|
||||
|
||||
if(r < cut_lc || r > cut_hc){
|
||||
return 0;
|
||||
}
|
||||
else if(r < cut_lo){
|
||||
return k * b_lo * (cut_lc - r)*(cut_lc-r);
|
||||
}
|
||||
else if(r < cut_hi){
|
||||
return k * 0.5 * ((r - cut_0)*(r-cut_0) - (cut_0 - cut_c)*(cut_0 - cut_c));
|
||||
}
|
||||
else{
|
||||
return k * b_hi * (cut_hc - r) * (cut_hc - r);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
derivative of f2 modulation factor
|
||||
------------------------------------------------------------------------- */
|
||||
inline double MFOxdna::DF2(double r, double k, double cut_0,
|
||||
double cut_lc, double cut_hc, double cut_lo, double cut_hi,
|
||||
double b_lo, double b_hi)
|
||||
{
|
||||
if(r < cut_lc || r > cut_hc){
|
||||
return 0;
|
||||
}
|
||||
else if(r < cut_lo){
|
||||
return 2*k * b_lo * (r - cut_lc);
|
||||
}
|
||||
else if(r < cut_hi){
|
||||
return k * (r - cut_0);
|
||||
}
|
||||
else{
|
||||
return 2*k * b_hi * (r - cut_hc);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
f3 modulation factor, force and energy calculation
|
||||
------------------------------------------------------------------------- */
|
||||
inline double MFOxdna::F3(double rsq, double cutsq_ast, double cut_c,
|
||||
double lj1, double lj2, double eps, double b, double & fpair)
|
||||
{
|
||||
double evdwl = 0.0;
|
||||
|
||||
if (rsq < cutsq_ast) {
|
||||
double r2inv = 1.0/rsq;
|
||||
double r6inv = r2inv*r2inv*r2inv;
|
||||
fpair = r2inv*r6inv*(12*lj1*r6inv - 6*lj2);
|
||||
evdwl = r6inv*(lj1*r6inv-lj2);
|
||||
}
|
||||
else {
|
||||
double r = sqrt(rsq);
|
||||
double rinv = 1.0/r;
|
||||
fpair = 2*eps*b*(cut_c*rinv - 1);
|
||||
evdwl = eps*b*(cut_c-r)*(cut_c-r);
|
||||
}
|
||||
return evdwl;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
f4 modulation factor
|
||||
------------------------------------------------------------------------- */
|
||||
inline double MFOxdna::F4(double theta, double a, double theta_0,
|
||||
double dtheta_ast, double b, double dtheta_c)
|
||||
{
|
||||
double dtheta = theta-theta_0;
|
||||
|
||||
if (fabs(dtheta) > dtheta_c) {
|
||||
return 0.0;
|
||||
}
|
||||
else if (dtheta > dtheta_ast) {
|
||||
return b * (dtheta-dtheta_c)*(dtheta-dtheta_c);
|
||||
}
|
||||
else if(dtheta > -dtheta_ast) {
|
||||
return 1 - a * dtheta*dtheta;
|
||||
}
|
||||
else {
|
||||
return b * (dtheta+dtheta_c)*(dtheta+dtheta_c);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
derivative of f4 modulation factor
|
||||
|
||||
NOTE: We handle the sin(theta) factor from the partial derivative
|
||||
of d(cos(theta))/dtheta externally. The reason for this is
|
||||
because the sign of DF4 depends on the sign of theta in the
|
||||
function call. It is also more efficient to store sin(theta).
|
||||
------------------------------------------------------------------------- */
|
||||
inline double MFOxdna::DF4(double theta, double a, double theta_0,
|
||||
double dtheta_ast, double b, double dtheta_c)
|
||||
{
|
||||
double dtheta = theta-theta_0;
|
||||
|
||||
if (fabs(dtheta) > dtheta_c) {
|
||||
return 0.0;
|
||||
}
|
||||
else if (dtheta > dtheta_ast) {
|
||||
return 2*b* (dtheta-dtheta_c);
|
||||
}
|
||||
else if (dtheta > -dtheta_ast) {
|
||||
return -2*a * dtheta;
|
||||
}
|
||||
else {
|
||||
return 2*b* (dtheta+dtheta_c);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
f5 modulation factor
|
||||
------------------------------------------------------------------------- */
|
||||
inline double MFOxdna::F5(double x, double a, double x_ast,
|
||||
double b, double x_c)
|
||||
{
|
||||
|
||||
if (x >= 0) {
|
||||
return 1.0;
|
||||
}
|
||||
else if (x > x_ast) {
|
||||
return 1 - a * x * x;
|
||||
}
|
||||
else if (x > x_c) {
|
||||
return b * (x-x_c) * (x-x_c);
|
||||
}
|
||||
else {
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
derivative of f5 modulation factor
|
||||
------------------------------------------------------------------------- */
|
||||
inline double MFOxdna::DF5(double x, double a, double x_ast,
|
||||
double b, double x_c)
|
||||
{
|
||||
if(x >= 0) {
|
||||
return 0.0;
|
||||
}
|
||||
else if (x > x_ast) {
|
||||
return -2 * a * x;
|
||||
}
|
||||
else if(x > x_c) {
|
||||
return 2 * b * (x-x_c);
|
||||
}
|
||||
else {
|
||||
return 0.0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
test for directionality by projecting base normal n onto delr,
|
||||
returns 1 if nucleotide a to nucleotide b is 3' to 5', otherwise -1
|
||||
------------------------------------------------------------------------- */
|
||||
inline double MFOxdna::is_3pto5p(const double * delr, const double * n)
|
||||
{
|
||||
return copysign(1.0,MathExtra::dot3(delr,n));
|
||||
}
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,89 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing author: Oliver Henrich (EPCC, University of Edinburgh)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef PAIR_CLASS
|
||||
|
||||
PairStyle(oxdna_coaxstk,PairOxdnaCoaxstk)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_PAIR_OXDNA_COAXSTK_H
|
||||
#define LMP_PAIR_OXDNA_COAXSTK_H
|
||||
|
||||
#include "pair.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairOxdnaCoaxstk : public Pair {
|
||||
public:
|
||||
PairOxdnaCoaxstk(class LAMMPS *);
|
||||
virtual ~PairOxdnaCoaxstk();
|
||||
virtual void compute(int, int);
|
||||
void settings(int, char **);
|
||||
void coeff(int, char **);
|
||||
void init_style();
|
||||
void init_list(int, class NeighList *);
|
||||
double init_one(int, int);
|
||||
void write_restart(FILE *);
|
||||
void read_restart(FILE *);
|
||||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
void write_data(FILE *);
|
||||
void write_data_all(FILE *);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
// coaxial stacking interaction
|
||||
double **k_cxst, **cut_cxst_0, **cut_cxst_c, **cut_cxst_lo, **cut_cxst_hi;
|
||||
double **cut_cxst_lc, **cut_cxst_hc, **b_cxst_lo, **b_cxst_hi;
|
||||
double **cutsq_cxst_hc;
|
||||
|
||||
double **a_cxst1, **theta_cxst1_0, **dtheta_cxst1_ast;
|
||||
double **b_cxst1, **dtheta_cxst1_c;
|
||||
|
||||
double **a_cxst4, **theta_cxst4_0, **dtheta_cxst4_ast;
|
||||
double **b_cxst4, **dtheta_cxst4_c;
|
||||
|
||||
double **a_cxst5, **theta_cxst5_0, **dtheta_cxst5_ast;
|
||||
double **b_cxst5, **dtheta_cxst5_c;
|
||||
|
||||
double **a_cxst6, **theta_cxst6_0, **dtheta_cxst6_ast;
|
||||
double **b_cxst6, **dtheta_cxst6_c;
|
||||
|
||||
double **a_cxst3p, **cosphi_cxst3p_ast, **b_cxst3p, **cosphi_cxst3p_c;
|
||||
double **a_cxst4p, **cosphi_cxst4p_ast, **b_cxst4p, **cosphi_cxst4p_c;
|
||||
|
||||
virtual void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ERROR/WARNING messages:
|
||||
|
||||
E: Illegal ... command
|
||||
|
||||
Self-explanatory. Check the input script syntax and compare to the
|
||||
documentation for the command. You can use -echo screen as a
|
||||
command-line option when running LAMMPS to see the offending line.
|
||||
|
||||
E: Incorrect args for pair coefficients
|
||||
|
||||
Self-explanatory. Check the input script or data file.
|
||||
|
||||
*/
|
|
@ -0,0 +1,840 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing author: Oliver Henrich (EPCC, University of Edinburgh)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "math.h"
|
||||
#include "stdio.h"
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
#include "pair_oxdna_excv.h"
|
||||
#include "mf_oxdna.h"
|
||||
#include "atom.h"
|
||||
#include "comm.h"
|
||||
#include "force.h"
|
||||
#include "neighbor.h"
|
||||
#include "neigh_list.h"
|
||||
#include "neigh_request.h"
|
||||
#include "update.h"
|
||||
#include "integrate.h"
|
||||
#include "math_const.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
#include "atom_vec_ellipsoid.h"
|
||||
#include "math_extra.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace MathConst;
|
||||
using namespace MFOxdna;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairOxdnaExcv::PairOxdnaExcv(LAMMPS *lmp) : Pair(lmp)
|
||||
{
|
||||
single_enable = 0;
|
||||
writedata = 1;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairOxdnaExcv::~PairOxdnaExcv()
|
||||
{
|
||||
if (allocated) {
|
||||
|
||||
memory->destroy(setflag);
|
||||
memory->destroy(cutsq);
|
||||
|
||||
memory->destroy(epsilon_ss);
|
||||
memory->destroy(sigma_ss);
|
||||
memory->destroy(cut_ss_ast);
|
||||
memory->destroy(b_ss);
|
||||
memory->destroy(cut_ss_c);
|
||||
memory->destroy(lj1_ss);
|
||||
memory->destroy(lj2_ss);
|
||||
memory->destroy(cutsq_ss_ast);
|
||||
memory->destroy(cutsq_ss_c);
|
||||
|
||||
memory->destroy(epsilon_sb);
|
||||
memory->destroy(sigma_sb);
|
||||
memory->destroy(cut_sb_ast);
|
||||
memory->destroy(b_sb);
|
||||
memory->destroy(cut_sb_c);
|
||||
memory->destroy(lj1_sb);
|
||||
memory->destroy(lj2_sb);
|
||||
memory->destroy(cutsq_sb_ast);
|
||||
memory->destroy(cutsq_sb_c);
|
||||
|
||||
memory->destroy(epsilon_bb);
|
||||
memory->destroy(sigma_bb);
|
||||
memory->destroy(cut_bb_ast);
|
||||
memory->destroy(b_bb);
|
||||
memory->destroy(cut_bb_c);
|
||||
memory->destroy(lj1_bb);
|
||||
memory->destroy(lj2_bb);
|
||||
memory->destroy(cutsq_bb_ast);
|
||||
memory->destroy(cutsq_bb_c);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
compute function for oxDNA pair interactions
|
||||
s=sugar-phosphate backbone site, b=base site, st=stacking site
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairOxdnaExcv::compute(int eflag, int vflag)
|
||||
{
|
||||
|
||||
double delf[3],delta[3],deltb[3]; // force, torque increment;
|
||||
double evdwl,fpair,factor_lj;
|
||||
double rtmp_s[3],rtmp_b[3];
|
||||
double delr_ss[3],rsq_ss,delr_sb[3],rsq_sb;
|
||||
double delr_bs[3],rsq_bs,delr_bb[3],rsq_bb;
|
||||
|
||||
// distances COM-backbone site, COM-base site
|
||||
double d_cs=-0.24, d_cb=0.56;
|
||||
// vectors COM-backbone site, COM-base site in lab frame
|
||||
double ra_cs[3],ra_cb[3];
|
||||
double rb_cs[3],rb_cb[3];
|
||||
|
||||
// quaternions and Cartesian unit vectors in lab frame
|
||||
double *qa,ax[3],ay[3],az[3];
|
||||
double *qb,bx[3],by[3],bz[3];
|
||||
double *special_lj = force->special_lj;
|
||||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
double **torque = atom->torque;
|
||||
int *type = atom->type;
|
||||
|
||||
int nlocal = atom->nlocal;
|
||||
int newton_pair = force->newton_pair;
|
||||
int *alist,*blist,*numneigh,**firstneigh;
|
||||
|
||||
AtomVecEllipsoid *avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
|
||||
AtomVecEllipsoid::Bonus *bonus = avec->bonus;
|
||||
|
||||
int a,b,ia,ib,anum,bnum,atype,btype;
|
||||
|
||||
evdwl = 0.0;
|
||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
||||
else evflag = vflag_fdotr = 0;
|
||||
|
||||
anum = list->inum;
|
||||
alist = list->ilist;
|
||||
numneigh = list->numneigh;
|
||||
firstneigh = list->firstneigh;
|
||||
|
||||
// loop over pair interaction neighbours of my atoms
|
||||
|
||||
for (ia = 0; ia < anum; ia++) {
|
||||
|
||||
a = alist[ia];
|
||||
atype = type[a];
|
||||
|
||||
qa=bonus[a].quat;
|
||||
MathExtra::q_to_exyz(qa,ax,ay,az);
|
||||
|
||||
// position of backbone site a
|
||||
ra_cs[0] = d_cs*ax[0];
|
||||
ra_cs[1] = d_cs*ax[1];
|
||||
ra_cs[2] = d_cs*ax[2];
|
||||
rtmp_s[0] = x[a][0] + ra_cs[0];
|
||||
rtmp_s[1] = x[a][1] + ra_cs[1];
|
||||
rtmp_s[2] = x[a][2] + ra_cs[2];
|
||||
|
||||
// position of base site a
|
||||
ra_cb[0] = d_cb*ax[0];
|
||||
ra_cb[1] = d_cb*ax[1];
|
||||
ra_cb[2] = d_cb*ax[2];
|
||||
rtmp_b[0] = x[a][0] + ra_cb[0];
|
||||
rtmp_b[1] = x[a][1] + ra_cb[1];
|
||||
rtmp_b[2] = x[a][2] + ra_cb[2];
|
||||
|
||||
blist = firstneigh[a];
|
||||
bnum = numneigh[a];
|
||||
|
||||
for (ib = 0; ib < bnum; ib++) {
|
||||
|
||||
b = blist[ib];
|
||||
factor_lj = special_lj[sbmask(b)]; // = 0 for nearest neighbours
|
||||
b &= NEIGHMASK;
|
||||
|
||||
btype = type[b];
|
||||
|
||||
qb=bonus[b].quat;
|
||||
MathExtra::q_to_exyz(qb,bx,by,bz);
|
||||
|
||||
rb_cs[0] = d_cs*bx[0];
|
||||
rb_cs[1] = d_cs*bx[1];
|
||||
rb_cs[2] = d_cs*bx[2];
|
||||
rb_cb[0] = d_cb*bx[0];
|
||||
rb_cb[1] = d_cb*bx[1];
|
||||
rb_cb[2] = d_cb*bx[2];
|
||||
|
||||
// vector backbone site b to a
|
||||
delr_ss[0] = rtmp_s[0] - (x[b][0] + rb_cs[0]);
|
||||
delr_ss[1] = rtmp_s[1] - (x[b][1] + rb_cs[1]);
|
||||
delr_ss[2] = rtmp_s[2] - (x[b][2] + rb_cs[2]);
|
||||
rsq_ss = delr_ss[0]*delr_ss[0] + delr_ss[1]*delr_ss[1] + delr_ss[2]*delr_ss[2];
|
||||
|
||||
// vector base site b to backbone site a
|
||||
delr_sb[0] = rtmp_s[0] - (x[b][0] + rb_cb[0]);
|
||||
delr_sb[1] = rtmp_s[1] - (x[b][1] + rb_cb[1]);
|
||||
delr_sb[2] = rtmp_s[2] - (x[b][2] + rb_cb[2]);
|
||||
rsq_sb = delr_sb[0]*delr_sb[0] + delr_sb[1]*delr_sb[1] + delr_sb[2]*delr_sb[2];
|
||||
|
||||
// vector backbone site b to base site a
|
||||
delr_bs[0] = rtmp_b[0] - (x[b][0] + rb_cs[0]);
|
||||
delr_bs[1] = rtmp_b[1] - (x[b][1] + rb_cs[1]);
|
||||
delr_bs[2] = rtmp_b[2] - (x[b][2] + rb_cs[2]);
|
||||
rsq_bs = delr_bs[0]*delr_bs[0] + delr_bs[1]*delr_bs[1] + delr_bs[2]*delr_bs[2];
|
||||
|
||||
// vector base site b to a
|
||||
delr_bb[0] = rtmp_b[0] - (x[b][0] + rb_cb[0]);
|
||||
delr_bb[1] = rtmp_b[1] - (x[b][1] + rb_cb[1]);
|
||||
delr_bb[2] = rtmp_b[2] - (x[b][2] + rb_cb[2]);
|
||||
rsq_bb = delr_bb[0]*delr_bb[0] + delr_bb[1]*delr_bb[1] + delr_bb[2]*delr_bb[2];
|
||||
|
||||
// excluded volume interaction
|
||||
|
||||
// backbone-backbone
|
||||
if (rsq_ss < cutsq_ss_c[atype][btype]) {
|
||||
|
||||
evdwl = F3(rsq_ss,cutsq_ss_ast[atype][btype],cut_ss_c[atype][btype],lj1_ss[atype][btype],
|
||||
lj2_ss[atype][btype],epsilon_ss[atype][btype],b_ss[atype][btype],fpair);
|
||||
|
||||
// knock out nearest-neighbour interaction between ss
|
||||
fpair *= factor_lj;
|
||||
evdwl *= factor_lj;
|
||||
|
||||
// increment energy and virial
|
||||
if (evflag) ev_tally(a,b,nlocal,newton_pair,
|
||||
evdwl,0.0,fpair,delr_ss[0],delr_ss[1],delr_ss[2]);
|
||||
|
||||
delf[0] = delr_ss[0]*fpair;
|
||||
delf[1] = delr_ss[1]*fpair;
|
||||
delf[2] = delr_ss[2]*fpair;
|
||||
|
||||
f[a][0] += delf[0];
|
||||
f[a][1] += delf[1];
|
||||
f[a][2] += delf[2];
|
||||
|
||||
MathExtra::cross3(ra_cs,delf,delta);
|
||||
|
||||
torque[a][0] += delta[0];
|
||||
torque[a][1] += delta[1];
|
||||
torque[a][2] += delta[2];
|
||||
|
||||
if (newton_pair || b < nlocal) {
|
||||
|
||||
f[b][0] -= delf[0];
|
||||
f[b][1] -= delf[1];
|
||||
f[b][2] -= delf[2];
|
||||
|
||||
MathExtra::cross3(rb_cs,delf,deltb);
|
||||
|
||||
torque[b][0] -= deltb[0];
|
||||
torque[b][1] -= deltb[1];
|
||||
torque[b][2] -= deltb[2];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// backbone-base
|
||||
if (rsq_sb < cutsq_sb_c[atype][btype]) {
|
||||
|
||||
evdwl = F3(rsq_sb,cutsq_sb_ast[atype][btype],cut_sb_c[atype][btype],lj1_sb[atype][btype],
|
||||
lj2_sb[atype][btype],epsilon_sb[atype][btype],b_sb[atype][btype],fpair);
|
||||
|
||||
// increment energy and virial
|
||||
if (evflag) ev_tally(a,b,nlocal,newton_pair,
|
||||
evdwl,0.0,fpair,delr_sb[0],delr_sb[1],delr_sb[2]);
|
||||
|
||||
delf[0] = delr_sb[0]*fpair;
|
||||
delf[1] = delr_sb[1]*fpair;
|
||||
delf[2] = delr_sb[2]*fpair;
|
||||
|
||||
f[a][0] += delf[0];
|
||||
f[a][1] += delf[1];
|
||||
f[a][2] += delf[2];
|
||||
|
||||
MathExtra::cross3(ra_cs,delf,delta);
|
||||
|
||||
torque[a][0] += delta[0];
|
||||
torque[a][1] += delta[1];
|
||||
torque[a][2] += delta[2];
|
||||
|
||||
if (newton_pair || b < nlocal) {
|
||||
|
||||
f[b][0] -= delf[0];
|
||||
f[b][1] -= delf[1];
|
||||
f[b][2] -= delf[2];
|
||||
|
||||
MathExtra::cross3(rb_cb,delf,deltb);
|
||||
|
||||
torque[b][0] -= deltb[0];
|
||||
torque[b][1] -= deltb[1];
|
||||
torque[b][2] -= deltb[2];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// base-backbone
|
||||
if (rsq_bs < cutsq_sb_c[atype][btype]) {
|
||||
|
||||
evdwl = F3(rsq_bs,cutsq_sb_ast[atype][btype],cut_sb_c[atype][btype],lj1_sb[atype][btype],
|
||||
lj2_sb[atype][btype],epsilon_sb[atype][btype],b_sb[atype][btype],fpair);
|
||||
|
||||
// increment energy and virial
|
||||
if (evflag) ev_tally(a,b,nlocal,newton_pair,
|
||||
evdwl,0.0,fpair,delr_bs[0],delr_bs[1],delr_bs[2]);
|
||||
|
||||
delf[0] = delr_bs[0]*fpair;
|
||||
delf[1] = delr_bs[1]*fpair;
|
||||
delf[2] = delr_bs[2]*fpair;
|
||||
|
||||
f[a][0] += delf[0];
|
||||
f[a][1] += delf[1];
|
||||
f[a][2] += delf[2];
|
||||
|
||||
MathExtra::cross3(ra_cb,delf,delta);
|
||||
|
||||
torque[a][0] += delta[0];
|
||||
torque[a][1] += delta[1];
|
||||
torque[a][2] += delta[2];
|
||||
|
||||
if (newton_pair || b < nlocal) {
|
||||
|
||||
f[b][0] -= delf[0];
|
||||
f[b][1] -= delf[1];
|
||||
f[b][2] -= delf[2];
|
||||
|
||||
MathExtra::cross3(rb_cs,delf,deltb);
|
||||
|
||||
torque[b][0] -= deltb[0];
|
||||
torque[b][1] -= deltb[1];
|
||||
torque[b][2] -= deltb[2];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// base-base
|
||||
if (rsq_bb < cutsq_bb_c[atype][btype]) {
|
||||
|
||||
evdwl = F3(rsq_bb,cutsq_bb_ast[atype][btype],cut_bb_c[atype][btype],lj1_bb[atype][btype],
|
||||
lj2_bb[atype][btype],epsilon_bb[atype][btype],b_bb[atype][btype],fpair);
|
||||
|
||||
// increment energy and virial
|
||||
if (evflag) ev_tally(a,b,nlocal,newton_pair,
|
||||
evdwl,0.0,fpair,delr_bb[0],delr_bb[1],delr_bb[2]);
|
||||
|
||||
delf[0] = delr_bb[0]*fpair;
|
||||
delf[1] = delr_bb[1]*fpair;
|
||||
delf[2] = delr_bb[2]*fpair;
|
||||
|
||||
f[a][0] += delf[0];
|
||||
f[a][1] += delf[1];
|
||||
f[a][2] += delf[2];
|
||||
|
||||
MathExtra::cross3(ra_cb,delf,delta);
|
||||
|
||||
torque[a][0] += delta[0];
|
||||
torque[a][1] += delta[1];
|
||||
torque[a][2] += delta[2];
|
||||
|
||||
if (newton_pair || b < nlocal) {
|
||||
|
||||
f[b][0] -= delf[0];
|
||||
f[b][1] -= delf[1];
|
||||
f[b][2] -= delf[2];
|
||||
|
||||
MathExtra::cross3(rb_cb,delf,deltb);
|
||||
|
||||
torque[b][0] -= deltb[0];
|
||||
torque[b][1] -= deltb[1];
|
||||
torque[b][2] -= deltb[2];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// end excluded volume interaction
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (vflag_fdotr) virial_fdotr_compute();
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
allocate all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairOxdnaExcv::allocate()
|
||||
{
|
||||
allocated = 1;
|
||||
int n = atom->ntypes;
|
||||
|
||||
memory->create(setflag,n+1,n+1,"pair:setflag");
|
||||
for (int i = 1; i <= n; i++)
|
||||
for (int j = i; j <= n; j++)
|
||||
setflag[i][j] = 0;
|
||||
|
||||
memory->create(cutsq,n+1,n+1,"pair:cutsq");
|
||||
|
||||
memory->create(epsilon_ss,n+1,n+1,"pair:epsilon_ss");
|
||||
memory->create(sigma_ss,n+1,n+1,"pair:sigma_ss");
|
||||
memory->create(cut_ss_ast,n+1,n+1,"pair:cut_ss_ast");
|
||||
memory->create(b_ss,n+1,n+1,"pair:b_ss");
|
||||
memory->create(cut_ss_c,n+1,n+1,"pair:cut_ss_c");
|
||||
memory->create(lj1_ss,n+1,n+1,"pair:lj1_ss");
|
||||
memory->create(lj2_ss,n+1,n+1,"pair:lj2_ss");
|
||||
memory->create(cutsq_ss_ast,n+1,n+1,"pair:cutsq_ss_ast");
|
||||
memory->create(cutsq_ss_c,n+1,n+1,"pair:cutsq_ss_c");
|
||||
|
||||
memory->create(epsilon_sb,n+1,n+1,"pair:epsilon_sb");
|
||||
memory->create(sigma_sb,n+1,n+1,"pair:sigma_sb");
|
||||
memory->create(cut_sb_ast,n+1,n+1,"pair:cut_sb_ast");
|
||||
memory->create(b_sb,n+1,n+1,"pair:b_sb");
|
||||
memory->create(cut_sb_c,n+1,n+1,"pair:cut_sb_c");
|
||||
memory->create(lj1_sb,n+1,n+1,"pair:lj1_sb");
|
||||
memory->create(lj2_sb,n+1,n+1,"pair:lj2_sb");
|
||||
memory->create(cutsq_sb_ast,n+1,n+1,"pair:cutsq_sb_ast");
|
||||
memory->create(cutsq_sb_c,n+1,n+1,"pair:cutsq_sb_c");
|
||||
|
||||
memory->create(epsilon_bb,n+1,n+1,"pair:epsilon_bb");
|
||||
memory->create(sigma_bb,n+1,n+1,"pair:sigma_bb");
|
||||
memory->create(cut_bb_ast,n+1,n+1,"pair:cut_bb_ast");
|
||||
memory->create(b_bb,n+1,n+1,"pair:b_bb");
|
||||
memory->create(cut_bb_c,n+1,n+1,"pair:cut_bb_c");
|
||||
memory->create(lj1_bb,n+1,n+1,"pair:lj1_bb");
|
||||
memory->create(lj2_bb,n+1,n+1,"pair:lj2_bb");
|
||||
memory->create(cutsq_bb_ast,n+1,n+1,"pair:cutsq_bb_ast");
|
||||
memory->create(cutsq_bb_c,n+1,n+1,"pair:cutsq_bb_c");
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
global settings
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairOxdnaExcv::settings(int narg, char **arg)
|
||||
{
|
||||
if (narg != 0) error->all(FLERR,"Illegal pair_style command");
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
set coeffs for one or more type pairs
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairOxdnaExcv::coeff(int narg, char **arg)
|
||||
{
|
||||
int count;
|
||||
|
||||
if (narg != 11) error->all(FLERR,"Incorrect args for pair coefficients in oxdna_excv");
|
||||
if (!allocated) allocate();
|
||||
|
||||
int ilo,ihi,jlo,jhi;
|
||||
force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi);
|
||||
force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi);
|
||||
|
||||
count = 0;
|
||||
|
||||
double epsilon_ss_one, sigma_ss_one;
|
||||
double cut_ss_ast_one, cut_ss_c_one, b_ss_one;
|
||||
|
||||
double epsilon_sb_one, sigma_sb_one;
|
||||
double cut_sb_ast_one, cut_sb_c_one, b_sb_one;
|
||||
|
||||
double epsilon_bb_one, sigma_bb_one;
|
||||
double cut_bb_ast_one, cut_bb_c_one, b_bb_one;
|
||||
|
||||
// Excluded volume interaction
|
||||
// LJ parameters
|
||||
epsilon_ss_one = force->numeric(FLERR,arg[2]);
|
||||
sigma_ss_one = force->numeric(FLERR,arg[3]);
|
||||
cut_ss_ast_one = force->numeric(FLERR,arg[4]);
|
||||
|
||||
// smoothing - determined through continuity and differentiability
|
||||
b_ss_one = 4.0/sigma_ss_one
|
||||
*(6.0*pow(sigma_ss_one/cut_ss_ast_one,7)-12.0*pow(sigma_ss_one/cut_ss_ast_one,13))
|
||||
*4.0/sigma_ss_one*(6.0*pow(sigma_ss_one/cut_ss_ast_one,7)-12.0*pow(sigma_ss_one/cut_ss_ast_one,13))
|
||||
/4.0/(4.0*(pow(sigma_ss_one/cut_ss_ast_one,12)-pow(sigma_ss_one/cut_ss_ast_one,6)));
|
||||
|
||||
cut_ss_c_one = cut_ss_ast_one
|
||||
- 2.0*4.0*(pow(sigma_ss_one/cut_ss_ast_one,12)-pow(sigma_ss_one/cut_ss_ast_one,6))
|
||||
/(4.0/sigma_ss_one*(6.0*pow(sigma_ss_one/cut_ss_ast_one,7)-12.0*pow(sigma_ss_one/cut_ss_ast_one,13)));
|
||||
|
||||
for (int i = ilo; i <= ihi; i++) {
|
||||
for (int j = MAX(jlo,i); j <= jhi; j++) {
|
||||
epsilon_ss[i][j] = epsilon_ss_one;
|
||||
sigma_ss[i][j] = sigma_ss_one;
|
||||
cut_ss_ast[i][j] = cut_ss_ast_one;
|
||||
b_ss[i][j] = b_ss_one;
|
||||
cut_ss_c[i][j] = cut_ss_c_one;
|
||||
setflag[i][j] = 1;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients in oxdna_excv");
|
||||
|
||||
count = 0;
|
||||
|
||||
// LJ parameters
|
||||
epsilon_sb_one = force->numeric(FLERR,arg[5]);
|
||||
sigma_sb_one = force->numeric(FLERR,arg[6]);
|
||||
cut_sb_ast_one = force->numeric(FLERR,arg[7]);
|
||||
|
||||
// smoothing - determined through continuity and differentiability
|
||||
b_sb_one = 4.0/sigma_sb_one
|
||||
*(6.0*pow(sigma_sb_one/cut_sb_ast_one,7)-12.0*pow(sigma_sb_one/cut_sb_ast_one,13))
|
||||
*4.0/sigma_sb_one*(6.0*pow(sigma_sb_one/cut_sb_ast_one,7)-12.0*pow(sigma_sb_one/cut_sb_ast_one,13))
|
||||
/4.0/(4.0*(pow(sigma_sb_one/cut_sb_ast_one,12)-pow(sigma_sb_one/cut_sb_ast_one,6)));
|
||||
|
||||
cut_sb_c_one = cut_sb_ast_one
|
||||
- 2.0*4.0*(pow(sigma_sb_one/cut_sb_ast_one,12)-pow(sigma_sb_one/cut_sb_ast_one,6))
|
||||
/(4.0/sigma_sb_one*(6.0*pow(sigma_sb_one/cut_sb_ast_one,7)-12.0*pow(sigma_sb_one/cut_sb_ast_one,13)));
|
||||
|
||||
for (int i = ilo; i <= ihi; i++) {
|
||||
for (int j = MAX(jlo,i); j <= jhi; j++) {
|
||||
epsilon_sb[i][j] = epsilon_sb_one;
|
||||
sigma_sb[i][j] = sigma_sb_one;
|
||||
cut_sb_ast[i][j] = cut_sb_ast_one;
|
||||
b_sb[i][j] = b_sb_one;
|
||||
cut_sb_c[i][j] = cut_sb_c_one;
|
||||
setflag[i][j] = 1;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients in oxdna_excv");
|
||||
|
||||
count = 0;
|
||||
|
||||
// LJ parameters
|
||||
epsilon_bb_one = force->numeric(FLERR,arg[8]);
|
||||
sigma_bb_one = force->numeric(FLERR,arg[9]);
|
||||
cut_bb_ast_one = force->numeric(FLERR,arg[10]);
|
||||
|
||||
// smoothing - determined through continuity and differentiability
|
||||
b_bb_one = 4.0/sigma_bb_one
|
||||
*(6.0*pow(sigma_bb_one/cut_bb_ast_one,7)-12.0*pow(sigma_bb_one/cut_bb_ast_one,13))
|
||||
*4.0/sigma_bb_one*(6.0*pow(sigma_bb_one/cut_bb_ast_one,7)-12.0*pow(sigma_bb_one/cut_bb_ast_one,13))
|
||||
/4.0/(4.0*(pow(sigma_bb_one/cut_bb_ast_one,12)-pow(sigma_bb_one/cut_bb_ast_one,6)));
|
||||
|
||||
cut_bb_c_one = cut_bb_ast_one
|
||||
- 2.0*4.0*(pow(sigma_bb_one/cut_bb_ast_one,12)-pow(sigma_bb_one/cut_bb_ast_one,6))
|
||||
/(4.0/sigma_bb_one*(6.0*pow(sigma_bb_one/cut_bb_ast_one,7)-12.0*pow(sigma_bb_one/cut_bb_ast_one,13)));
|
||||
|
||||
for (int i = ilo; i <= ihi; i++) {
|
||||
for (int j = MAX(jlo,i); j <= jhi; j++) {
|
||||
epsilon_bb[i][j] = epsilon_bb_one;
|
||||
sigma_bb[i][j] = sigma_bb_one;
|
||||
cut_bb_ast[i][j] = cut_bb_ast_one;
|
||||
b_bb[i][j] = b_bb_one;
|
||||
cut_bb_c[i][j] = cut_bb_c_one;
|
||||
setflag[i][j] = 1;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients in oxdna_excv");
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
init specific to this pair style
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairOxdnaExcv::init_style()
|
||||
{
|
||||
int irequest;
|
||||
|
||||
// request regular neighbor lists
|
||||
|
||||
irequest = neighbor->request(this,instance_me);
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
neighbor callback to inform pair style of neighbor list to use regular
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairOxdnaExcv::init_list(int id, NeighList *ptr)
|
||||
{
|
||||
if (id == 0) list = ptr;
|
||||
if (id > 0) error->all(FLERR,"Respa not supported");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
init for one type pair i,j and corresponding j,i
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double PairOxdnaExcv::init_one(int i, int j)
|
||||
{
|
||||
|
||||
if (setflag[i][j] == 0) {
|
||||
error->all(FLERR,"Coefficient mixing not defined in oxDNA");
|
||||
}
|
||||
if (offset_flag) {
|
||||
error->all(FLERR,"Offset not supported in oxDNA");
|
||||
}
|
||||
|
||||
epsilon_ss[j][i] = epsilon_ss[i][j];
|
||||
sigma_ss[j][i] = sigma_ss[i][j];
|
||||
cut_ss_ast[j][i] = cut_ss_ast[i][j];
|
||||
cut_ss_c[j][i] = cut_ss_c[i][j];
|
||||
b_ss[j][i] = b_ss[i][j];
|
||||
|
||||
epsilon_sb[j][i] = epsilon_sb[i][j];
|
||||
sigma_sb[j][i] = sigma_sb[i][j];
|
||||
cut_sb_ast[j][i] = cut_sb_ast[i][j];
|
||||
cut_sb_c[j][i] = cut_sb_c[i][j];
|
||||
b_sb[j][i] = b_sb[i][j];
|
||||
|
||||
epsilon_bb[j][i] = epsilon_bb[i][j];
|
||||
sigma_bb[j][i] = sigma_bb[i][j];
|
||||
cut_bb_ast[j][i] = cut_bb_ast[i][j];
|
||||
cut_bb_c[j][i] = cut_bb_c[i][j];
|
||||
b_bb[j][i] = b_bb[i][j];
|
||||
|
||||
// excluded volume auxiliary parameters
|
||||
|
||||
lj1_ss[i][j] = 4.0 * epsilon_ss[i][j] * pow(sigma_ss[i][j],12.0);
|
||||
lj2_ss[i][j] = 4.0 * epsilon_ss[i][j] * pow(sigma_ss[i][j],6.0);
|
||||
|
||||
lj1_sb[i][j] = 4.0 * epsilon_sb[i][j] * pow(sigma_sb[i][j],12.0);
|
||||
lj2_sb[i][j] = 4.0 * epsilon_sb[i][j] * pow(sigma_sb[i][j],6.0);
|
||||
|
||||
lj1_bb[i][j] = 4.0 * epsilon_bb[i][j] * pow(sigma_bb[i][j],12.0);
|
||||
lj2_bb[i][j] = 4.0 * epsilon_bb[i][j] * pow(sigma_bb[i][j],6.0);
|
||||
|
||||
lj1_ss[j][i] = lj1_ss[i][j];
|
||||
lj2_ss[j][i] = lj2_ss[i][j];
|
||||
|
||||
lj1_sb[j][i] = lj1_sb[i][j];
|
||||
lj2_sb[j][i] = lj2_sb[i][j];
|
||||
|
||||
lj1_bb[j][i] = lj1_bb[i][j];
|
||||
lj2_bb[j][i] = lj2_bb[i][j];
|
||||
|
||||
cutsq_ss_ast[i][j] = cut_ss_ast[i][j]*cut_ss_ast[i][j];
|
||||
cutsq_ss_c[i][j] = cut_ss_c[i][j]*cut_ss_c[i][j];
|
||||
|
||||
cutsq_sb_ast[i][j] = cut_sb_ast[i][j]*cut_sb_ast[i][j];
|
||||
cutsq_sb_c[i][j] = cut_sb_c[i][j]*cut_sb_c[i][j];
|
||||
|
||||
cutsq_bb_ast[i][j] = cut_bb_ast[i][j]*cut_bb_ast[i][j];
|
||||
cutsq_bb_c[i][j] = cut_bb_c[i][j]*cut_bb_c[i][j];
|
||||
|
||||
cutsq_ss_ast[j][i] = cutsq_ss_ast[i][j];
|
||||
cutsq_ss_c[j][i] = cutsq_ss_c[i][j];
|
||||
|
||||
cutsq_sb_ast[j][i] = cutsq_sb_ast[i][j];
|
||||
cutsq_sb_c[j][i] = cutsq_sb_c[i][j];
|
||||
|
||||
cutsq_bb_ast[j][i] = cutsq_bb_ast[i][j];
|
||||
cutsq_bb_c[j][i] = cutsq_bb_c[i][j];
|
||||
|
||||
// set the master list distance cutoff
|
||||
return cut_ss_ast[i][j];
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes to restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairOxdnaExcv::write_restart(FILE *fp)
|
||||
{
|
||||
write_restart_settings(fp);
|
||||
|
||||
int i,j;
|
||||
for (i = 1; i <= atom->ntypes; i++)
|
||||
for (j = i; j <= atom->ntypes; j++) {
|
||||
fwrite(&setflag[i][j],sizeof(int),1,fp);
|
||||
if (setflag[i][j]) {
|
||||
|
||||
fwrite(&epsilon_ss[i][j],sizeof(double),1,fp);
|
||||
fwrite(&sigma_ss[i][j],sizeof(double),1,fp);
|
||||
fwrite(&cut_ss_ast[i][j],sizeof(double),1,fp);
|
||||
fwrite(&b_ss[i][j],sizeof(double),1,fp);
|
||||
fwrite(&cut_ss_c[i][j],sizeof(double),1,fp);
|
||||
fwrite(&epsilon_sb[i][j],sizeof(double),1,fp);
|
||||
fwrite(&sigma_sb[i][j],sizeof(double),1,fp);
|
||||
fwrite(&cut_sb_ast[i][j],sizeof(double),1,fp);
|
||||
fwrite(&b_sb[i][j],sizeof(double),1,fp);
|
||||
fwrite(&cut_sb_c[i][j],sizeof(double),1,fp);
|
||||
fwrite(&epsilon_bb[i][j],sizeof(double),1,fp);
|
||||
fwrite(&sigma_bb[i][j],sizeof(double),1,fp);
|
||||
fwrite(&cut_bb_ast[i][j],sizeof(double),1,fp);
|
||||
fwrite(&b_bb[i][j],sizeof(double),1,fp);
|
||||
fwrite(&cut_bb_c[i][j],sizeof(double),1,fp);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 reads from restart file, bcasts
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairOxdnaExcv::read_restart(FILE *fp)
|
||||
{
|
||||
read_restart_settings(fp);
|
||||
allocate();
|
||||
|
||||
int i,j;
|
||||
int me = comm->me;
|
||||
for (i = 1; i <= atom->ntypes; i++)
|
||||
for (j = i; j <= atom->ntypes; j++) {
|
||||
if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
|
||||
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
|
||||
if (setflag[i][j]) {
|
||||
if (me == 0) {
|
||||
|
||||
fread(&epsilon_ss[i][j],sizeof(double),1,fp);
|
||||
fread(&sigma_ss[i][j],sizeof(double),1,fp);
|
||||
fread(&cut_ss_ast[i][j],sizeof(double),1,fp);
|
||||
fread(&b_ss[i][j],sizeof(double),1,fp);
|
||||
fread(&cut_ss_c[i][j],sizeof(double),1,fp);
|
||||
fread(&epsilon_sb[i][j],sizeof(double),1,fp);
|
||||
fread(&sigma_sb[i][j],sizeof(double),1,fp);
|
||||
fread(&cut_sb_ast[i][j],sizeof(double),1,fp);
|
||||
fread(&b_sb[i][j],sizeof(double),1,fp);
|
||||
fread(&cut_sb_c[i][j],sizeof(double),1,fp);
|
||||
fread(&epsilon_bb[i][j],sizeof(double),1,fp);
|
||||
fread(&sigma_bb[i][j],sizeof(double),1,fp);
|
||||
fread(&cut_bb_ast[i][j],sizeof(double),1,fp);
|
||||
fread(&b_bb[i][j],sizeof(double),1,fp);
|
||||
fread(&cut_bb_c[i][j],sizeof(double),1,fp);
|
||||
|
||||
}
|
||||
|
||||
MPI_Bcast(&epsilon_ss[i][j],1,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&sigma_ss[i][j],1,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&cut_ss_ast[i][j],1,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&b_ss[i][j],1,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&cut_ss_c[i][j],1,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&epsilon_sb[i][j],1,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&sigma_sb[i][j],1,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&cut_sb_ast[i][j],1,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&b_sb[i][j],1,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&cut_sb_c[i][j],1,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&epsilon_bb[i][j],1,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&sigma_bb[i][j],1,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&cut_bb_ast[i][j],1,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&b_bb[i][j],1,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&cut_bb_c[i][j],1,MPI_DOUBLE,0,world);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes to restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairOxdnaExcv::write_restart_settings(FILE *fp)
|
||||
{
|
||||
fwrite(&offset_flag,sizeof(int),1,fp);
|
||||
fwrite(&mix_flag,sizeof(int),1,fp);
|
||||
fwrite(&tail_flag,sizeof(int),1,fp);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 reads from restart file, bcasts
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairOxdnaExcv::read_restart_settings(FILE *fp)
|
||||
{
|
||||
int me = comm->me;
|
||||
if (me == 0) {
|
||||
fread(&offset_flag,sizeof(int),1,fp);
|
||||
fread(&mix_flag,sizeof(int),1,fp);
|
||||
fread(&tail_flag,sizeof(int),1,fp);
|
||||
}
|
||||
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
|
||||
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
|
||||
MPI_Bcast(&tail_flag,1,MPI_INT,0,world);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes to data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairOxdnaExcv::write_data(FILE *fp)
|
||||
{
|
||||
for (int i = 1; i <= atom->ntypes; i++)
|
||||
fprintf(fp,"%d\
|
||||
%g %g %g %g %g\
|
||||
%g %g %g %g %g\
|
||||
%g %g %g %g %g\
|
||||
\n",i,
|
||||
epsilon_ss[i][i],sigma_ss[i][i],cut_ss_ast[i][i],b_ss[i][i],cut_ss_c[i][i],
|
||||
epsilon_sb[i][i],sigma_sb[i][i],cut_sb_ast[i][i],b_sb[i][i],cut_sb_c[i][i],
|
||||
epsilon_bb[i][i],sigma_bb[i][i],cut_bb_ast[i][i],b_bb[i][i],cut_bb_c[i][i]);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
proc 0 writes all pairs to data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairOxdnaExcv::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\
|
||||
%g %g %g %g %g\
|
||||
%g %g %g %g %g\
|
||||
%g %g %g %g %g\
|
||||
\n",i,j,
|
||||
epsilon_ss[i][j],sigma_ss[i][j],cut_ss_ast[i][j],b_ss[i][j],cut_ss_c[i][j],
|
||||
epsilon_sb[i][j],sigma_sb[i][j],cut_sb_ast[i][j],b_sb[i][j],cut_sb_c[i][j],
|
||||
epsilon_bb[i][j],sigma_bb[i][j],cut_bb_ast[i][j],b_bb[i][j],cut_bb_c[i][j]);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void *PairOxdnaExcv::extract(const char *str, int &dim)
|
||||
{
|
||||
dim = 2;
|
||||
|
||||
if (strcmp(str,"epsilon_ss") == 0) return (void *) epsilon_ss;
|
||||
if (strcmp(str,"sigma_ss") == 0) return (void *) sigma_ss;
|
||||
if (strcmp(str,"cut_ss_ast") == 0) return (void *) cut_ss_ast;
|
||||
if (strcmp(str,"b_ss") == 0) return (void *) b_ss;
|
||||
if (strcmp(str,"cut_ss_c") == 0) return (void *) cut_ss_c;
|
||||
if (strcmp(str,"epsilon_sb") == 0) return (void *) epsilon_sb;
|
||||
if (strcmp(str,"sigma_sb") == 0) return (void *) sigma_sb;
|
||||
if (strcmp(str,"cut_sb_ast") == 0) return (void *) cut_sb_ast;
|
||||
if (strcmp(str,"b_sb") == 0) return (void *) b_sb;
|
||||
if (strcmp(str,"cut_sb_c") == 0) return (void *) cut_sb_c;
|
||||
if (strcmp(str,"epsilon_bb") == 0) return (void *) epsilon_bb;
|
||||
if (strcmp(str,"sigma_bb") == 0) return (void *) sigma_bb;
|
||||
if (strcmp(str,"cut_bb_ast") == 0) return (void *) cut_bb_ast;
|
||||
if (strcmp(str,"b_bb") == 0) return (void *) b_bb;
|
||||
if (strcmp(str,"cut_bb_c") == 0) return (void *) cut_bb_c;
|
||||
|
||||
return NULL;
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing author: Oliver Henrich (EPCC, University of Edinburgh)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef PAIR_CLASS
|
||||
|
||||
PairStyle(oxdna_excv,PairOxdnaExcv)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_PAIR_OXDNA_EXCV_H
|
||||
#define LMP_PAIR_OXDNA_EXCV_H
|
||||
|
||||
#include "pair.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairOxdnaExcv : public Pair {
|
||||
public:
|
||||
PairOxdnaExcv(class LAMMPS *);
|
||||
virtual ~PairOxdnaExcv();
|
||||
virtual void compute(int, int);
|
||||
void settings(int, char **);
|
||||
void coeff(int, char **);
|
||||
void init_style();
|
||||
void init_list(int, class NeighList *);
|
||||
double init_one(int, int);
|
||||
void write_restart(FILE *);
|
||||
void read_restart(FILE *);
|
||||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
void write_data(FILE *);
|
||||
void write_data_all(FILE *);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
// s=sugar-phosphate backbone site, b=base site, st=stacking site
|
||||
|
||||
// excluded volume interaction
|
||||
double **epsilon_ss, **sigma_ss, **cut_ss_ast, **cutsq_ss_ast;
|
||||
double **lj1_ss, **lj2_ss, **b_ss, **cut_ss_c, **cutsq_ss_c;
|
||||
double **epsilon_sb, **sigma_sb, **cut_sb_ast, **cutsq_sb_ast;
|
||||
double **lj1_sb, **lj2_sb, **b_sb, **cut_sb_c, **cutsq_sb_c;
|
||||
double **epsilon_bb, **sigma_bb, **cut_bb_ast, **cutsq_bb_ast;
|
||||
double **lj1_bb, **lj2_bb, **b_bb, **cut_bb_c, **cutsq_bb_c;
|
||||
|
||||
virtual void allocate();
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ERROR/WARNING messages:
|
||||
|
||||
E: Illegal ... command
|
||||
|
||||
Self-explanatory. Check the input script syntax and compare to the
|
||||
documentation for the command. You can use -echo screen as a
|
||||
command-line option when running LAMMPS to see the offending line.
|
||||
|
||||
E: Incorrect args for pair coefficients
|
||||
|
||||
Self-explanatory. Check the input script or data file.
|
||||
|
||||
*/
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,92 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing author: Oliver Henrich (EPCC, University of Edinburgh)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef PAIR_CLASS
|
||||
|
||||
PairStyle(oxdna_hbond,PairOxdnaHbond)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_PAIR_OXDNA_HBOND_H
|
||||
#define LMP_PAIR_OXDNA_HBOND_H
|
||||
|
||||
#include "pair.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairOxdnaHbond : public Pair {
|
||||
public:
|
||||
PairOxdnaHbond(class LAMMPS *);
|
||||
virtual ~PairOxdnaHbond();
|
||||
virtual void compute(int, int);
|
||||
void settings(int, char **);
|
||||
void coeff(int, char **);
|
||||
void init_style();
|
||||
void init_list(int, class NeighList *);
|
||||
double init_one(int, int);
|
||||
void write_restart(FILE *);
|
||||
void read_restart(FILE *);
|
||||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
void write_data(FILE *);
|
||||
void write_data_all(FILE *);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
// h-bonding interaction
|
||||
double **epsilon_hb, **a_hb, **cut_hb_0, **cut_hb_c, **cut_hb_lo, **cut_hb_hi;
|
||||
double **cut_hb_lc, **cut_hb_hc, **b_hb_lo, **b_hb_hi, **shift_hb;
|
||||
double **cutsq_hb_hc;
|
||||
|
||||
double **a_hb1, **theta_hb1_0, **dtheta_hb1_ast;
|
||||
double **b_hb1, **dtheta_hb1_c;
|
||||
|
||||
double **a_hb2, **theta_hb2_0, **dtheta_hb2_ast;
|
||||
double **b_hb2, **dtheta_hb2_c;
|
||||
|
||||
double **a_hb3, **theta_hb3_0, **dtheta_hb3_ast;
|
||||
double **b_hb3, **dtheta_hb3_c;
|
||||
|
||||
double **a_hb4, **theta_hb4_0, **dtheta_hb4_ast;
|
||||
double **b_hb4, **dtheta_hb4_c;
|
||||
|
||||
double **a_hb7, **theta_hb7_0, **dtheta_hb7_ast;
|
||||
double **b_hb7, **dtheta_hb7_c;
|
||||
|
||||
double **a_hb8, **theta_hb8_0, **dtheta_hb8_ast;
|
||||
double **b_hb8, **dtheta_hb8_c;
|
||||
|
||||
virtual void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ERROR/WARNING messages:
|
||||
|
||||
E: Illegal ... command
|
||||
|
||||
Self-explanatory. Check the input script syntax and compare to the
|
||||
documentation for the command. You can use -echo screen as a
|
||||
command-line option when running LAMMPS to see the offending line.
|
||||
|
||||
E: Incorrect args for pair coefficients
|
||||
|
||||
Self-explanatory. Check the input script or data file.
|
||||
|
||||
*/
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,83 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing author: Oliver Henrich (EPCC, University of Edinburgh)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef PAIR_CLASS
|
||||
|
||||
PairStyle(oxdna_stk,PairOxdnaStk)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_PAIR_OXDNA_STK_H
|
||||
#define LMP_PAIR_OXDNA_STK_H
|
||||
|
||||
#include "pair.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairOxdnaStk : public Pair {
|
||||
public:
|
||||
PairOxdnaStk(class LAMMPS *);
|
||||
virtual ~PairOxdnaStk();
|
||||
virtual void compute(int, int);
|
||||
void settings(int, char **);
|
||||
void coeff(int, char **);
|
||||
void init_style();
|
||||
void init_list(int, class NeighList *);
|
||||
double init_one(int, int);
|
||||
void write_restart(FILE *);
|
||||
void read_restart(FILE *);
|
||||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
void write_data(FILE *);
|
||||
void write_data_all(FILE *);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
// stacking interaction
|
||||
double **epsilon_st, **a_st, **cut_st_0, **cut_st_c;
|
||||
double **cut_st_lo, **cut_st_hi;
|
||||
double **cut_st_lc, **cut_st_hc, **b_st_lo, **b_st_hi, **shift_st;
|
||||
double **cutsq_st_hc;
|
||||
double **a_st4, **theta_st4_0, **dtheta_st4_ast;
|
||||
double **b_st4, **dtheta_st4_c;
|
||||
double **a_st5, **theta_st5_0, **dtheta_st5_ast;
|
||||
double **b_st5, **dtheta_st5_c;
|
||||
double **a_st6, **theta_st6_0, **dtheta_st6_ast;
|
||||
double **b_st6, **dtheta_st6_c;
|
||||
double **a_st1, **cosphi_st1_ast, **b_st1, **cosphi_st1_c;
|
||||
double **a_st2, **cosphi_st2_ast, **b_st2, **cosphi_st2_c;
|
||||
|
||||
virtual void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ERROR/WARNING messages:
|
||||
|
||||
E: Illegal ... command
|
||||
|
||||
Self-explanatory. Check the input script syntax and compare to the
|
||||
documentation for the command. You can use -echo screen as a
|
||||
command-line option when running LAMMPS to see the offending line.
|
||||
|
||||
E: Incorrect args for pair coefficients
|
||||
|
||||
Self-explanatory. Check the input script or data file.
|
||||
|
||||
*/
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,92 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing author: Oliver Henrich (EPCC, University of Edinburgh)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef PAIR_CLASS
|
||||
|
||||
PairStyle(oxdna_xstk,PairOxdnaXstk)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_PAIR_OXDNA_XSTK_H
|
||||
#define LMP_PAIR_OXDNA_XSTK_H
|
||||
|
||||
#include "pair.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairOxdnaXstk : public Pair {
|
||||
public:
|
||||
PairOxdnaXstk(class LAMMPS *);
|
||||
virtual ~PairOxdnaXstk();
|
||||
virtual void compute(int, int);
|
||||
void settings(int, char **);
|
||||
void coeff(int, char **);
|
||||
void init_style();
|
||||
void init_list(int, class NeighList *);
|
||||
double init_one(int, int);
|
||||
void write_restart(FILE *);
|
||||
void read_restart(FILE *);
|
||||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
void write_data(FILE *);
|
||||
void write_data_all(FILE *);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
// cross-stacking interaction
|
||||
double **k_xst, **cut_xst_0, **cut_xst_c, **cut_xst_lo, **cut_xst_hi;
|
||||
double **cut_xst_lc, **cut_xst_hc, **b_xst_lo, **b_xst_hi;
|
||||
double **cutsq_xst_hc;
|
||||
|
||||
double **a_xst1, **theta_xst1_0, **dtheta_xst1_ast;
|
||||
double **b_xst1, **dtheta_xst1_c;
|
||||
|
||||
double **a_xst2, **theta_xst2_0, **dtheta_xst2_ast;
|
||||
double **b_xst2, **dtheta_xst2_c;
|
||||
|
||||
double **a_xst3, **theta_xst3_0, **dtheta_xst3_ast;
|
||||
double **b_xst3, **dtheta_xst3_c;
|
||||
|
||||
double **a_xst4, **theta_xst4_0, **dtheta_xst4_ast;
|
||||
double **b_xst4, **dtheta_xst4_c;
|
||||
|
||||
double **a_xst7, **theta_xst7_0, **dtheta_xst7_ast;
|
||||
double **b_xst7, **dtheta_xst7_c;
|
||||
|
||||
double **a_xst8, **theta_xst8_0, **dtheta_xst8_ast;
|
||||
double **b_xst8, **dtheta_xst8_c;
|
||||
|
||||
virtual void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ERROR/WARNING messages:
|
||||
|
||||
E: Illegal ... command
|
||||
|
||||
Self-explanatory. Check the input script syntax and compare to the
|
||||
documentation for the command. You can use -echo screen as a
|
||||
command-line option when running LAMMPS to see the offending line.
|
||||
|
||||
E: Incorrect args for pair coefficients
|
||||
|
||||
Self-explanatory. Check the input script or data file.
|
||||
|
||||
*/
|
Loading…
Reference in New Issue