45 |
|
|
46 |
|
!! @author Charles F. Vardeman II |
47 |
|
!! @author Matthew Meineke |
48 |
< |
!! @version $Id: doForces.F90,v 1.20 2005-06-27 21:01:30 gezelter Exp $, $Date: 2005-06-27 21:01:30 $, $Name: not supported by cvs2svn $, $Revision: 1.20 $ |
48 |
> |
!! @version $Id: doForces.F90,v 1.21 2005-06-27 22:21:37 chuckv Exp $, $Date: 2005-06-27 22:21:37 $, $Name: not supported by cvs2svn $, $Revision: 1.21 $ |
49 |
|
|
50 |
|
|
51 |
|
module doForces |
116 |
|
logical, save :: SIM_uses_PBC |
117 |
|
logical, save :: SIM_uses_molecular_cutoffs |
118 |
|
|
119 |
< |
real(kind=dp), save :: rlist, rlistsq |
119 |
> |
!!!GO AWAY--------- |
120 |
> |
!!!!!real(kind=dp), save :: rlist, rlistsq |
121 |
|
|
122 |
|
public :: init_FF |
123 |
|
public :: do_force_loop |
124 |
< |
public :: setRlistDF |
124 |
> |
! public :: setRlistDF |
125 |
|
|
126 |
|
#ifdef PROFILE |
127 |
|
public :: getforcetime |
147 |
|
|
148 |
|
type(Properties), dimension(:),allocatable :: PropertyMap |
149 |
|
|
149 |
– |
contains |
150 |
|
|
151 |
< |
subroutine setRlistDF( this_rlist ) |
151 |
> |
|
152 |
> |
type, public :: Interaction |
153 |
> |
integer :: InteractionHash |
154 |
> |
real(kind=dp) :: rCut |
155 |
> |
end type Interaction |
156 |
> |
|
157 |
> |
type(Interaction), public, dimension(:,:), allocatable :: InteractionMap |
158 |
> |
|
159 |
> |
!public :: addInteraction |
160 |
> |
!public :: setInteractionHash |
161 |
> |
!public :: getInteractionHash |
162 |
> |
public :: createInteractionMap |
163 |
|
|
164 |
< |
real(kind=dp) :: this_rlist |
164 |
> |
contains |
165 |
|
|
166 |
< |
rlist = this_rlist |
167 |
< |
rlistsq = rlist * rlist |
166 |
> |
|
167 |
> |
subroutine createInteractionMap(status) |
168 |
> |
integer :: nAtypes |
169 |
> |
integer :: status |
170 |
> |
integer :: i |
171 |
> |
integer :: j |
172 |
> |
integer :: ihash |
173 |
> |
real(kind=dp) :: myRcut |
174 |
> |
! Test Types |
175 |
> |
logical :: i_is_LJ |
176 |
> |
logical :: i_is_Elect |
177 |
> |
logical :: i_is_Sticky |
178 |
> |
logical :: i_is_StickyP |
179 |
> |
logical :: i_is_GB |
180 |
> |
logical :: i_is_EAM |
181 |
> |
logical :: i_is_Shape |
182 |
> |
logical :: j_is_LJ |
183 |
> |
logical :: j_is_Elect |
184 |
> |
logical :: j_is_Sticky |
185 |
> |
logical :: j_is_StickyP |
186 |
> |
logical :: j_is_GB |
187 |
> |
logical :: j_is_EAM |
188 |
> |
logical :: j_is_Shape |
189 |
> |
|
190 |
> |
|
191 |
> |
if (.not. associated(atypes)) then |
192 |
> |
call handleError("atype", "atypes was not present before call of createDefaultInteractionMap!") |
193 |
> |
status = -1 |
194 |
> |
return |
195 |
> |
endif |
196 |
> |
|
197 |
> |
nAtypes = getSize(atypes) |
198 |
> |
|
199 |
> |
if (nAtypes == 0) then |
200 |
> |
status = -1 |
201 |
> |
return |
202 |
> |
end if |
203 |
|
|
204 |
< |
haveRlist = .true. |
204 |
> |
if (.not. allocated(InteractionMap)) then |
205 |
> |
allocate(InteractionMap(nAtypes,nAtypes)) |
206 |
> |
endif |
207 |
> |
|
208 |
> |
do i = 1, nAtypes |
209 |
> |
call getElementProperty(atypes, i, "is_LennardJones", i_is_LJ) |
210 |
> |
call getElementProperty(atypes, i, "is_Electrostatic", i_is_Elect) |
211 |
> |
call getElementProperty(atypes, i, "is_Sticky", i_is_Sticky) |
212 |
> |
call getElementProperty(atypes, i, "is_StickyPower", i_is_StickyP) |
213 |
> |
call getElementProperty(atypes, i, "is_GayBerne", i_is_GB) |
214 |
> |
call getElementProperty(atypes, i, "is_EAM", i_is_EAM) |
215 |
> |
call getElementProperty(atypes, i, "is_Shape", i_is_Shape) |
216 |
|
|
217 |
< |
end subroutine setRlistDF |
217 |
> |
do j = i, nAtypes |
218 |
> |
|
219 |
> |
iHash = 0 |
220 |
> |
myRcut = 0.0_dp |
221 |
> |
|
222 |
> |
call getElementProperty(atypes, j, "is_LennardJones", j_is_LJ) |
223 |
> |
call getElementProperty(atypes, j, "is_Electrostatic", j_is_Elect) |
224 |
> |
call getElementProperty(atypes, j, "is_Sticky", j_is_Sticky) |
225 |
> |
call getElementProperty(atypes, j, "is_StickyPower", j_is_StickyP) |
226 |
> |
call getElementProperty(atypes, j, "is_GayBerne", j_is_GB) |
227 |
> |
call getElementProperty(atypes, j, "is_EAM", j_is_EAM) |
228 |
> |
call getElementProperty(atypes, j, "is_Shape", j_is_Shape) |
229 |
> |
|
230 |
> |
if (i_is_LJ .and. j_is_LJ) then |
231 |
> |
iHash = ior(iHash, LJ_PAIR) |
232 |
> |
|
233 |
> |
|
234 |
> |
|
235 |
> |
endif |
236 |
> |
|
237 |
> |
|
238 |
> |
|
239 |
> |
if (i_is_Elect .and. j_is_Elect) iHash = ior(iHash, ELECTROSTATIC_PAIR) |
240 |
> |
if (i_is_Sticky .and. j_is_Sticky) iHash = ior(iHash, STICKY_PAIR) |
241 |
> |
if (i_is_StickyP .and. j_is_StickyP) iHash = ior(iHash, STICKYPOWER_PAIR) |
242 |
> |
|
243 |
> |
if (i_is_EAM .and. j_is_EAM) iHash = ior(iHash, EAM_PAIR) |
244 |
> |
|
245 |
> |
if (i_is_GB .and. j_is_GB) iHash = ior(iHash, GAYBERNE_PAIR) |
246 |
> |
if (i_is_GB .and. j_is_LJ) iHash = ior(iHash, GAYBERNE_LJ) |
247 |
> |
if (i_is_LJ .and. j_is_GB) iHash = ior(iHash, GAYBERNE_LJ) |
248 |
> |
|
249 |
> |
if (i_is_Shape .and. j_is_Shape) iHash = ior(iHash, SHAPE_PAIR) |
250 |
> |
if (i_is_Shape .and. j_is_LJ) iHash = ior(iHash, SHAPE_LJ) |
251 |
> |
if (i_is_LJ .and. j_is_Shape) iHash = ior(iHash, SHAPE_LJ) |
252 |
> |
|
253 |
> |
|
254 |
> |
InteractionMap(i,j)%InteractionHash = iHash |
255 |
> |
InteractionMap(j,i)%InteractionHash = iHash |
256 |
> |
|
257 |
> |
end do |
258 |
> |
|
259 |
> |
end do |
260 |
> |
end subroutine createInteractionMap |
261 |
|
|
262 |
+ |
|
263 |
+ |
|
264 |
+ |
!!! THIS GOES AWAY FOR SIZE DEPENDENT CUTOFF |
265 |
+ |
!!$ subroutine setRlistDF( this_rlist ) |
266 |
+ |
!!$ |
267 |
+ |
!!$ real(kind=dp) :: this_rlist |
268 |
+ |
!!$ |
269 |
+ |
!!$ rlist = this_rlist |
270 |
+ |
!!$ rlistsq = rlist * rlist |
271 |
+ |
!!$ |
272 |
+ |
!!$ haveRlist = .true. |
273 |
+ |
!!$ |
274 |
+ |
!!$ end subroutine setRlistDF |
275 |
+ |
|
276 |
|
subroutine createPropertyMap(status) |
277 |
|
integer :: nAtypes |
278 |
|
integer :: status |