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

Comparing trunk/OOPSE/utils/zsub.cpp (file contents):
Revision 1074 by tim, Mon Mar 1 20:01:50 2004 UTC vs.
Revision 1108 by tim, Wed Apr 14 15:37:41 2004 UTC

# Line 88 | Line 88 | int main(int argc, char* argv[]){
88      zmolPos = zReader->getZConsPos();
89      
90      atomToZMol = getAtomToZMol(info, zmolIndex);
91 <
91 >  
92      //get tolerance
93      GenericData* data;
94      DoubleData* toleranceData;
# Line 109 | Line 109 | int main(int argc, char* argv[]){
109        else{
110          zconsTol = toleranceData->getData();
111        }
112 +
113 +      if (zReader->hasNextFrame())
114 +        zReader->readNextFrame();
115 +
116      }    
117  
118  
119      
120    }
121  
122 +
123    xyzStream = new ofstream(xyzFileName.c_str());
124    for (int i = 0; i < nFrame; i += args_info.frame_arg){
125      dumpReader->readFrame(info, i);
126 +    
127      if (args_info.replace_given && info->nZconstraints > 0){    
128 +
129 +      while (zReader->getCurTime() < info->currentTime){
130 +        // (zReader->hasNextFrame())
131 +          zReader->readNextFrame();
132 +      }
133 +
134 +      zmolPos = zReader->getZConsPos();
135 +
136        replaceAtomType(info, zmolIndex, zmolPos, atomToZMol, zconsTol);
137      }
138      dumpToXYZ(info, xyzStream,args_info.repeatX_arg,
# Line 190 | Line 204 | void dumpToXYZ(SimInfo* info, ofstream* xyzStream, int
204    int newN;
205    Atom** atoms;
206    double pos[3];
207 <  char atomType[100];
207 >  char* atomType;
208    double HMat[3][3];
209    int numNonSSD;
210    int numSSD;
# Line 202 | Line 216 | void dumpToXYZ(SimInfo* info, ofstream* xyzStream, int
216  
217    //Determine the number of SSD molecules and Non-SSD molecules
218    for (int i = 0; i < info->n_atoms; i++){
219 <    atoms[i]->getType();
220 <    if (strcmp(atomType, "SSD") || strcmp(atomType+2, "SSD"))
219 >    atomType = atoms[i]->getType();
220 >    if (!strcmp(atomType, "SSD") || !strcmp(atomType+2, "SSD"))
221        numSSD++;
222      else
223        numNonSSD++;
# Line 231 | Line 245 | void dumpToXYZ(SimInfo* info, ofstream* xyzStream, int
245  
246          for (int l = 0; l < info->n_atoms; l++){
247            atoms[l]->getPos(pos);
248 <          strcpy(atomType, atoms[l]->getType());
248 >          atomType = atoms[l]->getType();
249  
250            if (periodicBox_given)
251                info->wrapVector(pos);
# Line 276 | Line 290 | void dumpToXYZ(SimInfo* info, ofstream* xyzStream, int
290                            atomType, pos[0], pos [1], pos[2], u[0], u[1], u[2] );
291                }
292                else
293 <                sprintf(buffer,"%s\t%lf\t%lf\t%lf\t0.0\t0.0\t0.0\n",
293 >                sprintf(buffer,"%s\t%lf\t%lf\t%lf\n",
294                            atomType,pos[0], pos [1], pos[2]);
295              }
296            }
297            else{
298 <              sprintf(buffer,"%s\t%lf\t%lf\t%lf\n",
298 >              if (dipole_given)
299 >                sprintf(buffer,"%s\t%lf\t%lf\t%lf\t0.0\t0.0\t0.0\n",
300                          atomType,pos[0], pos [1], pos[2]);
301 +
302 +              else
303 +                sprintf(buffer,"%s\t%lf\t%lf\t%lf\n",
304 +                        atomType,pos[0], pos [1], pos[2]);
305            }//end if atoms[i]->isDirectional()
306  
307            (*xyzStream) << buffer;
# Line 376 | Line 395 | vector<int> getAtomToZMol(SimInfo* info, vector<int>&
395      }
396      else{
397        if(mols[i].getGlobalIndex() == zmolIndex[curIndex]){
398 <      isZmol = zmolIndex[curIndex];
398 >      isZmol = curIndex;
399        curIndex ++;
400        }
401        else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines