45 |
|
|
46 |
|
!! @author Charles F. Vardeman II |
47 |
|
!! @author Matthew Meineke |
48 |
< |
!! @version $Id: doForces.F90,v 1.22 2005-06-28 13:58:45 gezelter Exp $, $Date: 2005-06-28 13:58:45 $, $Name: not supported by cvs2svn $, $Revision: 1.22 $ |
48 |
> |
!! @version $Id: doForces.F90,v 1.23 2005-07-03 20:53:43 chuckv Exp $, $Date: 2005-07-03 20:53:43 $, $Name: not supported by cvs2svn $, $Revision: 1.23 $ |
49 |
|
|
50 |
|
|
51 |
|
module doForces |
82 |
|
logical, save :: haveNeighborList = .false. |
83 |
|
logical, save :: haveSIMvariables = .false. |
84 |
|
logical, save :: haveSaneForceField = .false. |
85 |
+ |
logical, save :: haveInteractionMap = .false. |
86 |
|
|
87 |
|
logical, save :: FF_uses_DirectionalAtoms |
88 |
|
logical, save :: FF_uses_LennardJones |
122 |
|
public :: init_FF |
123 |
|
public :: do_force_loop |
124 |
|
! public :: setRlistDF |
125 |
+ |
!public :: addInteraction |
126 |
+ |
!public :: setInteractionHash |
127 |
+ |
!public :: getInteractionHash |
128 |
+ |
public :: createInteractionMap |
129 |
+ |
public :: createRcuts |
130 |
|
|
131 |
|
#ifdef PROFILE |
132 |
|
public :: getforcetime |
137 |
|
|
138 |
|
type, public :: Interaction |
139 |
|
integer :: InteractionHash |
140 |
< |
real(kind=dp) :: rCut |
140 |
> |
real(kind=dp) :: rList = 0.0_dp |
141 |
> |
real(kind=dp) :: rListSq = 0.0_dp |
142 |
|
end type Interaction |
143 |
|
|
144 |
|
type(Interaction), dimension(:,:),allocatable :: InteractionMap |
145 |
|
|
146 |
< |
!public :: addInteraction |
140 |
< |
!public :: setInteractionHash |
141 |
< |
!public :: getInteractionHash |
142 |
< |
public :: createInteractionMap |
146 |
> |
|
147 |
|
|
148 |
|
contains |
149 |
|
|
248 |
|
end do |
249 |
|
end subroutine createInteractionMap |
250 |
|
|
251 |
+ |
! Query each potential and return the cutoff for that potential. We build the neighbor list based on the largest cutoff value for that atype. Each potential can decide whether to calculate the force for that atype based upon it's own cutoff. |
252 |
+ |
subroutine createRcuts(defaultRList) |
253 |
+ |
real(kind=dp), intent(in), optional :: defaultRList |
254 |
+ |
integer :: iMap |
255 |
+ |
integer :: map_i,map_j |
256 |
+ |
real(kind=dp) :: thisRCut = 0.0_dp |
257 |
+ |
real(kind=dp) :: actualCutoff = 0.0_dp |
258 |
+ |
integer :: nAtypes |
259 |
+ |
|
260 |
+ |
if(.not. allocated(InteractionMap)) return |
261 |
+ |
|
262 |
+ |
nAtypes = getSize(atypes) |
263 |
+ |
! If we pass a default rcut, set all atypes to that cutoff distance |
264 |
+ |
if(present(defaultRList)) then |
265 |
+ |
InteractionMap(:,:)%rList = defaultRList |
266 |
+ |
InteractionMap(:,:)%rListSq = defaultRList*defaultRList |
267 |
+ |
haveRlist = .true. |
268 |
+ |
return |
269 |
+ |
end if |
270 |
+ |
|
271 |
+ |
do map_i = 1,nAtypes |
272 |
+ |
do map_j = map_i,nAtypes |
273 |
+ |
iMap = InteractionMap(map_i, map_j)%InteractionHash |
274 |
+ |
|
275 |
+ |
if ( iand(iMap, LJ_PAIR).ne.0 ) then |
276 |
+ |
! thisRCut = getLJCutOff(map_i,map_j) |
277 |
+ |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
278 |
+ |
endif |
279 |
+ |
|
280 |
+ |
if ( iand(iMap, ELECTROSTATIC_PAIR).ne.0 ) then |
281 |
+ |
! thisRCut = getElectrostaticCutOff(map_i,map_j) |
282 |
+ |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
283 |
+ |
endif |
284 |
+ |
|
285 |
+ |
if ( iand(iMap, STICKY_PAIR).ne.0 ) then |
286 |
+ |
! thisRCut = getStickyCutOff(map_i,map_j) |
287 |
+ |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
288 |
+ |
endif |
289 |
+ |
|
290 |
+ |
if ( iand(iMap, STICKYPOWER_PAIR).ne.0 ) then |
291 |
+ |
! thisRCut = getStickyPowerCutOff(map_i,map_j) |
292 |
+ |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
293 |
+ |
endif |
294 |
+ |
|
295 |
+ |
if ( iand(iMap, GAYBERNE_PAIR).ne.0 ) then |
296 |
+ |
! thisRCut = getGayberneCutOff(map_i,map_j) |
297 |
+ |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
298 |
+ |
endif |
299 |
+ |
|
300 |
+ |
if ( iand(iMap, GAYBERNE_LJ).ne.0 ) then |
301 |
+ |
! thisRCut = getGaybrneLJCutOff(map_i,map_j) |
302 |
+ |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
303 |
+ |
endif |
304 |
+ |
|
305 |
+ |
if ( iand(iMap, EAM_PAIR).ne.0 ) then |
306 |
+ |
! thisRCut = getEAMCutOff(map_i,map_j) |
307 |
+ |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
308 |
+ |
endif |
309 |
+ |
|
310 |
+ |
if ( iand(iMap, SHAPE_PAIR).ne.0 ) then |
311 |
+ |
! thisRCut = getShapeCutOff(map_i,map_j) |
312 |
+ |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
313 |
+ |
endif |
314 |
+ |
|
315 |
+ |
if ( iand(iMap, SHAPE_LJ).ne.0 ) then |
316 |
+ |
! thisRCut = getShapeLJCutOff(map_i,map_j) |
317 |
+ |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
318 |
+ |
endif |
319 |
+ |
InteractionMap(map_i, map_j)%rList = actualCutoff |
320 |
+ |
InteractionMap(map_i, map_j)%rListSq = actualCutoff * actualCutoff |
321 |
+ |
end do |
322 |
+ |
end do |
323 |
+ |
haveRlist = .true. |
324 |
+ |
end subroutine createRcuts |
325 |
|
|
326 |
|
|
327 |
|
!!! THIS GOES AWAY FOR SIZE DEPENDENT CUTOFF |
631 |
|
integer :: localError |
632 |
|
integer :: propPack_i, propPack_j |
633 |
|
integer :: loopStart, loopEnd, loop |
634 |
< |
|
634 |
> |
integer :: iMap |
635 |
|
real(kind=dp) :: listSkin = 1.0 |
636 |
|
|
637 |
|
!! initialize local variables |
757 |
|
q_group(:,j), d_grp, rgrpsq) |
758 |
|
#endif |
759 |
|
|
760 |
< |
if (rgrpsq < rlistsq) then |
760 |
> |
if (rgrpsq < InteractionMap(me_i,me_j)%rListsq) then |
761 |
|
if (update_nlist) then |
762 |
|
nlist = nlist + 1 |
763 |
|
|
1093 |
|
endif |
1094 |
|
|
1095 |
|
if ( iand(iMap, GAYBERNE_LJ).ne.0 ) then |
1096 |
< |
call do_gblj_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1097 |
< |
pot, A, f, t, do_pot) |
1096 |
> |
! call do_gblj_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1097 |
> |
! pot, A, f, t, do_pot) |
1098 |
|
endif |
1099 |
|
|
1100 |
|
if ( iand(iMap, EAM_PAIR).ne.0 ) then |