43 |
|
!! Calculates Long Range forces Lennard-Jones interactions. |
44 |
|
!! @author Charles F. Vardeman II |
45 |
|
!! @author Matthew Meineke |
46 |
< |
!! @version $Id: LJ.F90,v 1.13 2005-08-09 22:33:48 gezelter Exp $, $Date: 2005-08-09 22:33:48 $, $Name: not supported by cvs2svn $, $Revision: 1.13 $ |
46 |
> |
!! @version $Id: LJ.F90,v 1.16 2005-09-21 23:45:48 chuckv Exp $, $Date: 2005-09-21 23:45:48 $, $Name: not supported by cvs2svn $, $Revision: 1.16 $ |
47 |
|
|
48 |
|
|
49 |
|
module lj |
77 |
|
end type LJtype |
78 |
|
|
79 |
|
type, private :: LJList |
80 |
< |
integer :: nLJtypes = 0 |
80 |
> |
integer :: Nljtypes = 0 |
81 |
|
integer :: currentLJtype = 0 |
82 |
|
type(LJtype), pointer :: LJtypes(:) => null() |
83 |
|
integer, pointer :: atidToLJtype(:) => null() |
157 |
|
defaultCutoff = thisRcut |
158 |
|
defaultShift = shiftedPot |
159 |
|
haveDefaultCutoff = .true. |
160 |
+ |
!we only want to build LJ Mixing map if LJ is being used. |
161 |
+ |
if(LJMap%nLJTypes /= 0) then |
162 |
+ |
call createMixingMap() |
163 |
+ |
end if |
164 |
|
end subroutine setLJDefaultCutoff |
165 |
|
|
166 |
|
subroutine setLJUniformCutoff(thisRcut, shiftedPot) |
257 |
|
integer :: nLJtypes, i, j |
258 |
|
real ( kind = dp ) :: s1, s2, e1, e2 |
259 |
|
real ( kind = dp ) :: rcut6, tp6, tp12 |
260 |
< |
logical :: isSoftCore1, isSoftCore2 |
260 |
> |
logical :: isSoftCore1, isSoftCore2, doShift |
261 |
|
|
262 |
|
if (LJMap%currentLJtype == 0) then |
263 |
|
call handleError("LJ", "No members in LJMap") |
300 |
|
else |
301 |
|
if (haveDefaultCutoff) then |
302 |
|
rcut6 = defaultCutoff**6 |
303 |
+ |
doShift = defaultShift |
304 |
|
else |
305 |
|
call handleError("LJ", "No specified or default cutoff value!") |
306 |
|
endif |
308 |
|
|
309 |
|
tp6 = MixingMap(i,j)%sigma6/rcut6 |
310 |
|
tp12 = tp6**2 |
306 |
– |
|
311 |
|
MixingMap(i,j)%delta =-4.0_DP*MixingMap(i,j)%epsilon*(tp12 - tp6) |
312 |
+ |
MixingMap(i,j)%shiftedPot = doShift |
313 |
+ |
|
314 |
+ |
if (i.ne.j) then |
315 |
+ |
MixingMap(j,i)%sigma = MixingMap(i,j)%sigma |
316 |
+ |
MixingMap(j,i)%epsilon = MixingMap(i,j)%epsilon |
317 |
+ |
MixingMap(j,i)%sigma6 = MixingMap(i,j)%sigma6 |
318 |
+ |
MixingMap(j,i)%rCut = MixingMap(i,j)%rCut |
319 |
+ |
MixingMap(j,i)%delta = MixingMap(i,j)%delta |
320 |
+ |
MixingMap(j,i)%rCutWasSet = MixingMap(i,j)%rCutWasSet |
321 |
+ |
MixingMap(j,i)%shiftedPot = MixingMap(i,j)%shiftedPot |
322 |
+ |
MixingMap(j,i)%isSoftCore = MixingMap(i,j)%isSoftCore |
323 |
+ |
endif |
324 |
+ |
|
325 |
|
enddo |
326 |
|
enddo |
327 |
|
|
411 |
|
fy = dudr * drdy |
412 |
|
fz = dudr * drdz |
413 |
|
|
397 |
– |
|
414 |
|
#ifdef IS_MPI |
415 |
|
if (do_pot) then |
416 |
|
pot_Row(atom1) = pot_Row(atom1) + sw*pot_temp*0.5 |