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 1075 by tim, Mon Mar 1 21:17:27 2004 UTC

# Line 190 | Line 190 | void dumpToXYZ(SimInfo* info, ofstream* xyzStream, int
190    int newN;
191    Atom** atoms;
192    double pos[3];
193 <  char atomType[100];
193 >  char* atomType;
194    double HMat[3][3];
195    int numNonSSD;
196    int numSSD;
# Line 202 | Line 202 | void dumpToXYZ(SimInfo* info, ofstream* xyzStream, int
202  
203    //Determine the number of SSD molecules and Non-SSD molecules
204    for (int i = 0; i < info->n_atoms; i++){
205 <    atoms[i]->getType();
206 <    if (strcmp(atomType, "SSD") || strcmp(atomType+2, "SSD"))
205 >    atomType = atoms[i]->getType();
206 >    if (!strcmp(atomType, "SSD") || !strcmp(atomType+2, "SSD"))
207        numSSD++;
208      else
209        numNonSSD++;
# Line 231 | Line 231 | void dumpToXYZ(SimInfo* info, ofstream* xyzStream, int
231  
232          for (int l = 0; l < info->n_atoms; l++){
233            atoms[l]->getPos(pos);
234 <          strcpy(atomType, atoms[l]->getType());
234 >          atomType = atoms[l]->getType();
235  
236            if (periodicBox_given)
237                info->wrapVector(pos);
# Line 276 | Line 276 | void dumpToXYZ(SimInfo* info, ofstream* xyzStream, int
276                            atomType, pos[0], pos [1], pos[2], u[0], u[1], u[2] );
277                }
278                else
279 <                sprintf(buffer,"%s\t%lf\t%lf\t%lf\t0.0\t0.0\t0.0\n",
279 >                sprintf(buffer,"%s\t%lf\t%lf\t%lf\n",
280                            atomType,pos[0], pos [1], pos[2]);
281              }
282            }
283            else{
284 <              sprintf(buffer,"%s\t%lf\t%lf\t%lf\n",
284 >              if (dipole_given)
285 >                sprintf(buffer,"%s\t%lf\t%lf\t%lf\t0.0\t0.0\t0.0\n",
286                          atomType,pos[0], pos [1], pos[2]);
287 +
288 +              else
289 +                sprintf(buffer,"%s\t%lf\t%lf\t%lf\n",
290 +                        atomType,pos[0], pos [1], pos[2]);
291            }//end if atoms[i]->isDirectional()
292  
293            (*xyzStream) << buffer;
# Line 376 | Line 381 | vector<int> getAtomToZMol(SimInfo* info, vector<int>&
381      }
382      else{
383        if(mols[i].getGlobalIndex() == zmolIndex[curIndex]){
384 <      isZmol = zmolIndex[curIndex];
384 >      isZmol = curIndex;
385        curIndex ++;
386        }
387        else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines