Simplified GJF formalism

This commit is contained in:
charlie sievers
2019-08-21 19:14:08 -07:00
parent f2068ece84
commit 52a51ea470
2 changed files with 371 additions and 526 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,12 +2,10 @@
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under certain rights in this software. This software is distributed under
the GNU General Public License. the GNU General Public License.
See the README file in the top-level LAMMPS directory. See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
@ -24,68 +22,64 @@ FixStyle(langevin,FixLangevin)
namespace LAMMPS_NS { namespace LAMMPS_NS {
class FixLangevin : public Fix { class FixLangevin : public Fix {
public: public:
FixLangevin(class LAMMPS *, int, char **); FixLangevin(class LAMMPS *, int, char **);
virtual ~FixLangevin(); virtual ~FixLangevin();
int setmask(); int setmask();
void init(); void init();
void setup(int); void setup(int);
//virtual void initial_integrate(int); void initial_integrate_respa(int, int, int);
virtual void post_integrate(); virtual void initial_integrate(int);
virtual void post_force(int); virtual void post_force(int);
void post_force_respa(int, int, int); void post_force_respa(int, int, int);
virtual void end_of_step(); virtual void end_of_step();
void reset_target(double); void reset_target(double);
void reset_dt(); void reset_dt();
int modify_param(int, char **); int modify_param(int, char **);
virtual double compute_scalar(); virtual double compute_scalar();
double memory_usage(); double memory_usage();
virtual void *extract(const char *, int &); virtual void *extract(const char *, int &);
void grow_arrays(int); void grow_arrays(int);
void copy_arrays(int, int, int); void copy_arrays(int, int, int);
int pack_exchange(int, double *); int pack_exchange(int, double *);
int unpack_exchange(int, double *); int unpack_exchange(int, double *);
protected: protected:
int gjfflag,oflag,tallyflag,zeroflag,tbiasflag,hsflag; int gjfflag,oflag,tallyflag,zeroflag,tbiasflag;
int flangevin_allocated; int flangevin_allocated;
double ascale; double ascale;
double t_start,t_stop,t_period,t_target; double t_start,t_stop,t_period,t_target;
double *gfactor1,*gfactor2,*ratio; double *gfactor1,*gfactor2,*ratio;
double energy,energy_onestep; double energy,energy_onestep;
double tsqrt; double tsqrt;
int tstyle,tvar; int tstyle,tvar;
double gjffac; double gjfa, gjfsib; //gjf a and gjf sqrt inverse b
char *tstr; char *tstr;
class AtomVecEllipsoid *avec; class AtomVecEllipsoid *avec;
int maxatom1,maxatom2; int maxatom1,maxatom2;
double **flangevin; double **flangevin;
double *tforce; double *tforce;
double **franprev; double **franprev;
double **lv; //2GJ velocity or half-step velocity double **lv; //half step velocity
double **wildcard;
double **bias; //Bias velocity
int nvalues; char *id_temp;
class Compute *temperature;
char *id_temp; int nlevels_respa;
class Compute *temperature; class RanMars *random;
int seed;
int nlevels_respa; template < int Tp_TSTYLEATOM, int Tp_GJF, int Tp_TALLY,
class RanMars *random; int Tp_BIAS, int Tp_RMASS, int Tp_ZERO >
int seed; void post_force_templated();
template < int Tp_TSTYLEATOM, int Tp_GJF, int Tp_TALLY, void omega_thermostat();
int Tp_BIAS, int Tp_RMASS, int Tp_ZERO > void angmom_thermostat();
void post_force_templated(); void compute_target();
};
void omega_thermostat();
void angmom_thermostat();
void compute_target();
};
} }
@ -93,62 +87,35 @@ class FixLangevin : public Fix {
#endif #endif
/* ERROR/WARNING messages: /* ERROR/WARNING messages:
E: Illegal ... command E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line. command-line option when running LAMMPS to see the offending line.
E: Fix langevin period must be > 0.0 E: Fix langevin period must be > 0.0
The time window for temperature relaxation must be > 0 The time window for temperature relaxation must be > 0
E: Fix langevin omega requires atom style sphere E: Fix langevin omega requires atom style sphere
Self-explanatory. Self-explanatory.
E: Fix langevin angmom requires atom style ellipsoid E: Fix langevin angmom requires atom style ellipsoid
Self-explanatory. Self-explanatory.
E: Variable name for fix langevin does not exist E: Variable name for fix langevin does not exist
Self-explanatory. Self-explanatory.
E: Variable for fix langevin is invalid style E: Variable for fix langevin is invalid style
It must be an equal-style variable. It must be an equal-style variable.
E: Fix langevin omega requires extended particles E: Fix langevin omega requires extended particles
One of the particles has radius 0.0. One of the particles has radius 0.0.
E: Fix langevin angmom requires extended particles E: Fix langevin angmom requires extended particles
This fix option cannot be used with point particles. This fix option cannot be used with point particles.
E: Cannot zero Langevin force of 0 atoms E: Cannot zero Langevin force of 0 atoms
The group has zero atoms, so you cannot request its force The group has zero atoms, so you cannot request its force
be zeroed. be zeroed.
E: Fix langevin variable returned negative temperature E: Fix langevin variable returned negative temperature
Self-explanatory. Self-explanatory.
E: Could not find fix_modify temperature ID E: Could not find fix_modify temperature ID
The compute ID for computing temperature does not exist. The compute ID for computing temperature does not exist.
E: Fix_modify temperature ID does not compute temperature E: Fix_modify temperature ID does not compute temperature
The compute ID assigned to the fix must compute temperature. The compute ID assigned to the fix must compute temperature.
W: Group for fix_modify temp != fix group W: Group for fix_modify temp != fix group
The fix_modify command is specifying a temperature computation that The fix_modify command is specifying a temperature computation that
computes a temperature on a different group of atoms than the fix computes a temperature on a different group of atoms than the fix
itself operates on. This is probably not what you want to do. itself operates on. This is probably not what you want to do.
*/ */