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

Comparing trunk/OOPSE_old/src/mdtools/libmdCode/LJ_FF.cpp (file contents):
Revision 270 by mmeineke, Fri Feb 14 17:08:46 2003 UTC vs.
Revision 290 by chuckv, Thu Feb 27 21:25:47 2003 UTC

# Line 5 | Line 5 | using namespace std;
5   #include <iostream>
6   using namespace std;
7  
8 + #ifdef IS_MPI
9 + #include <mpi.h>
10 + #include <mpi++.h>
11 + #endif //is_mpi
12 +
13   #include "ForceFields.hpp"
14   #include "SRI.hpp"
15   #include "simError.h"
16  
17 +
18 +
19   // Declare the structures that will be passed by the parser and  MPI
20  
21   typedef struct{
# Line 47 | Line 54 | extern "C" {
54                                              void (*p3)( double* positionArray,
55                                                          double* forceArray,
56                                                          double* potentialEnergy,
57 <                                                        short int* doPotentialCalc )),
57 >                                                        double* tau,
58 >                                                        short int* doPotentialCalc,
59 >                                                        int* isError)),
60                        int forceNameLength );
61   }
62  
# Line 56 | Line 65 | void LJfunctionWrapper( void (*p1)( int* ident, double
65                                     double* sigma, int* status ),
66                          void (*p2)( int *nLocal, int *identArray, int *isError ),
67                          void (*p3)( double* positionArray,double* forceArray,
68 <                                    double* potentialEnergy,
69 <                                    short int* doPotentialCalc ) );
68 >                                    double* potentialEnergy, double* tau,
69 >                                    short int* doPotentialCalc, int* isError ) );
70  
71   void (*newLJtype)( int* ident, double* mass, double* epslon, double* sigma,
72                     int* status );
# Line 621 | Line 630 | void LJ_FF::doForces( int calcPot ){
630  
631   void LJ_FF::doForces( int calcPot ){
632  
633 <  int i;
633 >  int i, isError;
634    double* frc;
635    double* pos;
636 +  double* tau;
637    short int passedCalcPot = (short int)calcPot;
638  
639    // forces are zeroed here, before any are acumulated.
# Line 635 | Line 645 | void LJ_FF::doForces( int calcPot ){
645  
646    frc = Atom::getFrcArray();
647    pos = Atom::getPosArray();
648 <
639 < //   entry_plug->lrPot = -1;
640 <  doLJfortran( pos, frc, &(entry_plug->lrPot), &passedCalcPot );
648 >  tau = entry_plug->tau;
649  
650 +  isError = 0;
651 +  doLJfortran( pos, frc, &(entry_plug->lrPot), tau, &passedCalcPot, &isError );
652  
653 <  //   fprintf( stderr,
654 <  //   "lrPot =  %lf\n", entry_plug->lrPot );
655 <  
653 >
654 >  if( isError ){
655 >    sprintf( painCave.errMsg,
656 >             "Error returned from the fortran force calculation.\n" );
657 >    painCave.isFatal = 1;
658 >    simError();
659 >  }
660 >
661 > #ifdef IS_MPI
662 >  sprintf( checkPointMsg,
663 >           "returned from the force calculation.\n" );
664 >  MPIcheckPoint();
665 > #endif // is_mpi
666 >
667   }
668    
669   void LJ_FF::initFortran( void ){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines