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

Comparing trunk/OOPSE/libmdtools/calc_LJ_FF.F90 (file contents):
Revision 378 by mmeineke, Fri Mar 21 17:42:12 2003 UTC vs.
Revision 483 by gezelter, Wed Apr 9 04:06:43 2003 UTC

# Line 2 | Line 2
2   !! Corresponds to the force field defined in lj_FF.cpp
3   !! @author Charles F. Vardeman II
4   !! @author Matthew Meineke
5 < !! @version $Id: calc_LJ_FF.F90,v 1.1.1.1 2003-03-21 17:42:12 mmeineke Exp $, $Date: 2003-03-21 17:42:12 $, $Name: not supported by cvs2svn $, $Revision: 1.1.1.1 $
5 > !! @version $Id: calc_LJ_FF.F90,v 1.4 2003-04-09 04:06:43 gezelter Exp $, $Date: 2003-04-09 04:06:43 $, $Name: not supported by cvs2svn $, $Revision: 1.4 $
6  
7   module lj
8    use definitions
9    use atype_module
10    use vector_class
11 +  use simulation
12   #ifdef IS_MPI
13    use mpiSimulation
14   #endif
# Line 180 | Line 181 | contains
181      integer, intent(in) ::  atom1, atom2
182      real( kind = dp ), intent(in) :: rij, r2
183      real( kind = dp ) :: pot
184 <    real( kind = dp ), dimension(:,:) :: f    
184 >    real( kind = dp ), dimension(3,getNlocal()) :: f    
185      real( kind = dp ), intent(in), dimension(3) :: d
186      logical, intent(in) :: do_pot, do_stress
187  
# Line 218 | Line 219 | contains
219        
220         dudr = 24.0E0_DP * epsilon * (t6 - 2.0E0_DP*t12) / rij
221        
222 <       drdx = -d(1) / rij
223 <       drdy = -d(2) / rij
224 <       drdz = -d(3) / rij
222 >       drdx = d(1) / rij
223 >       drdy = d(2) / rij
224 >       drdz = d(3) / rij
225        
226         fx = dudr * drdx
227         fy = dudr * drdy
# Line 253 | Line 254 | contains
254   #endif
255        
256         if (do_stress) then
257 <          tau_Temp(1) = tau_Temp(1) + fx * d(1)
258 <          tau_Temp(2) = tau_Temp(2) + fx * d(2)
259 <          tau_Temp(3) = tau_Temp(3) + fx * d(3)
260 <          tau_Temp(4) = tau_Temp(4) + fy * d(1)
261 <          tau_Temp(5) = tau_Temp(5) + fy * d(2)
262 <          tau_Temp(6) = tau_Temp(6) + fy * d(3)
263 <          tau_Temp(7) = tau_Temp(7) + fz * d(1)
264 <          tau_Temp(8) = tau_Temp(8) + fz * d(2)
265 <          tau_Temp(9) = tau_Temp(9) + fz * d(3)
266 <          virial_Temp = virial_Temp + (tau_Temp(1) + tau_Temp(5) + tau_Temp(9))
257 >
258 >          if (molMembershipList(atom1) .ne. molMembershipList(atom2)) then
259 >             tau_Temp(1) = tau_Temp(1) + fx * d(1)
260 >             tau_Temp(2) = tau_Temp(2) + fx * d(2)
261 >             tau_Temp(3) = tau_Temp(3) + fx * d(3)
262 >             tau_Temp(4) = tau_Temp(4) + fy * d(1)
263 >             tau_Temp(5) = tau_Temp(5) + fy * d(2)
264 >             tau_Temp(6) = tau_Temp(6) + fy * d(3)
265 >             tau_Temp(7) = tau_Temp(7) + fz * d(1)
266 >             tau_Temp(8) = tau_Temp(8) + fz * d(2)
267 >             tau_Temp(9) = tau_Temp(9) + fz * d(3)
268 >             virial_Temp = virial_Temp + &
269 >                  (tau_Temp(1) + tau_Temp(5) + tau_Temp(9))
270 >          endif
271 >
272         endif
273        
274      endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines