Unverified Commit fd44f800 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1973 from evoyiatzis/ext-fix-adapt

Small extension of bonds supported by fix adapt
parents fbac800b 08e81d6a
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -288,11 +288,19 @@ Currently *bond* does not support bond_style hybrid nor bond_style
hybrid/overlay as bond styles. The only bonds that currently are
working with fix_adapt are

+---------------------------------+-------+------------+
+------------------------------------+-------+------------+
| :doc:`class2 <bond_class2>`        | r0    | type bonds |
+------------------------------------+-------+------------+
| :doc:`fene <bond_fene>`            | k, r0 | type bonds |
+------------------------------------+-------+------------+
| :doc:`gromos <bond_gromos>`        | k, r0 | type bonds |
+---------------------------------+-------+------------+
+------------------------------------+-------+------------+
| :doc:`harmonic <bond_harmonic>`    | k,r0  | type bonds |
+---------------------------------+-------+------------+
+------------------------------------+-------+------------+
| :doc:`morse <bond_morse>`          | r0    | type bonds |
+------------------------------------+-------+------------+
| :doc:`nonlinear <bond_nonlinear>`  | r0    | type bonds |
+------------------------------------+-------+------------+

----------

+10 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
   Contributing author: Eric Simon (Cray)
------------------------------------------------------------------------- */

#include <cstring>
#include "bond_class2.h"
#include <mpi.h>
#include <cmath>
@@ -220,3 +221,12 @@ double BondClass2::single(int type, double rsq, int /*i*/, int /*j*/, double &ff
  else fforce = 0.0;
  return (k2[type]*dr2 + k3[type]*dr3 + k4[type]*dr4);
}

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

void *BondClass2::extract( char *str, int &dim )
{
  dim = 1;
  if (strcmp(str,"r0")==0) return (void*) r0;
  return NULL;
}
+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ class BondClass2 : public Bond {
  virtual void read_restart(FILE *);
  void write_data(FILE *);
  double single(int, double, int, int, double &);
  virtual void *extract(char *, int &);

 protected:
  double *r0,*k2,*k3,*k4;
+11 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
#include "bond_fene.h"
#include <mpi.h>
#include <cmath>
#include <cstring>
#include "atom.h"
#include "neighbor.h"
#include "comm.h"
@@ -272,3 +273,13 @@ double BondFENE::single(int type, double rsq, int /*i*/, int /*j*/,

  return eng;
}

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

void *BondFENE::extract( char *str, int &dim )
{
  dim = 1;
  if (strcmp(str,"kappa")==0) return (void*) k;
  if (strcmp(str,"r0")==0) return (void*) r0;
  return NULL;
}
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ class BondFENE : public Bond {
  void read_restart(FILE *);
  void write_data(FILE *);
  double single(int, double, int, int, double &);
  virtual void *extract(char *, int &);

 protected:
  double TWO_1_3;
Loading