45 |
|
|
46 |
|
!! @author Charles F. Vardeman II |
47 |
|
!! @author Matthew Meineke |
48 |
< |
!! @version $Id: doForces.F90,v 1.13 2005-04-15 22:03:37 gezelter Exp $, $Date: 2005-04-15 22:03:37 $, $Name: not supported by cvs2svn $, $Revision: 1.13 $ |
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 $ |
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 |
90 |
|
logical, save :: FF_uses_Charges |
91 |
|
logical, save :: FF_uses_Dipoles |
92 |
|
logical, save :: FF_uses_Quadrupoles |
93 |
< |
logical, save :: FF_uses_sticky |
93 |
> |
logical, save :: FF_uses_Sticky |
94 |
> |
logical, save :: FF_uses_StickyPower |
95 |
|
logical, save :: FF_uses_GayBerne |
96 |
|
logical, save :: FF_uses_EAM |
97 |
|
logical, save :: FF_uses_Shapes |
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 |
110 |
|
logical, save :: SIM_uses_EAM |
111 |
|
logical, save :: SIM_uses_Shapes |
137 |
|
logical :: is_Dipole = .false. |
138 |
|
logical :: is_Quadrupole = .false. |
139 |
|
logical :: is_Sticky = .false. |
140 |
+ |
logical :: is_StickyPower = .false. |
141 |
|
logical :: is_GayBerne = .false. |
142 |
|
logical :: is_EAM = .false. |
143 |
|
logical :: is_Shape = .false. |
200 |
|
|
201 |
|
call getElementProperty(atypes, i, "is_Sticky", thisProperty) |
202 |
|
PropertyMap(i)%is_Sticky = thisProperty |
203 |
+ |
|
204 |
+ |
call getElementProperty(atypes, i, "is_StickyPower", thisProperty) |
205 |
+ |
PropertyMap(i)%is_StickyPower = thisProperty |
206 |
|
|
207 |
|
call getElementProperty(atypes, i, "is_GayBerne", thisProperty) |
208 |
|
PropertyMap(i)%is_GayBerne = thisProperty |
228 |
|
SIM_uses_Charges = SimUsesCharges() |
229 |
|
SIM_uses_Dipoles = SimUsesDipoles() |
230 |
|
SIM_uses_Sticky = SimUsesSticky() |
231 |
+ |
SIM_uses_StickyPower = SimUsesStickyPower() |
232 |
|
SIM_uses_GayBerne = SimUsesGayBerne() |
233 |
|
SIM_uses_EAM = SimUsesEAM() |
234 |
|
SIM_uses_Shapes = SimUsesShapes() |
323 |
|
FF_uses_Charges = .false. |
324 |
|
FF_uses_Dipoles = .false. |
325 |
|
FF_uses_Sticky = .false. |
326 |
+ |
FF_uses_StickyPower = .false. |
327 |
|
FF_uses_GayBerne = .false. |
328 |
|
FF_uses_EAM = .false. |
329 |
|
FF_uses_Shapes = .false. |
373 |
|
FF_uses_DirectionalAtoms = .true. |
374 |
|
endif |
375 |
|
|
376 |
+ |
call getMatchingElementList(atypes, "is_StickyPower", .true., nMatches, & |
377 |
+ |
MatchList) |
378 |
+ |
if (nMatches .gt. 0) then |
379 |
+ |
FF_uses_StickyPower = .true. |
380 |
+ |
FF_uses_DirectionalAtoms = .true. |
381 |
+ |
endif |
382 |
+ |
|
383 |
|
call getMatchingElementList(atypes, "is_GayBerne", .true., & |
384 |
|
nMatches, MatchList) |
385 |
|
if (nMatches .gt. 0) then |
924 |
|
real ( kind = dp ), intent(inout) :: rijsq |
925 |
|
real ( kind = dp ) :: r |
926 |
|
real ( kind = dp ), intent(inout) :: d(3) |
927 |
+ |
real ( kind = dp ) :: ebalance |
928 |
|
integer :: me_i, me_j |
929 |
+ |
|
930 |
+ |
integer :: iMap |
931 |
|
|
932 |
|
r = sqrt(rijsq) |
933 |
|
vpair = 0.0d0 |
941 |
|
me_j = atid(j) |
942 |
|
#endif |
943 |
|
|
944 |
< |
! write(*,*) i, j, me_i, me_j |
926 |
< |
|
927 |
< |
if (FF_uses_LennardJones .and. SIM_uses_LennardJones) then |
944 |
> |
iMap = InteractionMap(me_i, me_j)%InteractionHash |
945 |
|
|
946 |
< |
if ( PropertyMap(me_i)%is_LennardJones .and. & |
947 |
< |
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 |
< |
|
946 |
> |
if ( iand(iMap, LJ_PAIR).ne.0 ) then |
947 |
> |
call do_lj_pair(i, j, d, r, rijsq, sw, vpair, fpair, pot, f, do_pot) |
948 |
|
endif |
949 |
|
|
950 |
< |
if (FF_uses_Electrostatics .and. SIM_uses_Electrostatics) then |
950 |
> |
if ( iand(iMap, ELECTROSTATIC_PAIR).ne.0 ) then |
951 |
> |
call doElectrostaticPair(i, j, d, r, rijsq, sw, vpair, fpair, & |
952 |
> |
pot, eFrame, f, t, do_pot) |
953 |
|
|
954 |
< |
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 |
943 |
< |
|
944 |
< |
if (FF_uses_dipoles .and. SIM_uses_dipoles) then |
954 |
> |
if (FF_uses_dipoles .and. SIM_uses_dipoles) then |
955 |
|
if ( PropertyMap(me_i)%is_Dipole .and. & |
956 |
|
PropertyMap(me_j)%is_Dipole) then |
957 |
|
if (FF_uses_RF .and. SIM_uses_RF) then |
962 |
|
endif |
963 |
|
endif |
964 |
|
|
965 |
+ |
if ( iand(iMap, STICKY_PAIR).ne.0 ) then |
966 |
+ |
call do_sticky_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
967 |
+ |
pot, A, f, t, do_pot) |
968 |
+ |
endif |
969 |
|
|
970 |
< |
if (FF_uses_Sticky .and. SIM_uses_sticky) then |
971 |
< |
|
972 |
< |
if ( PropertyMap(me_i)%is_Sticky .and. PropertyMap(me_j)%is_Sticky) then |
959 |
< |
call do_sticky_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
960 |
< |
pot, A, f, t, do_pot) |
961 |
< |
endif |
962 |
< |
|
970 |
> |
if ( iand(iMap, STICKYPOWER_PAIR).ne.0 ) then |
971 |
> |
call do_sticky_power_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
972 |
> |
pot, A, f, t, do_pot) |
973 |
|
endif |
974 |
|
|
975 |
< |
|
976 |
< |
if (FF_uses_GayBerne .and. SIM_uses_GayBerne) then |
977 |
< |
|
978 |
< |
if ( PropertyMap(me_i)%is_GayBerne .and. & |
979 |
< |
PropertyMap(me_j)%is_GayBerne) then |
980 |
< |
call do_gb_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
981 |
< |
pot, A, f, t, do_pot) |
982 |
< |
endif |
973 |
< |
|
975 |
> |
if ( iand(iMap, GAYBERNE_PAIR).ne.0 ) then |
976 |
> |
call do_gb_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
977 |
> |
pot, A, f, t, do_pot) |
978 |
> |
endif |
979 |
> |
|
980 |
> |
if ( iand(iMap, GAYBERNE_LJ).ne.0 ) then |
981 |
> |
call do_gblj_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
982 |
> |
pot, A, f, t, do_pot) |
983 |
|
endif |
984 |
|
|
985 |
< |
if (FF_uses_EAM .and. SIM_uses_EAM) then |
986 |
< |
|
987 |
< |
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 |
< |
|
985 |
> |
if ( iand(iMap, EAM_PAIR).ne.0 ) then |
986 |
> |
call do_eam_pair(i, j, d, r, rijsq, sw, vpair, fpair, pot, f, & |
987 |
> |
do_pot) |
988 |
|
endif |
989 |
|
|
990 |
< |
|
991 |
< |
! write(*,*) PropertyMap(me_i)%is_Shape,PropertyMap(me_j)%is_Shape |
992 |
< |
|
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 |
< |
|
990 |
> |
if ( iand(iMap, SHAPE_PAIR).ne.0 ) then |
991 |
> |
call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
992 |
> |
pot, A, f, t, do_pot) |
993 |
|
endif |
994 |
|
|
995 |
+ |
if ( iand(iMap, SHAPE_LJ).ne.0 ) then |
996 |
+ |
call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
997 |
+ |
pot, A, f, t, do_pot) |
998 |
+ |
endif |
999 |
+ |
|
1000 |
|
end subroutine do_pair |
1001 |
|
|
1002 |
|
subroutine do_prepair(i, j, rijsq, d, sw, rcijsq, dc, & |
1014 |
|
real ( kind = dp ) :: r, rc |
1015 |
|
real ( kind = dp ), intent(inout) :: d(3), dc(3) |
1016 |
|
|
1017 |
< |
logical :: is_EAM_i, is_EAM_j |
1015 |
< |
|
1016 |
< |
integer :: me_i, me_j |
1017 |
< |
|
1018 |
< |
|
1019 |
< |
r = sqrt(rijsq) |
1020 |
< |
if (SIM_uses_molecular_cutoffs) then |
1021 |
< |
rc = sqrt(rcijsq) |
1022 |
< |
else |
1023 |
< |
rc = r |
1024 |
< |
endif |
1025 |
< |
|
1017 |
> |
integer :: me_i, me_j, iMap |
1018 |
|
|
1019 |
|
#ifdef IS_MPI |
1020 |
|
me_i = atid_row(i) |
1024 |
|
me_j = atid(j) |
1025 |
|
#endif |
1026 |
|
|
1027 |
< |
if (FF_uses_EAM .and. SIM_uses_EAM) then |
1036 |
< |
|
1037 |
< |
if (PropertyMap(me_i)%is_EAM .and. PropertyMap(me_j)%is_EAM) & |
1038 |
< |
call calc_EAM_prepair_rho(i, j, d, r, rijsq ) |
1027 |
> |
iMap = InteractionMap(me_i, me_j)%InteractionHash |
1028 |
|
|
1029 |
+ |
if ( iand(iMap, EAM_PAIR).ne.0 ) then |
1030 |
+ |
call calc_EAM_prepair_rho(i, j, d, r, rijsq ) |
1031 |
|
endif |
1032 |
< |
|
1032 |
> |
|
1033 |
|
end subroutine do_prepair |
1034 |
|
|
1035 |
|
|
1225 |
|
logical :: doesit |
1226 |
|
doesit = FF_uses_DirectionalAtoms .or. FF_uses_Dipoles .or. & |
1227 |
|
FF_uses_Quadrupoles .or. FF_uses_Sticky .or. & |
1228 |
< |
FF_uses_GayBerne .or. FF_uses_Shapes |
1228 |
> |
FF_uses_StickyPower .or. FF_uses_GayBerne .or. FF_uses_Shapes |
1229 |
|
end function FF_UsesDirectionalAtoms |
1230 |
|
|
1231 |
|
function FF_RequiresPrepairCalc() result(doesit) |