45 |
|
|
46 |
|
!! @author Charles F. Vardeman II |
47 |
|
!! @author Matthew Meineke |
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 $ |
48 |
> |
!! @version $Id: doForces.F90,v 1.30 2005-08-17 15:26:37 gezelter Exp $, $Date: 2005-08-17 15:26:37 $, $Name: not supported by cvs2svn $, $Revision: 1.30 $ |
49 |
|
|
50 |
|
|
51 |
|
module doForces |
73 |
|
|
74 |
|
#define __FORTRAN90 |
75 |
|
#include "UseTheForce/fSwitchingFunction.h" |
76 |
+ |
#include "UseTheForce/fCutoffPolicy.h" |
77 |
|
#include "UseTheForce/DarkSide/fInteractionMap.h" |
78 |
|
|
79 |
+ |
|
80 |
|
INTEGER, PARAMETER:: PREPAIR_LOOP = 1 |
81 |
|
INTEGER, PARAMETER:: PAIR_LOOP = 2 |
82 |
|
|
100 |
|
logical, save :: SIM_uses_PBC |
101 |
|
|
102 |
|
public :: init_FF |
103 |
+ |
public :: setDefaultCutoffs |
104 |
|
public :: do_force_loop |
105 |
|
public :: createInteractionHash |
106 |
|
public :: createGtypeCutoffMap |
125 |
|
real(kind=dp) :: rlistsq |
126 |
|
end type gtypeCutoffs |
127 |
|
type(gtypeCutoffs), dimension(:,:), allocatable :: gtypeCutoffMap |
128 |
+ |
|
129 |
+ |
integer, save :: cutoffPolicy = TRADITIONAL_CUTOFF_POLICY |
130 |
+ |
real(kind=dp),save :: defaultRcut, defaultRsw, defaultRlist |
131 |
|
|
132 |
|
contains |
133 |
|
|
185 |
|
call getElementProperty(atypes, i, "is_EAM", i_is_EAM) |
186 |
|
call getElementProperty(atypes, i, "is_Shape", i_is_Shape) |
187 |
|
|
182 |
– |
if (i_is_LJ) then |
183 |
– |
thisCut = getDefaultLJCutoff(i) |
184 |
– |
if (thisCut .gt. atypeMaxCutoff(i)) atypeMaxCutoff(i) = thisCut |
185 |
– |
endif |
186 |
– |
|
187 |
– |
|
188 |
– |
|
188 |
|
do j = i, nAtypes |
189 |
|
|
190 |
|
iHash = 0 |
237 |
|
haveInteractionHash = .true. |
238 |
|
end subroutine createInteractionHash |
239 |
|
|
240 |
< |
subroutine createGtypeCutoffMap(defaultRcut, defaultSkinThickness, stat) |
240 |
> |
subroutine createGtypeCutoffMap() |
241 |
|
|
242 |
< |
real(kind=dp), intent(in), optional :: defaultRCut, defaultSkinThickness |
243 |
< |
integer, intent(out) :: stat |
242 |
> |
logical :: i_is_LJ |
243 |
> |
logical :: i_is_Elect |
244 |
> |
logical :: i_is_Sticky |
245 |
> |
logical :: i_is_StickyP |
246 |
> |
logical :: i_is_GB |
247 |
> |
logical :: i_is_EAM |
248 |
> |
logical :: i_is_Shape |
249 |
|
|
250 |
|
integer :: myStatus, nAtypes |
251 |
+ |
real(kind=dp):: thisSigma, bigSigma |
252 |
|
|
253 |
|
stat = 0 |
254 |
|
if (.not. haveInteractionHash) then |
261 |
|
endif |
262 |
|
|
263 |
|
nAtypes = getSize(atypes) |
264 |
< |
|
264 |
> |
|
265 |
|
do i = 1, nAtypes |
266 |
< |
|
267 |
< |
atypeMaxCutoff(i) = |
266 |
> |
if (SimHasAtype(i)) then |
267 |
> |
call getElementProperty(atypes, i, "is_LennardJones", i_is_LJ) |
268 |
> |
call getElementProperty(atypes, i, "is_Electrostatic", i_is_Elect) |
269 |
> |
call getElementProperty(atypes, i, "is_Sticky", i_is_Sticky) |
270 |
> |
call getElementProperty(atypes, i, "is_StickyPower", i_is_StickyP) |
271 |
> |
call getElementProperty(atypes, i, "is_GayBerne", i_is_GB) |
272 |
> |
call getElementProperty(atypes, i, "is_EAM", i_is_EAM) |
273 |
> |
call getElementProperty(atypes, i, "is_Shape", i_is_Shape) |
274 |
> |
|
275 |
> |
if (i_is_LJ) then |
276 |
> |
thisRcut = getSigma(i) * 2.5_dp |
277 |
> |
if (thisRCut .gt. atypeMaxCutoff(i)) atypeMaxCutoff(i) = thisRCut |
278 |
> |
endif |
279 |
> |
if (i_is_Elect) then |
280 |
> |
thisRcut = defaultRcut |
281 |
> |
if (thisRCut .gt. atypeMaxCutoff(i)) atypeMaxCutoff(i) = thisRCut |
282 |
> |
endif |
283 |
> |
if (i_is_Sticky) then |
284 |
> |
thisRcut = getStickyCut(i) |
285 |
> |
if (thisRCut .gt. atypeMaxCutoff(i)) atypeMaxCutoff(i) = thisRCut |
286 |
> |
endif |
287 |
> |
if (i_is_StickyPower) then |
288 |
> |
thisRcut = getStickyPowerCut(i) |
289 |
> |
if (thisRCut .gt. atypeMaxCutoff(i)) atypeMaxCutoff(i) = thisRCut |
290 |
> |
endif |
291 |
> |
if (i_is_GayBerne) then |
292 |
> |
thisRcut = getGayBerneCut(i) |
293 |
> |
if (thisRCut .gt. atypeMaxCutoff(i)) atypeMaxCutoff(i) = thisRCut |
294 |
> |
endif |
295 |
> |
if (i_is_EAM) then |
296 |
> |
thisRcut = getEAMCut(i) |
297 |
> |
if (thisRCut .gt. atypeMaxCutoff(i)) atypeMaxCutoff(i) = thisRCut |
298 |
> |
endif |
299 |
> |
if (i_is_Shape) then |
300 |
> |
thisRcut = getShapeCut(i) |
301 |
> |
if (thisRCut .gt. atypeMaxCutoff(i)) atypeMaxCutoff(i) = thisRCut |
302 |
> |
endif |
303 |
> |
|
304 |
> |
if (atypeMaxCutoff(i).gt.biggestAtypeCutoff) then |
305 |
> |
biggestAtypeCutoff = atypeMaxCutoff(i) |
306 |
> |
endif |
307 |
> |
endif |
308 |
> |
enddo |
309 |
|
|
310 |
< |
|
310 |
> |
istart = 1 |
311 |
> |
#ifdef IS_MPI |
312 |
> |
iend = nGroupsInRow |
313 |
> |
#else |
314 |
> |
iend = nGroups |
315 |
> |
#endif |
316 |
> |
outer: do i = istart, iend |
317 |
> |
|
318 |
> |
n_in_i = groupStartRow(i+1) - groupStartRow(i) |
319 |
> |
|
320 |
> |
#ifdef IS_MPI |
321 |
> |
jstart = 1 |
322 |
> |
jend = nGroupsInCol |
323 |
> |
#else |
324 |
> |
jstart = i+1 |
325 |
> |
jend = nGroups |
326 |
> |
#endif |
327 |
|
|
328 |
|
|
329 |
|
|
330 |
+ |
|
331 |
+ |
|
332 |
+ |
|
333 |
+ |
|
334 |
|
haveGtypeCutoffMap = .true. |
335 |
|
end subroutine createGtypeCutoffMap |
336 |
+ |
|
337 |
+ |
subroutine setDefaultCutoffs(defRcut, defRsw, defRlist, cutPolicy) |
338 |
+ |
real(kind=dp),intent(in) :: defRcut, defRsw, defRlist |
339 |
+ |
integer, intent(in) :: cutPolicy |
340 |
|
|
341 |
+ |
defaultRcut = defRcut |
342 |
+ |
defaultRsw = defRsw |
343 |
+ |
defaultRlist = defRlist |
344 |
+ |
cutoffPolicy = cutPolicy |
345 |
+ |
end subroutine setDefaultCutoffs |
346 |
+ |
|
347 |
+ |
subroutine setCutoffPolicy(cutPolicy) |
348 |
+ |
|
349 |
+ |
integer, intent(in) :: cutPolicy |
350 |
+ |
cutoffPolicy = cutPolicy |
351 |
+ |
call createGtypeCutoffMap() |
352 |
+ |
|
353 |
+ |
end subroutine setDefaultCutoffs |
354 |
+ |
|
355 |
+ |
|
356 |
|
subroutine setSimVariables() |
357 |
|
SIM_uses_DirectionalAtoms = SimUsesDirectionalAtoms() |
358 |
|
SIM_uses_EAM = SimUsesEAM() |
659 |
|
iend = nGroups - 1 |
660 |
|
#endif |
661 |
|
outer: do i = istart, iend |
577 |
– |
|
578 |
– |
#ifdef IS_MPI |
579 |
– |
me_i = atid_row(i) |
580 |
– |
#else |
581 |
– |
me_i = atid(i) |
582 |
– |
#endif |
662 |
|
|
663 |
|
if (update_nlist) point(i) = nlist + 1 |
664 |
|
|