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

Comparing trunk/mdtools/interface_implementation/LJ_FF.cpp (file contents):
Revision 249 by chuckv, Mon Jan 27 21:28:19 2003 UTC vs.
Revision 257 by chuckv, Thu Jan 30 22:29:24 2003 UTC

# Line 9 | Line 9 | using namespace std;
9   #include "SRI.hpp"
10   #include "simError.h"
11  
12
12   // Declare the structures that will be passed by the parser and  MPI
13  
14   typedef struct{
# Line 25 | Line 24 | int parseAtomLJ( char *lineBuffer, int lineNum, atomSt
24   int parseAtomLJ( char *lineBuffer, int lineNum, atomStruct &info );
25  
26   #ifdef IS_MPI
28
27   #include "mpiForceField.h"
28  
29   MPI_Datatype mpiAtomStructType;
# Line 73 | Line 71 | LJ_FF* currentLJwrap;
71   // begins the actual forcefield stuff.  
72   //****************************************************************
73  
74 +
75   LJ_FF::LJ_FF(){
76  
77    char fileName[200];
# Line 213 | Line 212 | void LJfunctionWrapper( void (*p1)( int* ident, double
212                                      short int* doPotentialCalc ) ){
213    
214    
215 <  p1 = newLJtype;
216 <  p2 = initLJfortran;
215 >  newLJtype = p1;
216 >  initLJfortran = p2;
217    currentLJwrap->setLJfortran( p3 );
218   }
219  
# Line 351 | Line 350 | void LJ_FF::initializeAtoms( void ){
350               "LJ_FF atom structures read successfully." );
351      MPIcheckPoint();
352  
353 <    currentAtomType = headAtomType;
353 >    currentAtomType = headAtomType->next; //skip the first element who is a place holder.
354      while( currentAtomType != NULL ){
355        currentAtomType->duplicate( info );
356 +
357 +
358 +
359        sendFrcStruct( &info, mpiAtomStructType );
360 +
361 +      sprintf( checkPointMsg,
362 +               "successfully sent lJ force type: \"%s\"\n",
363 +               info.name );
364 +      MPIcheckPoint();
365 +
366        currentAtomType = currentAtomType->next;
367      }
368      info.last = 1;
# Line 370 | Line 378 | void LJ_FF::initializeAtoms( void ){
378  
379      headAtomType = new LinkedType;
380      recieveFrcStruct( &info, mpiAtomStructType );
381 +    
382      while( !info.last ){
383 +
384 +
385  
386        headAtomType->add( info );
387 +      
388 +      MPIcheckPoint();
389 +
390        recieveFrcStruct( &info, mpiAtomStructType );
391      }
392    }
# Line 386 | Line 400 | void LJ_FF::initializeAtoms( void ){
400      
401      if( currentAtomType->name[0] != '\0' ){
402        isError = 0;
403 <      newLJtype( &(currentAtomType->ident),
403 >          newLJtype( &(currentAtomType->ident),
404                   &(currentAtomType->mass),
405                   &(currentAtomType->epslon),
406                   &(currentAtomType->sigma),
# Line 438 | Line 452 | void LJ_FF::initializeAtoms( void ){
452    
453   #ifdef IS_MPI
454    double tempBig = bigSigma;
455 <  MPI::COMM_WORLD::Allreduce( &tempBig, &bigSigma, 1, MPI_DOUBLE, MPI_MAX );
455 >  MPI::COMM_WORLD.Allreduce( &tempBig, &bigSigma, 1, MPI_DOUBLE, MPI_MAX );
456   #endif  //is_mpi
457  
458    //calc rCut and rList
# Line 605 | Line 619 | int parseAtomLJ( char *lineBuffer, int lineNum,  atomS
619   }
620  
621  
622 < void LJ_FF::doForces( void ){
622 > void LJ_FF::doForces( int calcPot ){
623  
624    int i;
625    double* frc;
626    double* pos;
627 <  short int calcPot = 1;
627 >  short int passedCalcPot = (short int)calcPot;
628  
629    // forces are zeroed here, before any are acumulated.
630    // NOTE: do not rezero the forces in Fortran.
# Line 622 | Line 636 | void LJ_FF::doForces( void ){
636    frc = Atom::getFrcArray();
637    pos = Atom::getPosArray();
638  
639 <  doLJfortran( pos, frc, &(entry_plug->lrPot), &calcPot );
639 > //   entry_plug->lrPot = -1;
640 >  doLJfortran( pos, frc, &(entry_plug->lrPot), &passedCalcPot );
641 >
642 >
643 > //  fprintf( stderr,
644 > //         "lrPot =  %lf\n", entry_plug->lrPot );
645 >  
646   }
647    
648   void LJ_FF::initFortran( void ){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines