ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/UseTheForce/doForces.F90
(Generate patch)

Comparing trunk/OOPSE-2.0/src/UseTheForce/doForces.F90 (file contents):
Revision 2260 by chuckv, Mon Jun 27 22:21:37 2005 UTC vs.
Revision 2261 by gezelter, Tue Jun 28 13:58:45 2005 UTC

# Line 45 | Line 45
45  
46   !! @author Charles F. Vardeman II
47   !! @author Matthew Meineke
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 $
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
# Line 81 | Line 81 | module doForces
81    logical, save :: haveRlist = .false.
82    logical, save :: haveNeighborList = .false.
83    logical, save :: haveSIMvariables = .false.
84  logical, save :: havePropertyMap = .false.
84    logical, save :: haveSaneForceField = .false.
85  
86    logical, save :: FF_uses_DirectionalAtoms
# Line 130 | Line 129 | module doForces
129    integer :: nLoops
130   #endif
131  
133  type :: Properties
134     logical :: is_Directional   = .false.
135     logical :: is_LennardJones  = .false.
136     logical :: is_Electrostatic = .false.
137     logical :: is_Charge        = .false.
138     logical :: is_Dipole        = .false.
139     logical :: is_Quadrupole    = .false.
140     logical :: is_Sticky        = .false.
141     logical :: is_StickyPower   = .false.
142     logical :: is_GayBerne      = .false.
143     logical :: is_EAM           = .false.
144     logical :: is_Shape         = .false.
145     logical :: is_FLARB         = .false.
146  end type Properties
147
148  type(Properties), dimension(:),allocatable :: PropertyMap
149
150
151  
132    type, public :: Interaction
133       integer :: InteractionHash
134       real(kind=dp) :: rCut
135    end type Interaction
136    
137 <  type(Interaction), public, dimension(:,:), allocatable :: InteractionMap
137 >  type(Interaction), dimension(:,:),allocatable :: InteractionMap
138    
139    !public :: addInteraction
140    !public :: setInteractionHash
141    !public :: getInteractionHash
142    public :: createInteractionMap
143 <
143 >  
144   contains
145  
146  
# Line 228 | Line 208 | contains
208            call getElementProperty(atypes, j, "is_Shape", j_is_Shape)
209  
210            if (i_is_LJ .and. j_is_LJ) then
211 <             iHash = ior(iHash, LJ_PAIR)
232 <            
233 <
234 <
211 >             iHash = ior(iHash, LJ_PAIR)            
212            endif
213 <
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 +          if (i_is_StickyP .and. j_is_StickyP) then
223 +             iHash = ior(iHash, STICKYPOWER_PAIR)
224 +          endif
225  
226 <          if (i_is_Elect .and. j_is_Elect) iHash = ior(iHash, ELECTROSTATIC_PAIR)
227 <          if (i_is_Sticky .and. j_is_Sticky) iHash = ior(iHash, STICKY_PAIR)
228 <          if (i_is_StickyP .and. j_is_StickyP) iHash = ior(iHash, STICKYPOWER_PAIR)
226 >          if (i_is_EAM .and. j_is_EAM) then
227 >             iHash = ior(iHash, EAM_PAIR)
228 >          endif
229  
243          if (i_is_EAM .and. j_is_EAM) iHash = ior(iHash, EAM_PAIR)
244
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)
# Line 273 | Line 258 | contains
258   !!$
259   !!$  end subroutine setRlistDF
260  
276  subroutine createPropertyMap(status)
277    integer :: nAtypes
278    integer :: status
279    integer :: i
280    logical :: thisProperty
281    real (kind=DP) :: thisDPproperty
261  
283    status = 0
284
285    nAtypes = getSize(atypes)
286
287    if (nAtypes == 0) then
288       status = -1
289       return
290    end if
291
292    if (.not. allocated(PropertyMap)) then
293       allocate(PropertyMap(nAtypes))
294    endif
295
296    do i = 1, nAtypes
297       call getElementProperty(atypes, i, "is_Directional", thisProperty)
298       PropertyMap(i)%is_Directional = thisProperty
299
300       call getElementProperty(atypes, i, "is_LennardJones", thisProperty)
301       PropertyMap(i)%is_LennardJones = thisProperty
302
303       call getElementProperty(atypes, i, "is_Electrostatic", thisProperty)
304       PropertyMap(i)%is_Electrostatic = thisProperty
305
306       call getElementProperty(atypes, i, "is_Charge", thisProperty)
307       PropertyMap(i)%is_Charge = thisProperty
308
309       call getElementProperty(atypes, i, "is_Dipole", thisProperty)
310       PropertyMap(i)%is_Dipole = thisProperty
311
312       call getElementProperty(atypes, i, "is_Quadrupole", thisProperty)
313       PropertyMap(i)%is_Quadrupole = thisProperty
314
315       call getElementProperty(atypes, i, "is_Sticky", thisProperty)
316       PropertyMap(i)%is_Sticky = thisProperty
317      
318       call getElementProperty(atypes, i, "is_StickyPower", thisProperty)
319       PropertyMap(i)%is_StickyPower = thisProperty
320
321       call getElementProperty(atypes, i, "is_GayBerne", thisProperty)
322       PropertyMap(i)%is_GayBerne = thisProperty
323
324       call getElementProperty(atypes, i, "is_EAM", thisProperty)
325       PropertyMap(i)%is_EAM = thisProperty
326
327       call getElementProperty(atypes, i, "is_Shape", thisProperty)
328       PropertyMap(i)%is_Shape = thisProperty
329
330       call getElementProperty(atypes, i, "is_FLARB", thisProperty)
331       PropertyMap(i)%is_FLARB = thisProperty
332    end do
333
334    havePropertyMap = .true.
335
336  end subroutine createPropertyMap
337
262    subroutine setSimVariables()
263      SIM_uses_DirectionalAtoms = SimUsesDirectionalAtoms()
264      SIM_uses_LennardJones = SimUsesLennardJones()
# Line 364 | Line 288 | contains
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
# Line 973 | Line 897 | contains
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  
# Line 1065 | Line 990 | contains
990         call doElectrostaticPair(i, j, d, r, rijsq, sw, vpair, fpair, &
991              pot, eFrame, f, t, do_pot)
992  
993 <       if (FF_uses_dipoles .and. SIM_uses_dipoles) then                
994 <          if ( PropertyMap(me_i)%is_Dipole .and. &
995 <               PropertyMap(me_j)%is_Dipole) then
996 <             if (FF_uses_RF .and. SIM_uses_RF) then
997 <                call accumulate_rf(i, j, r, eFrame, sw)
1073 <                call rf_correct_forces(i, j, d, r, eFrame, sw, f, fpair)
1074 <             endif
1075 <          endif
993 >       if (FF_uses_RF .and. SIM_uses_RF) then
994 >
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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines