| 54 |
|
while( !startFound ){ |
| 55 |
|
|
| 56 |
|
startFrame++; |
| 57 |
– |
|
| 58 |
– |
if(startTime <= frameTimes[startFrame]) |
| 59 |
– |
startFound = 1; |
| 57 |
|
|
| 58 |
|
if(startFrame >= nFrames){ |
| 59 |
|
|
| 62 |
|
startTime ); |
| 63 |
|
exit(0); |
| 64 |
|
} |
| 65 |
+ |
|
| 66 |
+ |
if(startTime <= frameTimes[startFrame]) |
| 67 |
+ |
startFound = 1; |
| 68 |
+ |
|
| 69 |
+ |
|
| 70 |
|
} |
| 71 |
|
|
| 72 |
|
corrFrames = nFrames - startFrame; |
| 73 |
|
directorHead = (struct directStr*)calloc(corrFrames, |
| 74 |
|
sizeof(struct directStr)); |
| 73 |
– |
|
| 75 |
|
|
| 76 |
|
for(i=startFrame; i<nFrames; i++){ |
| 77 |
|
|
| 78 |
|
percentComplete = |
| 79 |
|
(int)( 100.0 * (double)framesFinished / (double) corrFrames ); |
| 80 |
|
|
| 81 |
< |
// fprintf( stdout, |
| 82 |
< |
// "\rDirector head corr %3d%% complete.", |
| 83 |
< |
// percentComplete ); |
| 84 |
< |
// fflush( stdout ); |
| 81 |
> |
fprintf( stdout, |
| 82 |
> |
"\rDirector head corr %3d%% complete.", |
| 83 |
> |
percentComplete ); |
| 84 |
> |
fflush( stdout ); |
| 85 |
|
|
| 86 |
|
readFrame( i, atoms, Hmat ); |
| 87 |
|
|
| 88 |
< |
accumDHFrame( i, atoms ); |
| 88 |
> |
accumDHFrame( i-startFrame, atoms ); |
| 89 |
|
|
| 90 |
|
framesFinished++; |
| 91 |
|
} |
| 92 |
|
|
| 93 |
< |
// sprintf( outName, "%s.dirHead", outPrefix ); |
| 94 |
< |
// outFile = fopen( outName, "w" ); |
| 93 |
> |
sprintf( outName, "%s.dirHeadTop", outPrefix ); |
| 94 |
> |
outFile = fopen( outName, "w" ); |
| 95 |
> |
fprintf( outFile, |
| 96 |
> |
"#time\torderParam\tx\ty\tz\n"); |
| 97 |
|
|
| 98 |
+ |
for(i=0;i<corrFrames;i++){ |
| 99 |
+ |
fprintf( outFile, |
| 100 |
+ |
"%6G\t%6G\t%6G\t%6G\t%6G\n", |
| 101 |
+ |
directorHead[i].time, |
| 102 |
+ |
directorHead[i].orderTop, |
| 103 |
+ |
directorHead[i].uTop[0], |
| 104 |
+ |
directorHead[i].uTop[1], |
| 105 |
+ |
directorHead[i].uTop[2]); |
| 106 |
+ |
} |
| 107 |
+ |
fflush(outFile); |
| 108 |
+ |
fclose(outFile); |
| 109 |
|
|
| 110 |
< |
|
| 110 |
> |
sprintf( outName, "%s.dirHeadBottom", outPrefix ); |
| 111 |
> |
outFile = fopen( outName, "w" ); |
| 112 |
> |
fprintf( outFile, |
| 113 |
> |
"#time\torderParam\tx\ty\tz\n"); |
| 114 |
|
|
| 115 |
< |
// fflush(outFile); |
| 116 |
< |
// fclose(outFile); |
| 115 |
> |
for(i=0;i<corrFrames;i++){ |
| 116 |
> |
fprintf( outFile, |
| 117 |
> |
"%6G\t%6G\t%6G\t%6G\t%6G\n", |
| 118 |
> |
directorHead[i].time, |
| 119 |
> |
directorHead[i].orderBottom, |
| 120 |
> |
directorHead[i].uBottom[0], |
| 121 |
> |
directorHead[i].uBottom[1], |
| 122 |
> |
directorHead[i].uBottom[2]); |
| 123 |
> |
} |
| 124 |
> |
fflush(outFile); |
| 125 |
> |
fclose(outFile); |
| 126 |
|
|
| 127 |
+ |
|
| 128 |
|
percentComplete = |
| 129 |
|
(int)( 100.0 * (double)framesFinished / (double) corrFrames ); |
| 130 |
|
|
| 131 |
|
fprintf( stdout, |
| 132 |
< |
"\rDirector head corr %3d%% complete.", |
| 132 |
> |
"\rDirector head corr %3d%% complete.\n" |
| 133 |
|
"done.\n", |
| 134 |
|
percentComplete ); |
| 135 |
|
fflush( stdout ); |
| 136 |
+ |
|
| 137 |
+ |
free( directorHead ); |
| 138 |
+ |
directorHead = NULL; |
| 139 |
|
} |
| 140 |
|
|
| 141 |
|
|
| 150 |
|
const int nAtoms = nLipAtoms * nLipids + nSSD; |
| 151 |
|
const double oneThird = 1.0 / 3.0; |
| 152 |
|
|
| 153 |
< |
int i,j,k; |
| 153 |
> |
int i,j,k,l,m; |
| 154 |
|
int nTop; |
| 155 |
|
int nBot; |
| 156 |
|
int lWork; |
| 160 |
|
|
| 161 |
|
double oTop[3][3]; |
| 162 |
|
double oBottom[3][3]; |
| 163 |
+ |
double matWrap[9]; |
| 164 |
|
double evals[3]; |
| 165 |
|
double work[9]; |
| 166 |
|
double *u; |
| 229 |
|
} |
| 230 |
|
} |
| 231 |
|
|
| 232 |
+ |
// matWrap to fortran convention |
| 233 |
+ |
|
| 234 |
+ |
for(j=0;j<3;j++) |
| 235 |
+ |
for(l=0;l<3;l++) |
| 236 |
+ |
matWrap[l+3*j] = oTop[l][j]; |
| 237 |
+ |
|
| 238 |
|
ifail = 0; |
| 239 |
|
|
| 240 |
< |
dsyev(&job, &uplo, &nfilled, oTop, &ndiag, evals, work, &lWork, &ifail); |
| 240 |
> |
dsyev(&job, &uplo, &nfilled, matWrap, &ndiag, evals, work, &lWork, &ifail); |
| 241 |
|
|
| 242 |
|
if (ifail) { |
| 243 |
|
fprintf(stderr, "dsyev screwed something up!\n"); |
| 244 |
|
exit(0); |
| 245 |
|
} |
| 246 |
+ |
|
| 247 |
+ |
// matWrap from fortran convention |
| 248 |
|
|
| 249 |
+ |
for(j=0;j<3;j++) |
| 250 |
+ |
for(l=0;l<3;l++) |
| 251 |
+ |
oTop[l][j] = matWrap[l+3*j]; |
| 252 |
+ |
|
| 253 |
|
max = 0.0; |
| 254 |
|
for (i=0; i<3;i++) { |
| 255 |
|
if (fabs(evals[i]) > max) { |
| 259 |
|
} |
| 260 |
|
|
| 261 |
|
for (i = 0; i < 3; i++) { |
| 262 |
< |
directorHead[index].uTop[i] = oTop[which][i]; |
| 262 |
> |
directorHead[index].uTop[i] = oTop[i][which]; |
| 263 |
|
} |
| 264 |
|
|
| 265 |
|
directorHead[index].orderTop = 1.5 * max; |
| 266 |
|
|
| 267 |
+ |
// matWrap to fortran convention |
| 268 |
+ |
|
| 269 |
+ |
for(j=0;j<3;j++) |
| 270 |
+ |
for(l=0;l<3;l++) |
| 271 |
+ |
matWrap[l+3*j] = oBottom[l][j]; |
| 272 |
+ |
|
| 273 |
|
ifail = 0; |
| 274 |
+ |
dsyev(&job, &uplo, &nfilled, matWrap, &ndiag, evals, work, &lWork, &ifail); |
| 275 |
|
|
| 226 |
– |
dsyev(&job, &uplo, &nfilled, oBottom, &ndiag, evals, work, &lWork, &ifail); |
| 227 |
– |
|
| 276 |
|
if (ifail) { |
| 277 |
|
fprintf(stderr, "dsyev screwed something up!\n"); |
| 278 |
|
exit(0); |
| 279 |
|
} |
| 280 |
|
|
| 281 |
+ |
// matWrap from fortran convention |
| 282 |
+ |
|
| 283 |
+ |
for(j=0;j<3;j++) |
| 284 |
+ |
for(l=0;l<3;l++) |
| 285 |
+ |
oBottom[l][j] = matWrap[l+3*j]; |
| 286 |
+ |
|
| 287 |
|
max = 0.0; |
| 288 |
|
for (i=0; i<3;i++) { |
| 289 |
|
if (fabs(evals[i]) > max) { |
| 293 |
|
} |
| 294 |
|
|
| 295 |
|
for (i = 0; i < 3; i++) { |
| 296 |
< |
directorHead[index].uBottom[i] = oBottom[which][i]; |
| 296 |
> |
directorHead[index].uBottom[i] = oBottom[i][which]; |
| 297 |
|
} |
| 298 |
|
|
| 299 |
|
directorHead[index].orderBottom = 1.5 * max; |
| 300 |
|
|
| 301 |
|
directorHead[index].time = frameTimes[index]; |
| 302 |
|
|
| 303 |
< |
fprintf(stderr, |
| 304 |
< |
"frame[%d] => orderTop = %6G; < %6G, %6G, %6G >\n" |
| 305 |
< |
" orderBottom = %6G; < %6G, %6G, %6G >\n\n", |
| 306 |
< |
index, |
| 307 |
< |
directorHead[index].orderTop, |
| 308 |
< |
directorHead[index].uTop[0], |
| 309 |
< |
directorHead[index].uTop[1], |
| 310 |
< |
directorHead[index].uTop[2], |
| 311 |
< |
directorHead[index].orderBottom, |
| 312 |
< |
directorHead[index].uBottom[0], |
| 313 |
< |
directorHead[index].uBottom[1], |
| 314 |
< |
directorHead[index].uBottom[2] ); |
| 303 |
> |
// fprintf(stderr, |
| 304 |
> |
// "frame[%d] => orderTop = %6G; < %6G, %6G, %6G >\n" |
| 305 |
> |
// " orderBottom = %6G; < %6G, %6G, %6G >\n\n", |
| 306 |
> |
// index, |
| 307 |
> |
// directorHead[index].orderTop, |
| 308 |
> |
// directorHead[index].uTop[0], |
| 309 |
> |
// directorHead[index].uTop[1], |
| 310 |
> |
// directorHead[index].uTop[2], |
| 311 |
> |
// directorHead[index].orderBottom, |
| 312 |
> |
// directorHead[index].uBottom[0], |
| 313 |
> |
// directorHead[index].uBottom[1], |
| 314 |
> |
// directorHead[index].uBottom[2] ); |
| 315 |
|
} |
| 316 |
|
|