| 16 |
|
* @version: 1.0 |
| 17 |
|
* @email: tlin@nd.edu |
| 18 |
|
* |
| 19 |
< |
* This program is a substitue of quickLate. It not only implemnet all of the functions in |
| 20 |
< |
* quickLate, but also provide the functions of replacing atom types for z-constraint. |
| 19 |
> |
* This program is a substitue of quickLate. It not only implemnets all of the functions in |
| 20 |
> |
* quickLate, but also provides the functions of replacing atom types for z-constraint. |
| 21 |
|
* This implement is kind of wierd!!! |
| 22 |
|
*/ |
| 23 |
|
vector<int> getAtomToZMol(SimInfo* info, vector<int>& zmolIndex); |
| 88 |
|
zmolPos = zReader->getZConsPos(); |
| 89 |
|
|
| 90 |
|
atomToZMol = getAtomToZMol(info, zmolIndex); |
| 91 |
< |
|
| 91 |
> |
|
| 92 |
|
//get tolerance |
| 93 |
|
GenericData* data; |
| 94 |
|
DoubleData* toleranceData; |
| 109 |
|
else{ |
| 110 |
|
zconsTol = toleranceData->getData(); |
| 111 |
|
} |
| 112 |
+ |
|
| 113 |
+ |
if (zReader->hasNextFrame()) |
| 114 |
+ |
zReader->readNextFrame(); |
| 115 |
+ |
|
| 116 |
|
} |
| 117 |
|
|
| 118 |
|
|
| 119 |
|
|
| 120 |
|
} |
| 121 |
|
|
| 122 |
+ |
|
| 123 |
|
xyzStream = new ofstream(xyzFileName.c_str()); |
| 124 |
|
for (int i = 0; i < nFrame; i += args_info.frame_arg){ |
| 125 |
|
dumpReader->readFrame(info, i); |
| 126 |
+ |
|
| 127 |
|
if (args_info.replace_given && info->nZconstraints > 0){ |
| 128 |
+ |
|
| 129 |
+ |
while (zReader->getCurTime() < info->currentTime){ |
| 130 |
+ |
// (zReader->hasNextFrame()) |
| 131 |
+ |
zReader->readNextFrame(); |
| 132 |
+ |
} |
| 133 |
+ |
|
| 134 |
+ |
zmolPos = zReader->getZConsPos(); |
| 135 |
+ |
|
| 136 |
|
replaceAtomType(info, zmolIndex, zmolPos, atomToZMol, zconsTol); |
| 137 |
|
} |
| 138 |
|
dumpToXYZ(info, xyzStream,args_info.repeatX_arg, |
| 204 |
|
int newN; |
| 205 |
|
Atom** atoms; |
| 206 |
|
double pos[3]; |
| 207 |
< |
char atomType[100]; |
| 207 |
> |
char* atomType; |
| 208 |
|
double HMat[3][3]; |
| 209 |
|
int numNonSSD; |
| 210 |
|
int numSSD; |
| 216 |
|
|
| 217 |
|
//Determine the number of SSD molecules and Non-SSD molecules |
| 218 |
|
for (int i = 0; i < info->n_atoms; i++){ |
| 219 |
< |
atoms[i]->getType(); |
| 220 |
< |
if (strcmp(atomType, "SSD") || strcmp(atomType+2, "SSD")) |
| 219 |
> |
atomType = atoms[i]->getType(); |
| 220 |
> |
if (!strcmp(atomType, "SSD") || !strcmp(atomType+2, "SSD")) |
| 221 |
|
numSSD++; |
| 222 |
|
else |
| 223 |
|
numNonSSD++; |
| 245 |
|
|
| 246 |
|
for (int l = 0; l < info->n_atoms; l++){ |
| 247 |
|
atoms[l]->getPos(pos); |
| 248 |
< |
strcpy(atomType, atoms[l]->getType()); |
| 248 |
> |
atomType = atoms[l]->getType(); |
| 249 |
|
|
| 250 |
|
if (periodicBox_given) |
| 251 |
|
info->wrapVector(pos); |
| 290 |
|
atomType, pos[0], pos [1], pos[2], u[0], u[1], u[2] ); |
| 291 |
|
} |
| 292 |
|
else |
| 293 |
< |
sprintf(buffer,"%s\t%lf\t%lf\t%lf\t0.0\t0.0\t0.0\n", |
| 293 |
> |
sprintf(buffer,"%s\t%lf\t%lf\t%lf\n", |
| 294 |
|
atomType,pos[0], pos [1], pos[2]); |
| 295 |
|
} |
| 296 |
|
} |
| 297 |
|
else{ |
| 298 |
< |
sprintf(buffer,"%s\t%lf\t%lf\t%lf\n", |
| 298 |
> |
if (dipole_given) |
| 299 |
> |
sprintf(buffer,"%s\t%lf\t%lf\t%lf\t0.0\t0.0\t0.0\n", |
| 300 |
|
atomType,pos[0], pos [1], pos[2]); |
| 301 |
+ |
|
| 302 |
+ |
else |
| 303 |
+ |
sprintf(buffer,"%s\t%lf\t%lf\t%lf\n", |
| 304 |
+ |
atomType,pos[0], pos [1], pos[2]); |
| 305 |
|
}//end if atoms[i]->isDirectional() |
| 306 |
|
|
| 307 |
|
(*xyzStream) << buffer; |
| 395 |
|
} |
| 396 |
|
else{ |
| 397 |
|
if(mols[i].getGlobalIndex() == zmolIndex[curIndex]){ |
| 398 |
< |
isZmol = zmolIndex[curIndex]; |
| 398 |
> |
isZmol = curIndex; |
| 399 |
|
curIndex ++; |
| 400 |
|
} |
| 401 |
|
else |