ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/SHAPES/forcer.cpp
(Generate patch)

Comparing trunk/SHAPES/forcer.cpp (file contents):
Revision 1271 by gezelter, Tue Jun 15 20:20:36 2004 UTC vs.
Revision 1275 by chrisfen, Tue Jun 15 22:36:23 2004 UTC

# Line 69 | Line 69 | int main(int argc, char* argv[]){
69    int lineNum;
70    int nTokens;
71    int FF;
72 +  int bandwidth;
73    short int gotMatch;
74  
75    //parse the command line options
# Line 83 | Line 84 | int main(int argc, char* argv[]){
84      exit(1);
85    }
86  
87 +  //the bandwidth has a default value (default=8), so it is always given
88 +  bandwidth = args_info.bandwidth_arg;
89 +  
90    if (args_info.charmm_given) {
91      FF=CHARMM;
92      strcpy(vdwFileName, "charmm27.vdw");
# Line 108 | Line 112 | int main(int argc, char* argv[]){
112      strcpy(vdwFileName, "oplsaal.vdw");
113    }
114  
115 +
116 +  printf ("opening %s\n", vdwFileName);
117    vdwFile = fopen( vdwFileName, "r" );
118    
119    if( vdwFile == NULL ){
# Line 124 | Line 130 | int main(int argc, char* argv[]){
130      strcat( temp, vdwFileName );
131      strcpy( vdwFileName, temp );
132      
133 +    printf ("opening %s\n", vdwFileName);
134      vdwFile = fopen( vdwFileName, "r" );
135      
136      if( vdwFile == NULL ){
# Line 134 | Line 141 | int main(int argc, char* argv[]){
141                 vdwFileName );
142        exit(-1);
143      }
144 <    printf( "VDW file %s opened sucessfully.\n", vdwFileName );
145 <    lineNum = 0;
146 <    
144 >  }
145 >  printf( "VDW file %s opened sucessfully.\n", vdwFileName );
146 >  lineNum = 0;
147 >  
148 >  eof_test = fgets( readLine, sizeof(readLine), vdwFile );
149 >  lineNum++;
150 >  
151 >  if( eof_test == NULL ){
152 >    printf("Error in reading Atoms from force file at line %d.\n",
153 >           lineNum );
154 >    exit(-1);
155 >  }
156 >  
157 >  while( eof_test != NULL ){
158 >    // toss comment lines
159 >    if( readLine[0] != '!' && readLine[0] != '#' ){
160 >      
161 >      nTokens = count_tokens(readLine, " ,;\t");
162 >      if (nTokens < 4) {
163 >        printf("Not enough tokens on line %d.\n", lineNum);
164 >        exit(-1);
165 >      }
166 >      
167 >      at = new Atype();
168 >      foo = strtok(readLine, " ,;\t");
169 >      at->setType(foo);
170 >      foo = strtok(NULL, " ,;\t");      
171 >      mass = atof(foo);
172 >      at->setMass(mass);
173 >      foo = strtok(NULL, " ,;\t");
174 >      rpar = atof(foo);
175 >      at->setRpar(rpar);
176 >      foo = strtok(NULL, " ,;\t");
177 >      eps = atof(foo);  
178 >      at->setEps(eps);
179 >      vdwAtypes.push_back(at);        
180 >    }
181      eof_test = fgets( readLine, sizeof(readLine), vdwFile );
182      lineNum++;
183 <    
184 <    if( eof_test == NULL ){
185 <      printf("Error in reading Atoms from force file at line %d.\n",
186 <             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 <  }
183 >  }          
184 >  
185 >  fclose( vdwFile );
186 >  
187    printf("%d Atom Types read from VDW file\n", vdwAtypes.size());
188  
189    // Now, open and parse the input file!
# Line 226 | Line 234 | int main(int argc, char* argv[]){
234  
235    rb = new RigidBody();
236    for( j = theAtoms.begin(); j !=  theAtoms.end(); ++j){
237 <          rb->addAtom(*j);
237 >    rb->addAtom(*j);
238    }
239 +  
240 +  //GridBuilder gb = new GridBuilder(rb);
241  
232  //GridBuilder gb = new GridBuilder();
233  //gb->findAxesAndOrigin(theAtoms);
242    //gb->launchProbe(FF, sigmaGrid, sGrid, epsGrid);
235
243  
244 +  
245   }
246  
247   int count_tokens(char *line, char *delimiters) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines