| 24 |
|
#define NPTxyz_ENS 4 |
| 25 |
|
|
| 26 |
|
|
| 27 |
< |
#define FF_DUFF 0 |
| 28 |
< |
#define FF_LJ 1 |
| 29 |
< |
#define FF_EAM 2 |
| 27 |
> |
#define FF_DUFF 0 |
| 28 |
> |
#define FF_LJ 1 |
| 29 |
> |
#define FF_EAM 2 |
| 30 |
> |
#define FF_H2O 3 |
| 31 |
|
|
| 32 |
|
using namespace std; |
| 33 |
|
|
| 175 |
|
bend_set* theBends; |
| 176 |
|
torsion_set* theTorsions; |
| 177 |
|
|
| 177 |
– |
|
| 178 |
|
//init the forceField paramters |
| 179 |
|
|
| 180 |
|
the_ff->readParams(); |
| 182 |
|
|
| 183 |
|
// init the atoms |
| 184 |
|
|
| 185 |
+ |
double phi, theta, psi; |
| 186 |
+ |
double sux, suy, suz; |
| 187 |
+ |
double Axx, Axy, Axz, Ayx, Ayy, Ayz, Azx, Azy, Azz; |
| 188 |
|
double ux, uy, uz, u, uSqr; |
| 189 |
|
|
| 190 |
|
for (k = 0; k < nInfo; k++){ |
| 221 |
|
info[k].n_oriented++; |
| 222 |
|
molInfo.myAtoms[j] = dAtom; |
| 223 |
|
|
| 224 |
< |
ux = currentAtom->getOrntX(); |
| 225 |
< |
uy = currentAtom->getOrntY(); |
| 226 |
< |
uz = currentAtom->getOrntZ(); |
| 224 |
> |
// Directional Atoms have standard unit vectors which are oriented |
| 225 |
> |
// in space using the three Euler angles. We assume the standard |
| 226 |
> |
// unit vector was originally along the z axis below. |
| 227 |
> |
|
| 228 |
> |
phi = currentAtom->getEulerPhi() * M_PI / 180.0; |
| 229 |
> |
theta = currentAtom->getEulerTheta() * M_PI / 180.0; |
| 230 |
> |
psi = currentAtom->getEulerPsi()* M_PI / 180.0; |
| 231 |
> |
|
| 232 |
> |
Axx = (cos(phi) * cos(psi)) - (sin(phi) * cos(theta) * sin(psi)); |
| 233 |
> |
Axy = (sin(phi) * cos(psi)) + (cos(phi) * cos(theta) * sin(psi)); |
| 234 |
> |
Axz = sin(theta) * sin(psi); |
| 235 |
> |
|
| 236 |
> |
Ayx = -(cos(phi) * sin(psi)) - (sin(phi) * cos(theta) * cos(psi)); |
| 237 |
> |
Ayy = -(sin(phi) * sin(psi)) + (cos(phi) * cos(theta) * cos(psi)); |
| 238 |
> |
Ayz = sin(theta) * cos(psi); |
| 239 |
> |
|
| 240 |
> |
Azx = sin(phi) * sin(theta); |
| 241 |
> |
Azy = -cos(phi) * sin(theta); |
| 242 |
> |
Azz = cos(theta); |
| 243 |
> |
|
| 244 |
> |
sux = 0.0; |
| 245 |
> |
suy = 0.0; |
| 246 |
> |
suz = 1.0; |
| 247 |
> |
|
| 248 |
> |
ux = (Axx * sux) + (Ayx * suy) + (Azx * suz); |
| 249 |
> |
uy = (Axy * sux) + (Ayy * suy) + (Azy * suz); |
| 250 |
> |
uz = (Axz * sux) + (Ayz * suy) + (Azz * suz); |
| 251 |
|
|
| 252 |
|
uSqr = (ux * ux) + (uy * uy) + (uz * uz); |
| 253 |
|
|
| 636 |
|
else if (!strcasecmp(force_field, "EAM")){ |
| 637 |
|
ffCase = FF_EAM; |
| 638 |
|
} |
| 639 |
+ |
else if (!strcasecmp(force_field, "WATER")){ |
| 640 |
+ |
ffCase = FF_H2O; |
| 641 |
+ |
} |
| 642 |
|
else{ |
| 643 |
|
sprintf(painCave.errMsg, "SimSetup Error. Unrecognized force field -> %s\n", |
| 644 |
|
force_field); |
| 843 |
|
} |
| 844 |
|
|
| 845 |
|
#ifdef IS_MPI |
| 846 |
< |
strcpy(checkPointMsg, "Succesfully gathered all information from Bass\n"); |
| 846 |
> |
strcpy(checkPointMsg, "Successfully gathered all information from Bass\n"); |
| 847 |
|
MPIcheckPoint(); |
| 848 |
|
#endif // is_mpi |
| 849 |
|
} |
| 1140 |
|
the_ff = new EAM_FF(); |
| 1141 |
|
break; |
| 1142 |
|
|
| 1143 |
+ |
case FF_H2O: |
| 1144 |
+ |
the_ff = new WATER(); |
| 1145 |
+ |
break; |
| 1146 |
+ |
|
| 1147 |
|
default: |
| 1148 |
|
sprintf(painCave.errMsg, |
| 1149 |
|
"SimSetup Error. Unrecognized force field in case statement.\n"); |