24 Atom(
double x_,
double y_,
double z_,
double q_,
double m_) {
25 x = x_; y = y_; z = z_; q = q_; m = m_;
27 vx = 0.0; vy = 0.0; vz = 0.0;
28 fx = 0.0; fy = 0.0; fz = 0.0;
29 fxu = 0.0; fyu = 0.0; fzu = 0.0;
30 mvx2 = 0.0; mvy2 = 0.0; mvz2 = 0.0;
32 Atom(
double x_,
double y_,
double z_,
double q_,
double m_,
33 double vx_,
double vy_,
double vz_) {
34 x = x_; y = y_; z = z_; q = q_; m = m_;
36 vx = vx_; vy = vy_; vz = vz_;
37 fx = 0.0; fy = 0.0; fz = 0.0;
38 fxu = 0.0; fyu = 0.0; fzu = 0.0;
39 mvx2 = 0.0; mvy2 = 0.0; mvz2 = 0.0;
41 void Init(
double x_,
double y_,
double z_,
double q_,
double m_) {
42 x = x_; y = y_; z = z_; q = q_; m = m_;
45 vx = 0.0; vy = 0.0; vz = 0.0;
46 fx = 0.0; fy = 0.0; fz = 0.0;
47 fxu = 0.0; fyu = 0.0; fzu = 0.0;
48 mvx2 = 0.0; mvy2 = 0.0; mvz2 = 0.0;
50 void Init(
double x_,
double y_,
double z_,
double q_,
double m_,
51 double vx_,
double vy_,
double vz_) {
52 x = x_; y = y_; z = z_; q = q_; m = m_;
54 vx = vx_; vy = vy_; vz = vz_;
55 fx = 0.0; fy = 0.0; fz = 0.0;
56 fxu = 0.0; fyu = 0.0; fzu = 0.0;
57 mvx2 = 0.0; mvy2 = 0.0; mvz2 = 0.0;
60 x = a->x; y = a->y; z = a->z; q = a->q; m = a->m;
61 xu = a->xu; yu = a->yu; zu = a->zu; mu = a->mu;
62 vx = a->vx; vy = a->vy; vz = a->vz;
63 fx = a->fx; fy = a->fy; fz = a->fz;
64 fxu = a->fxu; fyu = a->fyu; fzu = a->fzu;
65 mvx2 = 0.0; mvy2 = 0.0; mvz2 = 0.0;
71 double vxold,vyold,vzold;
72 double xold,yold,zold;
73 double vx,vy,vz,mvx2,mvy2,mvz2;
75 double xu, yu, zu, mu;
79 void pup(PUP::er &p) {
80 p|x; p|y; p|z; p|q; p|m;
83 p|mvx2; p|mvy2; p|mvz2;
84 p|xu; p|yu; p|zu; p|mu;
101 double *xu,*yu,*zu,*q;
102 double *fxu,*fyu,*fzu;
105 FastAtoms(){natm=0;xu=yu=zu=q=fzu=fyu=x=y=z=fx=fy=fz=NULL;}
119 PIMD_CM(){x=NULL; y=NULL;z=NULL;}
135 double fx[5],fy[5],fz[5];
136 double vx[5],vy[5],vz[5];
139 AtomNHC(
int len_nhc_in,
double kT_in,
double *vx_in,
double *vy_in,
double *vz_in,
141 len_nhc = len_nhc_in;
142 checkLenNHC(len_nhc);
145 for(
int i=0;i<len_nhc;i++){
147 vx[i] = vx_in[i]; vy[i] = vy_in[i]; vz[i] = vz_in[i];
148 fx[i] = 0.0; fy[i] = 0.0; fz[i] = 0.0;
152 len_nhc = a->len_nhc;
155 checkLenNHC(len_nhc);
156 for(
int i=0;i<len_nhc;i++){
158 vx[i] = a->vx[i]; vy[i] = a->vy[i]; vz[i] = a->vz[i];
159 fx[i] = a->fx[i]; fy[i] = a->fy[i]; fz[i] = a->fz[i];
163 void Init(
int len_nhc_in,
double kT_in,
double *vx_in,
double *vy_in,
double *vz_in,
165 len_nhc = len_nhc_in;
168 checkLenNHC(len_nhc);
169 for(
int i=0;i<len_nhc;i++){
171 vx[i] = vx_in[i]; vy[i] = vy_in[i]; vz[i] = vz_in[i];
172 fx[i] = 0.0; fy[i] = 0.0; fz[i] = 0.0;
176 len_nhc = a->len_nhc;
179 checkLenNHC(len_nhc);
180 for(
int i=0;i<len_nhc;i++){
182 vx[i] = a->vx[i]; vy[i] = a->vy[i]; vz[i] = a->vz[i];
183 fx[i] = a->fx[i]; fy[i] = a->fy[i]; fz[i] = a->fz[i];
189 void pup(PUP::er &p) {
190 p|len_nhc; p|kT; p|posKT;
192 p(vx,len_nhc); p(vy,len_nhc); p(vz,len_nhc);
193 p(fx,len_nhc); p(fy,len_nhc); p(fz,len_nhc);
196 void checkLenNHC(
int mylen_nhc){
198 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@@@\n");
199 CkPrintf(
"The maximum allowed Atm NHC len is 5.\n");
200 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@@@\n");