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 472 by mmeineke, Mon Apr 7 21:16:35 2003 UTC vs.
Revision 484 by gezelter, Wed Apr 9 13:59:35 2003 UTC

# 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;;
44    DirectionalAtom* dAtom;
45  
47  double ut[3];
48
49  //u_l = new double[entry_plug->n_atoms];
50
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  
57
52    for(i=0; i<entry_plug->n_atoms; i++){
53 <    entry_plug->atoms[i]->zeroForces();
60 <
61 < //     if( entry_plug->atoms[i]->isDirectional() ){
62 < //       dAtom = (DirectionalAtom *)entry_plug->atoms[i];
63 < //       dAtom->getU(ut);
64 <    
65 <
66 < //       if(dAtom->getIndex()== 1){
67 < //      std::cerr << "atom 2's u_l = " << ut[0] << ", " << ut[1]
68 < //                << ", " << ut[2] << "\n";
69 < //       }
70 < //     }
71 <    
53 >    entry_plug->atoms[i]->zeroForces();    
54    }
55  
56    for(i=0; i<entry_plug->n_mol; i++ ){
# Line 80 | Line 62 | void ForceFields::doForces( int calcPot, int calcStres
62    trq = Atom::getTrqArray();
63    A   = Atom::getAmatArray();
64    u_l = Atom::getUlArray();
83  tau = entry_plug->tau;
84
65    
66    isError = 0;
67    entry_plug->lrPot = 0.0;
88  tau[0] = 0.0;
89  tau[1] = 0.0;
90  tau[2] = 0.0;
91  
68  
69 +  for (i=0; i<9; i++) {
70 +    entry_plug->tau[i] = 0.0;
71 +  }
72  
94  
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  
106
107  //  delete[] u_l;
108
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