45 |
|
|
46 |
|
!! @author Charles F. Vardeman II |
47 |
|
!! @author Matthew Meineke |
48 |
< |
!! @version $Id: doForces.F90,v 1.26 2005-07-29 19:38:27 gezelter Exp $, $Date: 2005-07-29 19:38:27 $, $Name: not supported by cvs2svn $, $Revision: 1.26 $ |
48 |
> |
!! @version $Id: doForces.F90,v 1.28 2005-08-09 22:33:37 gezelter Exp $, $Date: 2005-08-09 22:33:37 $, $Name: not supported by cvs2svn $, $Revision: 1.28 $ |
49 |
|
|
50 |
|
|
51 |
|
module doForces |
78 |
|
INTEGER, PARAMETER:: PREPAIR_LOOP = 1 |
79 |
|
INTEGER, PARAMETER:: PAIR_LOOP = 2 |
80 |
|
|
81 |
– |
logical, save :: haveRlist = .false. |
81 |
|
logical, save :: haveNeighborList = .false. |
82 |
|
logical, save :: haveSIMvariables = .false. |
83 |
|
logical, save :: haveSaneForceField = .false. |
84 |
< |
logical, save :: haveInteractionMap = .false. |
84 |
> |
logical, save :: haveInteractionHash = .false. |
85 |
> |
logical, save :: haveGtypeCutoffMap = .false. |
86 |
|
|
87 |
|
logical, save :: FF_uses_DirectionalAtoms |
88 |
– |
logical, save :: FF_uses_LennardJones |
89 |
– |
logical, save :: FF_uses_Electrostatics |
90 |
– |
logical, save :: FF_uses_Charges |
88 |
|
logical, save :: FF_uses_Dipoles |
92 |
– |
logical, save :: FF_uses_Quadrupoles |
93 |
– |
logical, save :: FF_uses_Sticky |
94 |
– |
logical, save :: FF_uses_StickyPower |
89 |
|
logical, save :: FF_uses_GayBerne |
90 |
|
logical, save :: FF_uses_EAM |
97 |
– |
logical, save :: FF_uses_Shapes |
98 |
– |
logical, save :: FF_uses_FLARB |
91 |
|
logical, save :: FF_uses_RF |
92 |
|
|
93 |
|
logical, save :: SIM_uses_DirectionalAtoms |
102 |
– |
logical, save :: SIM_uses_LennardJones |
103 |
– |
logical, save :: SIM_uses_Electrostatics |
104 |
– |
logical, save :: SIM_uses_Charges |
105 |
– |
logical, save :: SIM_uses_Dipoles |
106 |
– |
logical, save :: SIM_uses_Quadrupoles |
107 |
– |
logical, save :: SIM_uses_Sticky |
108 |
– |
logical, save :: SIM_uses_StickyPower |
109 |
– |
logical, save :: SIM_uses_GayBerne |
94 |
|
logical, save :: SIM_uses_EAM |
111 |
– |
logical, save :: SIM_uses_Shapes |
112 |
– |
logical, save :: SIM_uses_FLARB |
95 |
|
logical, save :: SIM_uses_RF |
96 |
|
logical, save :: SIM_requires_postpair_calc |
97 |
|
logical, save :: SIM_requires_prepair_calc |
98 |
|
logical, save :: SIM_uses_PBC |
117 |
– |
logical, save :: SIM_uses_molecular_cutoffs |
99 |
|
|
119 |
– |
!!!GO AWAY--------- |
120 |
– |
!!!!!real(kind=dp), save :: rlist, rlistsq |
121 |
– |
|
100 |
|
public :: init_FF |
101 |
|
public :: do_force_loop |
102 |
< |
! public :: setRlistDF |
103 |
< |
!public :: addInteraction |
126 |
< |
!public :: setInteractionHash |
127 |
< |
!public :: getInteractionHash |
128 |
< |
public :: createInteractionMap |
129 |
< |
public :: createRcuts |
102 |
> |
public :: createInteractionHash |
103 |
> |
public :: createGtypeCutoffMap |
104 |
|
|
105 |
|
#ifdef PROFILE |
106 |
|
public :: getforcetime |
108 |
|
real :: forceTimeInitial, forceTimeFinal |
109 |
|
integer :: nLoops |
110 |
|
#endif |
137 |
– |
|
138 |
– |
type, public :: Interaction |
139 |
– |
integer :: InteractionHash |
140 |
– |
real(kind=dp) :: rCut = 0.0_dp |
141 |
– |
real(kind=dp) :: rCutSq = 0.0_dp |
142 |
– |
real(kind=dp) :: rListSq = 0.0_dp |
143 |
– |
end type Interaction |
111 |
|
|
112 |
< |
type(Interaction), dimension(:,:),allocatable :: InteractionMap |
112 |
> |
!! Variables for cutoff mapping and interaction mapping |
113 |
> |
! Bit hash to determine pair-pair interactions. |
114 |
> |
integer, dimension(:,:), allocatable :: InteractionHash |
115 |
> |
real(kind=dp), dimension(:), allocatable :: atypeMaxCutoff |
116 |
> |
real(kind=dp), dimension(:), allocatable :: groupMaxCutoff |
117 |
> |
integer, dimension(:), allocatable :: groupToGtype |
118 |
> |
real(kind=dp), dimension(:), allocatable :: gtypeMaxCutoff |
119 |
> |
type ::gtypeCutoffs |
120 |
> |
real(kind=dp) :: rcut |
121 |
> |
real(kind=dp) :: rcutsq |
122 |
> |
real(kind=dp) :: rlistsq |
123 |
> |
end type gtypeCutoffs |
124 |
> |
type(gtypeCutoffs), dimension(:,:), allocatable :: gtypeCutoffMap |
125 |
|
|
147 |
– |
|
148 |
– |
|
126 |
|
contains |
127 |
|
|
128 |
< |
|
152 |
< |
subroutine createInteractionMap(status) |
128 |
> |
subroutine createInteractionHash(status) |
129 |
|
integer :: nAtypes |
130 |
|
integer, intent(out) :: status |
131 |
|
integer :: i |
132 |
|
integer :: j |
133 |
< |
integer :: ihash |
158 |
< |
real(kind=dp) :: myRcut |
133 |
> |
integer :: iHash |
134 |
|
!! Test Types |
135 |
|
logical :: i_is_LJ |
136 |
|
logical :: i_is_Elect |
150 |
|
status = 0 |
151 |
|
|
152 |
|
if (.not. associated(atypes)) then |
153 |
< |
call handleError("atype", "atypes was not present before call of createDefaultInteractionMap!") |
153 |
> |
call handleError("atype", "atypes was not present before call of createInteractionHash!") |
154 |
|
status = -1 |
155 |
|
return |
156 |
|
endif |
162 |
|
return |
163 |
|
end if |
164 |
|
|
165 |
< |
if (.not. allocated(InteractionMap)) then |
166 |
< |
allocate(InteractionMap(nAtypes,nAtypes)) |
165 |
> |
if (.not. allocated(InteractionHash)) then |
166 |
> |
allocate(InteractionHash(nAtypes,nAtypes)) |
167 |
|
endif |
168 |
+ |
|
169 |
+ |
if (.not. allocated(atypeMaxCutoff)) then |
170 |
+ |
allocate(atypeMaxCutoff(nAtypes)) |
171 |
+ |
endif |
172 |
|
|
173 |
|
do i = 1, nAtypes |
174 |
|
call getElementProperty(atypes, i, "is_LennardJones", i_is_LJ) |
179 |
|
call getElementProperty(atypes, i, "is_EAM", i_is_EAM) |
180 |
|
call getElementProperty(atypes, i, "is_Shape", i_is_Shape) |
181 |
|
|
182 |
+ |
if (i_is_LJ) then |
183 |
+ |
thisCut = getDefaultLJCutoff(i) |
184 |
+ |
if (thisCut .gt. atypeMaxCutoff(i)) atypeMaxCutoff(i) = thisCut |
185 |
+ |
endif |
186 |
+ |
|
187 |
+ |
|
188 |
+ |
|
189 |
|
do j = i, nAtypes |
190 |
|
|
191 |
|
iHash = 0 |
228 |
|
if (i_is_LJ .and. j_is_Shape) iHash = ior(iHash, SHAPE_LJ) |
229 |
|
|
230 |
|
|
231 |
< |
InteractionMap(i,j)%InteractionHash = iHash |
232 |
< |
InteractionMap(j,i)%InteractionHash = iHash |
231 |
> |
InteractionHash(i,j) = iHash |
232 |
> |
InteractionHash(j,i) = iHash |
233 |
|
|
234 |
|
end do |
235 |
|
|
236 |
|
end do |
237 |
|
|
238 |
< |
haveInteractionMap = .true. |
239 |
< |
end subroutine createInteractionMap |
238 |
> |
haveInteractionHash = .true. |
239 |
> |
end subroutine createInteractionHash |
240 |
|
|
241 |
< |
! Query each potential and return the cutoff for that potential. We |
256 |
< |
! build the neighbor list based on the largest cutoff value for that |
257 |
< |
! atype. Each potential can decide whether to calculate the force for |
258 |
< |
! that atype based upon it's own cutoff. |
259 |
< |
|
260 |
< |
subroutine createRcuts(defaultRcut, defaultSkinThickness, stat) |
241 |
> |
subroutine createGtypeCutoffMap(defaultRcut, defaultSkinThickness, stat) |
242 |
|
|
243 |
|
real(kind=dp), intent(in), optional :: defaultRCut, defaultSkinThickness |
263 |
– |
integer :: iMap |
264 |
– |
integer :: map_i,map_j |
265 |
– |
real(kind=dp) :: thisRCut = 0.0_dp |
266 |
– |
real(kind=dp) :: actualCutoff = 0.0_dp |
244 |
|
integer, intent(out) :: stat |
268 |
– |
integer :: nAtypes |
269 |
– |
integer :: myStatus |
245 |
|
|
246 |
< |
stat = 0 |
272 |
< |
if (.not. haveInteractionMap) then |
246 |
> |
integer :: myStatus, nAtypes |
247 |
|
|
248 |
< |
call createInteractionMap(myStatus) |
249 |
< |
|
248 |
> |
stat = 0 |
249 |
> |
if (.not. haveInteractionHash) then |
250 |
> |
call createInteractionHash(myStatus) |
251 |
|
if (myStatus .ne. 0) then |
252 |
< |
write(default_error, *) 'createInteractionMap failed in doForces!' |
252 |
> |
write(default_error, *) 'createInteractionHash failed in doForces!' |
253 |
|
stat = -1 |
254 |
|
return |
255 |
|
endif |
256 |
|
endif |
257 |
|
|
258 |
|
nAtypes = getSize(atypes) |
284 |
– |
!! If we pass a default rcut, set all atypes to that cutoff distance |
285 |
– |
if(present(defaultRList)) then |
286 |
– |
InteractionMap(:,:)%rCut = defaultRCut |
287 |
– |
InteractionMap(:,:)%rCutSq = defaultRCut*defaultRCut |
288 |
– |
InteractionMap(:,:)%rListSq = (defaultRCut+defaultSkinThickness)**2 |
289 |
– |
haveRlist = .true. |
290 |
– |
return |
291 |
– |
end if |
292 |
– |
|
293 |
– |
do map_i = 1,nAtypes |
294 |
– |
do map_j = map_i,nAtypes |
295 |
– |
iMap = InteractionMap(map_i, map_j)%InteractionHash |
296 |
– |
|
297 |
– |
if ( iand(iMap, LJ_PAIR).ne.0 ) then |
298 |
– |
! thisRCut = getLJCutOff(map_i,map_j) |
299 |
– |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
300 |
– |
endif |
301 |
– |
|
302 |
– |
if ( iand(iMap, ELECTROSTATIC_PAIR).ne.0 ) then |
303 |
– |
! thisRCut = getElectrostaticCutOff(map_i,map_j) |
304 |
– |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
305 |
– |
endif |
306 |
– |
|
307 |
– |
if ( iand(iMap, STICKY_PAIR).ne.0 ) then |
308 |
– |
! thisRCut = getStickyCutOff(map_i,map_j) |
309 |
– |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
310 |
– |
endif |
311 |
– |
|
312 |
– |
if ( iand(iMap, STICKYPOWER_PAIR).ne.0 ) then |
313 |
– |
! thisRCut = getStickyPowerCutOff(map_i,map_j) |
314 |
– |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
315 |
– |
endif |
316 |
– |
|
317 |
– |
if ( iand(iMap, GAYBERNE_PAIR).ne.0 ) then |
318 |
– |
! thisRCut = getGayberneCutOff(map_i,map_j) |
319 |
– |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
320 |
– |
endif |
321 |
– |
|
322 |
– |
if ( iand(iMap, GAYBERNE_LJ).ne.0 ) then |
323 |
– |
! thisRCut = getGaybrneLJCutOff(map_i,map_j) |
324 |
– |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
325 |
– |
endif |
326 |
– |
|
327 |
– |
if ( iand(iMap, EAM_PAIR).ne.0 ) then |
328 |
– |
! thisRCut = getEAMCutOff(map_i,map_j) |
329 |
– |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
330 |
– |
endif |
331 |
– |
|
332 |
– |
if ( iand(iMap, SHAPE_PAIR).ne.0 ) then |
333 |
– |
! thisRCut = getShapeCutOff(map_i,map_j) |
334 |
– |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
335 |
– |
endif |
336 |
– |
|
337 |
– |
if ( iand(iMap, SHAPE_LJ).ne.0 ) then |
338 |
– |
! thisRCut = getShapeLJCutOff(map_i,map_j) |
339 |
– |
if (thisRcut > actualCutoff) actualCutoff = thisRcut |
340 |
– |
endif |
341 |
– |
InteractionMap(map_i, map_j)%rCut = actualCutoff |
342 |
– |
InteractionMap(map_i, map_j)%rCutSq = actualCutoff * actualCutoff |
343 |
– |
InteractionMap(map_i, map_j)%rListSq = (actualCutoff + skinThickness)**2 |
344 |
– |
|
345 |
– |
InteractionMap(map_j, map_i)%rCut = InteractionMap(map_i, map_j)%rCut |
346 |
– |
InteractionMap(map_j, map_i)%rCutSq = InteractionMap(map_i, map_j)%rCutSq |
347 |
– |
InteractionMap(map_j, map_i)%rListSq = InteractionMap(map_i, map_j)%rListSq |
348 |
– |
end do |
349 |
– |
end do |
350 |
– |
! now the groups |
259 |
|
|
260 |
+ |
do i = 1, nAtypes |
261 |
+ |
|
262 |
+ |
atypeMaxCutoff(i) = |
263 |
|
|
264 |
+ |
|
265 |
|
|
354 |
– |
haveRlist = .true. |
355 |
– |
end subroutine createRcuts |
266 |
|
|
267 |
|
|
268 |
< |
!!! THIS GOES AWAY FOR SIZE DEPENDENT CUTOFF |
269 |
< |
!!$ subroutine setRlistDF( this_rlist ) |
360 |
< |
!!$ |
361 |
< |
!!$ real(kind=dp) :: this_rlist |
362 |
< |
!!$ |
363 |
< |
!!$ rlist = this_rlist |
364 |
< |
!!$ rlistsq = rlist * rlist |
365 |
< |
!!$ |
366 |
< |
!!$ haveRlist = .true. |
367 |
< |
!!$ |
368 |
< |
!!$ end subroutine setRlistDF |
268 |
> |
haveGtypeCutoffMap = .true. |
269 |
> |
end subroutine createGtypeCutoffMap |
270 |
|
|
370 |
– |
|
271 |
|
subroutine setSimVariables() |
272 |
|
SIM_uses_DirectionalAtoms = SimUsesDirectionalAtoms() |
373 |
– |
SIM_uses_LennardJones = SimUsesLennardJones() |
374 |
– |
SIM_uses_Electrostatics = SimUsesElectrostatics() |
375 |
– |
SIM_uses_Charges = SimUsesCharges() |
376 |
– |
SIM_uses_Dipoles = SimUsesDipoles() |
377 |
– |
SIM_uses_Sticky = SimUsesSticky() |
378 |
– |
SIM_uses_StickyPower = SimUsesStickyPower() |
379 |
– |
SIM_uses_GayBerne = SimUsesGayBerne() |
273 |
|
SIM_uses_EAM = SimUsesEAM() |
381 |
– |
SIM_uses_Shapes = SimUsesShapes() |
382 |
– |
SIM_uses_FLARB = SimUsesFLARB() |
274 |
|
SIM_uses_RF = SimUsesRF() |
275 |
|
SIM_requires_postpair_calc = SimRequiresPostpairCalc() |
276 |
|
SIM_requires_prepair_calc = SimRequiresPrepairCalc() |
288 |
|
|
289 |
|
error = 0 |
290 |
|
|
291 |
< |
if (.not. haveInteractionMap) then |
401 |
< |
|
291 |
> |
if (.not. haveInteractionHash) then |
292 |
|
myStatus = 0 |
293 |
< |
call createInteractionMap(myStatus) |
404 |
< |
|
293 |
> |
call createInteractionHash(myStatus) |
294 |
|
if (myStatus .ne. 0) then |
295 |
< |
write(default_error, *) 'createInteractionMap failed in doForces!' |
295 |
> |
write(default_error, *) 'createInteractionHash failed in doForces!' |
296 |
|
error = -1 |
297 |
|
return |
298 |
|
endif |
299 |
|
endif |
300 |
|
|
301 |
+ |
if (.not. haveGtypeCutoffMap) then |
302 |
+ |
myStatus = 0 |
303 |
+ |
call createGtypeCutoffMap(myStatus) |
304 |
+ |
if (myStatus .ne. 0) then |
305 |
+ |
write(default_error, *) 'createGtypeCutoffMap failed in doForces!' |
306 |
+ |
error = -1 |
307 |
+ |
return |
308 |
+ |
endif |
309 |
+ |
endif |
310 |
+ |
|
311 |
|
if (.not. haveSIMvariables) then |
312 |
|
call setSimVariables() |
313 |
|
endif |
363 |
|
!! interactions are used by the force field. |
364 |
|
|
365 |
|
FF_uses_DirectionalAtoms = .false. |
467 |
– |
FF_uses_LennardJones = .false. |
468 |
– |
FF_uses_Electrostatics = .false. |
469 |
– |
FF_uses_Charges = .false. |
366 |
|
FF_uses_Dipoles = .false. |
471 |
– |
FF_uses_Sticky = .false. |
472 |
– |
FF_uses_StickyPower = .false. |
367 |
|
FF_uses_GayBerne = .false. |
368 |
|
FF_uses_EAM = .false. |
475 |
– |
FF_uses_Shapes = .false. |
476 |
– |
FF_uses_FLARB = .false. |
369 |
|
|
370 |
|
call getMatchingElementList(atypes, "is_Directional", .true., & |
371 |
|
nMatches, MatchList) |
372 |
|
if (nMatches .gt. 0) FF_uses_DirectionalAtoms = .true. |
373 |
|
|
482 |
– |
call getMatchingElementList(atypes, "is_LennardJones", .true., & |
483 |
– |
nMatches, MatchList) |
484 |
– |
if (nMatches .gt. 0) FF_uses_LennardJones = .true. |
485 |
– |
|
486 |
– |
call getMatchingElementList(atypes, "is_Electrostatic", .true., & |
487 |
– |
nMatches, MatchList) |
488 |
– |
if (nMatches .gt. 0) then |
489 |
– |
FF_uses_Electrostatics = .true. |
490 |
– |
endif |
491 |
– |
|
492 |
– |
call getMatchingElementList(atypes, "is_Charge", .true., & |
493 |
– |
nMatches, MatchList) |
494 |
– |
if (nMatches .gt. 0) then |
495 |
– |
FF_uses_Charges = .true. |
496 |
– |
FF_uses_Electrostatics = .true. |
497 |
– |
endif |
498 |
– |
|
374 |
|
call getMatchingElementList(atypes, "is_Dipole", .true., & |
375 |
|
nMatches, MatchList) |
376 |
< |
if (nMatches .gt. 0) then |
502 |
< |
FF_uses_Dipoles = .true. |
503 |
< |
FF_uses_Electrostatics = .true. |
504 |
< |
FF_uses_DirectionalAtoms = .true. |
505 |
< |
endif |
506 |
< |
|
507 |
< |
call getMatchingElementList(atypes, "is_Quadrupole", .true., & |
508 |
< |
nMatches, MatchList) |
509 |
< |
if (nMatches .gt. 0) then |
510 |
< |
FF_uses_Quadrupoles = .true. |
511 |
< |
FF_uses_Electrostatics = .true. |
512 |
< |
FF_uses_DirectionalAtoms = .true. |
513 |
< |
endif |
514 |
< |
|
515 |
< |
call getMatchingElementList(atypes, "is_Sticky", .true., nMatches, & |
516 |
< |
MatchList) |
517 |
< |
if (nMatches .gt. 0) then |
518 |
< |
FF_uses_Sticky = .true. |
519 |
< |
FF_uses_DirectionalAtoms = .true. |
520 |
< |
endif |
521 |
< |
|
522 |
< |
call getMatchingElementList(atypes, "is_StickyPower", .true., nMatches, & |
523 |
< |
MatchList) |
524 |
< |
if (nMatches .gt. 0) then |
525 |
< |
FF_uses_StickyPower = .true. |
526 |
< |
FF_uses_DirectionalAtoms = .true. |
527 |
< |
endif |
376 |
> |
if (nMatches .gt. 0) FF_uses_Dipoles = .true. |
377 |
|
|
378 |
|
call getMatchingElementList(atypes, "is_GayBerne", .true., & |
379 |
|
nMatches, MatchList) |
380 |
< |
if (nMatches .gt. 0) then |
532 |
< |
FF_uses_GayBerne = .true. |
533 |
< |
FF_uses_DirectionalAtoms = .true. |
534 |
< |
endif |
380 |
> |
if (nMatches .gt. 0) FF_uses_GayBerne = .true. |
381 |
|
|
382 |
|
call getMatchingElementList(atypes, "is_EAM", .true., nMatches, MatchList) |
383 |
|
if (nMatches .gt. 0) FF_uses_EAM = .true. |
384 |
|
|
539 |
– |
call getMatchingElementList(atypes, "is_Shape", .true., & |
540 |
– |
nMatches, MatchList) |
541 |
– |
if (nMatches .gt. 0) then |
542 |
– |
FF_uses_Shapes = .true. |
543 |
– |
FF_uses_DirectionalAtoms = .true. |
544 |
– |
endif |
385 |
|
|
546 |
– |
call getMatchingElementList(atypes, "is_FLARB", .true., & |
547 |
– |
nMatches, MatchList) |
548 |
– |
if (nMatches .gt. 0) FF_uses_FLARB = .true. |
549 |
– |
|
550 |
– |
!! Assume sanity (for the sake of argument) |
386 |
|
haveSaneForceField = .true. |
387 |
|
|
388 |
|
!! check to make sure the FF_uses_RF setting makes sense |
389 |
|
|
390 |
< |
if (FF_uses_dipoles) then |
390 |
> |
if (FF_uses_Dipoles) then |
391 |
|
if (FF_uses_RF) then |
392 |
|
dielect = getDielect() |
393 |
|
call initialize_rf(dielect) |
401 |
|
endif |
402 |
|
endif |
403 |
|
|
569 |
– |
!sticky module does not contain check_sticky_FF anymore |
570 |
– |
!if (FF_uses_sticky) then |
571 |
– |
! call check_sticky_FF(my_status) |
572 |
– |
! if (my_status /= 0) then |
573 |
– |
! thisStat = -1 |
574 |
– |
! haveSaneForceField = .false. |
575 |
– |
! return |
576 |
– |
! end if |
577 |
– |
!endif |
578 |
– |
|
404 |
|
if (FF_uses_EAM) then |
405 |
|
call init_EAM_FF(my_status) |
406 |
|
if (my_status /= 0) then |
420 |
|
endif |
421 |
|
endif |
422 |
|
|
598 |
– |
if (FF_uses_GayBerne .and. FF_uses_LennardJones) then |
599 |
– |
endif |
600 |
– |
|
423 |
|
if (.not. haveNeighborList) then |
424 |
|
!! Create neighbor lists |
425 |
|
call expandNeighborList(nLocal, my_status) |
483 |
|
integer :: localError |
484 |
|
integer :: propPack_i, propPack_j |
485 |
|
integer :: loopStart, loopEnd, loop |
486 |
< |
integer :: iMap |
486 |
> |
integer :: iHash |
487 |
|
real(kind=dp) :: listSkin = 1.0 |
488 |
|
|
489 |
|
!! initialize local variables |
617 |
|
q_group(:,j), d_grp, rgrpsq) |
618 |
|
#endif |
619 |
|
|
620 |
< |
if (rgrpsq < InteractionMap(me_i,me_j)%rListsq) then |
620 |
> |
if (rgrpsq < InteractionHash(me_i,me_j)%rListsq) then |
621 |
|
if (update_nlist) then |
622 |
|
nlist = nlist + 1 |
623 |
|
|
835 |
|
#else |
836 |
|
me_i = atid(i) |
837 |
|
#endif |
838 |
< |
iMap = InteractionMap(me_i, me_j)%InteractionHash |
838 |
> |
iHash = InteractionHash(me_i,me_j) |
839 |
|
|
840 |
< |
if ( iand(iMap, ELECTROSTATIC_PAIR).ne.0 ) then |
840 |
> |
if ( iand(iHash, ELECTROSTATIC_PAIR).ne.0 ) then |
841 |
|
|
842 |
|
mu_i = getDipoleMoment(me_i) |
843 |
|
|
904 |
|
real ( kind = dp ) :: ebalance |
905 |
|
integer :: me_i, me_j |
906 |
|
|
907 |
< |
integer :: iMap |
907 |
> |
integer :: iHash |
908 |
|
|
909 |
|
r = sqrt(rijsq) |
910 |
|
vpair = 0.0d0 |
918 |
|
me_j = atid(j) |
919 |
|
#endif |
920 |
|
|
921 |
< |
iMap = InteractionMap(me_i, me_j)%InteractionHash |
921 |
> |
iHash = InteractionHash(me_i, me_j) |
922 |
|
|
923 |
< |
if ( iand(iMap, LJ_PAIR).ne.0 ) then |
923 |
> |
if ( iand(iHash, LJ_PAIR).ne.0 ) then |
924 |
|
call do_lj_pair(i, j, d, r, rijsq, sw, vpair, fpair, pot, f, do_pot) |
925 |
|
endif |
926 |
|
|
927 |
< |
if ( iand(iMap, ELECTROSTATIC_PAIR).ne.0 ) then |
927 |
> |
if ( iand(iHash, ELECTROSTATIC_PAIR).ne.0 ) then |
928 |
|
call doElectrostaticPair(i, j, d, r, rijsq, sw, vpair, fpair, & |
929 |
|
pot, eFrame, f, t, do_pot) |
930 |
|
|
937 |
|
|
938 |
|
endif |
939 |
|
|
940 |
< |
if ( iand(iMap, STICKY_PAIR).ne.0 ) then |
940 |
> |
if ( iand(iHash, STICKY_PAIR).ne.0 ) then |
941 |
|
call do_sticky_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
942 |
|
pot, A, f, t, do_pot) |
943 |
|
endif |
944 |
|
|
945 |
< |
if ( iand(iMap, STICKYPOWER_PAIR).ne.0 ) then |
945 |
> |
if ( iand(iHash, STICKYPOWER_PAIR).ne.0 ) then |
946 |
|
call do_sticky_power_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
947 |
|
pot, A, f, t, do_pot) |
948 |
|
endif |
949 |
|
|
950 |
< |
if ( iand(iMap, GAYBERNE_PAIR).ne.0 ) then |
950 |
> |
if ( iand(iHash, GAYBERNE_PAIR).ne.0 ) then |
951 |
|
call do_gb_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
952 |
|
pot, A, f, t, do_pot) |
953 |
|
endif |
954 |
|
|
955 |
< |
if ( iand(iMap, GAYBERNE_LJ).ne.0 ) then |
955 |
> |
if ( iand(iHash, GAYBERNE_LJ).ne.0 ) then |
956 |
|
! call do_gblj_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
957 |
|
! pot, A, f, t, do_pot) |
958 |
|
endif |
959 |
|
|
960 |
< |
if ( iand(iMap, EAM_PAIR).ne.0 ) then |
960 |
> |
if ( iand(iHash, EAM_PAIR).ne.0 ) then |
961 |
|
call do_eam_pair(i, j, d, r, rijsq, sw, vpair, fpair, pot, f, & |
962 |
|
do_pot) |
963 |
|
endif |
964 |
|
|
965 |
< |
if ( iand(iMap, SHAPE_PAIR).ne.0 ) then |
965 |
> |
if ( iand(iHash, SHAPE_PAIR).ne.0 ) then |
966 |
|
call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
967 |
|
pot, A, f, t, do_pot) |
968 |
|
endif |
969 |
|
|
970 |
< |
if ( iand(iMap, SHAPE_LJ).ne.0 ) then |
970 |
> |
if ( iand(iHash, SHAPE_LJ).ne.0 ) then |
971 |
|
call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
972 |
|
pot, A, f, t, do_pot) |
973 |
|
endif |
989 |
|
real ( kind = dp ) :: r, rc |
990 |
|
real ( kind = dp ), intent(inout) :: d(3), dc(3) |
991 |
|
|
992 |
< |
integer :: me_i, me_j, iMap |
992 |
> |
integer :: me_i, me_j, iHash |
993 |
|
|
994 |
|
#ifdef IS_MPI |
995 |
|
me_i = atid_row(i) |
999 |
|
me_j = atid(j) |
1000 |
|
#endif |
1001 |
|
|
1002 |
< |
iMap = InteractionMap(me_i, me_j)%InteractionHash |
1002 |
> |
iHash = InteractionHash(me_i, me_j) |
1003 |
|
|
1004 |
< |
if ( iand(iMap, EAM_PAIR).ne.0 ) then |
1004 |
> |
if ( iand(iHash, EAM_PAIR).ne.0 ) then |
1005 |
|
call calc_EAM_prepair_rho(i, j, d, r, rijsq ) |
1006 |
|
endif |
1007 |
|
|
1198 |
|
|
1199 |
|
function FF_UsesDirectionalAtoms() result(doesit) |
1200 |
|
logical :: doesit |
1201 |
< |
doesit = FF_uses_DirectionalAtoms .or. FF_uses_Dipoles .or. & |
1380 |
< |
FF_uses_Quadrupoles .or. FF_uses_Sticky .or. & |
1381 |
< |
FF_uses_StickyPower .or. FF_uses_GayBerne .or. FF_uses_Shapes |
1201 |
> |
doesit = FF_uses_DirectionalAtoms |
1202 |
|
end function FF_UsesDirectionalAtoms |
1203 |
|
|
1204 |
|
function FF_RequiresPrepairCalc() result(doesit) |