28 |
|
|
29 |
|
void calcRMSDpair( int bin, int i, int j, enum atomNames rType ); |
30 |
|
|
31 |
< |
void rmsd( enum atomNames rType, double startTime, char* outPrefix ){ |
31 |
> |
void rmsd( enum atomNames rType, double startTime, char* outPrefix, |
32 |
> |
char* theName){ |
33 |
|
|
34 |
|
// list of 'a priori' constants |
35 |
|
|
57 |
|
double rmsdDt; |
58 |
|
double timeOut, outVal; |
59 |
|
|
60 |
+ |
struct atomCoord* atoms; |
61 |
+ |
|
62 |
|
framesFinished = 0; |
63 |
|
|
64 |
|
startFound = 0; |
94 |
|
index, |
95 |
|
corrFrames ); |
96 |
|
} |
97 |
< |
|
97 |
> |
|
98 |
> |
// initialize the arrays |
99 |
> |
|
100 |
> |
atoms = myFrames[index].atoms; |
101 |
> |
for(j=0;j<nLipids;j++){ |
102 |
> |
|
103 |
> |
atoms[nLipAtoms*j+0].type = HEAD; |
104 |
> |
atoms[nLipAtoms*j+0].mass = 72; |
105 |
> |
atoms[nLipAtoms*j+0].u[0] = 0.0; |
106 |
> |
atoms[nLipAtoms*j+0].u[1] = 0.0; |
107 |
> |
atoms[nLipAtoms*j+0].u[2] = 1.0; |
108 |
> |
|
109 |
> |
|
110 |
> |
|
111 |
> |
atoms[nLipAtoms*j+1].type = CH2; |
112 |
> |
atoms[nLipAtoms*j+1].mass = 14.03; |
113 |
> |
|
114 |
> |
atoms[nLipAtoms*j+2].type = CH; |
115 |
> |
atoms[nLipAtoms*j+2].mass = 13.02; |
116 |
> |
|
117 |
> |
atoms[nLipAtoms*j+3].type = CH2; |
118 |
> |
atoms[nLipAtoms*j+3].mass = 14.03; |
119 |
> |
|
120 |
> |
atoms[nLipAtoms*j+4].type = CH2; |
121 |
> |
atoms[nLipAtoms*j+4].mass = 14.03; |
122 |
> |
|
123 |
> |
atoms[nLipAtoms*j+5].type = CH2; |
124 |
> |
atoms[nLipAtoms*j+5].mass = 14.03; |
125 |
> |
|
126 |
> |
atoms[nLipAtoms*j+6].type = CH2; |
127 |
> |
atoms[nLipAtoms*j+6].mass = 14.03; |
128 |
> |
|
129 |
> |
atoms[nLipAtoms*j+7].type = CH2; |
130 |
> |
atoms[nLipAtoms*j+7].mass = 14.03; |
131 |
> |
|
132 |
> |
atoms[nLipAtoms*j+8].type = CH2; |
133 |
> |
atoms[nLipAtoms*j+8].mass = 14.03; |
134 |
> |
|
135 |
> |
atoms[nLipAtoms*j+9].type = CH2; |
136 |
> |
atoms[nLipAtoms*j+9].mass = 14.03; |
137 |
> |
|
138 |
> |
atoms[nLipAtoms*j+10].type = CH3; |
139 |
> |
atoms[nLipAtoms*j+10].mass = 15.04; |
140 |
> |
|
141 |
> |
atoms[nLipAtoms*j+11].type = CH2; |
142 |
> |
atoms[nLipAtoms*j+11].mass = 14.03; |
143 |
> |
|
144 |
> |
atoms[nLipAtoms*j+12].type = CH2; |
145 |
> |
atoms[nLipAtoms*j+12].mass = 14.03; |
146 |
> |
|
147 |
> |
atoms[nLipAtoms*j+13].type = CH2; |
148 |
> |
atoms[nLipAtoms*j+13].mass = 14.03; |
149 |
> |
|
150 |
> |
atoms[nLipAtoms*j+14].type = CH2; |
151 |
> |
atoms[nLipAtoms*j+14].mass = 14.03; |
152 |
> |
|
153 |
> |
atoms[nLipAtoms*j+15].type = CH2; |
154 |
> |
atoms[nLipAtoms*j+15].mass = 14.03; |
155 |
> |
|
156 |
> |
atoms[nLipAtoms*j+16].type = CH2; |
157 |
> |
atoms[nLipAtoms*j+16].mass = 14.03; |
158 |
> |
|
159 |
> |
atoms[nLipAtoms*j+17].type = CH2; |
160 |
> |
atoms[nLipAtoms*j+17].mass = 14.03; |
161 |
> |
|
162 |
> |
atoms[nLipAtoms*j+18].type = CH3; |
163 |
> |
atoms[nLipAtoms*j+18].mass = 15.04; |
164 |
> |
} |
165 |
> |
|
166 |
> |
for(j=(nLipAtoms*nLipids);j<nAtoms;j++){ |
167 |
> |
atoms[j].type = SSD; |
168 |
> |
atoms[j].mass = 18.03; |
169 |
> |
atoms[j].u[0] = 0.0; |
170 |
> |
atoms[j].u[1] = 0.0; |
171 |
> |
atoms[j].u[2] = 1.0; |
172 |
> |
} |
173 |
|
myFrames[index].time = frameTimes[i]; |
174 |
< |
readFrame(i, myFrames[index].atoms, myFrames[index].Hmat ); |
174 |
> |
readFrame(i, atoms, myFrames[index].Hmat ); |
175 |
> |
|
176 |
> |
index++; |
177 |
|
} |
178 |
|
|
179 |
|
// initialize the counts and the correlation |
197 |
|
for(j=i+1;j<corrFrames;j++){ |
198 |
|
|
199 |
|
diffTime = myFrames[j].time - myFrames[i].time; |
200 |
< |
if( diffTime > 0.0 ){ |
200 |
> |
|
201 |
> |
if( diffTime > 0.0 ){ |
202 |
|
|
203 |
|
percentComplete = |
204 |
|
(int)( 100.0 * (double)index / (double) nCounts ); |
205 |
|
|
206 |
|
fprintf( stdout, |
207 |
< |
"\rRMSD corr %3d%% complete.", |
207 |
> |
"\rMSD corr %3d%% complete.", |
208 |
|
percentComplete ); |
209 |
|
fflush( stdout ); |
210 |
|
|
219 |
|
|
220 |
|
// print out the correlation |
221 |
|
|
222 |
< |
sprintf( outName, "%s.rmsd", outPrefix ); |
222 |
> |
sprintf( outName, "%s-%s.msd", outPrefix, theName ); |
223 |
|
outFile = fopen( outName, "w" ); |
224 |
|
|
225 |
|
fprintf( outFile, |
226 |
< |
"#time\trmsd\n"); |
226 |
> |
"#time\tmsd\n"); |
227 |
|
|
228 |
|
for(i=0;i<RMSDBINS;i++){ |
229 |
|
|
245 |
|
(int)( 100.0 * (double)index / (double) nCounts ); |
246 |
|
|
247 |
|
fprintf( stdout, |
248 |
< |
"\rRMSD corr %3d%% complete.", |
248 |
> |
"\rMSD corr %3d%% complete.\n", |
249 |
|
percentComplete ); |
250 |
|
fflush( stdout ); |
251 |
|
|
283 |
|
atomsI = myFrames[frameI].atoms; |
284 |
|
atomsJ = myFrames[frameJ].atoms; |
285 |
|
|
286 |
+ |
accum = 0.0; |
287 |
+ |
|
288 |
|
if( rType != COM ){ |
289 |
|
|
290 |
|
nAccums = 0; |
299 |
|
for(j=0;j<3;j++) |
300 |
|
dSqr += d[j] * d[j]; |
301 |
|
|
302 |
< |
accum += sqrt(dSqr); |
302 |
> |
accum += dSqr; |
303 |
|
nAccums++; |
304 |
|
} |
305 |
|
} |
340 |
|
for(j=0;j<3;j++) |
341 |
|
dSqr += d[j] * d[j]; |
342 |
|
|
343 |
< |
accum += sqrt(dSqr); |
343 |
> |
accum += dSqr; |
344 |
|
nAccums++; |
345 |
|
} |
346 |
|
} |