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 1275 by chrisfen, Tue Jun 15 22:36:23 2004 UTC vs.
Revision 1286 by chrisfen, Tue Jun 22 20:38:04 2004 UTC

# Line 5 | Line 5
5   #include "forcerCmd.h"
6   #include "PDBReader.hpp"
7   #include "RigidBody.hpp"
8 + #include "GridBuilder.hpp"
9  
10   #define MK_STR(s) # s
11   #define STR_DEFINE(t, s) t = MK_STR(s)
# Line 52 | Line 53 | int main(int argc, char* argv[]){
53    vector<VDWAtom*> theAtoms;
54    vector<VDWAtom*>::iterator j;
55    VDWAtom* atom;
56 <
56 >  GridBuilder* gb;
57 >  vector<double> sigmaGrid;
58 >  vector<double> epsGrid;
59 >  vector<double> sGrid;
60 >  
61    double mass, rpar, eps;
62 +  double xyz3[3];
63    string fileName;  
64    char vdwFileName[2002];
65    char structureFileName[2002];
66    char temp[200];
67    char readLine[500];
68 +  char xyzFile[200];
69    FILE *vdwFile, *structureFile;
70    char* ffPath_env = "VDW_PATH";
71    char* ffPath;
# Line 66 | Line 73 | int main(int argc, char* argv[]){
73    char* foo;
74    char* myType;
75    char* vType;
76 +  char *token;
77 +  const char *file;
78 +  const char *period = ".";
79 +  int k;
80    int lineNum;
81    int nTokens;
82    int FF;
# Line 84 | Line 95 | int main(int argc, char* argv[]){
95      exit(1);
96    }
97  
98 <  //the bandwidth has a default value (default=8), so it is always given
98 >  file = fileName.c_str();
99 >  strcpy(xyzFile, file);
100 >  token = strtok(xyzFile, period);
101 >  strcpy(xyzFile, token);
102 >  strcat(xyzFile, "ref.xyz");
103 >  ofstream xfiles(xyzFile);
104 >  
105 >  //the bandwidth has a default value (default=16), so it is always given
106    bandwidth = args_info.bandwidth_arg;
107    
108    if (args_info.charmm_given) {
# Line 236 | Line 254 | int main(int argc, char* argv[]){
254    for( j = theAtoms.begin(); j !=  theAtoms.end(); ++j){
255      rb->addAtom(*j);
256    }
257 +
258 +  rb->calcRefCoords();
259    
260 <  //GridBuilder gb = new GridBuilder(rb);
260 >  //print a reference coordinate xyz file
261 >  xfiles << rb->getNumAtoms() << "\n\n";
262 >  for (k=0; k<rb->getNumAtoms(); k++){
263 >    rb->getAtomRefCoor(xyz3, k);
264 >    xfiles << rb->getAtomType(k) << "\t" <<
265 >              xyz3[0] << "\t" << xyz3[1] << "\t" <<
266 >              xyz3[2] << "\n";
267 >  }
268 >  
269 >  gb = new GridBuilder(rb, bandwidth*2);
270  
271 <  //gb->launchProbe(FF, sigmaGrid, sGrid, epsGrid);
272 <
273 <  
271 >  cout << "Doing GridBuilder calculations...\n";
272 >  gb->launchProbe(FF, sigmaGrid, sGrid, epsGrid);
273 >  
274 >  //write out the grid files
275   }
276  
277   int count_tokens(char *line, char *delimiters) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines