git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@254 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -1,7 +1,5 @@
|
||||
# Install/unInstall package classes in LAMMPS
|
||||
|
||||
# pair_lj_class2_coul_long.h must always be in src
|
||||
|
||||
if ($1 == 1) then
|
||||
|
||||
cp style_class2.h ..
|
||||
@ -22,7 +20,7 @@ if ($1 == 1) then
|
||||
|
||||
cp pair_lj_class2.h ..
|
||||
cp pair_lj_class2_coul_cut.h ..
|
||||
# cp pair_lj_class2_coul_long.h ..
|
||||
cp pair_lj_class2_coul_long.h ..
|
||||
|
||||
else if ($1 == 0) then
|
||||
|
||||
@ -45,6 +43,6 @@ else if ($1 == 0) then
|
||||
|
||||
rm ../pair_lj_class2.h
|
||||
rm ../pair_lj_class2_coul_cut.h
|
||||
# rm ../pair_lj_class2_coul_long.h
|
||||
rm ../pair_lj_class2_coul_long.h
|
||||
|
||||
endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -26,11 +26,15 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define SMALL 0.001
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
AngleClass2::AngleClass2(LAMMPS *lmp) : Angle(lmp) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
AngleClass2::~AngleClass2()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -17,9 +17,11 @@
|
||||
#include "stdio.h"
|
||||
#include "angle.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class AngleClass2 : public Angle {
|
||||
public:
|
||||
AngleClass2() {}
|
||||
AngleClass2(class LAMMPS *);
|
||||
~AngleClass2();
|
||||
void compute(int, int);
|
||||
void coeff(int, int, char **);
|
||||
@ -36,4 +38,6 @@ class AngleClass2 : public Angle {
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -26,9 +26,13 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
BondClass2::BondClass2(LAMMPS *lmp) : Bond(lmp) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
BondClass2::~BondClass2()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -17,9 +17,11 @@
|
||||
#include "stdio.h"
|
||||
#include "bond.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class BondClass2 : public Bond {
|
||||
public:
|
||||
BondClass2() {}
|
||||
BondClass2(class LAMMPS *);
|
||||
~BondClass2();
|
||||
void compute(int, int);
|
||||
void coeff(int, char **);
|
||||
@ -34,4 +36,6 @@ class BondClass2 : public Bond {
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -27,24 +27,22 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
|
||||
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
|
||||
|
||||
#define TOLERANCE 0.05
|
||||
#define SMALL 0.0000001
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
set all global defaults
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
DihedralClass2::DihedralClass2()
|
||||
DihedralClass2::DihedralClass2(LAMMPS *lmp) : Dihedral(lmp)
|
||||
{
|
||||
PI = 4.0*atan(1.0);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
DihedralClass2::~DihedralClass2()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -17,9 +17,11 @@
|
||||
#include "stdio.h"
|
||||
#include "dihedral.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class DihedralClass2 : public Dihedral {
|
||||
public:
|
||||
DihedralClass2();
|
||||
DihedralClass2(class LAMMPS *);
|
||||
~DihedralClass2();
|
||||
void compute(int, int);
|
||||
void coeff(int, int, char **);
|
||||
@ -43,4 +45,6 @@ class DihedralClass2 : public Dihedral {
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -27,20 +27,18 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define SMALL 0.001
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
set all global defaults
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
ImproperClass2::ImproperClass2()
|
||||
ImproperClass2::ImproperClass2(LAMMPS *lmp) : Improper(lmp)
|
||||
{
|
||||
PI = 4.0*atan(1.0);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
ImproperClass2::~ImproperClass2()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -17,9 +17,11 @@
|
||||
#include "stdio.h"
|
||||
#include "improper.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class ImproperClass2 : public Improper {
|
||||
public:
|
||||
ImproperClass2();
|
||||
ImproperClass2(class LAMMPS *);
|
||||
~ImproperClass2();
|
||||
void compute(int, int);
|
||||
void coeff(int, int, char **);
|
||||
@ -38,4 +40,6 @@ class ImproperClass2 : public Improper {
|
||||
double dot(double *, double *);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -23,12 +23,16 @@
|
||||
#include "neighbor.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairLJClass2::PairLJClass2(LAMMPS *lmp) : Pair(lmp) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairLJClass2::~PairLJClass2()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,9 +16,11 @@
|
||||
|
||||
#include "pair.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairLJClass2 : public Pair {
|
||||
public:
|
||||
PairLJClass2() {}
|
||||
PairLJClass2(class LAMMPS *);
|
||||
~PairLJClass2();
|
||||
void compute(int, int);
|
||||
void settings(int, char **);
|
||||
@ -39,4 +41,6 @@ class PairLJClass2 : public Pair {
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -23,12 +23,16 @@
|
||||
#include "neighbor.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairLJClass2CoulCut::PairLJClass2CoulCut(LAMMPS *lmp) : Pair(lmp) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairLJClass2CoulCut::~PairLJClass2CoulCut()
|
||||
{
|
||||
@ -333,7 +337,7 @@ void PairLJClass2CoulCut::init_style()
|
||||
{
|
||||
// require an atom style with charge defined
|
||||
|
||||
if (atom->charge_allow == 0)
|
||||
if (atom->q == NULL)
|
||||
error->all("Must use charged atom style with this pair style");
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,9 +16,11 @@
|
||||
|
||||
#include "pair.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairLJClass2CoulCut : public Pair {
|
||||
public:
|
||||
PairLJClass2CoulCut() {}
|
||||
PairLJClass2CoulCut(class LAMMPS *);
|
||||
~PairLJClass2CoulCut();
|
||||
void compute(int, int);
|
||||
void settings(int, char **);
|
||||
@ -41,4 +43,6 @@ class PairLJClass2CoulCut : public Pair {
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -25,6 +25,8 @@
|
||||
#include "neighbor.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
@ -36,9 +38,11 @@
|
||||
#define A4 -1.453152027
|
||||
#define A5 1.061405429
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairLJClass2CoulLong::PairLJClass2CoulLong(LAMMPS *lmp) : Pair(lmp) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairLJClass2CoulLong::~PairLJClass2CoulLong()
|
||||
{
|
||||
@ -339,7 +343,7 @@ void PairLJClass2CoulLong::init_style()
|
||||
{
|
||||
// require an atom style with charge defined
|
||||
|
||||
if (atom->charge_allow == 0)
|
||||
if (atom->q == NULL)
|
||||
error->all("Must use charged atom style with this pair style");
|
||||
|
||||
cut_coulsq = cut_coul * cut_coul;
|
||||
@ -474,3 +478,10 @@ void PairLJClass2CoulLong::single(int i, int j, int itype, int jtype,
|
||||
} else one.eng_vdwl = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void PairLJClass2CoulLong::extract_long(double *p_cut_coul)
|
||||
{
|
||||
*p_cut_coul = cut_coul;
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
|
||||
@ -4,10 +4,10 @@ if ($1 == 1) then
|
||||
|
||||
cp style_dpd.h ..
|
||||
|
||||
cp atom_dpd.cpp ..
|
||||
cp atom_vec_dpd.cpp ..
|
||||
cp pair_dpd.cpp ..
|
||||
|
||||
cp atom_dpd.h ..
|
||||
cp atom_vec_dpd.h ..
|
||||
cp pair_dpd.h ..
|
||||
|
||||
else if ($1 == 0) then
|
||||
@ -15,10 +15,10 @@ else if ($1 == 0) then
|
||||
rm ../style_dpd.h
|
||||
touch ../style_dpd.h
|
||||
|
||||
rm ../atom_dpd.cpp
|
||||
rm ../atom_vec_dpd.cpp
|
||||
rm ../pair_dpd.cpp
|
||||
|
||||
rm ../atom_dpd.h
|
||||
rm ../atom_vec_dpd.h
|
||||
rm ../pair_dpd.h
|
||||
|
||||
endif
|
||||
|
||||
@ -1,236 +0,0 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
|
||||
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.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "atom_dpd.h"
|
||||
#include "domain.h"
|
||||
#include "modify.h"
|
||||
#include "fix.h"
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
AtomDPD::AtomDPD(int narg, char **arg) : Atom(narg, arg) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void AtomDPD::copy(int i, int j)
|
||||
{
|
||||
tag[j] = tag[i];
|
||||
type[j] = type[i];
|
||||
mask[j] = mask[i];
|
||||
image[j] = image[i];
|
||||
x[j][0] = x[i][0];
|
||||
x[j][1] = x[i][1];
|
||||
x[j][2] = x[i][2];
|
||||
v[j][0] = v[i][0];
|
||||
v[j][1] = v[i][1];
|
||||
v[j][2] = v[i][2];
|
||||
|
||||
if (nextra_grow)
|
||||
for (int iextra = 0; iextra < nextra_grow; iextra++)
|
||||
modify->fix[extra_grow[iextra]]->copy_arrays(i,j);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void AtomDPD::pack_comm(int n, int *list, double *buf, int *pbc_flags)
|
||||
{
|
||||
int i,j,m;
|
||||
|
||||
m = 0;
|
||||
if (pbc_flags[0] == 0) {
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = x[j][0];
|
||||
buf[m++] = x[j][1];
|
||||
buf[m++] = x[j][2];
|
||||
buf[m++] = v[j][0];
|
||||
buf[m++] = v[j][1];
|
||||
buf[m++] = v[j][2];
|
||||
}
|
||||
} else {
|
||||
double xprd = domain->xprd;
|
||||
double yprd = domain->yprd;
|
||||
double zprd = domain->zprd;
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = x[j][0] + pbc_flags[1]*xprd;
|
||||
buf[m++] = x[j][1] + pbc_flags[2]*yprd;
|
||||
buf[m++] = x[j][2] + pbc_flags[3]*zprd;
|
||||
buf[m++] = v[j][0];
|
||||
buf[m++] = v[j][1];
|
||||
buf[m++] = v[j][2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void AtomDPD::unpack_comm(int n, int first, double *buf)
|
||||
{
|
||||
int i,m,last;
|
||||
|
||||
m = 0;
|
||||
last = first + n;
|
||||
for (i = first; i < last; i++) {
|
||||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
v[i][0] = buf[m++];
|
||||
v[i][1] = buf[m++];
|
||||
v[i][2] = buf[m++];
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void AtomDPD::pack_reverse(int n, int first, double *buf)
|
||||
{
|
||||
int i,m,last;
|
||||
|
||||
m = 0;
|
||||
last = first + n;
|
||||
for (i = first; i < last; i++) {
|
||||
buf[m++] = f[i][0];
|
||||
buf[m++] = f[i][1];
|
||||
buf[m++] = f[i][2];
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void AtomDPD::unpack_reverse(int n, int *list, double *buf)
|
||||
{
|
||||
int i,j,m;
|
||||
|
||||
m = 0;
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
f[j][0] += buf[m++];
|
||||
f[j][1] += buf[m++];
|
||||
f[j][2] += buf[m++];
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void AtomDPD::pack_border(int n, int *list, double *buf, int *pbc_flags)
|
||||
{
|
||||
int i,j,m;
|
||||
|
||||
m = 0;
|
||||
if (pbc_flags[0] == 0) {
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = x[j][0];
|
||||
buf[m++] = x[j][1];
|
||||
buf[m++] = x[j][2];
|
||||
buf[m++] = tag[j];
|
||||
buf[m++] = type[j];
|
||||
buf[m++] = mask[j];
|
||||
buf[m++] = v[j][0];
|
||||
buf[m++] = v[j][1];
|
||||
buf[m++] = v[j][2];
|
||||
}
|
||||
} else {
|
||||
double xprd = domain->xprd;
|
||||
double yprd = domain->yprd;
|
||||
double zprd = domain->zprd;
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = x[j][0] + pbc_flags[1]*xprd;
|
||||
buf[m++] = x[j][1] + pbc_flags[2]*yprd;
|
||||
buf[m++] = x[j][2] + pbc_flags[3]*zprd;
|
||||
buf[m++] = tag[j];
|
||||
buf[m++] = type[j];
|
||||
buf[m++] = mask[j];
|
||||
buf[m++] = v[j][0];
|
||||
buf[m++] = v[j][1];
|
||||
buf[m++] = v[j][2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void AtomDPD::unpack_border(int n, int first, double *buf)
|
||||
{
|
||||
int i,m,last;
|
||||
|
||||
m = 0;
|
||||
last = first + n;
|
||||
for (i = first; i < last; i++) {
|
||||
if (i == nmax) grow(0);
|
||||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = static_cast<int> (buf[m++]);
|
||||
type[i] = static_cast<int> (buf[m++]);
|
||||
mask[i] = static_cast<int> (buf[m++]);
|
||||
v[i][0] = buf[m++];
|
||||
v[i][1] = buf[m++];
|
||||
v[i][2] = buf[m++];
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
pack all atom quantities for shipping to another proc
|
||||
xyz must be 1st 3 values, so that comm::exchange can test on them
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int AtomDPD::pack_exchange(int i, double *buf)
|
||||
{
|
||||
int m = 1;
|
||||
buf[m++] = x[i][0];
|
||||
buf[m++] = x[i][1];
|
||||
buf[m++] = x[i][2];
|
||||
buf[m++] = v[i][0];
|
||||
buf[m++] = v[i][1];
|
||||
buf[m++] = v[i][2];
|
||||
buf[m++] = tag[i];
|
||||
buf[m++] = type[i];
|
||||
buf[m++] = mask[i];
|
||||
buf[m++] = image[i];
|
||||
|
||||
if (nextra_grow)
|
||||
for (int iextra = 0; iextra < nextra_grow; iextra++)
|
||||
m += modify->fix[extra_grow[iextra]]->pack_exchange(i,&buf[m]);
|
||||
|
||||
buf[0] = m;
|
||||
return m;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
int AtomDPD::unpack_exchange(double *buf)
|
||||
{
|
||||
if (nlocal == nmax) grow(0);
|
||||
|
||||
int m = 1;
|
||||
x[nlocal][0] = buf[m++];
|
||||
x[nlocal][1] = buf[m++];
|
||||
x[nlocal][2] = buf[m++];
|
||||
v[nlocal][0] = buf[m++];
|
||||
v[nlocal][1] = buf[m++];
|
||||
v[nlocal][2] = buf[m++];
|
||||
tag[nlocal] = static_cast<int> (buf[m++]);
|
||||
type[nlocal] = static_cast<int> (buf[m++]);
|
||||
mask[nlocal] = static_cast<int> (buf[m++]);
|
||||
image[nlocal] = static_cast<int> (buf[m++]);
|
||||
|
||||
if (nextra_grow)
|
||||
for (int iextra = 0; iextra < nextra_grow; iextra++)
|
||||
m += modify->fix[extra_grow[iextra]]->unpack_exchange(nlocal,&buf[m]);
|
||||
|
||||
nlocal++;
|
||||
return m;
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
|
||||
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.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifndef ATOM_DPD_H
|
||||
#define ATOM_DPD_H
|
||||
|
||||
#include "atom.h"
|
||||
|
||||
class AtomDPD : public Atom {
|
||||
public:
|
||||
AtomDPD(int, char **);
|
||||
~AtomDPD() {}
|
||||
void copy(int, int);
|
||||
void pack_comm(int, int *, double *, int *);
|
||||
void unpack_comm(int, int, double *);
|
||||
void pack_reverse(int, int, double *);
|
||||
void unpack_reverse(int, int *, double *);
|
||||
void pack_border(int, int *, double *, int *);
|
||||
void unpack_border(int, int, double *);
|
||||
int pack_exchange(int, double *);
|
||||
int unpack_exchange(double *);
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -28,6 +28,8 @@
|
||||
#include "neighbor.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
@ -35,14 +37,12 @@
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairDPD::PairDPD()
|
||||
PairDPD::PairDPD(LAMMPS *lmp) : Pair(lmp)
|
||||
{
|
||||
random = NULL;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairDPD::~PairDPD()
|
||||
{
|
||||
@ -208,7 +208,7 @@ void PairDPD::settings(int narg, char **arg)
|
||||
if (seed <= 0 || seed > 900000000)
|
||||
error->all("Illegal fix pair_style command");
|
||||
if (random) delete random;
|
||||
random = new RanMars(seed + comm->me);
|
||||
random = new RanMars(lmp,seed + comm->me);
|
||||
|
||||
// reset cutoffs that have been explicitly set
|
||||
|
||||
@ -372,7 +372,7 @@ void PairDPD::read_restart_settings(FILE *fp)
|
||||
// same seed that pair_style command initially specified
|
||||
|
||||
if (random) delete random;
|
||||
random = new RanMars(seed + comm->me);
|
||||
random = new RanMars(lmp,seed + comm->me);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -381,15 +381,7 @@ void PairDPD::single(int i, int j, int itype, int jtype, double rsq,
|
||||
double factor_coul, double factor_dpd, int eflag,
|
||||
One &one)
|
||||
{
|
||||
double r,rinv,dot,wd,randnum,phi;
|
||||
|
||||
double delx = atom->x[i][0] - atom->x[j][0];
|
||||
double dely = atom->x[i][1] - atom->x[j][1];
|
||||
double delz = atom->x[i][2] - atom->x[j][2];
|
||||
double delvx = atom->v[i][0] - atom->v[j][0];
|
||||
double delvy = atom->v[i][1] - atom->v[j][1];
|
||||
double delvz = atom->v[i][2] - atom->v[j][2];
|
||||
double dtinvsqrt = 1.0/sqrt(update->dt);
|
||||
double r,rinv,wd,phi;
|
||||
|
||||
r = sqrt(rsq);
|
||||
if (r < EPSILON) {
|
||||
@ -399,9 +391,7 @@ void PairDPD::single(int i, int j, int itype, int jtype, double rsq,
|
||||
}
|
||||
|
||||
rinv = 1.0/r;
|
||||
dot = delx*delvx + dely*delvy + delz*delvz;
|
||||
wd = 1.0 - r/cut[itype][jtype];
|
||||
randnum = random->gaussian();
|
||||
|
||||
one.fforce = a0[itype][jtype]*wd * factor_dpd*rinv;
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,11 +16,11 @@
|
||||
|
||||
#include "pair.h"
|
||||
|
||||
class RanMars;
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairDPD : public Pair {
|
||||
public:
|
||||
PairDPD();
|
||||
PairDPD(class LAMMPS *);
|
||||
~PairDPD();
|
||||
void compute(int, int);
|
||||
void settings(int, char **);
|
||||
@ -39,9 +39,11 @@ class PairDPD : public Pair {
|
||||
double **cut;
|
||||
double **a0,**gamma;
|
||||
double **sigma;
|
||||
RanMars *random;
|
||||
class RanMars *random;
|
||||
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -12,11 +12,11 @@
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef AtomInclude
|
||||
#include "atom_dpd.h"
|
||||
#include "atom_vec_dpd.h"
|
||||
#endif
|
||||
|
||||
#ifdef AtomClass
|
||||
AtomStyle(dpd,AtomDPD)
|
||||
AtomStyle(dpd,AtomVecDPD)
|
||||
#endif
|
||||
|
||||
#ifdef PairInclude
|
||||
|
||||
@ -1,28 +1,24 @@
|
||||
# Install/unInstall package classes in LAMMPS
|
||||
|
||||
# fix_shear_history.h must always be in src
|
||||
|
||||
if ($1 == 1) then
|
||||
|
||||
cp style_granular.h ..
|
||||
|
||||
cp atom_granular.cpp ..
|
||||
cp atom_vec_granular.cpp ..
|
||||
cp fix_freeze.cpp ..
|
||||
cp fix_gran_diag.cpp ..
|
||||
cp fix_nve_gran.cpp ..
|
||||
cp fix_pour.cpp ..
|
||||
cp fix_shear_history.cpp ..
|
||||
cp fix_wall_gran.cpp ..
|
||||
cp pair_gran_hertzian.cpp ..
|
||||
cp pair_gran_history.cpp ..
|
||||
cp pair_gran_no_history.cpp ..
|
||||
|
||||
cp atom_granular.h ..
|
||||
cp atom_vec_granular.h ..
|
||||
cp fix_freeze.h ..
|
||||
cp fix_gran_diag.h ..
|
||||
cp fix_nve_gran.h ..
|
||||
cp fix_pour.h ..
|
||||
# cp fix_shear_history.h ..
|
||||
cp fix_wall_gran.h ..
|
||||
cp pair_gran_hertzian.h ..
|
||||
cp pair_gran_history.h ..
|
||||
@ -33,23 +29,21 @@ else if ($1 == 0) then
|
||||
rm ../style_granular.h
|
||||
touch ../style_granular.h
|
||||
|
||||
rm ../atom_granular.cpp
|
||||
rm ../atom_vec_granular.cpp
|
||||
rm ../fix_freeze.cpp
|
||||
rm ../fix_gran_diag.cpp
|
||||
rm ../fix_nve_gran.cpp
|
||||
rm ../fix_pour.cpp
|
||||
rm ../fix_shear_history.cpp
|
||||
rm ../fix_wall_gran.cpp
|
||||
rm ../pair_gran_hertzian.cpp
|
||||
rm ../pair_gran_history.cpp
|
||||
rm ../pair_gran_no_history.cpp
|
||||
|
||||
rm ../atom_granular.h
|
||||
rm ../atom_vec_granular.h
|
||||
rm ../fix_freeze.h
|
||||
rm ../fix_gran_diag.h
|
||||
rm ../fix_nve_gran.h
|
||||
rm ../fix_pour.h
|
||||
# rm ../fix_shear_history.h
|
||||
rm ../fix_wall_gran.h
|
||||
rm ../pair_gran_hertzian.h
|
||||
rm ../pair_gran_history.h
|
||||
|
||||
@ -1,322 +0,0 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
|
||||
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.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "string.h"
|
||||
#include "atom_granular.h"
|
||||
#include "domain.h"
|
||||
#include "modify.h"
|
||||
#include "fix.h"
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
AtomGranular::AtomGranular(int narg, char **arg) : Atom(narg, arg) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void AtomGranular::copy(int i, int j)
|
||||
{
|
||||
tag[j] = tag[i];
|
||||
type[j] = type[i];
|
||||
mask[j] = mask[i];
|
||||
image[j] = image[i];
|
||||
x[j][0] = x[i][0];
|
||||
x[j][1] = x[i][1];
|
||||
x[j][2] = x[i][2];
|
||||
v[j][0] = v[i][0];
|
||||
v[j][1] = v[i][1];
|
||||
v[j][2] = v[i][2];
|
||||
phix[j][0] = phix[i][0];
|
||||
phix[j][1] = phix[i][1];
|
||||
phix[j][2] = phix[i][2];
|
||||
phiv[j][0] = phiv[i][0];
|
||||
phiv[j][1] = phiv[i][1];
|
||||
phiv[j][2] = phiv[i][2];
|
||||
radius[j] = radius[i];
|
||||
density[j] = density[i];
|
||||
rmass[j] = rmass[i];
|
||||
|
||||
if (nextra_grow)
|
||||
for (int iextra = 0; iextra < nextra_grow; iextra++)
|
||||
modify->fix[extra_grow[iextra]]->copy_arrays(i,j);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void AtomGranular::pack_comm(int n, int *list, double *buf, int *pbc_flags)
|
||||
{
|
||||
int i,j,m;
|
||||
|
||||
m = 0;
|
||||
if (pbc_flags[0] == 0) {
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = x[j][0];
|
||||
buf[m++] = x[j][1];
|
||||
buf[m++] = x[j][2];
|
||||
buf[m++] = v[j][0];
|
||||
buf[m++] = v[j][1];
|
||||
buf[m++] = v[j][2];
|
||||
buf[m++] = phiv[j][0];
|
||||
buf[m++] = phiv[j][1];
|
||||
buf[m++] = phiv[j][2];
|
||||
}
|
||||
} else {
|
||||
double xprd = domain->xprd;
|
||||
double yprd = domain->yprd;
|
||||
double zprd = domain->zprd;
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = x[j][0] + pbc_flags[1]*xprd;
|
||||
buf[m++] = x[j][1] + pbc_flags[2]*yprd;
|
||||
buf[m++] = x[j][2] + pbc_flags[3]*zprd;
|
||||
buf[m++] = v[j][0];
|
||||
buf[m++] = v[j][1];
|
||||
buf[m++] = v[j][2];
|
||||
buf[m++] = phiv[j][0];
|
||||
buf[m++] = phiv[j][1];
|
||||
buf[m++] = phiv[j][2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void AtomGranular::unpack_comm(int n, int first, double *buf)
|
||||
{
|
||||
int i,m,last;
|
||||
|
||||
m = 0;
|
||||
last = first + n;
|
||||
for (i = first; i < last; i++) {
|
||||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
v[i][0] = buf[m++];
|
||||
v[i][1] = buf[m++];
|
||||
v[i][2] = buf[m++];
|
||||
phiv[i][0] = buf[m++];
|
||||
phiv[i][1] = buf[m++];
|
||||
phiv[i][2] = buf[m++];
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void AtomGranular::pack_reverse(int n, int first, double *buf)
|
||||
{
|
||||
int i,m,last;
|
||||
|
||||
m = 0;
|
||||
last = first + n;
|
||||
for (i = first; i < last; i++) {
|
||||
buf[m++] = f[i][0];
|
||||
buf[m++] = f[i][1];
|
||||
buf[m++] = f[i][2];
|
||||
buf[m++] = phia[i][0];
|
||||
buf[m++] = phia[i][1];
|
||||
buf[m++] = phia[i][2];
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void AtomGranular::unpack_reverse(int n, int *list, double *buf)
|
||||
{
|
||||
int i,j,m;
|
||||
|
||||
m = 0;
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
f[j][0] += buf[m++];
|
||||
f[j][1] += buf[m++];
|
||||
f[j][2] += buf[m++];
|
||||
phia[j][0] += buf[m++];
|
||||
phia[j][1] += buf[m++];
|
||||
phia[j][2] += buf[m++];
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void AtomGranular::pack_border(int n, int *list, double *buf, int *pbc_flags)
|
||||
{
|
||||
int i,j,m;
|
||||
|
||||
m = 0;
|
||||
if (pbc_flags[0] == 0) {
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = x[j][0];
|
||||
buf[m++] = x[j][1];
|
||||
buf[m++] = x[j][2];
|
||||
buf[m++] = tag[j];
|
||||
buf[m++] = type[j];
|
||||
buf[m++] = mask[j];
|
||||
buf[m++] = v[j][0];
|
||||
buf[m++] = v[j][1];
|
||||
buf[m++] = v[j][2];
|
||||
buf[m++] = phiv[j][0];
|
||||
buf[m++] = phiv[j][1];
|
||||
buf[m++] = phiv[j][2];
|
||||
buf[m++] = radius[j];
|
||||
buf[m++] = rmass[j];
|
||||
}
|
||||
} else {
|
||||
double xprd = domain->xprd;
|
||||
double yprd = domain->yprd;
|
||||
double zprd = domain->zprd;
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = x[j][0] + pbc_flags[1]*xprd;
|
||||
buf[m++] = x[j][1] + pbc_flags[2]*yprd;
|
||||
buf[m++] = x[j][2] + pbc_flags[3]*zprd;
|
||||
buf[m++] = tag[j];
|
||||
buf[m++] = type[j];
|
||||
buf[m++] = mask[j];
|
||||
buf[m++] = v[j][0];
|
||||
buf[m++] = v[j][1];
|
||||
buf[m++] = v[j][2];
|
||||
buf[m++] = phiv[j][0];
|
||||
buf[m++] = phiv[j][1];
|
||||
buf[m++] = phiv[j][2];
|
||||
buf[m++] = radius[j];
|
||||
buf[m++] = rmass[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void AtomGranular::unpack_border(int n, int first, double *buf)
|
||||
{
|
||||
int i,m,last;
|
||||
|
||||
m = 0;
|
||||
last = first + n;
|
||||
for (i = first; i < last; i++) {
|
||||
if (i == nmax) grow(0);
|
||||
x[i][0] = buf[m++];
|
||||
x[i][1] = buf[m++];
|
||||
x[i][2] = buf[m++];
|
||||
tag[i] = static_cast<int> (buf[m++]);
|
||||
type[i] = static_cast<int> (buf[m++]);
|
||||
mask[i] = static_cast<int> (buf[m++]);
|
||||
v[i][0] = buf[m++];
|
||||
v[i][1] = buf[m++];
|
||||
v[i][2] = buf[m++];
|
||||
phiv[i][0] = buf[m++];
|
||||
phiv[i][1] = buf[m++];
|
||||
phiv[i][2] = buf[m++];
|
||||
radius[i] = buf[m++];
|
||||
rmass[i] = buf[m++];
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
pack all atom quantities for shipping to another proc
|
||||
xyz must be 1st 3 values, so that comm::exchange can test on them
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int AtomGranular::pack_exchange(int i, double *buf)
|
||||
{
|
||||
int m = 1;
|
||||
buf[m++] = x[i][0];
|
||||
buf[m++] = x[i][1];
|
||||
buf[m++] = x[i][2];
|
||||
buf[m++] = v[i][0];
|
||||
buf[m++] = v[i][1];
|
||||
buf[m++] = v[i][2];
|
||||
buf[m++] = phix[i][0];
|
||||
buf[m++] = phix[i][1];
|
||||
buf[m++] = phix[i][2];
|
||||
buf[m++] = phiv[i][0];
|
||||
buf[m++] = phiv[i][1];
|
||||
buf[m++] = phiv[i][2];
|
||||
buf[m++] = radius[i];
|
||||
buf[m++] = density[i];
|
||||
buf[m++] = rmass[i];
|
||||
buf[m++] = tag[i];
|
||||
buf[m++] = type[i];
|
||||
buf[m++] = mask[i];
|
||||
buf[m++] = image[i];
|
||||
|
||||
if (nextra_grow)
|
||||
for (int iextra = 0; iextra < nextra_grow; iextra++)
|
||||
m += modify->fix[extra_grow[iextra]]->pack_exchange(i,&buf[m]);
|
||||
|
||||
buf[0] = m;
|
||||
return m;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
int AtomGranular::unpack_exchange(double *buf)
|
||||
{
|
||||
if (nlocal == nmax) grow(0);
|
||||
|
||||
int m = 1;
|
||||
x[nlocal][0] = buf[m++];
|
||||
x[nlocal][1] = buf[m++];
|
||||
x[nlocal][2] = buf[m++];
|
||||
v[nlocal][0] = buf[m++];
|
||||
v[nlocal][1] = buf[m++];
|
||||
v[nlocal][2] = buf[m++];
|
||||
phix[nlocal][0] = buf[m++];
|
||||
phix[nlocal][1] = buf[m++];
|
||||
phix[nlocal][2] = buf[m++];
|
||||
phiv[nlocal][0] = buf[m++];
|
||||
phiv[nlocal][1] = buf[m++];
|
||||
phiv[nlocal][2] = buf[m++];
|
||||
radius[nlocal] = buf[m++];
|
||||
density[nlocal] = buf[m++];
|
||||
rmass[nlocal] = buf[m++];
|
||||
tag[nlocal] = static_cast<int> (buf[m++]);
|
||||
type[nlocal] = static_cast<int> (buf[m++]);
|
||||
mask[nlocal] = static_cast<int> (buf[m++]);
|
||||
image[nlocal] = static_cast<int> (buf[m++]);
|
||||
|
||||
if (nextra_grow)
|
||||
for (int iextra = 0; iextra < nextra_grow; iextra++)
|
||||
m += modify->fix[extra_grow[iextra]]->unpack_exchange(nlocal,&buf[m]);
|
||||
|
||||
nlocal++;
|
||||
return m;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
unpack vels & phis specific to granular data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void AtomGranular::unpack_vels(int n, char *buf)
|
||||
{
|
||||
int m,tagtmp;
|
||||
double vxtmp,vytmp,vztmp,phivxtmp,phivytmp,phivztmp;
|
||||
char *next;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
next = strchr(buf,'\n');
|
||||
*next = '\0';
|
||||
sscanf(buf,"%d %lg %lg %lg %lg %lg %lg",
|
||||
&tagtmp,&vxtmp,&vytmp,&vztmp,
|
||||
&phivxtmp,&phivytmp,&phivztmp);
|
||||
if ((m = map(tagtmp)) >= 0) {
|
||||
v[m][0] = vxtmp;
|
||||
v[m][1] = vytmp;
|
||||
v[m][2] = vztmp;
|
||||
phiv[m][0] = phivxtmp;
|
||||
phiv[m][1] = phivytmp;
|
||||
phiv[m][2] = phivztmp;
|
||||
}
|
||||
buf = next + 1;
|
||||
}
|
||||
}
|
||||
@ -1,36 +0,0 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
|
||||
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.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifndef ATOM_GRANULAR_H
|
||||
#define ATOM_GRANULAR_H
|
||||
|
||||
#include "atom.h"
|
||||
|
||||
class AtomGranular : public Atom {
|
||||
public:
|
||||
AtomGranular(int, char **);
|
||||
~AtomGranular() {}
|
||||
void copy(int, int);
|
||||
void pack_comm(int, int *, double *, int *);
|
||||
void unpack_comm(int, int, double *);
|
||||
void pack_reverse(int, int, double *);
|
||||
void unpack_reverse(int, int *, double *);
|
||||
void pack_border(int, int *, double *, int *);
|
||||
void unpack_border(int, int, double *);
|
||||
int pack_exchange(int, double *);
|
||||
int unpack_exchange(double *);
|
||||
|
||||
void unpack_vels(int, char *);
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -18,9 +18,12 @@
|
||||
#include "comm.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixFreeze::FixFreeze(int narg, char **arg) : Fix(narg, arg)
|
||||
FixFreeze::FixFreeze(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg)
|
||||
{
|
||||
if (narg != 3) error->all("Illegal fix freeze command");
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,14 +16,17 @@
|
||||
|
||||
#include "fix.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class FixFreeze : public Fix {
|
||||
public:
|
||||
FixFreeze(int, char **);
|
||||
~FixFreeze() {}
|
||||
FixFreeze(class LAMMPS *, int, char **);
|
||||
int setmask();
|
||||
void init();
|
||||
void setup();
|
||||
void post_force(int);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -17,28 +17,29 @@
|
||||
|
||||
#include "math.h"
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
#include "fix_gran_diag.h"
|
||||
#include "update.h"
|
||||
#include "force.h"
|
||||
#include "pair_gran_no_history.h"
|
||||
#include "pair_gran_history.h"
|
||||
#include "pair_gran_hertzian.h"
|
||||
#include "pair.h"
|
||||
#include "atom.h"
|
||||
#include "neighbor.h"
|
||||
#include "modify.h"
|
||||
#include "comm.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
#define NO_HISTORY 1
|
||||
#define HISTORY 2
|
||||
#define HERTZIAN 3
|
||||
enum{NO_HISTORY,HISTORY,HERTZIAN};
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixGranDiag::FixGranDiag(int narg, char **arg) : Fix(narg, arg)
|
||||
FixGranDiag::FixGranDiag(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg)
|
||||
{
|
||||
if (narg != 6) error->all("Illegal fix gran/diag command");
|
||||
nevery = atoi(arg[3]);
|
||||
@ -112,37 +113,38 @@ int FixGranDiag::setmask()
|
||||
|
||||
void FixGranDiag::init()
|
||||
{
|
||||
// insure use of granular pair_style
|
||||
// set local values from Pair values
|
||||
|
||||
Pair *pair = force->pair_match("gran");
|
||||
if (pair == NULL)
|
||||
error->all("Fix gran/diag is incompatible with Pair style");
|
||||
int dampflag;
|
||||
double gamman;
|
||||
pair->extract_gran(&xkk,&gamman,&xmu,&dampflag);
|
||||
|
||||
// same initialization as in pair_gran_history::init_style()
|
||||
|
||||
xkkt = xkk * 2.0/7.0;
|
||||
dt = update->dt;
|
||||
double gammas = 0.5*gamman;
|
||||
if (dampflag == 0) gammas = 0.0;
|
||||
gamman_dl = gamman/dt;
|
||||
gammas_dl = gammas/dt;
|
||||
|
||||
// set constants from pair style
|
||||
// set pairstyle from granular pair style
|
||||
|
||||
Pair *anypair;
|
||||
if (anypair = force->pair_match("gran/no_history")) {
|
||||
pairstyle = NO_HISTORY;
|
||||
xkk = ((PairGranNoHistory *) anypair)->xkk;
|
||||
xkkt = ((PairGranNoHistory *) anypair)->xkkt;
|
||||
xmu = ((PairGranNoHistory *) anypair)->xmu;
|
||||
gamman_dl = ((PairGranNoHistory *) anypair)->gamman_dl;
|
||||
gammas_dl = ((PairGranNoHistory *) anypair)->gammas_dl;
|
||||
freeze_group_bit = ((PairGranNoHistory *) anypair)->freeze_group_bit;
|
||||
} else if (anypair = force->pair_match("gran/history")) {
|
||||
pairstyle = HISTORY;
|
||||
xkk = ((PairGranHistory *) anypair)->xkk;
|
||||
xkkt = ((PairGranHistory *) anypair)->xkkt;
|
||||
xmu = ((PairGranHistory *) anypair)->xmu;
|
||||
gamman_dl = ((PairGranHistory *) anypair)->gamman_dl;
|
||||
gammas_dl = ((PairGranHistory *) anypair)->gammas_dl;
|
||||
freeze_group_bit = ((PairGranNoHistory *) anypair)->freeze_group_bit;
|
||||
} else if (anypair = force->pair_match("gran/hertzian")) {
|
||||
pairstyle = HERTZIAN;
|
||||
xkk = ((PairGranHertzian *) anypair)->xkk;
|
||||
xkkt = ((PairGranHertzian *) anypair)->xkkt;
|
||||
xmu = ((PairGranHertzian *) anypair)->xmu;
|
||||
gamman_dl = ((PairGranHertzian *) anypair)->gamman_dl;
|
||||
gammas_dl = ((PairGranHertzian *) anypair)->gammas_dl;
|
||||
freeze_group_bit = ((PairGranNoHistory *) anypair)->freeze_group_bit;
|
||||
} else
|
||||
error->all("Must use fix gran/diag with granular pair style");
|
||||
if (force->pair_match("gran/no_history")) pairstyle = NO_HISTORY;
|
||||
else if (force->pair_match("gran/history")) pairstyle = HISTORY;
|
||||
else if (force->pair_match("gran/hertzian")) pairstyle = HERTZIAN;
|
||||
|
||||
// check for freeze Fix and set freeze_group_bit
|
||||
|
||||
int i;
|
||||
for (i = 0; i < modify->nfix; i++)
|
||||
if (strcmp(modify->fix[i]->style,"freeze") == 0) break;
|
||||
if (i < modify->nfix) freeze_group_bit = modify->fix[i]->groupbit;
|
||||
else freeze_group_bit = 0;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -17,9 +17,11 @@
|
||||
#include "stdio.h"
|
||||
#include "fix.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class FixGranDiag : public Fix {
|
||||
public:
|
||||
FixGranDiag(int, char **);
|
||||
FixGranDiag(class LAMMPS *, int, char **);
|
||||
~FixGranDiag();
|
||||
int setmask();
|
||||
void init();
|
||||
@ -50,4 +52,6 @@ class FixGranDiag : public Fix {
|
||||
void stress_hertzian();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -19,6 +19,8 @@
|
||||
#include "force.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
// moments of inertia for sphere and disk
|
||||
|
||||
#define INERTIA3D 0.4
|
||||
@ -26,7 +28,8 @@
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixNVEGran::FixNVEGran(int narg, char **arg) : Fix(narg, arg)
|
||||
FixNVEGran::FixNVEGran(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg)
|
||||
{
|
||||
if (narg != 3) error->all("Illegal fix nve/gran command");
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,10 +16,11 @@
|
||||
|
||||
#include "fix.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class FixNVEGran : public Fix {
|
||||
public:
|
||||
FixNVEGran(int, char **);
|
||||
~FixNVEGran() {}
|
||||
FixNVEGran(class LAMMPS *, int, char **);
|
||||
int setmask();
|
||||
void init();
|
||||
void initial_integrate();
|
||||
@ -29,4 +30,6 @@ class FixNVEGran : public Fix {
|
||||
double dtv,dtf,dtfphi;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,6 +16,7 @@
|
||||
#include "string.h"
|
||||
#include "fix_pour.h"
|
||||
#include "atom.h"
|
||||
#include "atom_vec.h"
|
||||
#include "force.h"
|
||||
#include "update.h"
|
||||
#include "comm.h"
|
||||
@ -30,11 +31,14 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define EPSILON 0.001
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixPour::FixPour(int narg, char **arg) : Fix(narg, arg)
|
||||
FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg)
|
||||
{
|
||||
if (narg < 6) error->all("Illegal fix pour command");
|
||||
|
||||
@ -151,7 +155,7 @@ FixPour::FixPour(int narg, char **arg) : Fix(narg, arg)
|
||||
|
||||
// random number generator, same for all procs
|
||||
|
||||
random = new RanPark(seed);
|
||||
random = new RanPark(lmp,seed);
|
||||
|
||||
// allgather arrays
|
||||
|
||||
@ -269,10 +273,11 @@ void FixPour::init()
|
||||
|
||||
// check if a shear history fix exists
|
||||
|
||||
ifix_history = -1;
|
||||
fix_history = NULL;
|
||||
if (force->pair_match("gran/history") || force->pair_match("gran/hertzian"))
|
||||
for (int i = 0; i < modify->nfix; i++)
|
||||
if (strcmp(modify->fix[i]->style,"SHEAR_HISTORY") == 0) ifix_history = i;
|
||||
if (strcmp(modify->fix[i]->style,"SHEAR_HISTORY") == 0)
|
||||
fix_history = (FixShearHistory *) modify->fix[i];
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -403,7 +408,7 @@ void FixPour::pre_exchange()
|
||||
error->warning("Less insertions than requested");
|
||||
|
||||
// check if new atom is in my sub-box or above it if I'm highest proc
|
||||
// if so, add to my list via create_one()
|
||||
// if so, add to my list via create_atom()
|
||||
// initialize info about the atom
|
||||
// type, diameter, density set from fix parameters
|
||||
// group mask set to "all" plus fix group
|
||||
@ -412,6 +417,7 @@ void FixPour::pre_exchange()
|
||||
// this gives continuous stream of atoms
|
||||
// set npartner for new atom to 0 (assume not touching any others)
|
||||
|
||||
AtomVec *avec = atom->avec;
|
||||
int m,flag;
|
||||
double denstmp,vxtmp,vytmp,vztmp;
|
||||
double g = 1.0;
|
||||
@ -445,7 +451,7 @@ void FixPour::pre_exchange()
|
||||
xtmp >= domain->subxlo && xtmp < domain->subxhi) flag = 1;
|
||||
|
||||
if (flag) {
|
||||
atom->create_one(ntype,xtmp,ytmp,ztmp);
|
||||
avec->create_atom(ntype,xtmp,ytmp,ztmp,0);
|
||||
m = atom->nlocal - 1;
|
||||
atom->type[m] = ntype;
|
||||
atom->radius[m] = radtmp;
|
||||
@ -458,8 +464,7 @@ void FixPour::pre_exchange()
|
||||
atom->v[m][0] = vxtmp;
|
||||
atom->v[m][1] = vytmp;
|
||||
atom->v[m][2] = vztmp;
|
||||
if (ifix_history >= 0)
|
||||
((FixShearHistory *) modify->fix[ifix_history])->npartner[m] = 0;
|
||||
if (fix_history) fix_history->npartner[m] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
#include "fix.h"
|
||||
|
||||
class RanPark;
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class FixPour : public Fix {
|
||||
friend class PairGranHistory;
|
||||
@ -24,7 +24,7 @@ class FixPour : public Fix {
|
||||
friend class PairGranNoHistory;
|
||||
|
||||
public:
|
||||
FixPour(int, char **);
|
||||
FixPour(class LAMMPS *, int, char **);
|
||||
~FixPour();
|
||||
int setmask();
|
||||
void init();
|
||||
@ -47,12 +47,13 @@ class FixPour : public Fix {
|
||||
double PI;
|
||||
int nfreq,nfirst,ninserted,nper;
|
||||
double lo_current,hi_current;
|
||||
int ifix_history;
|
||||
|
||||
RanPark *random;
|
||||
class FixShearHistory *fix_history;
|
||||
class RanPark *random;
|
||||
|
||||
int overlap(int);
|
||||
void xyz_random(double, double &, double &, double &);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,282 +0,0 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
|
||||
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.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "string.h"
|
||||
#include "stdio.h"
|
||||
#include "fix_shear_history.h"
|
||||
#include "atom.h"
|
||||
#include "neighbor.h"
|
||||
#include "force.h"
|
||||
#include "update.h"
|
||||
#include "modify.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
#define MAXTOUCH 15
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixShearHistory::FixShearHistory(int narg, char **arg) : Fix(narg, arg)
|
||||
{
|
||||
restart_peratom = 1;
|
||||
|
||||
// perform initial allocation of atom-based arrays
|
||||
// register with atom class
|
||||
|
||||
npartner = NULL;
|
||||
partner = NULL;
|
||||
shearpartner = NULL;
|
||||
grow_arrays(atom->nmax);
|
||||
atom->add_callback(0);
|
||||
atom->add_callback(1);
|
||||
|
||||
// initialize npartner to 0 so neighbor list creation is OK the 1st time
|
||||
|
||||
int nlocal = atom->nlocal;
|
||||
for (int i = 0; i < nlocal; i++) npartner[i] = 0;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixShearHistory::~FixShearHistory()
|
||||
{
|
||||
// if atom class still exists:
|
||||
// unregister this fix so atom class doesn't invoke it any more
|
||||
|
||||
if (atom) atom->delete_callback(id,0);
|
||||
if (atom) atom->delete_callback(id,1);
|
||||
|
||||
// delete locally stored arrays
|
||||
|
||||
memory->sfree(npartner);
|
||||
memory->destroy_2d_int_array(partner);
|
||||
memory->destroy_3d_double_array(shearpartner);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
int FixShearHistory::setmask()
|
||||
{
|
||||
int mask = 0;
|
||||
mask |= PRE_EXCHANGE;
|
||||
return mask;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixShearHistory::init()
|
||||
{
|
||||
if (atom->tag_enable == 0)
|
||||
error->all("Pair style granular with history requires atoms have IDs");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
copy shear partner info from neighbor lists to atom arrays
|
||||
so can be exchanged with atoms
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixShearHistory::pre_exchange()
|
||||
{
|
||||
int i,j,k,m;
|
||||
|
||||
// zero npartners for all current atoms
|
||||
|
||||
int nlocal = atom->nlocal;
|
||||
for (i = 0; i < nlocal; i++) npartner[i] = 0;
|
||||
|
||||
// copy shear info from neighbor list atoms to atom arrays
|
||||
// nlocal = nlocal_neighbor = nlocal when neighbor list last built,
|
||||
// which might be pre-insert on this step
|
||||
|
||||
int numneigh;
|
||||
int *neighs,*touch;
|
||||
double *firstshear,*shear;
|
||||
int *tag = atom->tag;
|
||||
nlocal = neighbor->nlocal_neighbor;
|
||||
|
||||
for (i = 0; i < nlocal; i++) {
|
||||
neighs = neighbor->firstneigh[i];
|
||||
touch = neighbor->firsttouch[i];
|
||||
firstshear = neighbor->firstshear[i];
|
||||
numneigh = neighbor->numneigh[i];
|
||||
for (k = 0; k < numneigh; k++) {
|
||||
if (touch[k]) {
|
||||
shear = &firstshear[3*k];
|
||||
j = neighs[k];
|
||||
if (npartner[i] < MAXTOUCH) {
|
||||
m = npartner[i];
|
||||
partner[i][m] = tag[j];
|
||||
shearpartner[i][m][0] = shear[0];
|
||||
shearpartner[i][m][1] = shear[1];
|
||||
shearpartner[i][m][2] = shear[2];
|
||||
}
|
||||
npartner[i]++;
|
||||
if (j < nlocal) {
|
||||
if (npartner[j] < MAXTOUCH) {
|
||||
m = npartner[j];
|
||||
partner[j][m] = tag[i];
|
||||
shearpartner[j][m][0] = -shear[0];
|
||||
shearpartner[j][m][1] = -shear[1];
|
||||
shearpartner[j][m][2] = -shear[2];
|
||||
}
|
||||
npartner[j]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// test for too many touching neighbors
|
||||
|
||||
int flag = 0;
|
||||
for (i = 0; i < nlocal; i++)
|
||||
if (npartner[i] >= MAXTOUCH) flag = 1;
|
||||
int flag_all;
|
||||
MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
|
||||
if (flag_all) error->all("Too many touching neighbors - boost MAXTOUCH");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
memory usage of local atom-based arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixShearHistory::memory_usage()
|
||||
{
|
||||
int nmax = atom->nmax;
|
||||
int bytes = nmax * sizeof(int);
|
||||
bytes += nmax*MAXTOUCH * sizeof(int);
|
||||
bytes += nmax*MAXTOUCH*3 * sizeof(double);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
allocate local atom-based arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixShearHistory::grow_arrays(int nmax)
|
||||
{
|
||||
npartner = (int *) memory->srealloc(npartner,nmax*sizeof(int),
|
||||
"shear_history:npartner");
|
||||
partner = memory->grow_2d_int_array(partner,nmax,MAXTOUCH,
|
||||
"shear_history:partner");
|
||||
shearpartner =
|
||||
memory->grow_3d_double_array(shearpartner,nmax,MAXTOUCH,3,
|
||||
"shear_history:shearpartner");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
copy values within local atom-based arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixShearHistory::copy_arrays(int i, int j)
|
||||
{
|
||||
npartner[j] = npartner[i];
|
||||
for (int m = 0; m < npartner[j]; m++) {
|
||||
partner[j][m] = partner[i][m];
|
||||
shearpartner[j][m][0] = shearpartner[i][m][0];
|
||||
shearpartner[j][m][1] = shearpartner[i][m][1];
|
||||
shearpartner[j][m][2] = shearpartner[i][m][2];
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
pack values in local atom-based arrays for exchange with another proc
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixShearHistory::pack_exchange(int i, double *buf)
|
||||
{
|
||||
int m = 0;
|
||||
buf[m++] = npartner[i];
|
||||
for (int n = 0; n < npartner[i]; n++) {
|
||||
buf[m++] = partner[i][n];
|
||||
buf[m++] = shearpartner[i][n][0];
|
||||
buf[m++] = shearpartner[i][n][1];
|
||||
buf[m++] = shearpartner[i][n][2];
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
unpack values in local atom-based arrays from exchange with another proc
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixShearHistory::unpack_exchange(int nlocal, double *buf)
|
||||
{
|
||||
int m = 0;
|
||||
npartner[nlocal] = static_cast<int> (buf[m++]);
|
||||
for (int n = 0; n < npartner[nlocal]; n++) {
|
||||
partner[nlocal][n] = static_cast<int> (buf[m++]);
|
||||
shearpartner[nlocal][n][0] = buf[m++];
|
||||
shearpartner[nlocal][n][1] = buf[m++];
|
||||
shearpartner[nlocal][n][2] = buf[m++];
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
pack values in local atom-based arrays for restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixShearHistory::pack_restart(int i, double *buf)
|
||||
{
|
||||
int m = 0;
|
||||
buf[m++] = 4*npartner[i] + 2;
|
||||
buf[m++] = npartner[i];
|
||||
for (int n = 0; n < npartner[i]; n++) {
|
||||
buf[m++] = partner[i][n];
|
||||
buf[m++] = shearpartner[i][n][0];
|
||||
buf[m++] = shearpartner[i][n][1];
|
||||
buf[m++] = shearpartner[i][n][2];
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
unpack values from atom->extra array to restart the fix
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixShearHistory::unpack_restart(int nlocal, int nth)
|
||||
{
|
||||
double **extra = atom->extra;
|
||||
|
||||
// skip to Nth set of extra values
|
||||
|
||||
int m = 0;
|
||||
for (int i = 0; i < nth; i++) m += static_cast<int> (extra[nlocal][m]);
|
||||
m++;
|
||||
|
||||
npartner[nlocal] = static_cast<int> (extra[nlocal][m++]);
|
||||
for (int n = 0; n < npartner[nlocal]; n++) {
|
||||
partner[nlocal][n] = static_cast<int> (extra[nlocal][m++]);
|
||||
shearpartner[nlocal][n][0] = extra[nlocal][m++];
|
||||
shearpartner[nlocal][n][1] = extra[nlocal][m++];
|
||||
shearpartner[nlocal][n][2] = extra[nlocal][m++];
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
maxsize of any atom's restart data
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixShearHistory::maxsize_restart()
|
||||
{
|
||||
return 4*MAXTOUCH + 2;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
size of atom nlocal's restart data
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int FixShearHistory::size_restart(int nlocal)
|
||||
{
|
||||
return 4*npartner[nlocal] + 2;
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -22,21 +22,15 @@
|
||||
#include "atom.h"
|
||||
#include "update.h"
|
||||
#include "force.h"
|
||||
#include "pair.h"
|
||||
#include "modify.h"
|
||||
#include "pair_gran_no_history.h"
|
||||
#include "pair_gran_history.h"
|
||||
#include "pair_gran_hertzian.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
#define XPLANE 1
|
||||
#define YPLANE 2
|
||||
#define ZPLANE 3
|
||||
#define ZCYLINDER 4
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define NO_HISTORY 1
|
||||
#define HISTORY 2
|
||||
#define HERTZIAN 3
|
||||
enum{XPLANE,YPLANE,ZPLANE,ZCYLINDER};
|
||||
enum{NO_HISTORY,HISTORY,HERTZIAN};
|
||||
|
||||
#define BIG 1.0e20
|
||||
|
||||
@ -45,7 +39,8 @@
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixWallGran::FixWallGran(int narg, char **arg) : Fix(narg, arg)
|
||||
FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg)
|
||||
{
|
||||
if (narg < 4) error->all("Illegal fix wall/gran command");
|
||||
|
||||
@ -125,7 +120,7 @@ FixWallGran::FixWallGran(int narg, char **arg) : Fix(narg, arg)
|
||||
}
|
||||
|
||||
// perform initial allocation of atom-based arrays
|
||||
// register with atom class
|
||||
// register with Atom class
|
||||
|
||||
shear = NULL;
|
||||
grow_arrays(atom->nmax);
|
||||
@ -143,11 +138,10 @@ FixWallGran::FixWallGran(int narg, char **arg) : Fix(narg, arg)
|
||||
|
||||
FixWallGran::~FixWallGran()
|
||||
{
|
||||
// if atom class still exists:
|
||||
// unregister this fix so atom class doesn't invoke it any more
|
||||
// unregister callbacks to this fix from Atom class
|
||||
|
||||
if (atom) atom->delete_callback(id,0);
|
||||
if (atom) atom->delete_callback(id,1);
|
||||
atom->delete_callback(id,0);
|
||||
atom->delete_callback(id,1);
|
||||
|
||||
// delete locally stored arrays
|
||||
|
||||
@ -167,32 +161,29 @@ int FixWallGran::setmask()
|
||||
|
||||
void FixWallGran::init()
|
||||
{
|
||||
// set constants that depend on pair style
|
||||
// insure use of granular pair_style
|
||||
// set local values from Pair values
|
||||
|
||||
Pair *anypair;
|
||||
if (anypair = force->pair_match("gran/no_history")) {
|
||||
historystyle = 0;
|
||||
pairstyle = NO_HISTORY;
|
||||
xkk = ((PairGranNoHistory *) anypair)->xkk;
|
||||
xkkt = ((PairGranNoHistory *) anypair)->xkkt;
|
||||
} else if (anypair = force->pair_match("gran/history")) {
|
||||
historystyle = 1;
|
||||
pairstyle = HISTORY;
|
||||
xkk = ((PairGranHistory *) anypair)->xkk;
|
||||
xkkt = ((PairGranHistory *) anypair)->xkkt;
|
||||
} else if (anypair = force->pair_match("gran/hertzian")) {
|
||||
historystyle = 1;
|
||||
pairstyle = HERTZIAN;
|
||||
xkk = ((PairGranHertzian *) anypair)->xkk;
|
||||
xkkt = ((PairGranHertzian *) anypair)->xkkt;
|
||||
} else
|
||||
error->all("Fix wall/gran can only be used with granular pair style");
|
||||
Pair *pair = force->pair_match("gran");
|
||||
if (pair == NULL)
|
||||
error->all("Fix wall/gran is incompatible with Pair style");
|
||||
int itmp;
|
||||
double tmp1,tmp2;
|
||||
pair->extract_gran(&xkk,&tmp1,&tmp2,&itmp);
|
||||
|
||||
// friction coeffs
|
||||
// same initialization as in pair_gran_history::init_style()
|
||||
|
||||
xkkt = xkk * 2.0/7.0;
|
||||
dt = update->dt;
|
||||
double gammas = 0.5*gamman;
|
||||
gamman_dl = gamman/dt;
|
||||
gammas_dl = 0.5*gamman_dl;
|
||||
gammas_dl = gammas/dt;
|
||||
|
||||
// set pairstyle from granular pair style
|
||||
|
||||
if (force->pair_match("gran/no_history")) pairstyle = NO_HISTORY;
|
||||
else if (force->pair_match("gran/history")) pairstyle = HISTORY;
|
||||
else if (force->pair_match("gran/hertzian")) pairstyle = HERTZIAN;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -274,7 +265,7 @@ void FixWallGran::post_force(int vflag)
|
||||
rsq = dx*dx + dy*dy + dz*dz;
|
||||
|
||||
if (rsq > radius[i]*radius[i]) {
|
||||
if (historystyle) {
|
||||
if (pairstyle != NO_HISTORY) {
|
||||
shear[i][0] = 0.0;
|
||||
shear[i][1] = 0.0;
|
||||
shear[i][2] = 0.0;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,9 +16,11 @@
|
||||
|
||||
#include "fix.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class FixWallGran : public Fix {
|
||||
public:
|
||||
FixWallGran(int, char **);
|
||||
FixWallGran(class LAMMPS *, int, char **);
|
||||
~FixWallGran();
|
||||
int setmask();
|
||||
void init();
|
||||
@ -36,7 +38,7 @@ class FixWallGran : public Fix {
|
||||
int maxsize_restart();
|
||||
|
||||
private:
|
||||
int wallstyle,pairstyle,historystyle,wiggle,axis;
|
||||
int wallstyle,pairstyle,wiggle,axis;
|
||||
double xkk,xkkt,gamman,xmu;
|
||||
double lo,hi,cylradius;
|
||||
double dt,gamman_dl,gammas_dl;
|
||||
@ -55,4 +57,6 @@ class FixWallGran : public Fix {
|
||||
double *);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -23,11 +23,20 @@
|
||||
#include "force.h"
|
||||
#include "neighbor.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairGranHertzian::PairGranHertzian(LAMMPS *lmp) : PairGranHistory(lmp)
|
||||
{
|
||||
history = 1;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void PairGranHertzian::compute(int eflag, int vflag)
|
||||
{
|
||||
int i,j,k,numneigh;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,9 +16,14 @@
|
||||
|
||||
#include "pair_gran_history.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairGranHertzian : public PairGranHistory {
|
||||
public:
|
||||
PairGranHertzian(class LAMMPS *);
|
||||
void compute(int, int);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -32,24 +32,27 @@
|
||||
#include "neighbor.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairGranHistory::PairGranHistory()
|
||||
PairGranHistory::PairGranHistory(LAMMPS *lmp) : Pair(lmp)
|
||||
{
|
||||
single_enable = 0;
|
||||
|
||||
for (int i = 0; i < 6; i++) virial[i] = 0.0;
|
||||
ifix_history = -1;
|
||||
history = 1;
|
||||
fix_history = NULL;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairGranHistory::~PairGranHistory()
|
||||
{
|
||||
if (ifix_history >= 0) modify->delete_fix("SHEAR_HISTORY");
|
||||
if (fix_history) modify->delete_fix("SHEAR_HISTORY");
|
||||
|
||||
if (allocated) {
|
||||
memory->destroy_2d_int_array(setflag);
|
||||
@ -335,32 +338,21 @@ void PairGranHistory::init_style()
|
||||
if (atom->check_style("granular") == 0)
|
||||
error->all("Must use atom style granular with pair style granular");
|
||||
|
||||
// for pair choices with shear history:
|
||||
// if shear history is stored:
|
||||
// check if newton flag is valid
|
||||
// if first init, create Fix needed for storing shear history
|
||||
|
||||
int history = 0;
|
||||
if (force->pair_match("gran/history") || force->pair_match("gran/hertzian"))
|
||||
history = 1;
|
||||
|
||||
if (history && force->newton_pair == 1)
|
||||
error->all("Potential with shear history requires newton pair off");
|
||||
|
||||
if (history && ifix_history == -1) {
|
||||
if (history && fix_history == NULL) {
|
||||
char **fixarg = new char*[3];
|
||||
fixarg[0] = "SHEAR_HISTORY";
|
||||
fixarg[1] = "all";
|
||||
fixarg[2] = "SHEAR_HISTORY";
|
||||
modify->add_fix(3,fixarg);
|
||||
delete [] fixarg;
|
||||
}
|
||||
|
||||
// find associated SHEAR_HISTORY fix that must exist
|
||||
// could have changed locations in fix list since created
|
||||
|
||||
if (history) {
|
||||
for (i = 0; i < modify->nfix; i++)
|
||||
if (strcmp(modify->fix[i]->style,"SHEAR_HISTORY") == 0) ifix_history = i;
|
||||
fix_history = (FixShearHistory *) modify->fix[modify->nfix-1];
|
||||
}
|
||||
|
||||
// check for freeze Fix and set freeze_group_bit
|
||||
@ -452,3 +444,14 @@ void PairGranHistory::read_restart_settings(FILE *fp)
|
||||
MPI_Bcast(&xmu,1,MPI_DOUBLE,0,world);
|
||||
MPI_Bcast(&dampflag,1,MPI_INT,0,world);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void PairGranHistory::extract_gran(double *p_xkk, double *p_gamman,
|
||||
double *p_xmu, int *p_dampflag)
|
||||
{
|
||||
*p_xkk = xkk;
|
||||
*p_gamman = gamman;
|
||||
*p_xmu = xmu;
|
||||
*p_dampflag = dampflag;
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,13 +16,11 @@
|
||||
|
||||
#include "pair.h"
|
||||
|
||||
class PairGranHistory : public Pair {
|
||||
friend class Neighbor;
|
||||
friend class FixWallGran;
|
||||
friend class FixGranDiag;
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairGranHistory : public Pair {
|
||||
public:
|
||||
PairGranHistory();
|
||||
PairGranHistory(class LAMMPS *);
|
||||
~PairGranHistory();
|
||||
virtual void compute(int, int);
|
||||
void settings(int, char **);
|
||||
@ -34,14 +32,20 @@ class PairGranHistory : public Pair {
|
||||
void write_restart_settings(FILE *);
|
||||
void read_restart_settings(FILE *);
|
||||
|
||||
void extract_gran(double *, double *, double *, int *);
|
||||
|
||||
protected:
|
||||
double xkk,xkkt,xmu;
|
||||
int dampflag;
|
||||
double gamman;
|
||||
double dt,gamman_dl,gammas_dl;
|
||||
int ifix_history,freeze_group_bit;
|
||||
int freeze_group_bit;
|
||||
int history;
|
||||
class FixShearHistory *fix_history;
|
||||
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -23,11 +23,20 @@
|
||||
#include "force.h"
|
||||
#include "neighbor.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairGranNoHistory::PairGranNoHistory(LAMMPS *lmp) : PairGranHistory(lmp)
|
||||
{
|
||||
history = 0;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void PairGranNoHistory::compute(int eflag, int vflag)
|
||||
{
|
||||
int i,j,k,numneigh;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,9 +16,14 @@
|
||||
|
||||
#include "pair_gran_history.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairGranNoHistory : public PairGranHistory {
|
||||
public:
|
||||
PairGranNoHistory(class LAMMPS *);
|
||||
void compute(int, int);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -12,11 +12,11 @@
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef AtomInclude
|
||||
#include "atom_granular.h"
|
||||
#include "atom_vec_granular.h"
|
||||
#endif
|
||||
|
||||
#ifdef AtomClass
|
||||
AtomStyle(granular,AtomGranular)
|
||||
AtomStyle(granular,AtomVecGranular)
|
||||
# endif
|
||||
|
||||
#ifdef FixInclude
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
# Install/unInstall package classes in LAMMPS
|
||||
|
||||
# pair_lj_charmm_coul_long.h must always be in src
|
||||
|
||||
if ($1 == 1) then
|
||||
|
||||
cp style_kspace.h ..
|
||||
@ -24,7 +22,7 @@ if ($1 == 1) then
|
||||
cp pair_buck_coul_long.h ..
|
||||
cp pair_lj_cut_coul_long.h ..
|
||||
cp pair_lj_cut_coul_long_tip4p.h ..
|
||||
# cp pair_lj_charmm_coul_long.h ..
|
||||
cp pair_lj_charmm_coul_long.h ..
|
||||
cp fft3d.h ..
|
||||
cp fft3d_wrap.h ..
|
||||
cp remap.h ..
|
||||
@ -53,7 +51,7 @@ else if ($1 == 0) then
|
||||
rm ../pair_buck_coul_long.h
|
||||
rm ../pair_lj_cut_coul_long.h
|
||||
rm ../pair_lj_cut_coul_long_tip4p.h
|
||||
# rm ../pair_lj_charmm_coul_long.h
|
||||
rm ../pair_lj_charmm_coul_long.h
|
||||
rm ../fft3d.h
|
||||
rm ../fft3d_wrap.h
|
||||
rm ../remap.h
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -23,21 +23,19 @@
|
||||
#include "atom.h"
|
||||
#include "comm.h"
|
||||
#include "force.h"
|
||||
#include "pair_buck_coul_long.h"
|
||||
#include "pair_lj_cut_coul_long.h"
|
||||
#include "pair_lj_charmm_coul_long.h"
|
||||
#include "pair_lj_class2_coul_long.h"
|
||||
#include "pair_table.h"
|
||||
#include "pair.h"
|
||||
#include "domain.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
Ewald::Ewald(int narg, char **arg) : KSpace(narg, arg)
|
||||
Ewald::Ewald(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg)
|
||||
{
|
||||
if (narg != 1) error->all("Illegal kspace_style ewald command");
|
||||
|
||||
@ -90,27 +88,16 @@ void Ewald::init()
|
||||
error->all("Incorrect boundaries with slab Ewald");
|
||||
}
|
||||
|
||||
// insure use of pair_style with long-range Coulombics
|
||||
// set cutoff to short-range Coulombic cutoff
|
||||
// insure use of long (or table) pair_style with long-range Coulombics
|
||||
// set cutoff to Pair's short-range Coulombic cutoff
|
||||
|
||||
qqrd2e = force->qqrd2e;
|
||||
|
||||
Pair *pair = force->pair_match("long");
|
||||
if (pair == NULL) pair = force->pair_match("table");
|
||||
if (pair == NULL) error->all("KSpace style is incompatible with Pair style");
|
||||
double cutoff;
|
||||
|
||||
Pair *anypair;
|
||||
if (force->pair == NULL)
|
||||
error->all("KSpace style is incompatible with Pair style");
|
||||
else if (anypair = force->pair_match("buck/coul/long"))
|
||||
cutoff = ((PairBuckCoulLong *) anypair)->cut_coul;
|
||||
else if (anypair = force->pair_match("lj/cut/coul/long"))
|
||||
cutoff = ((PairLJCutCoulLong *) anypair)->cut_coul;
|
||||
else if (anypair = force->pair_match("lj/charmm/coul/long"))
|
||||
cutoff = ((PairLJCharmmCoulLong *) anypair)->cut_coul;
|
||||
else if (anypair = force->pair_match("lj/class2/coul/long"))
|
||||
cutoff = ((PairLJClass2CoulLong *) anypair)->cut_coul;
|
||||
else if (anypair = force->pair_match("table"))
|
||||
cutoff = ((PairTable *) anypair)->cut_coul();
|
||||
else error->all("KSpace style is incompatible with Pair style");
|
||||
pair->extract_long(&cutoff);
|
||||
|
||||
// compute qsum & qsqsum
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,9 +16,11 @@
|
||||
|
||||
#include "kspace.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class Ewald : public KSpace {
|
||||
public:
|
||||
Ewald(int, char **);
|
||||
Ewald(class LAMMPS *, int, char **);
|
||||
~Ewald();
|
||||
void init();
|
||||
void setup();
|
||||
@ -49,4 +51,6 @@ class Ewald : public KSpace {
|
||||
};
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -15,14 +15,16 @@
|
||||
#include "fft3d_wrap.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FFT3d::FFT3d(MPI_Comm comm, int nfast, int nmid, int nslow,
|
||||
FFT3d::FFT3d(LAMMPS *lmp, MPI_Comm comm, int nfast, int nmid, int nslow,
|
||||
int in_ilo, int in_ihi, int in_jlo, int in_jhi,
|
||||
int in_klo, int in_khi,
|
||||
int out_ilo, int out_ihi, int out_jlo, int out_jhi,
|
||||
int out_klo, int out_khi,
|
||||
int scaled, int permute, int *nbuf)
|
||||
int scaled, int permute, int *nbuf) : Pointers(lmp)
|
||||
{
|
||||
plan = fft_3d_create_plan(comm,nfast,nmid,nslow,
|
||||
in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -14,12 +14,14 @@
|
||||
#ifndef FFT3D_WRAP_H
|
||||
#define FFT3D_WRAP_H
|
||||
|
||||
#include "lammps.h"
|
||||
#include "pointers.h"
|
||||
#include "fft3d.h"
|
||||
|
||||
class FFT3d : public LAMMPS {
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class FFT3d : protected Pointers {
|
||||
public:
|
||||
FFT3d(MPI_Comm,int,int,int,int,int,int,int,int,int,
|
||||
FFT3d(class LAMMPS *, MPI_Comm,int,int,int,int,int,int,int,int,int,
|
||||
int,int,int,int,int,int,int,int,int *);
|
||||
~FFT3d();
|
||||
void compute(double *, double *, int);
|
||||
@ -29,4 +31,6 @@ class FFT3d : public LAMMPS {
|
||||
struct fft_plan_3d *plan;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -25,6 +25,8 @@
|
||||
#include "neighbor.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
@ -36,9 +38,11 @@
|
||||
#define A4 -1.453152027
|
||||
#define A5 1.061405429
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairBuckCoulLong::PairBuckCoulLong(LAMMPS *lmp) : Pair(lmp) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairBuckCoulLong::~PairBuckCoulLong()
|
||||
{
|
||||
@ -305,7 +309,7 @@ void PairBuckCoulLong::init_style()
|
||||
{
|
||||
// require an atom style with charge defined
|
||||
|
||||
if (atom->charge_allow == 0)
|
||||
if (atom->q == NULL)
|
||||
error->all("Must use charged atom style with this pair style");
|
||||
|
||||
cut_coulsq = cut_coul * cut_coul;
|
||||
@ -444,3 +448,11 @@ void PairBuckCoulLong::single(int i, int j, int itype, int jtype,
|
||||
} else one.eng_vdwl = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void PairBuckCoulLong::extract_long(double *p_cut_coul)
|
||||
{
|
||||
*p_cut_coul = cut_coul;
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,11 +16,11 @@
|
||||
|
||||
#include "pair.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairBuckCoulLong : public Pair {
|
||||
public:
|
||||
double cut_coul;
|
||||
|
||||
PairBuckCoulLong() {}
|
||||
PairBuckCoulLong(class LAMMPS *);
|
||||
~PairBuckCoulLong();
|
||||
void compute(int, int);
|
||||
void settings(int, char **);
|
||||
@ -33,10 +33,12 @@ class PairBuckCoulLong : public Pair {
|
||||
void read_restart_settings(FILE *);
|
||||
void single(int, int, int, int, double, double, double, int, One &);
|
||||
|
||||
void extract_long(double *);
|
||||
|
||||
private:
|
||||
double cut_lj_global;
|
||||
double **cut_lj,**cut_ljsq;
|
||||
double cut_coulsq;
|
||||
double cut_coul,cut_coulsq;
|
||||
double **a,**rho,**c;
|
||||
double **rhoinv,**buck1,**buck2,**offset;
|
||||
double g_ewald;
|
||||
@ -44,4 +46,6 @@ class PairBuckCoulLong : public Pair {
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -31,6 +31,8 @@
|
||||
#include "neighbor.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
@ -44,7 +46,7 @@
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairLJCharmmCoulLong::PairLJCharmmCoulLong()
|
||||
PairLJCharmmCoulLong::PairLJCharmmCoulLong(LAMMPS *lmp) : Pair(lmp)
|
||||
{
|
||||
respa_enable = 1;
|
||||
ftable = NULL;
|
||||
@ -763,7 +765,7 @@ void PairLJCharmmCoulLong::init_style()
|
||||
{
|
||||
// require an atom style with charge defined
|
||||
|
||||
if (atom->charge_allow == 0)
|
||||
if (atom->q == NULL)
|
||||
error->all("Must use charged atom style with this pair style");
|
||||
|
||||
// require cut_lj_inner < cut_lj
|
||||
@ -1158,3 +1160,25 @@ void PairLJCharmmCoulLong::single(int i, int j, int itype, int jtype,
|
||||
} else one.eng_vdwl = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void PairLJCharmmCoulLong::extract_charmm(double ***p_lj14_1,
|
||||
double ***p_lj14_2,
|
||||
double ***p_lj14_3,
|
||||
double ***p_lj14_4,
|
||||
int *p_implicit_flag)
|
||||
{
|
||||
*p_lj14_1 = lj14_1;
|
||||
*p_lj14_2 = lj14_2;
|
||||
*p_lj14_3 = lj14_3;
|
||||
*p_lj14_4 = lj14_4;
|
||||
*p_implicit_flag = 0;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void PairLJCharmmCoulLong::extract_long(double *p_cut_coul)
|
||||
{
|
||||
*p_cut_coul = cut_coul;
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -31,6 +31,8 @@
|
||||
#include "neighbor.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
@ -44,15 +46,13 @@
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairLJCutCoulLong::PairLJCutCoulLong()
|
||||
PairLJCutCoulLong::PairLJCutCoulLong(LAMMPS *lmp) : Pair(lmp)
|
||||
{
|
||||
respa_enable = 1;
|
||||
ftable = NULL;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairLJCutCoulLong::~PairLJCutCoulLong()
|
||||
{
|
||||
@ -739,7 +739,7 @@ void PairLJCutCoulLong::init_style()
|
||||
|
||||
// require an atom style with charge defined
|
||||
|
||||
if (atom->charge_allow == 0)
|
||||
if (atom->q == NULL)
|
||||
error->all("Must use charged atom style with this pair style");
|
||||
|
||||
cut_coulsq = cut_coul * cut_coul;
|
||||
@ -1102,3 +1102,10 @@ void PairLJCutCoulLong::single(int i, int j, int itype, int jtype,
|
||||
} else one.eng_vdwl = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void PairLJCutCoulLong::extract_long(double *p_cut_coul)
|
||||
{
|
||||
*p_cut_coul = cut_coul;
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,11 +16,11 @@
|
||||
|
||||
#include "pair.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairLJCutCoulLong : public Pair {
|
||||
public:
|
||||
double cut_coul;
|
||||
|
||||
PairLJCutCoulLong();
|
||||
PairLJCutCoulLong(class LAMMPS *);
|
||||
~PairLJCutCoulLong();
|
||||
virtual void compute(int, int);
|
||||
virtual void settings(int, char **);
|
||||
@ -36,11 +36,12 @@ class PairLJCutCoulLong : public Pair {
|
||||
void compute_inner();
|
||||
void compute_middle();
|
||||
void compute_outer(int, int);
|
||||
void extract_long(double *);
|
||||
|
||||
protected:
|
||||
double cut_lj_global;
|
||||
double **cut_lj,**cut_ljsq;
|
||||
double cut_coulsq;
|
||||
double cut_coul,cut_coulsq;
|
||||
double **epsilon,**sigma;
|
||||
double **lj1,**lj2,**lj3,**lj4,**offset;
|
||||
double *cut_respa;
|
||||
@ -56,4 +57,6 @@ class PairLJCutCoulLong : public Pair {
|
||||
void free_tables();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -33,6 +33,8 @@
|
||||
#include "neighbor.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
@ -46,7 +48,8 @@
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairLJCutCoulLongTIP4P::PairLJCutCoulLongTIP4P()
|
||||
PairLJCutCoulLongTIP4P::PairLJCutCoulLongTIP4P(LAMMPS *lmp) :
|
||||
PairLJCutCoulLong(lmp)
|
||||
{
|
||||
single_enable = 0;
|
||||
}
|
||||
@ -407,7 +410,7 @@ void PairLJCutCoulLongTIP4P::init_style()
|
||||
error->all("Pair style lj/cut/coul/long/tip4p requires atom IDs");
|
||||
if (!force->newton_pair)
|
||||
error->all("Pair style lj/cut/coul/long/tip4p requires newton pair on");
|
||||
if (atom->charge_allow == 0)
|
||||
if (atom->q == NULL)
|
||||
error->all("Must use charged atom style with this pair style");
|
||||
|
||||
cut_coulsq = cut_coul * cut_coul;
|
||||
@ -526,3 +529,16 @@ void PairLJCutCoulLongTIP4P::find_M(int i, int &iH1, int &iH2, double *xM)
|
||||
xM[1] = x[i][1] + alpha * (dely1 + dely2);
|
||||
xM[2] = x[i][2] + alpha * (delz1 + delz2);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void PairLJCutCoulLongTIP4P::extract_tip4p(double *p_qdist,
|
||||
int *p_typeO, int *p_typeH,
|
||||
int *p_typeA, int *p_typeB)
|
||||
{
|
||||
*p_qdist = qdist;
|
||||
*p_typeO = typeO;
|
||||
*p_typeH = typeH;
|
||||
*p_typeA = typeA;
|
||||
*p_typeB = typeB;
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,17 +16,19 @@
|
||||
|
||||
#include "pair_lj_cut_coul_long.h"
|
||||
|
||||
class PairLJCutCoulLongTIP4P : public PairLJCutCoulLong {
|
||||
friend class PPPM;
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairLJCutCoulLongTIP4P : public PairLJCutCoulLong {
|
||||
public:
|
||||
PairLJCutCoulLongTIP4P();
|
||||
PairLJCutCoulLongTIP4P(class LAMMPS *);
|
||||
void compute(int, int);
|
||||
void settings(int, char **);
|
||||
void init_style();
|
||||
void write_restart_settings(FILE *fp);
|
||||
void read_restart_settings(FILE *fp);
|
||||
|
||||
void extract_tip4p(double *, int *, int *, int *, int *);
|
||||
|
||||
private:
|
||||
int typeH,typeO; // atom types of TIP4P water H and O atoms
|
||||
int typeA,typeB; // angle and bond types of TIP4P water
|
||||
@ -38,4 +40,6 @@ class PairLJCutCoulLongTIP4P : public PairLJCutCoulLong {
|
||||
void find_M(int, int &, int &, double *);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -25,12 +25,7 @@
|
||||
#include "comm.h"
|
||||
#include "neighbor.h"
|
||||
#include "force.h"
|
||||
#include "pair_buck_coul_long.h"
|
||||
#include "pair_lj_cut_coul_long.h"
|
||||
#include "pair_lj_charmm_coul_long.h"
|
||||
#include "pair_lj_class2_coul_long.h"
|
||||
#include "pair_lj_cut_coul_long_tip4p.h"
|
||||
#include "pair_table.h"
|
||||
#include "pair.h"
|
||||
#include "bond.h"
|
||||
#include "angle.h"
|
||||
#include "domain.h"
|
||||
@ -39,6 +34,8 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
@ -50,7 +47,7 @@
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PPPM::PPPM(int narg, char **arg) : KSpace(narg, arg)
|
||||
PPPM::PPPM(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg)
|
||||
{
|
||||
if (narg != 1) error->all("Illegal kspace_style pppm command");
|
||||
|
||||
@ -128,41 +125,35 @@ void PPPM::init()
|
||||
|
||||
deallocate();
|
||||
|
||||
// insure use of valid pair_style with long-range Coulombics
|
||||
// set cutoff to short-range Coulombic cutoff
|
||||
// insure use of long (or table) pair_style with long-range Coulombics
|
||||
// set cutoff to Pair's short-range Coulombic cutoff
|
||||
|
||||
qqrd2e = force->qqrd2e;
|
||||
|
||||
Pair *pair = force->pair_match("long");
|
||||
if (pair == NULL) pair = force->pair_match("table");
|
||||
if (pair == NULL) error->all("KSpace style is incompatible with Pair style");
|
||||
pair->extract_long(&cutoff);
|
||||
|
||||
// insure use of TIP4P pair_style with TIP4P long-range Coulombics
|
||||
// set TIP4P params from Pair's params
|
||||
|
||||
qdist = 0.0;
|
||||
|
||||
Pair *anypair;
|
||||
if (force->pair == NULL)
|
||||
error->all("Pair style is incompatible with KSpace style");
|
||||
else if (anypair = force->pair_match("buck/coul/long"))
|
||||
cutoff = ((PairBuckCoulLong *) anypair)->cut_coul;
|
||||
else if (anypair = force->pair_match("lj/cut/coul/long"))
|
||||
cutoff = ((PairLJCutCoulLong *) anypair)->cut_coul;
|
||||
else if (anypair = force->pair_match("lj/charmm/coul/long"))
|
||||
cutoff = ((PairLJCharmmCoulLong *) anypair)->cut_coul;
|
||||
else if (anypair = force->pair_match("lj/class2/coul/long"))
|
||||
cutoff = ((PairLJClass2CoulLong *) anypair)->cut_coul;
|
||||
else if (anypair = force->pair_match("lj/cut/coul/long/tip4p")) {
|
||||
if (strcmp(force->kspace_style,"pppm/tip4p") != 0)
|
||||
error->all("Pair style is incompatible with KSpace style");
|
||||
cutoff = ((PairLJCutCoulLongTIP4P *) anypair)->cut_coul;
|
||||
qdist = ((PairLJCutCoulLongTIP4P *) anypair)->qdist;
|
||||
typeO = ((PairLJCutCoulLongTIP4P *) anypair)->typeO;
|
||||
typeH = ((PairLJCutCoulLongTIP4P *) anypair)->typeH;
|
||||
int typeA = ((PairLJCutCoulLongTIP4P *) anypair)->typeA;
|
||||
int typeB = ((PairLJCutCoulLongTIP4P *) anypair)->typeB;
|
||||
pair = force->pair_match("tip4p");
|
||||
if (strcmp(force->kspace_style,"pppm/tip4p") != 0 && pair != NULL)
|
||||
error->all("KSpace style is incompatible with Pair style");
|
||||
if (strcmp(force->kspace_style,"pppm/tip4p") == 0 && pair == NULL)
|
||||
error->all("KSpace style is incompatible with Pair style");
|
||||
if (pair) {
|
||||
int typeA,typeB;
|
||||
pair->extract_tip4p(&qdist,&typeO,&typeH,&typeA,&typeB);
|
||||
if (force->angle == NULL || force->bond == NULL)
|
||||
error->all("Bond and angle potentials must be defined for TIP4P");
|
||||
double theta = force->angle->equilibrium_angle(typeA);
|
||||
double blen = force->bond->equilibrium_distance(typeB);
|
||||
alpha = qdist / (2.0 * cos(0.5*theta) * blen);
|
||||
}
|
||||
else if (anypair = force->pair_match("table"))
|
||||
cutoff = ((PairTable *) anypair)->cut_coul();
|
||||
else error->all("Pair style is incompatible with KSpace style");
|
||||
|
||||
// compute qsum & qsqsum and warn if not charge-neutral
|
||||
|
||||
@ -698,17 +689,17 @@ void PPPM::allocate()
|
||||
|
||||
int tmp;
|
||||
|
||||
fft1 = new FFT3d(world,nx_pppm,ny_pppm,nz_pppm,
|
||||
fft1 = new FFT3d(lmp,world,nx_pppm,ny_pppm,nz_pppm,
|
||||
nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
|
||||
nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
|
||||
0,0,&tmp);
|
||||
|
||||
fft2 = new FFT3d(world,nx_pppm,ny_pppm,nz_pppm,
|
||||
fft2 = new FFT3d(lmp,world,nx_pppm,ny_pppm,nz_pppm,
|
||||
nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
|
||||
nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in,
|
||||
0,0,&tmp);
|
||||
|
||||
remap = new Remap(world,
|
||||
remap = new Remap(lmp,world,
|
||||
nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in,
|
||||
nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
|
||||
1,0,0,2);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,12 +16,11 @@
|
||||
|
||||
#include "kspace.h"
|
||||
|
||||
class FFT3d;
|
||||
class Remap;
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PPPM : public KSpace {
|
||||
public:
|
||||
PPPM(int, char **);
|
||||
PPPM(class LAMMPS *, int, char **);
|
||||
~PPPM();
|
||||
void init();
|
||||
void setup();
|
||||
@ -61,8 +60,8 @@ class PPPM : public KSpace {
|
||||
double *gf_b;
|
||||
double **rho1d,**rho_coeff;
|
||||
|
||||
FFT3d *fft1,*fft2;
|
||||
Remap *remap;
|
||||
class FFT3d *fft1,*fft2;
|
||||
class Remap *remap;
|
||||
|
||||
int **part2grid; // storage for particle -> grid mapping
|
||||
int nmax;
|
||||
@ -91,4 +90,6 @@ class PPPM : public KSpace {
|
||||
void slabcorr(int);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -22,11 +22,14 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define OFFSET 4096
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PPPMTIP4P::PPPMTIP4P(int narg, char **arg) : PPPM(narg, arg) {}
|
||||
PPPMTIP4P::PPPMTIP4P(LAMMPS *lmp, int narg, char **arg) :
|
||||
PPPM(lmp, narg, arg) {}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
find center grid pt for each of my particles
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,9 +16,11 @@
|
||||
|
||||
#include "pppm.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PPPMTIP4P : public PPPM {
|
||||
public:
|
||||
PPPMTIP4P(int, char **);
|
||||
PPPMTIP4P(class LAMMPS *, int, char **);
|
||||
|
||||
private:
|
||||
void particle_map();
|
||||
@ -28,4 +30,6 @@ class PPPMTIP4P : public PPPM {
|
||||
void find_M(int, int &, int &, double *);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -15,14 +15,16 @@
|
||||
#include "remap_wrap.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
Remap::Remap(MPI_Comm comm,
|
||||
Remap::Remap(LAMMPS *lmp, MPI_Comm comm,
|
||||
int in_ilo, int in_ihi, int in_jlo, int in_jhi,
|
||||
int in_klo, int in_khi,
|
||||
int out_ilo, int out_ihi, int out_jlo, int out_jhi,
|
||||
int out_klo, int out_khi,
|
||||
int nqty, int permute, int memory, int precision)
|
||||
int nqty, int permute, int memory, int precision) : Pointers(lmp)
|
||||
{
|
||||
plan = remap_3d_create_plan(comm,
|
||||
in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -14,12 +14,14 @@
|
||||
#ifndef REMAP_WRAP_H
|
||||
#define REMAP_WRAP_H
|
||||
|
||||
#include "lammps.h"
|
||||
#include "pointers.h"
|
||||
#include "remap.h"
|
||||
|
||||
class Remap : public LAMMPS {
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class Remap : protected Pointers {
|
||||
public:
|
||||
Remap(MPI_Comm,int,int,int,int,int,int,
|
||||
Remap(class LAMMPS *, MPI_Comm,int,int,int,int,int,int,
|
||||
int,int,int,int,int,int,int,int,int,int);
|
||||
~Remap();
|
||||
void perform(double *, double *, double *);
|
||||
@ -28,4 +30,6 @@ class Remap : public LAMMPS {
|
||||
struct remap_plan_3d *plan;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
|
||||
@ -8,6 +8,8 @@ SHELL = /bin/sh
|
||||
CC = icc
|
||||
CCFLAGS = -O -I/home/sjplimp/tools/mpich/include \
|
||||
-I/home/sjplimp/tools/fftw/include -DFFT_FFTW -DGZIP
|
||||
#CCFLAGS = -O -restrict -I/home/sjplimp/tools/mpich/include \
|
||||
# -I/home/sjplimp/tools/fftw/include -DFFT_FFTW -DGZIP
|
||||
DEPFLAGS = -M
|
||||
LINK = icc
|
||||
LINKFLAGS = -O -L/home/sjplimp/tools/mpich/lib \
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
# Install/unInstall package classes in LAMMPS
|
||||
|
||||
# pair_eam.h must always be in src
|
||||
|
||||
if ($1 == 1) then
|
||||
|
||||
cp style_manybody.h ..
|
||||
@ -12,7 +10,7 @@ if ($1 == 1) then
|
||||
cp pair_sw.cpp ..
|
||||
cp pair_tersoff.cpp ..
|
||||
|
||||
# cp pair_eam.h ..
|
||||
cp pair_eam.h ..
|
||||
cp pair_eam_alloy.h ..
|
||||
cp pair_eam_fs.h ..
|
||||
cp pair_sw.h ..
|
||||
@ -29,7 +27,7 @@ else if ($1 == 0) then
|
||||
rm ../pair_sw.cpp
|
||||
rm ../pair_tersoff.cpp
|
||||
|
||||
# rm ../pair_eam.h
|
||||
rm ../pair_eam.h
|
||||
rm ../pair_eam_alloy.h
|
||||
rm ../pair_eam_fs.h
|
||||
rm ../pair_sw.h
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -28,6 +28,8 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
@ -35,7 +37,7 @@
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairEAM::PairEAM()
|
||||
PairEAM::PairEAM(LAMMPS *lmp) : Pair(lmp)
|
||||
{
|
||||
nmax = 0;
|
||||
rho = NULL;
|
||||
@ -54,10 +56,14 @@ PairEAM::PairEAM()
|
||||
frho_spline = NULL;
|
||||
rhor_spline = NULL;
|
||||
z2r_spline = NULL;
|
||||
|
||||
// set comm size needed by this Pair
|
||||
|
||||
comm_forward = 1;
|
||||
comm_reverse = 1;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
check if allocated, since class can be destructed when incomplete
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -410,11 +416,6 @@ double PairEAM::init_one(int i, int j)
|
||||
|
||||
void PairEAM::init_style()
|
||||
{
|
||||
// set communication sizes in comm class
|
||||
|
||||
comm->maxforward_pair = MAX(comm->maxforward_pair,1);
|
||||
comm->maxreverse_pair = MAX(comm->maxreverse_pair,1);
|
||||
|
||||
// convert read-in file(s) to arrays and spline them
|
||||
|
||||
file2array();
|
||||
@ -804,17 +805,16 @@ void PairEAM::single(int i, int j, int itype, int jtype,
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void PairEAM::single_embed(int i, int itype, double &fpi,
|
||||
int eflag, double &phi)
|
||||
void PairEAM::single_embed(int i, int itype, double &phi)
|
||||
{
|
||||
printf("AAA %d\n",i);
|
||||
double p = rho[i]*rdrho + 1.0;
|
||||
int m = static_cast<int> (p);
|
||||
m = MAX(1,MIN(m,nrho-1));
|
||||
p -= m;
|
||||
|
||||
double *coeff = frho_spline[type2frho[itype]][m];
|
||||
fpi = (coeff[0]*p + coeff[1])*p + coeff[2];
|
||||
if (eflag) phi = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
|
||||
phi = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -876,3 +876,14 @@ int PairEAM::memory_usage()
|
||||
int bytes = 2 * nmax * sizeof(double);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
swap fp array with one passed in by caller
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairEAM::extract_eam(double *fp_caller, double **fp_caller_hold)
|
||||
{
|
||||
double *tmp = fp;
|
||||
fp = fp_caller;
|
||||
*fp_caller_hold = tmp;
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -24,8 +24,17 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MAXLINE 1024
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairEAMAlloy::PairEAMAlloy(LAMMPS *lmp) : PairEAM(lmp)
|
||||
{
|
||||
one_coeff = 1;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
set coeffs for one or more type pairs
|
||||
read DYNAMO setfl file
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,13 +16,21 @@
|
||||
|
||||
#include "pair_eam.h"
|
||||
|
||||
class PairEAMAlloy : public PairEAM {
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
// use virtual public since this class is parent in multiple inheritance
|
||||
|
||||
class PairEAMAlloy : virtual public PairEAM {
|
||||
public:
|
||||
PairEAMAlloy(class LAMMPS *);
|
||||
virtual ~PairEAMAlloy() {}
|
||||
void coeff(int, char **);
|
||||
|
||||
private:
|
||||
protected:
|
||||
void read_file(char *);
|
||||
void file2array();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -24,8 +24,17 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MAXLINE 1024
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairEAMFS::PairEAMFS(LAMMPS *lmp) : PairEAM(lmp)
|
||||
{
|
||||
one_coeff = 1;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
set coeffs for one or more type pairs
|
||||
read EAM Finnis-Sinclair file
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,13 +16,21 @@
|
||||
|
||||
#include "pair_eam.h"
|
||||
|
||||
class PairEAMFS : public PairEAM {
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
// use virtual public since this class is parent in multiple inheritance
|
||||
|
||||
class PairEAMFS : virtual public PairEAM {
|
||||
public:
|
||||
PairEAMFS(class LAMMPS *);
|
||||
virtual ~PairEAMFS() {}
|
||||
void coeff(int, char **);
|
||||
|
||||
private:
|
||||
protected:
|
||||
void read_file(char *);
|
||||
void file2array();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -29,12 +29,14 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MAXLINE 1024
|
||||
#define DELTA 4
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairSW::PairSW()
|
||||
PairSW::PairSW(LAMMPS *lmp) : Pair(lmp)
|
||||
{
|
||||
neigh_half_every = 0;
|
||||
neigh_full_every = 1;
|
||||
@ -50,7 +52,6 @@ PairSW::PairSW()
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
check if allocated, since class can be destructed when incomplete
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -211,7 +212,7 @@ void PairSW::settings(int narg, char **arg)
|
||||
|
||||
void PairSW::coeff(int narg, char **arg)
|
||||
{
|
||||
int i,j,m,n;
|
||||
int i,j,n;
|
||||
|
||||
if (!allocated) allocate();
|
||||
|
||||
@ -325,7 +326,7 @@ void PairSW::read_file(char *file)
|
||||
// one set of params can span multiple lines
|
||||
// store params if all 3 element tags are in element list
|
||||
|
||||
int i,n,nwords,ielement,jelement,kelement;
|
||||
int n,nwords,ielement,jelement,kelement;
|
||||
char line[MAXLINE],*ptr;
|
||||
int eof = 0;
|
||||
|
||||
@ -491,7 +492,6 @@ void PairSW::twobody(Param *param, double rsq, double &fforce,
|
||||
int eflag, double &eng)
|
||||
{
|
||||
double r,rinvsq,rp,rq,rainv,rainvsq,expsrainv;
|
||||
double delr[3];
|
||||
|
||||
r = sqrt(rsq);
|
||||
rinvsq = 1.0/rsq;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,9 +16,11 @@
|
||||
|
||||
#include "pair.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairSW : public Pair {
|
||||
public:
|
||||
PairSW();
|
||||
PairSW(class LAMMPS *);
|
||||
~PairSW();
|
||||
void compute(int, int);
|
||||
void settings(int, char **);
|
||||
@ -55,4 +57,6 @@ class PairSW : public Pair {
|
||||
double *, double *, int, double &);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -29,12 +29,14 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MAXLINE 1024
|
||||
#define DELTA 4
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairTersoff::PairTersoff()
|
||||
PairTersoff::PairTersoff(LAMMPS *lmp) : Pair(lmp)
|
||||
{
|
||||
neigh_half_every = 0;
|
||||
neigh_full_every = 1;
|
||||
@ -53,7 +55,6 @@ PairTersoff::PairTersoff()
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
check if allocated, since class can be destructed when incomplete
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -248,7 +249,7 @@ void PairTersoff::settings(int narg, char **arg)
|
||||
|
||||
void PairTersoff::coeff(int narg, char **arg)
|
||||
{
|
||||
int i,j,m,n;
|
||||
int i,j,n;
|
||||
|
||||
if (!allocated) allocate();
|
||||
|
||||
@ -361,7 +362,7 @@ void PairTersoff::read_file(char *file)
|
||||
// read each line out of file, skipping blank lines or leading '#'
|
||||
// store line of params if all 3 element tags are in element list
|
||||
|
||||
int i,n,nwords,ielement,jelement,kelement;
|
||||
int n,nwords,ielement,jelement,kelement;
|
||||
char line[MAXLINE],*ptr;
|
||||
int eof = 0;
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,9 +16,11 @@
|
||||
|
||||
#include "pair.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairTersoff : public Pair {
|
||||
public:
|
||||
PairTersoff();
|
||||
PairTersoff(class LAMMPS *);
|
||||
~PairTersoff();
|
||||
void compute(int, int);
|
||||
void settings(int, char **);
|
||||
@ -85,4 +87,6 @@ class PairTersoff : public Pair {
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
|
||||
@ -13,10 +13,9 @@ if ($1 == 1) then
|
||||
cp angle_cosine_squared.cpp ..
|
||||
cp angle_harmonic.cpp ..
|
||||
cp angle_hybrid.cpp ..
|
||||
cp atom_angle.cpp ..
|
||||
cp atom_bond.cpp ..
|
||||
cp atom_full.cpp ..
|
||||
cp atom_molecular.cpp ..
|
||||
cp atom_vec_angle.cpp ..
|
||||
cp atom_vec_bond.cpp ..
|
||||
cp atom_vec_molecular.cpp ..
|
||||
cp bond.cpp ..
|
||||
cp bond_fene.cpp ..
|
||||
cp bond_fene_expand.cpp ..
|
||||
@ -46,10 +45,9 @@ if ($1 == 1) then
|
||||
cp angle_cosine_squared.h ..
|
||||
cp angle_harmonic.h ..
|
||||
cp angle_hybrid.h ..
|
||||
cp atom_angle.h ..
|
||||
cp atom_bond.h ..
|
||||
cp atom_full.h ..
|
||||
cp atom_molecular.h ..
|
||||
cp atom_vec_angle.h ..
|
||||
cp atom_vec_bond.h ..
|
||||
cp atom_vec_molecular.h ..
|
||||
# cp bond.h ..
|
||||
cp bond_fene.h ..
|
||||
cp bond_fene_expand.h ..
|
||||
@ -84,10 +82,9 @@ else if ($1 == 0) then
|
||||
rm ../angle_cosine_squared.cpp
|
||||
rm ../angle_harmonic.cpp
|
||||
rm ../angle_hybrid.cpp
|
||||
rm ../atom_angle.cpp
|
||||
rm ../atom_bond.cpp
|
||||
rm ../atom_full.cpp
|
||||
rm ../atom_molecular.cpp
|
||||
rm ../atom_vec_angle.cpp
|
||||
rm ../atom_vec_bond.cpp
|
||||
rm ../atom_vec_molecular.cpp
|
||||
rm ../bond.cpp
|
||||
rm ../bond_fene.cpp
|
||||
rm ../bond_fene_expand.cpp
|
||||
@ -117,10 +114,9 @@ else if ($1 == 0) then
|
||||
rm ../angle_cosine_squared.h
|
||||
rm ../angle_harmonic.h
|
||||
rm ../angle_hybrid.h
|
||||
rm ../atom_angle.h
|
||||
rm ../atom_bond.h
|
||||
rm ../atom_full.h
|
||||
rm ../atom_molecular.h
|
||||
rm ../atom_vec_angle.h
|
||||
rm ../atom_vec_bond.h
|
||||
rm ../atom_vec_molecular.h
|
||||
# rm ../bond.h
|
||||
rm ../bond_fene.h
|
||||
rm ../bond_fene_expand.h
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,9 +16,11 @@
|
||||
#include "atom.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
Angle::Angle()
|
||||
Angle::Angle(LAMMPS *lmp) : Pointers(lmp)
|
||||
{
|
||||
allocated = 0;
|
||||
PI = 4.0*atan(1.0);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -26,11 +26,15 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define SMALL 0.001
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
AngleCharmm::AngleCharmm(LAMMPS *lmp) : Angle(lmp) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
AngleCharmm::~AngleCharmm()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -17,9 +17,11 @@
|
||||
#include "stdio.h"
|
||||
#include "angle.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class AngleCharmm : public Angle {
|
||||
public:
|
||||
AngleCharmm() {}
|
||||
AngleCharmm(class LAMMPS *);
|
||||
~AngleCharmm();
|
||||
void compute(int, int);
|
||||
void coeff(int, int, char **);
|
||||
@ -34,4 +36,6 @@ class AngleCharmm : public Angle {
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -22,11 +22,15 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define SMALL 0.001
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
AngleCosine::AngleCosine(LAMMPS *lmp) : Angle(lmp) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
AngleCosine::~AngleCosine()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -17,9 +17,11 @@
|
||||
#include "stdio.h"
|
||||
#include "angle.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class AngleCosine : public Angle {
|
||||
public:
|
||||
AngleCosine() {}
|
||||
AngleCosine(class LAMMPS *);
|
||||
~AngleCosine();
|
||||
void compute(int, int);
|
||||
void coeff(int, int, char **);
|
||||
@ -34,4 +36,6 @@ class AngleCosine : public Angle {
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -26,11 +26,15 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define SMALL 0.001
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
AngleCosineSquared::AngleCosineSquared(LAMMPS *lmp) : Angle(lmp) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
AngleCosineSquared::~AngleCosineSquared()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -17,9 +17,11 @@
|
||||
#include "stdio.h"
|
||||
#include "angle.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class AngleCosineSquared : public Angle {
|
||||
public:
|
||||
AngleCosineSquared() {}
|
||||
AngleCosineSquared(class LAMMPS *);
|
||||
~AngleCosineSquared();
|
||||
void compute(int, int);
|
||||
void coeff(int, int, char **);
|
||||
@ -34,4 +36,6 @@ class AngleCosineSquared : public Angle {
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -22,11 +22,15 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define SMALL 0.001
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
AngleHarmonic::AngleHarmonic(LAMMPS *lmp) : Angle(lmp) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
AngleHarmonic::~AngleHarmonic()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -17,9 +17,11 @@
|
||||
#include "stdio.h"
|
||||
#include "angle.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class AngleHarmonic : public Angle {
|
||||
public:
|
||||
AngleHarmonic() {}
|
||||
AngleHarmonic(class LAMMPS *);
|
||||
~AngleHarmonic();
|
||||
void compute(int, int);
|
||||
void coeff(int, int, char **);
|
||||
@ -34,4 +36,6 @@ class AngleHarmonic : public Angle {
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* -----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -22,20 +22,18 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define EXTRA 1000
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
set all global defaults
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
AngleHybrid::AngleHybrid()
|
||||
AngleHybrid::AngleHybrid(LAMMPS *lmp) : Angle(lmp)
|
||||
{
|
||||
nstyles = 0;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
AngleHybrid::~AngleHybrid()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -17,9 +17,11 @@
|
||||
#include "stdio.h"
|
||||
#include "angle.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class AngleHybrid : public Angle {
|
||||
public:
|
||||
AngleHybrid();
|
||||
AngleHybrid(class LAMMPS *);
|
||||
~AngleHybrid();
|
||||
void compute(int, int);
|
||||
void settings(int, char **);
|
||||
@ -43,4 +45,6 @@ class AngleHybrid : public Angle {
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -16,12 +16,14 @@
|
||||
#include "atom.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
set bond contribution to Vdwl energy to 0.0
|
||||
a particular bond style can override this
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
Bond::Bond()
|
||||
Bond::Bond(LAMMPS *lmp) : Pointers(lmp)
|
||||
{
|
||||
allocated = 0;
|
||||
eng_vdwl = 0.0;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -23,16 +23,16 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
BondFENE::BondFENE()
|
||||
BondFENE::BondFENE(LAMMPS *lmp) : Bond(lmp)
|
||||
{
|
||||
TWO_1_3 = pow(2.0,(1.0/3.0));
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
BondFENE::~BondFENE()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -17,9 +17,11 @@
|
||||
#include "stdio.h"
|
||||
#include "bond.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class BondFENE : public Bond {
|
||||
public:
|
||||
BondFENE();
|
||||
BondFENE(class LAMMPS *);
|
||||
~BondFENE();
|
||||
void compute(int, int);
|
||||
void coeff(int, char **);
|
||||
@ -35,4 +37,6 @@ class BondFENE : public Bond {
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -11,8 +11,6 @@
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
// FENE bond potential, with repulsive LJ, with shift
|
||||
|
||||
#include "math.h"
|
||||
#include "stdlib.h"
|
||||
#include "bond_fene_expand.h"
|
||||
@ -25,18 +23,16 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
set all global defaults
|
||||
------------------------------------------------------------------------- */
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
BondFENEExpand::BondFENEExpand()
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
BondFENEExpand::BondFENEExpand(LAMMPS *lmp) : Bond(lmp)
|
||||
{
|
||||
TWO_1_3 = pow(2.0,(1.0/3.0));
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
BondFENEExpand::~BondFENEExpand()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -17,9 +17,11 @@
|
||||
#include "stdio.h"
|
||||
#include "bond.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class BondFENEExpand : public Bond {
|
||||
public:
|
||||
BondFENEExpand();
|
||||
BondFENEExpand(class LAMMPS *);
|
||||
~BondFENEExpand();
|
||||
void compute(int, int);
|
||||
void coeff(int, char **);
|
||||
@ -35,4 +37,6 @@ class BondFENEExpand : public Bond {
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -22,9 +22,13 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
BondHarmonic::BondHarmonic(LAMMPS *lmp) : Bond(lmp) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
BondHarmonic::~BondHarmonic()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -17,9 +17,11 @@
|
||||
#include "stdio.h"
|
||||
#include "bond.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class BondHarmonic : public Bond {
|
||||
public:
|
||||
BondHarmonic() {}
|
||||
BondHarmonic(class LAMMPS *);
|
||||
~BondHarmonic();
|
||||
void compute(int, int);
|
||||
void coeff(int, char **);
|
||||
@ -34,4 +36,6 @@ class BondHarmonic : public Bond {
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* -----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -22,20 +22,18 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define EXTRA 1000
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
set all global defaults
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
BondHybrid::BondHybrid()
|
||||
BondHybrid::BondHybrid(LAMMPS *lmp) : Bond(lmp)
|
||||
{
|
||||
nstyles = 0;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
BondHybrid::~BondHybrid()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -26,9 +26,13 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
BondMorse::BondMorse(LAMMPS *lmp) : Bond(lmp) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
BondMorse::~BondMorse()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -17,9 +17,11 @@
|
||||
#include "stdio.h"
|
||||
#include "bond.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class BondMorse : public Bond {
|
||||
public:
|
||||
BondMorse() {}
|
||||
BondMorse(class LAMMPS *);
|
||||
~BondMorse();
|
||||
void compute(int, int);
|
||||
void coeff(int, char **);
|
||||
@ -34,4 +36,6 @@ class BondMorse : public Bond {
|
||||
void allocate();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
www.cs.sandia.gov/~sjplimp/lammps.html
|
||||
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
|
||||
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
|
||||
@ -22,9 +22,13 @@
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
BondNonlinear::BondNonlinear(LAMMPS *lmp) : Bond(lmp) {}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
BondNonlinear::~BondNonlinear()
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user