Commit e6aa7910 authored by Oliver Henrich's avatar Oliver Henrich
Browse files

Implemented and verified oxRNA2 model

parent 67b17470
Loading
Loading
Loading
Loading
+49 −0
Original line number Diff line number Diff line
/* ----------------------------------------------------------------------
   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 (University of Strathclyde, Glasgow)
------------------------------------------------------------------------- */

#include <cmath>
#include <cstdlib>
#include "bond_oxrna2_fene.h"

using namespace LAMMPS_NS;

/* ---------------------------------------------------------------------- */

BondOxrna2Fene::BondOxrna2Fene(LAMMPS *lmp) : BondOxdnaFene(lmp)
{

}

/* ---------------------------------------------------------------------- */

BondOxrna2Fene::~BondOxrna2Fene()
{

}

/* ----------------------------------------------------------------------
    compute vector COM-sugar-phosphate backbone interaction site in oxRNA2
------------------------------------------------------------------------- */
void BondOxrna2Fene::compute_interaction_sites(double e1[3], double /*e2*/[3],
  double e3[3], double r[3])
{
  double d_cs_x=-0.4, d_cs_z=+0.2;

  r[0] = d_cs_x*e1[0] + d_cs_z*e3[0];
  r[1] = d_cs_x*e1[1] + d_cs_z*e3[1];
  r[2] = d_cs_x*e1[2] + d_cs_z*e3[2];

}
+65 −0
Original line number Diff line number Diff line
/* -*- 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 BOND_CLASS

BondStyle(oxrna2/fene,BondOxrna2Fene)

#else

#ifndef LMP_BOND_OXRNA2_FENE_H
#define LMP_BOND_OXRNA2_FENE_H

#include "bond_oxdna_fene.h"

namespace LAMMPS_NS {

class BondOxrna2Fene : public BondOxdnaFene {
 public:
  BondOxrna2Fene(class LAMMPS *);
  virtual ~BondOxrna2Fene();
  virtual void compute_interaction_sites(double *, double *, double *,
    double *);
};

}

#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 oxrna

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.

*/
+3 −3
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ PairOxdna2Dh::~PairOxdna2Dh()
    compute vector COM-sugar-phosphate backbone interaction site in oxDNA2
------------------------------------------------------------------------- */
void PairOxdna2Dh::compute_interaction_sites(double e1[3],
  double e2[3], double r[3])
  double e2[3], double /*e3*/[3], double r[3])
{
  double d_cs_x=-0.34, d_cs_y=+0.3408;

@@ -125,7 +125,7 @@ void PairOxdna2Dh::compute(int eflag, int vflag)
    MathExtra::q_to_exyz(qa,ax,ay,az);

    // vector COM-backbone site a
    compute_interaction_sites(ax,ay,ra_cs);
    compute_interaction_sites(ax,ay,az,ra_cs);

    rtmp_s[0] = x[a][0] + ra_cs[0];
    rtmp_s[1] = x[a][1] + ra_cs[1];
@@ -145,7 +145,7 @@ void PairOxdna2Dh::compute(int eflag, int vflag)
      MathExtra::q_to_exyz(qb,bx,by,bz);

      // vector COM-backbone site b
      compute_interaction_sites(bx,by,rb_cs);
      compute_interaction_sites(bx,by,bz,rb_cs);

      // vector backbone site b to a
      delr[0] = rtmp_s[0] - x[b][0] - rb_cs[0];
+2 −1
Original line number Diff line number Diff line
@@ -28,7 +28,8 @@ class PairOxdna2Dh : public Pair {
 public:
  PairOxdna2Dh(class LAMMPS *);
  virtual ~PairOxdna2Dh();
  virtual void compute_interaction_sites(double *, double *, double *);
  virtual void compute_interaction_sites(double *, double *, double *, 
    double *);
  virtual void compute(int, int);
  void settings(int, char **);
  void coeff(int, char **);
+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
#ifdef PAIR_CLASS

PairStyle(oxdna/coaxstk,PairOxdnaCoaxstk)
PairStyle(oxrna2/coaxstk,PairOxdnaCoaxstk)

#else

Loading