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 ); |
147 |
|
const int nAtoms = nLipAtoms * nLipids + nSSD; |
148 |
|
const double oneThird = 1.0 / 3.0; |
149 |
|
|
150 |
< |
int i,j,k; |
150 |
> |
int i,j,k,l,m; |
151 |
|
int nTop; |
152 |
|
int nBot; |
153 |
|
int lWork; |
157 |
|
|
158 |
|
double oTop[3][3]; |
159 |
|
double oBottom[3][3]; |
160 |
+ |
double matWrap[9]; |
161 |
|
double evals[3]; |
162 |
|
double work[9]; |
163 |
|
double *u; |
226 |
|
} |
227 |
|
} |
228 |
|
|
229 |
+ |
// matWrap to fortran convention |
230 |
+ |
|
231 |
+ |
for(j=0;j<3;j++) |
232 |
+ |
for(l=0;l<3;l++) |
233 |
+ |
matWrap[l+3*j] = oTop[l][j]; |
234 |
+ |
|
235 |
|
ifail = 0; |
236 |
|
|
237 |
< |
dsyev(&job, &uplo, &nfilled, oTop, &ndiag, evals, work, &lWork, &ifail); |
237 |
> |
dsyev(&job, &uplo, &nfilled, matWrap, &ndiag, evals, work, &lWork, &ifail); |
238 |
|
|
239 |
|
if (ifail) { |
240 |
|
fprintf(stderr, "dsyev screwed something up!\n"); |
241 |
|
exit(0); |
242 |
|
} |
243 |
+ |
|
244 |
+ |
// matWrap from fortran convention |
245 |
|
|
246 |
+ |
for(j=0;j<3;j++) |
247 |
+ |
for(l=0;l<3;l++) |
248 |
+ |
oTop[l][j] = matWrap[l+3*j]; |
249 |
+ |
|
250 |
|
max = 0.0; |
251 |
|
for (i=0; i<3;i++) { |
252 |
|
if (fabs(evals[i]) > max) { |
256 |
|
} |
257 |
|
|
258 |
|
for (i = 0; i < 3; i++) { |
259 |
< |
directorHead[index].uTop[i] = oTop[which][i]; |
259 |
> |
directorHead[index].uTop[i] = oTop[i][which]; |
260 |
|
} |
261 |
|
|
262 |
|
directorHead[index].orderTop = 1.5 * max; |
263 |
|
|
264 |
+ |
// matWrap to fortran convention |
265 |
+ |
|
266 |
+ |
for(j=0;j<3;j++) |
267 |
+ |
for(l=0;l<3;l++) |
268 |
+ |
matWrap[l+3*j] = oBottom[l][j]; |
269 |
+ |
|
270 |
|
ifail = 0; |
271 |
+ |
dsyev(&job, &uplo, &nfilled, matWrap, &ndiag, evals, work, &lWork, &ifail); |
272 |
|
|
226 |
– |
dsyev(&job, &uplo, &nfilled, oBottom, &ndiag, evals, work, &lWork, &ifail); |
227 |
– |
|
273 |
|
if (ifail) { |
274 |
|
fprintf(stderr, "dsyev screwed something up!\n"); |
275 |
|
exit(0); |
276 |
|
} |
277 |
|
|
278 |
+ |
// matWrap from fortran convention |
279 |
+ |
|
280 |
+ |
for(j=0;j<3;j++) |
281 |
+ |
for(l=0;l<3;l++) |
282 |
+ |
oBottom[l][j] = matWrap[l+3*j]; |
283 |
+ |
|
284 |
|
max = 0.0; |
285 |
|
for (i=0; i<3;i++) { |
286 |
|
if (fabs(evals[i]) > max) { |
290 |
|
} |
291 |
|
|
292 |
|
for (i = 0; i < 3; i++) { |
293 |
< |
directorHead[index].uBottom[i] = oBottom[which][i]; |
293 |
> |
directorHead[index].uBottom[i] = oBottom[i][which]; |
294 |
|
} |
295 |
|
|
296 |
|
directorHead[index].orderBottom = 1.5 * max; |
297 |
|
|
298 |
|
directorHead[index].time = frameTimes[index]; |
299 |
|
|
300 |
< |
fprintf(stderr, |
301 |
< |
"frame[%d] => orderTop = %6G; < %6G, %6G, %6G >\n" |
302 |
< |
" orderBottom = %6G; < %6G, %6G, %6G >\n\n", |
303 |
< |
index, |
304 |
< |
directorHead[index].orderTop, |
305 |
< |
directorHead[index].uTop[0], |
306 |
< |
directorHead[index].uTop[1], |
307 |
< |
directorHead[index].uTop[2], |
308 |
< |
directorHead[index].orderBottom, |
309 |
< |
directorHead[index].uBottom[0], |
310 |
< |
directorHead[index].uBottom[1], |
311 |
< |
directorHead[index].uBottom[2] ); |
300 |
> |
// fprintf(stderr, |
301 |
> |
// "frame[%d] => orderTop = %6G; < %6G, %6G, %6G >\n" |
302 |
> |
// " orderBottom = %6G; < %6G, %6G, %6G >\n\n", |
303 |
> |
// index, |
304 |
> |
// directorHead[index].orderTop, |
305 |
> |
// directorHead[index].uTop[0], |
306 |
> |
// directorHead[index].uTop[1], |
307 |
> |
// directorHead[index].uTop[2], |
308 |
> |
// directorHead[index].orderBottom, |
309 |
> |
// directorHead[index].uBottom[0], |
310 |
> |
// directorHead[index].uBottom[1], |
311 |
> |
// directorHead[index].uBottom[2] ); |
312 |
|
} |
313 |
|
|