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

Comparing trunk/OOPSE/libmdtools/InitializeFromFile.cpp (file contents):
Revision 689 by tim, Tue Aug 12 19:56:49 2003 UTC vs.
Revision 830 by gezelter, Tue Oct 28 16:20:28 2003 UTC

# Line 1 | Line 1
1 + #define _FILE_OFFSET_BITS 64
2   #include <iostream>
3 < #include <cmath>
3 > #include <math.h>
4  
5   #include <stdio.h>
6   #include <stdlib.h>
# Line 28 | Line 29 | InitializeFromFile::InitializeFromFile( char *in_name
29  
30   InitializeFromFile::InitializeFromFile( char *in_name ){
31  
31  std::cerr << "Hello from Initialize from file.\n";
32
32   #ifdef IS_MPI
33    if (worldRank == 0) {
34   #endif
# Line 74 | Line 73 | void InitializeFromFile :: readInit( SimInfo* the_simn
73  
74   void InitializeFromFile :: readInit( SimInfo* the_simnfo ){
75  
76 <  int i, j, done, which_node, which_atom; // loop counter
76 >  int i, j;
77 >  
78 > #ifdef IS_MPI
79 >  int done, which_node, which_atom; // loop counter
80 > #endif //is_mpi
81  
82    const int BUFFERSIZE = 2000; // size of the read buffer
83    int n_atoms; // the number of atoms
84    char read_buffer[BUFFERSIZE]; //the line buffer for reading
82 #ifdef IS_MPI
83  char send_buffer[BUFFERSIZE];
84 #endif
85  
86    char *eof_test; // ptr to see when we reach the end of the file
87    char *parseErr;
88 <  int procIndex;
88 >
89    double currTime;
90    double boxMat[9];
91    double theBoxMat3[3][3];
# Line 105 | Line 105 | void InitializeFromFile :: readInit( SimInfo* the_simn
105  
106    n_atoms = atoi( read_buffer );
107  
108  Atom **atoms = simnfo->atoms;
109  DirectionalAtom* dAtom;
110
108    if( n_atoms != simnfo->n_atoms ){
109      sprintf( painCave.errMsg,
110               "Initialize from File error. %s n_atoms, %d, "
# Line 183 | Line 180 | void InitializeFromFile :: readInit( SimInfo* the_simn
180      eof_test = fgets(read_buffer, sizeof(read_buffer), c_in_file);
181      if( eof_test == NULL ){
182        sprintf( painCave.errMsg,
183 <               "Error reading 1st line of %d \n ",c_in_name);
183 >               "Error reading 1st line of %s \n ",c_in_name);
184        haveError = 1;
185        simError();
186      }
187      
188      n_atoms = atoi( read_buffer );
189      
193    Atom **atoms = simnfo->atoms;
194    DirectionalAtom* dAtom;
195
190      // Check to see that the number of atoms in the intial configuration file is the
191      // same as declared in simBass.
192      
# Line 335 | Line 329 | char* InitializeFromFile::parseDumpLine(char* readLine
329    Atom **atoms = simnfo->atoms;
330    DirectionalAtom* dAtom;
331    
332 <  int j, n_atoms, atomIndex;
332 >  int n_atoms, atomIndex;
333  
334   #ifdef IS_MPI
335 +  int j;
336 +
337    n_atoms = mpiSim->getTotAtoms();
338    atomIndex=-1;        
339    for (j=0; j < mpiSim->getMyNlocal(); j++) {
# Line 546 | Line 542 | char* InitializeFromFile::parseBoxLine(char* readLine,
542                                         double &time ){
543  
544    char *foo; // the pointer to the current string token
549  int j;
545  
546    // set the string tokenizer
547    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines