/* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #ifdef FIX_CLASS FixStyle(rigid/npt,FixRigidNPT) #else #ifndef LMP_FIX_RIGID_NPT_H #define LMP_FIX_RIGID_NPT_H #include "fix_rigid.h" namespace LAMMPS_NS { class FixRigidNPT : public FixRigid { public: FixRigidNPT(class LAMMPS *, int, char **); ~FixRigidNPT(); int setmask(); void init(); void setup(int); void initial_integrate(int); void final_integrate(); double compute_scalar(); void write_restart(FILE *); void restart(char *); void reset_target(double); private: int dimension; // # of dimensions double **conjqm; // conjugate quat momentum double boltz,nktv2p; double t_target,p_target; int nf_t,nf_r; // trans/rot degrees of freedom double *w,*wdti1,*wdti2,*wdti4; // Yoshida-Suzuki coefficients double *q_t,*q_r; // trans/rot thermostat mass double *eta_t,*eta_r; // trans/rot thermostat position double *eta_dot_t,*eta_dot_r; // trans/rot thermostat velocity double *f_eta_t,*f_eta_r; // trans/rot thermostat force double W, *q_b; // baro/thermo masses double epsilon,*eta_b; // baro/thermo positions double epsilon_dot,*eta_dot_b; // baro/thermo velocities double f_epsilon,*f_eta_b; // baro/thermo forces double dilation; double akin_t,akin_r; int allremap; // remap all atoms int kspace_flag; // 1 if KSpace invoked, 0 if not int nrigidfix; // number of rigid fixes int *rfix; // indicies of rigid fixes char *id_temp,*id_press; class Compute *temperature,*pressure; int tcomputeflag,pcomputeflag; void update_nhcp(double akin_t,double akin_r); void update_nhcb(); void remap(); inline double maclaurin_series(double); void allocate_chain(); void allocate_order(); void deallocate_chain(); void deallocate_order(); }; inline double FixRigidNPT::maclaurin_series(double x) { double x2,x4; x2 = x * x; x4 = x2 * x2; return (1.0 + (1.0/6.0) * x2 + (1.0/120.0) * x4 + (1.0/5040.0) * x2 * x4 + (1.0/362880.0) * x4 * x4); } } #endif #endif