108 |
|
strcpy(vdwFileName, "oplsaal.vdw"); |
109 |
|
} |
110 |
|
|
111 |
+ |
|
112 |
+ |
printf ("opening %s\n", vdwFileName); |
113 |
|
vdwFile = fopen( vdwFileName, "r" ); |
114 |
|
|
115 |
|
if( vdwFile == NULL ){ |
126 |
|
strcat( temp, vdwFileName ); |
127 |
|
strcpy( vdwFileName, temp ); |
128 |
|
|
129 |
+ |
printf ("opening %s\n", vdwFileName); |
130 |
|
vdwFile = fopen( vdwFileName, "r" ); |
131 |
|
|
132 |
|
if( vdwFile == NULL ){ |
137 |
|
vdwFileName ); |
138 |
|
exit(-1); |
139 |
|
} |
140 |
< |
printf( "VDW file %s opened sucessfully.\n", vdwFileName ); |
141 |
< |
lineNum = 0; |
142 |
< |
|
140 |
> |
} |
141 |
> |
printf( "VDW file %s opened sucessfully.\n", vdwFileName ); |
142 |
> |
lineNum = 0; |
143 |
> |
|
144 |
> |
eof_test = fgets( readLine, sizeof(readLine), vdwFile ); |
145 |
> |
lineNum++; |
146 |
> |
|
147 |
> |
if( eof_test == NULL ){ |
148 |
> |
printf("Error in reading Atoms from force file at line %d.\n", |
149 |
> |
lineNum ); |
150 |
> |
exit(-1); |
151 |
> |
} |
152 |
> |
|
153 |
> |
while( eof_test != NULL ){ |
154 |
> |
// toss comment lines |
155 |
> |
if( readLine[0] != '!' && readLine[0] != '#' ){ |
156 |
> |
|
157 |
> |
nTokens = count_tokens(readLine, " ,;\t"); |
158 |
> |
if (nTokens < 4) { |
159 |
> |
printf("Not enough tokens on line %d.\n", lineNum); |
160 |
> |
exit(-1); |
161 |
> |
} |
162 |
> |
|
163 |
> |
at = new Atype(); |
164 |
> |
foo = strtok(readLine, " ,;\t"); |
165 |
> |
at->setType(foo); |
166 |
> |
foo = strtok(NULL, " ,;\t"); |
167 |
> |
mass = atof(foo); |
168 |
> |
at->setMass(mass); |
169 |
> |
foo = strtok(NULL, " ,;\t"); |
170 |
> |
rpar = atof(foo); |
171 |
> |
at->setRpar(rpar); |
172 |
> |
foo = strtok(NULL, " ,;\t"); |
173 |
> |
eps = atof(foo); |
174 |
> |
at->setEps(eps); |
175 |
> |
vdwAtypes.push_back(at); |
176 |
> |
} |
177 |
|
eof_test = fgets( readLine, sizeof(readLine), vdwFile ); |
178 |
|
lineNum++; |
179 |
< |
|
180 |
< |
if( eof_test == NULL ){ |
181 |
< |
printf("Error in reading Atoms from force file at line %d.\n", |
182 |
< |
lineNum ); |
146 |
< |
exit(-1); |
147 |
< |
} |
148 |
< |
|
149 |
< |
while( eof_test != NULL ){ |
150 |
< |
// toss comment lines |
151 |
< |
if( readLine[0] != '!' && readLine[0] != '#' ){ |
152 |
< |
|
153 |
< |
nTokens = count_tokens(readLine, " ,;\t"); |
154 |
< |
if (nTokens < 4) { |
155 |
< |
printf("Not enough tokens on line %d.\n", lineNum); |
156 |
< |
exit(-1); |
157 |
< |
} |
158 |
< |
|
159 |
< |
at = new Atype(); |
160 |
< |
foo = strtok(readLine, " ,;\t"); |
161 |
< |
at->setType(foo); |
162 |
< |
foo = strtok(NULL, " ,;\t"); |
163 |
< |
mass = atof(foo); |
164 |
< |
at->setMass(mass); |
165 |
< |
foo = strtok(NULL, " ,;\t"); |
166 |
< |
rpar = atof(foo); |
167 |
< |
at->setRpar(rpar); |
168 |
< |
foo = strtok(NULL, " ,;\t"); |
169 |
< |
eps = atof(foo); |
170 |
< |
at->setEps(eps); |
171 |
< |
vdwAtypes.push_back(at); |
172 |
< |
} |
173 |
< |
eof_test = fgets( readLine, sizeof(readLine), vdwFile ); |
174 |
< |
lineNum++; |
175 |
< |
} |
176 |
< |
|
177 |
< |
fclose( vdwFile ); |
178 |
< |
} |
179 |
> |
} |
180 |
> |
|
181 |
> |
fclose( vdwFile ); |
182 |
> |
|
183 |
|
printf("%d Atom Types read from VDW file\n", vdwAtypes.size()); |
184 |
|
|
185 |
|
// Now, open and parse the input file! |
230 |
|
|
231 |
|
rb = new RigidBody(); |
232 |
|
for( j = theAtoms.begin(); j != theAtoms.end(); ++j){ |
233 |
< |
rb->addAtom(*j); |
233 |
> |
rb->addAtom(*j); |
234 |
|
} |
235 |
< |
|
236 |
< |
//GridBuilder gb = new GridBuilder(); |
233 |
< |
//gb->findAxesAndOrigin(theAtoms); |
235 |
> |
|
236 |
> |
//GridBuilder gb = new GridBuilder(rb); |
237 |
|
//gb->launchProbe(FF, sigmaGrid, sGrid, epsGrid); |
238 |
< |
|
236 |
< |
|
238 |
> |
|
239 |
|
} |
240 |
|
|
241 |
|
int count_tokens(char *line, char *delimiters) { |