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 389 by mmeineke, Mon Mar 24 15:26:05 2003 UTC vs.
Revision 479 by chuckv, Tue Apr 8 15:20:44 2003 UTC

# Line 11 | Line 11 | void ForceFields::doForces( int calcPot, int calcStres
11   #include "fortranWrappers.hpp"
12  
13  
14 + void ForceFields::calcRcut( void ){
15 +
16 + #ifdef IS_MPI
17 +  double tempBig = bigSigma;
18 +  MPI_Allreduce( &tempBig, &bigSigma, 1, MPI_DOUBLE, MPI_MAX,
19 +                 MPI_COMM_WORLD);
20 + #endif  //is_mpi
21 +
22 +  //calc rCut and rList
23 +
24 +  entry_plug->rCut = 2.5 * bigSigma;
25 +  if(entry_plug->rCut > (entry_plug->box_x / 2.0))
26 +    entry_plug->rCut = entry_plug->box_x / 2.0;
27 +  if(entry_plug->rCut > (entry_plug->box_y / 2.0))
28 +    entry_plug->rCut = entry_plug->box_y / 2.0;
29 +  if(entry_plug->rCut > (entry_plug->box_z / 2.0))
30 +    entry_plug->rCut = entry_plug->box_z / 2.0;
31 +  
32 +  entry_plug->rList = entry_plug->rCut + 1.0;
33 +  
34 + }
35 +
36   void ForceFields::doForces( int calcPot, int calcStress ){
37  
38    int i, isError;
39    double* frc;
40    double* pos;
41    double* trq;
20  double* tau;
42    double* A;
43 <  double* u_l;
43 >  double* u_l;;
44 >  DirectionalAtom* dAtom;
45  
46 +  double ut[3];
47 +
48 +  //u_l = new double[entry_plug->n_atoms];
49 +
50    short int passedCalcPot = (short int)calcPot;
51    short int passedCalcStress = (short int)calcStress;
52  
53    // forces are zeroed here, before any are acumulated.
54    // NOTE: do not rezero the forces in Fortran.
55  
56 +
57    for(i=0; i<entry_plug->n_atoms; i++){
58      entry_plug->atoms[i]->zeroForces();
59 +
60 + //     if( entry_plug->atoms[i]->isDirectional() ){
61 + //       dAtom = (DirectionalAtom *)entry_plug->atoms[i];
62 + //       dAtom->getU(ut);
63 +    
64 +
65 + //       if(dAtom->getIndex()== 1){
66 + //      std::cerr << "atom 2's u_l = " << ut[0] << ", " << ut[1]
67 + //                << ", " << ut[2] << "\n";
68 + //       }
69 + //     }
70 +    
71    }
72  
73 <  for(i=0; i<entry_plug->n_SRI; i++ ){
74 <    entry_plug->sr_interactions[i]->calc_forces();
73 >  for(i=0; i<entry_plug->n_mol; i++ ){
74 >    entry_plug->molecules[i].calcForces();
75    }
76  
77    frc = Atom::getFrcArray();
# Line 41 | Line 80 | void ForceFields::doForces( int calcPot, int calcStres
80    A   = Atom::getAmatArray();
81    u_l = Atom::getUlArray();
82  
83 <  tau = entry_plug->tau;
45 <    
83 >  
84    isError = 0;
85    entry_plug->lrPot = 0.0;
86 +
87 +  for (i=0; i<9; i++) {
88 +    entry_plug->tau[i] = 0.0;
89 +  }
90 +
91    fortranForceLoop( pos,
92                      A,
93                      u_l,
94                      frc,
95                      trq,
96 <                    tau,
96 >                    entry_plug->tau,
97                      &(entry_plug->lrPot),
98                      &passedCalcPot,
99                      &passedCalcStress,
100                      &isError );
101  
102 +  //  delete[] u_l;
103  
104    if( isError ){
105      sprintf( painCave.errMsg,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines