45 |
|
|
46 |
|
!! @author Charles F. Vardeman II |
47 |
|
!! @author Matthew Meineke |
48 |
< |
!! @version $Id: doForces.F90,v 1.14 2005-04-21 14:12:19 chrisfen Exp $, $Date: 2005-04-21 14:12:19 $, $Name: not supported by cvs2svn $, $Revision: 1.14 $ |
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 $ |
49 |
|
|
50 |
|
|
51 |
|
module doForces |
73 |
|
|
74 |
|
#define __FORTRAN90 |
75 |
|
#include "UseTheForce/fSwitchingFunction.h" |
76 |
+ |
#include "UseTheForce/DarkSide/fInteractionMap.h" |
77 |
|
|
78 |
|
INTEGER, PARAMETER:: PREPAIR_LOOP = 1 |
79 |
|
INTEGER, PARAMETER:: PAIR_LOOP = 2 |
81 |
|
logical, save :: haveRlist = .false. |
82 |
|
logical, save :: haveNeighborList = .false. |
83 |
|
logical, save :: haveSIMvariables = .false. |
83 |
– |
logical, save :: havePropertyMap = .false. |
84 |
|
logical, save :: haveSaneForceField = .false. |
85 |
|
|
86 |
|
logical, save :: FF_uses_DirectionalAtoms |
89 |
|
logical, save :: FF_uses_Charges |
90 |
|
logical, save :: FF_uses_Dipoles |
91 |
|
logical, save :: FF_uses_Quadrupoles |
92 |
< |
logical, save :: FF_uses_sticky |
92 |
> |
logical, save :: FF_uses_Sticky |
93 |
> |
logical, save :: FF_uses_StickyPower |
94 |
|
logical, save :: FF_uses_GayBerne |
95 |
|
logical, save :: FF_uses_EAM |
96 |
|
logical, save :: FF_uses_Shapes |
104 |
|
logical, save :: SIM_uses_Dipoles |
105 |
|
logical, save :: SIM_uses_Quadrupoles |
106 |
|
logical, save :: SIM_uses_Sticky |
107 |
+ |
logical, save :: SIM_uses_StickyPower |
108 |
|
logical, save :: SIM_uses_GayBerne |
109 |
|
logical, save :: SIM_uses_EAM |
110 |
|
logical, save :: SIM_uses_Shapes |
115 |
|
logical, save :: SIM_uses_PBC |
116 |
|
logical, save :: SIM_uses_molecular_cutoffs |
117 |
|
|
118 |
< |
real(kind=dp), save :: rlist, rlistsq |
118 |
> |
!!!GO AWAY--------- |
119 |
> |
!!!!!real(kind=dp), save :: rlist, rlistsq |
120 |
|
|
121 |
|
public :: init_FF |
122 |
|
public :: do_force_loop |
123 |
< |
public :: setRlistDF |
123 |
> |
! public :: setRlistDF |
124 |
|
|
125 |
|
#ifdef PROFILE |
126 |
|
public :: getforcetime |
129 |
|
integer :: nLoops |
130 |
|
#endif |
131 |
|
|
132 |
< |
type :: Properties |
133 |
< |
logical :: is_Directional = .false. |
134 |
< |
logical :: is_LennardJones = .false. |
135 |
< |
logical :: is_Electrostatic = .false. |
136 |
< |
logical :: is_Charge = .false. |
137 |
< |
logical :: is_Dipole = .false. |
138 |
< |
logical :: is_Quadrupole = .false. |
139 |
< |
logical :: is_Sticky = .false. |
140 |
< |
logical :: is_GayBerne = .false. |
141 |
< |
logical :: is_EAM = .false. |
142 |
< |
logical :: is_Shape = .false. |
143 |
< |
logical :: is_FLARB = .false. |
141 |
< |
end type Properties |
142 |
< |
|
143 |
< |
type(Properties), dimension(:),allocatable :: PropertyMap |
144 |
< |
|
132 |
> |
type, public :: Interaction |
133 |
> |
integer :: InteractionHash |
134 |
> |
real(kind=dp) :: rCut |
135 |
> |
end type Interaction |
136 |
> |
|
137 |
> |
type(Interaction), dimension(:,:),allocatable :: InteractionMap |
138 |
> |
|
139 |
> |
!public :: addInteraction |
140 |
> |
!public :: setInteractionHash |
141 |
> |
!public :: getInteractionHash |
142 |
> |
public :: createInteractionMap |
143 |
> |
|
144 |
|
contains |
145 |
|
|
146 |
< |
subroutine setRlistDF( this_rlist ) |
147 |
< |
|
149 |
< |
real(kind=dp) :: this_rlist |
150 |
< |
|
151 |
< |
rlist = this_rlist |
152 |
< |
rlistsq = rlist * rlist |
153 |
< |
|
154 |
< |
haveRlist = .true. |
155 |
< |
|
156 |
< |
end subroutine setRlistDF |
157 |
< |
|
158 |
< |
subroutine createPropertyMap(status) |
146 |
> |
|
147 |
> |
subroutine createInteractionMap(status) |
148 |
|
integer :: nAtypes |
149 |
|
integer :: status |
150 |
|
integer :: i |
151 |
< |
logical :: thisProperty |
152 |
< |
real (kind=DP) :: thisDPproperty |
153 |
< |
|
154 |
< |
status = 0 |
155 |
< |
|
151 |
> |
integer :: j |
152 |
> |
integer :: ihash |
153 |
> |
real(kind=dp) :: myRcut |
154 |
> |
! Test Types |
155 |
> |
logical :: i_is_LJ |
156 |
> |
logical :: i_is_Elect |
157 |
> |
logical :: i_is_Sticky |
158 |
> |
logical :: i_is_StickyP |
159 |
> |
logical :: i_is_GB |
160 |
> |
logical :: i_is_EAM |
161 |
> |
logical :: i_is_Shape |
162 |
> |
logical :: j_is_LJ |
163 |
> |
logical :: j_is_Elect |
164 |
> |
logical :: j_is_Sticky |
165 |
> |
logical :: j_is_StickyP |
166 |
> |
logical :: j_is_GB |
167 |
> |
logical :: j_is_EAM |
168 |
> |
logical :: j_is_Shape |
169 |
> |
|
170 |
> |
|
171 |
> |
if (.not. associated(atypes)) then |
172 |
> |
call handleError("atype", "atypes was not present before call of createDefaultInteractionMap!") |
173 |
> |
status = -1 |
174 |
> |
return |
175 |
> |
endif |
176 |
> |
|
177 |
|
nAtypes = getSize(atypes) |
178 |
< |
|
178 |
> |
|
179 |
|
if (nAtypes == 0) then |
180 |
|
status = -1 |
181 |
|
return |
182 |
|
end if |
183 |
|
|
184 |
< |
if (.not. allocated(PropertyMap)) then |
185 |
< |
allocate(PropertyMap(nAtypes)) |
184 |
> |
if (.not. allocated(InteractionMap)) then |
185 |
> |
allocate(InteractionMap(nAtypes,nAtypes)) |
186 |
|
endif |
187 |
< |
|
187 |
> |
|
188 |
|
do i = 1, nAtypes |
189 |
< |
call getElementProperty(atypes, i, "is_Directional", thisProperty) |
190 |
< |
PropertyMap(i)%is_Directional = thisProperty |
189 |
> |
call getElementProperty(atypes, i, "is_LennardJones", i_is_LJ) |
190 |
> |
call getElementProperty(atypes, i, "is_Electrostatic", i_is_Elect) |
191 |
> |
call getElementProperty(atypes, i, "is_Sticky", i_is_Sticky) |
192 |
> |
call getElementProperty(atypes, i, "is_StickyPower", i_is_StickyP) |
193 |
> |
call getElementProperty(atypes, i, "is_GayBerne", i_is_GB) |
194 |
> |
call getElementProperty(atypes, i, "is_EAM", i_is_EAM) |
195 |
> |
call getElementProperty(atypes, i, "is_Shape", i_is_Shape) |
196 |
|
|
197 |
< |
call getElementProperty(atypes, i, "is_LennardJones", thisProperty) |
183 |
< |
PropertyMap(i)%is_LennardJones = thisProperty |
197 |
> |
do j = i, nAtypes |
198 |
|
|
199 |
< |
call getElementProperty(atypes, i, "is_Electrostatic", thisProperty) |
200 |
< |
PropertyMap(i)%is_Electrostatic = thisProperty |
199 |
> |
iHash = 0 |
200 |
> |
myRcut = 0.0_dp |
201 |
|
|
202 |
< |
call getElementProperty(atypes, i, "is_Charge", thisProperty) |
203 |
< |
PropertyMap(i)%is_Charge = thisProperty |
202 |
> |
call getElementProperty(atypes, j, "is_LennardJones", j_is_LJ) |
203 |
> |
call getElementProperty(atypes, j, "is_Electrostatic", j_is_Elect) |
204 |
> |
call getElementProperty(atypes, j, "is_Sticky", j_is_Sticky) |
205 |
> |
call getElementProperty(atypes, j, "is_StickyPower", j_is_StickyP) |
206 |
> |
call getElementProperty(atypes, j, "is_GayBerne", j_is_GB) |
207 |
> |
call getElementProperty(atypes, j, "is_EAM", j_is_EAM) |
208 |
> |
call getElementProperty(atypes, j, "is_Shape", j_is_Shape) |
209 |
|
|
210 |
< |
call getElementProperty(atypes, i, "is_Dipole", thisProperty) |
211 |
< |
PropertyMap(i)%is_Dipole = thisProperty |
210 |
> |
if (i_is_LJ .and. j_is_LJ) then |
211 |
> |
iHash = ior(iHash, LJ_PAIR) |
212 |
> |
endif |
213 |
> |
|
214 |
> |
if (i_is_Elect .and. j_is_Elect) then |
215 |
> |
iHash = ior(iHash, ELECTROSTATIC_PAIR) |
216 |
> |
endif |
217 |
> |
|
218 |
> |
if (i_is_Sticky .and. j_is_Sticky) then |
219 |
> |
iHash = ior(iHash, STICKY_PAIR) |
220 |
> |
endif |
221 |
|
|
222 |
< |
call getElementProperty(atypes, i, "is_Quadrupole", thisProperty) |
223 |
< |
PropertyMap(i)%is_Quadrupole = thisProperty |
222 |
> |
if (i_is_StickyP .and. j_is_StickyP) then |
223 |
> |
iHash = ior(iHash, STICKYPOWER_PAIR) |
224 |
> |
endif |
225 |
|
|
226 |
< |
call getElementProperty(atypes, i, "is_Sticky", thisProperty) |
227 |
< |
PropertyMap(i)%is_Sticky = thisProperty |
226 |
> |
if (i_is_EAM .and. j_is_EAM) then |
227 |
> |
iHash = ior(iHash, EAM_PAIR) |
228 |
> |
endif |
229 |
|
|
230 |
< |
call getElementProperty(atypes, i, "is_GayBerne", thisProperty) |
231 |
< |
PropertyMap(i)%is_GayBerne = thisProperty |
230 |
> |
if (i_is_GB .and. j_is_GB) iHash = ior(iHash, GAYBERNE_PAIR) |
231 |
> |
if (i_is_GB .and. j_is_LJ) iHash = ior(iHash, GAYBERNE_LJ) |
232 |
> |
if (i_is_LJ .and. j_is_GB) iHash = ior(iHash, GAYBERNE_LJ) |
233 |
|
|
234 |
< |
call getElementProperty(atypes, i, "is_EAM", thisProperty) |
235 |
< |
PropertyMap(i)%is_EAM = thisProperty |
234 |
> |
if (i_is_Shape .and. j_is_Shape) iHash = ior(iHash, SHAPE_PAIR) |
235 |
> |
if (i_is_Shape .and. j_is_LJ) iHash = ior(iHash, SHAPE_LJ) |
236 |
> |
if (i_is_LJ .and. j_is_Shape) iHash = ior(iHash, SHAPE_LJ) |
237 |
|
|
206 |
– |
call getElementProperty(atypes, i, "is_Shape", thisProperty) |
207 |
– |
PropertyMap(i)%is_Shape = thisProperty |
238 |
|
|
239 |
< |
call getElementProperty(atypes, i, "is_FLARB", thisProperty) |
240 |
< |
PropertyMap(i)%is_FLARB = thisProperty |
239 |
> |
InteractionMap(i,j)%InteractionHash = iHash |
240 |
> |
InteractionMap(j,i)%InteractionHash = iHash |
241 |
> |
|
242 |
> |
end do |
243 |
> |
|
244 |
|
end do |
245 |
+ |
end subroutine createInteractionMap |
246 |
|
|
213 |
– |
havePropertyMap = .true. |
247 |
|
|
248 |
< |
end subroutine createPropertyMap |
248 |
> |
|
249 |
> |
!!! THIS GOES AWAY FOR SIZE DEPENDENT CUTOFF |
250 |
> |
!!$ subroutine setRlistDF( this_rlist ) |
251 |
> |
!!$ |
252 |
> |
!!$ real(kind=dp) :: this_rlist |
253 |
> |
!!$ |
254 |
> |
!!$ rlist = this_rlist |
255 |
> |
!!$ rlistsq = rlist * rlist |
256 |
> |
!!$ |
257 |
> |
!!$ haveRlist = .true. |
258 |
> |
!!$ |
259 |
> |
!!$ end subroutine setRlistDF |
260 |
|
|
261 |
+ |
|
262 |
|
subroutine setSimVariables() |
263 |
|
SIM_uses_DirectionalAtoms = SimUsesDirectionalAtoms() |
264 |
|
SIM_uses_LennardJones = SimUsesLennardJones() |
266 |
|
SIM_uses_Charges = SimUsesCharges() |
267 |
|
SIM_uses_Dipoles = SimUsesDipoles() |
268 |
|
SIM_uses_Sticky = SimUsesSticky() |
269 |
+ |
SIM_uses_StickyPower = SimUsesStickyPower() |
270 |
|
SIM_uses_GayBerne = SimUsesGayBerne() |
271 |
|
SIM_uses_EAM = SimUsesEAM() |
272 |
|
SIM_uses_Shapes = SimUsesShapes() |
288 |
|
|
289 |
|
error = 0 |
290 |
|
|
291 |
< |
if (.not. havePropertyMap) then |
291 |
> |
if (.not. haveInteractionMap) then |
292 |
|
|
293 |
|
myStatus = 0 |
294 |
|
|
295 |
< |
call createPropertyMap(myStatus) |
295 |
> |
call createInteractionMap(myStatus) |
296 |
|
|
297 |
|
if (myStatus .ne. 0) then |
298 |
< |
write(default_error, *) 'createPropertyMap failed in doForces!' |
298 |
> |
write(default_error, *) 'createInteractionMap failed in doForces!' |
299 |
|
error = -1 |
300 |
|
return |
301 |
|
endif |
361 |
|
FF_uses_Charges = .false. |
362 |
|
FF_uses_Dipoles = .false. |
363 |
|
FF_uses_Sticky = .false. |
364 |
+ |
FF_uses_StickyPower = .false. |
365 |
|
FF_uses_GayBerne = .false. |
366 |
|
FF_uses_EAM = .false. |
367 |
|
FF_uses_Shapes = .false. |
411 |
|
FF_uses_DirectionalAtoms = .true. |
412 |
|
endif |
413 |
|
|
414 |
+ |
call getMatchingElementList(atypes, "is_StickyPower", .true., nMatches, & |
415 |
+ |
MatchList) |
416 |
+ |
if (nMatches .gt. 0) then |
417 |
+ |
FF_uses_StickyPower = .true. |
418 |
+ |
FF_uses_DirectionalAtoms = .true. |
419 |
+ |
endif |
420 |
+ |
|
421 |
|
call getMatchingElementList(atypes, "is_GayBerne", .true., & |
422 |
|
nMatches, MatchList) |
423 |
|
if (nMatches .gt. 0) then |
897 |
|
#else |
898 |
|
me_i = atid(i) |
899 |
|
#endif |
900 |
< |
|
901 |
< |
if (PropertyMap(me_i)%is_Dipole) then |
900 |
> |
iMap = InteractionMap(me_i, me_j)%InteractionHash |
901 |
> |
|
902 |
> |
if ( iand(iMap, ELECTROSTATIC_PAIR).ne.0 ) then |
903 |
|
|
904 |
|
mu_i = getDipoleMoment(me_i) |
905 |
|
|
963 |
|
real ( kind = dp ), intent(inout) :: rijsq |
964 |
|
real ( kind = dp ) :: r |
965 |
|
real ( kind = dp ), intent(inout) :: d(3) |
966 |
+ |
real ( kind = dp ) :: ebalance |
967 |
|
integer :: me_i, me_j |
968 |
|
|
969 |
+ |
integer :: iMap |
970 |
+ |
|
971 |
|
r = sqrt(rijsq) |
972 |
|
vpair = 0.0d0 |
973 |
|
fpair(1:3) = 0.0d0 |
980 |
|
me_j = atid(j) |
981 |
|
#endif |
982 |
|
|
983 |
< |
! write(*,*) i, j, me_i, me_j |
983 |
> |
iMap = InteractionMap(me_i, me_j)%InteractionHash |
984 |
|
|
985 |
< |
if (FF_uses_LennardJones .and. SIM_uses_LennardJones) then |
986 |
< |
|
929 |
< |
if ( PropertyMap(me_i)%is_LennardJones .and. & |
930 |
< |
PropertyMap(me_j)%is_LennardJones ) then |
931 |
< |
call do_lj_pair(i, j, d, r, rijsq, sw, vpair, fpair, pot, f, do_pot) |
932 |
< |
endif |
933 |
< |
|
985 |
> |
if ( iand(iMap, LJ_PAIR).ne.0 ) then |
986 |
> |
call do_lj_pair(i, j, d, r, rijsq, sw, vpair, fpair, pot, f, do_pot) |
987 |
|
endif |
988 |
|
|
989 |
< |
if (FF_uses_Electrostatics .and. SIM_uses_Electrostatics) then |
989 |
> |
if ( iand(iMap, ELECTROSTATIC_PAIR).ne.0 ) then |
990 |
> |
call doElectrostaticPair(i, j, d, r, rijsq, sw, vpair, fpair, & |
991 |
> |
pot, eFrame, f, t, do_pot) |
992 |
|
|
993 |
< |
if (PropertyMap(me_i)%is_Electrostatic .and. & |
939 |
< |
PropertyMap(me_j)%is_Electrostatic) then |
940 |
< |
call doElectrostaticPair(i, j, d, r, rijsq, sw, vpair, fpair, & |
941 |
< |
pot, eFrame, f, t, do_pot) |
942 |
< |
endif |
993 |
> |
if (FF_uses_RF .and. SIM_uses_RF) then |
994 |
|
|
995 |
< |
if (FF_uses_dipoles .and. SIM_uses_dipoles) then |
996 |
< |
if ( PropertyMap(me_i)%is_Dipole .and. & |
997 |
< |
PropertyMap(me_j)%is_Dipole) then |
947 |
< |
if (FF_uses_RF .and. SIM_uses_RF) then |
948 |
< |
call accumulate_rf(i, j, r, eFrame, sw) |
949 |
< |
call rf_correct_forces(i, j, d, r, eFrame, sw, f, fpair) |
950 |
< |
endif |
951 |
< |
endif |
995 |
> |
! CHECK ME (RF needs to know about all electrostatic types) |
996 |
> |
call accumulate_rf(i, j, r, eFrame, sw) |
997 |
> |
call rf_correct_forces(i, j, d, r, eFrame, sw, f, fpair) |
998 |
|
endif |
999 |
+ |
|
1000 |
|
endif |
1001 |
|
|
1002 |
+ |
if ( iand(iMap, STICKY_PAIR).ne.0 ) then |
1003 |
+ |
call do_sticky_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1004 |
+ |
pot, A, f, t, do_pot) |
1005 |
+ |
endif |
1006 |
|
|
1007 |
< |
if (FF_uses_Sticky .and. SIM_uses_sticky) then |
1007 |
> |
if ( iand(iMap, STICKYPOWER_PAIR).ne.0 ) then |
1008 |
> |
call do_sticky_power_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1009 |
> |
pot, A, f, t, do_pot) |
1010 |
> |
endif |
1011 |
|
|
1012 |
< |
if ( PropertyMap(me_i)%is_Sticky .and. PropertyMap(me_j)%is_Sticky) then |
1013 |
< |
call do_sticky_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1014 |
< |
pot, A, f, t, do_pot) |
1015 |
< |
endif |
1016 |
< |
|
1012 |
> |
if ( iand(iMap, GAYBERNE_PAIR).ne.0 ) then |
1013 |
> |
call do_gb_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1014 |
> |
pot, A, f, t, do_pot) |
1015 |
> |
endif |
1016 |
> |
|
1017 |
> |
if ( iand(iMap, GAYBERNE_LJ).ne.0 ) then |
1018 |
> |
call do_gblj_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1019 |
> |
pot, A, f, t, do_pot) |
1020 |
|
endif |
1021 |
|
|
1022 |
< |
|
1023 |
< |
if (FF_uses_GayBerne .and. SIM_uses_GayBerne) then |
1024 |
< |
|
968 |
< |
if ( PropertyMap(me_i)%is_GayBerne .and. & |
969 |
< |
PropertyMap(me_j)%is_GayBerne) then |
970 |
< |
call do_gb_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
971 |
< |
pot, A, f, t, do_pot) |
972 |
< |
endif |
973 |
< |
|
1022 |
> |
if ( iand(iMap, EAM_PAIR).ne.0 ) then |
1023 |
> |
call do_eam_pair(i, j, d, r, rijsq, sw, vpair, fpair, pot, f, & |
1024 |
> |
do_pot) |
1025 |
|
endif |
1026 |
|
|
1027 |
< |
if (FF_uses_EAM .and. SIM_uses_EAM) then |
1028 |
< |
|
1029 |
< |
if ( PropertyMap(me_i)%is_EAM .and. PropertyMap(me_j)%is_EAM) then |
979 |
< |
call do_eam_pair(i, j, d, r, rijsq, sw, vpair, fpair, pot, f, & |
980 |
< |
do_pot) |
981 |
< |
endif |
982 |
< |
|
1027 |
> |
if ( iand(iMap, SHAPE_PAIR).ne.0 ) then |
1028 |
> |
call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1029 |
> |
pot, A, f, t, do_pot) |
1030 |
|
endif |
1031 |
|
|
1032 |
< |
|
1033 |
< |
! write(*,*) PropertyMap(me_i)%is_Shape,PropertyMap(me_j)%is_Shape |
1034 |
< |
|
988 |
< |
if (FF_uses_Shapes .and. SIM_uses_Shapes) then |
989 |
< |
if ( PropertyMap(me_i)%is_Shape .and. & |
990 |
< |
PropertyMap(me_j)%is_Shape ) then |
991 |
< |
call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
992 |
< |
pot, A, f, t, do_pot) |
993 |
< |
endif |
994 |
< |
if ( (PropertyMap(me_i)%is_Shape .and. & |
995 |
< |
PropertyMap(me_j)%is_LennardJones) .or. & |
996 |
< |
(PropertyMap(me_i)%is_LennardJones .and. & |
997 |
< |
PropertyMap(me_j)%is_Shape) ) then |
998 |
< |
call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
999 |
< |
pot, A, f, t, do_pot) |
1000 |
< |
endif |
1032 |
> |
if ( iand(iMap, SHAPE_LJ).ne.0 ) then |
1033 |
> |
call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1034 |
> |
pot, A, f, t, do_pot) |
1035 |
|
endif |
1036 |
< |
|
1036 |
> |
|
1037 |
|
end subroutine do_pair |
1038 |
|
|
1039 |
|
subroutine do_prepair(i, j, rijsq, d, sw, rcijsq, dc, & |
1051 |
|
real ( kind = dp ) :: r, rc |
1052 |
|
real ( kind = dp ), intent(inout) :: d(3), dc(3) |
1053 |
|
|
1054 |
< |
logical :: is_EAM_i, is_EAM_j |
1021 |
< |
|
1022 |
< |
integer :: me_i, me_j |
1023 |
< |
|
1024 |
< |
|
1025 |
< |
r = sqrt(rijsq) |
1026 |
< |
if (SIM_uses_molecular_cutoffs) then |
1027 |
< |
rc = sqrt(rcijsq) |
1028 |
< |
else |
1029 |
< |
rc = r |
1030 |
< |
endif |
1054 |
> |
integer :: me_i, me_j, iMap |
1055 |
|
|
1032 |
– |
|
1056 |
|
#ifdef IS_MPI |
1057 |
|
me_i = atid_row(i) |
1058 |
|
me_j = atid_col(j) |
1061 |
|
me_j = atid(j) |
1062 |
|
#endif |
1063 |
|
|
1064 |
< |
if (FF_uses_EAM .and. SIM_uses_EAM) then |
1064 |
> |
iMap = InteractionMap(me_i, me_j)%InteractionHash |
1065 |
|
|
1066 |
< |
if (PropertyMap(me_i)%is_EAM .and. PropertyMap(me_j)%is_EAM) & |
1067 |
< |
call calc_EAM_prepair_rho(i, j, d, r, rijsq ) |
1045 |
< |
|
1066 |
> |
if ( iand(iMap, EAM_PAIR).ne.0 ) then |
1067 |
> |
call calc_EAM_prepair_rho(i, j, d, r, rijsq ) |
1068 |
|
endif |
1069 |
< |
|
1069 |
> |
|
1070 |
|
end subroutine do_prepair |
1071 |
|
|
1072 |
|
|
1262 |
|
logical :: doesit |
1263 |
|
doesit = FF_uses_DirectionalAtoms .or. FF_uses_Dipoles .or. & |
1264 |
|
FF_uses_Quadrupoles .or. FF_uses_Sticky .or. & |
1265 |
< |
FF_uses_GayBerne .or. FF_uses_Shapes |
1265 |
> |
FF_uses_StickyPower .or. FF_uses_GayBerne .or. FF_uses_Shapes |
1266 |
|
end function FF_UsesDirectionalAtoms |
1267 |
|
|
1268 |
|
function FF_RequiresPrepairCalc() result(doesit) |