| 1 |
#define _FILE_OFFSET_BITS 64 |
| 2 |
|
| 3 |
#include <stdio.h> |
| 4 |
#include <stdlib.h> |
| 5 |
#include <string.h> |
| 6 |
#include <math.h> |
| 7 |
|
| 8 |
|
| 9 |
#include "params.h" |
| 10 |
#include "tcProps.h" |
| 11 |
#include "readWrite.h" |
| 12 |
#include "rmsd.h" |
| 13 |
|
| 14 |
struct frameStruct{ |
| 15 |
struct atomCoord atoms[NL_ATOMS*NLIPIDS+NSSD]; |
| 16 |
double time; |
| 17 |
double Hmat[3][3]; |
| 18 |
}; |
| 19 |
|
| 20 |
strcut frameStruct* myFrames; |
| 21 |
|
| 22 |
void rmsd(double startTime, char* outPrefix ){ |
| 23 |
|
| 24 |
// list of 'a priori' constants |
| 25 |
|
| 26 |
const int nLipAtoms = NL_ATOMS; |
| 27 |
const int nBonds = NBONDS; |
| 28 |
const int nLipids = NLIPIDS; |
| 29 |
const int nSSD = NSSD; |
| 30 |
const int nAtoms = nLipAtoms * nLipids + nSSD; |
| 31 |
|
| 32 |
// variables |
| 33 |
|
| 34 |
char outName[500]; |
| 35 |
FILE* outFile; |
| 36 |
int i, j, k; |
| 37 |
int startFrame, corrFrames, framesFinished; |
| 38 |
int startFound, percentComplete; |
| 39 |
|
| 40 |
double Hmat[3][3]; |
| 41 |
|
| 42 |
framesFinished = 0; |
| 43 |
|
| 44 |
startFound = 0; |
| 45 |
startFrame = -1; |
| 46 |
while( !startFound ){ |
| 47 |
|
| 48 |
startFrame++; |
| 49 |
|
| 50 |
if(startFrame >= nFrames){ |
| 51 |
|
| 52 |
fprintf( stderr, |
| 53 |
"Start Time, %G, was not found in the dump file.\n", |
| 54 |
startTime ); |
| 55 |
exit(0); |
| 56 |
} |
| 57 |
|
| 58 |
if(startTime <= frameTimes[startFrame]) |
| 59 |
startFound = 1; |
| 60 |
|
| 61 |
|
| 62 |
} |
| 63 |
|
| 64 |
corrFrames = nFrames - startFrame; |
| 65 |
myFrames = (struct frameStruct*)calloc(corrFrames, |
| 66 |
sizeof(struct frameStruct)); |