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

Comparing trunk/OOPSE/libmdtools/ForceFields.cpp (file contents):
Revision 428 by mmeineke, Thu Mar 27 21:07:14 2003 UTC vs.
Revision 484 by gezelter, Wed Apr 9 13:59:35 2003 UTC

# Line 2 | Line 2
2  
3   #ifdef IS_MPI
4   #include <mpi.h>
5 #include <mpi++.h>
5   #endif // is_mpi
6  
7  
# Line 16 | Line 15 | void ForceFields::calcRcut( void ){
15  
16   #ifdef IS_MPI
17    double tempBig = bigSigma;
18 <  MPI::COMM_WORLD.Allreduce( &tempBig, &bigSigma, 1, MPI_DOUBLE, MPI_MAX );
18 >  MPI_Allreduce( &tempBig, &bigSigma, 1, MPI_DOUBLE, MPI_MAX,
19 >                 MPI_COMM_WORLD);
20   #endif  //is_mpi
21  
22    //calc rCut and rList
# Line 39 | Line 39 | void ForceFields::doForces( int calcPot, int calcStres
39    double* frc;
40    double* pos;
41    double* trq;
42  double* tau;
42    double* A;
43 <  double* u_l;
43 >  double* u_l;;
44 >  DirectionalAtom* dAtom;
45  
46    short int passedCalcPot = (short int)calcPot;
47    short int passedCalcStress = (short int)calcStress;
48  
49 <  // forces are zeroed here, before any are acumulated.
49 >  // forces are zeroed here, before any are accumulated.
50    // NOTE: do not rezero the forces in Fortran.
51  
52    for(i=0; i<entry_plug->n_atoms; i++){
53 <    entry_plug->atoms[i]->zeroForces();
53 >    entry_plug->atoms[i]->zeroForces();    
54    }
55  
56    for(i=0; i<entry_plug->n_mol; i++ ){
# Line 62 | Line 62 | void ForceFields::doForces( int calcPot, int calcStres
62    trq = Atom::getTrqArray();
63    A   = Atom::getAmatArray();
64    u_l = Atom::getUlArray();
65  tau = entry_plug->tau;
66
65    
66    isError = 0;
67    entry_plug->lrPot = 0.0;
68  
69 <  
69 >  for (i=0; i<9; i++) {
70 >    entry_plug->tau[i] = 0.0;
71 >  }
72 >
73    fortranForceLoop( pos,
74                      A,
75                      u_l,
76                      frc,
77                      trq,
78 <                    tau,
78 >                    entry_plug->tau,
79                      &(entry_plug->lrPot),
80                      &passedCalcPot,
81                      &passedCalcStress,
82                      &isError );
83  
83
84    if( isError ){
85      sprintf( painCave.errMsg,
86               "Error returned from the fortran force calculation.\n" );

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines