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 248 by chuckv, Mon Jan 27 19:28:21 2003 UTC vs.
Revision 254 by chuckv, Thu Jan 30 20:03:37 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 64 | Line 62 | void (*newLJtype)( int* ident, double* mass, double* e
62   void (*newLJtype)( int* ident, double* mass, double* epslon, double* sigma,
63                     int* status );
64  
65 < void (*initLJfortran) ( int *nLocal, int *identArray, int *isError )
65 > void (*initLJfortran) ( int *nLocal, int *identArray, int *isError );
66  
67   LJ_FF* currentLJwrap;
68  
# 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 207 | Line 206 | void LJfunctionWrapper( void (*p1)( int* ident, double
206  
207   void LJfunctionWrapper( void (*p1)( int* ident, double* mass, double* epslon,
208                                     double* sigma, int* status ),
209 <                        void (*p2)( void ),
209 >                        void (*p2)( int*, int*, int* ),
210                          void (*p3)( double* positionArray,double* forceArray,
211                                      double* potentialEnergy,
212                                      short int* doPotentialCalc ) ){
213    
214    
215 <  p1 = newLJtype;
216 <  p2 = initLJfortran;
217 <  this->setLJfortran( p3 );
215 >  newLJtype = p1;
216 >  initLJfortran = p2;
217 >  currentLJwrap->setLJfortran( p3 );
218   }
219  
220  
# Line 242 | Line 241 | void LJ_FF::initializeAtoms( void ){
241        // check for duplicates
242        
243        if( !strcmp( info.name, name ) ){
244 <        sprintf( simError.painCave,
244 >        sprintf( painCave.errMsg,
245                   "Duplicate LJ atom type \"%s\" found in "
246                   "the LJ_FF param file./n",
247                   name );
# Line 307 | Line 306 | void LJ_FF::initializeAtoms( void ){
306  
307      headAtomType = new LinkedType;
308      
309 <    fastFoward( "AtomTypes", "initializeAtoms" );
309 >    fastForward( "AtomTypes", "initializeAtoms" );
310  
311      // we are now at the AtomTypes section.
312      
# Line 386 | Line 385 | void LJ_FF::initializeAtoms( void ){
385      
386      if( currentAtomType->name[0] != '\0' ){
387        isError = 0;
388 <      newLJtype( &(currentAtomType->ident),
388 >          newLJtype( &(currentAtomType->ident),
389                   &(currentAtomType->mass),
390                   &(currentAtomType->epslon),
391                   &(currentAtomType->sigma),
# Line 438 | Line 437 | void LJ_FF::initializeAtoms( void ){
437    
438   #ifdef IS_MPI
439    double tempBig = bigSigma;
440 <  MPI::COMM_WORLD::Allreduce( &tempBig, &bigSigma, 1, MPI_DOUBLE, MPI_MAX );
440 >  MPI::COMM_WORLD.Allreduce( &tempBig, &bigSigma, 1, MPI_DOUBLE, MPI_MAX );
441   #endif  //is_mpi
442  
443    //calc rCut and rList
# Line 605 | Line 604 | int parseAtomLJ( char *lineBuffer, int lineNum,  atomS
604   }
605  
606  
607 < void LJ_FF::doForces( void ){
607 > void LJ_FF::doForces( int calcPot ){
608  
609    int i;
610    double* frc;
611    double* pos;
612 <  double potE;
614 <  short int calcPot = 0;
612 >  short int passedCalcPot = (short int)calcPot;
613  
614    // forces are zeroed here, before any are acumulated.
615    // NOTE: do not rezero the forces in Fortran.
# Line 623 | Line 621 | void LJ_FF::doForces( void ){
621    frc = Atom::getFrcArray();
622    pos = Atom::getPosArray();
623  
624 <  doLJfortran( pos, frc, potE, calcPot );
624 > //   entry_plug->lrPot = -1;
625 >  doLJfortran( pos, frc, &(entry_plug->lrPot), &passedCalcPot );
626 >
627 >
628 > //  fprintf( stderr,
629 > //         "lrPot =  %lf\n", entry_plug->lrPot );
630 >  
631   }
632    
633   void LJ_FF::initFortran( void ){
# Line 636 | Line 640 | void LJ_FF::initFortran( void ){
640    ident = new int[nLocal];
641  
642    for(i=0; i<nLocal; i++){
643 <    ident[i] = entryplug->atoms[i]->getIdent();
643 >    ident[i] = entry_plug->atoms[i]->getIdent();
644    }
645  
646    isError = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines