45 |
|
|
46 |
|
!! @author Charles F. Vardeman II |
47 |
|
!! @author Matthew Meineke |
48 |
< |
!! @version $Id: doForces.F90,v 1.17 2005-05-17 22:35:01 chrisfen Exp $, $Date: 2005-05-17 22:35:01 $, $Name: not supported by cvs2svn $, $Revision: 1.17 $ |
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 |
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 |
934 |
|
fpair(1:3) = 0.0d0 |
941 |
|
me_j = atid(j) |
942 |
|
#endif |
943 |
|
|
944 |
< |
! write(*,*) i, j, me_i, me_j |
941 |
< |
|
942 |
< |
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 |
946 |
< |
call do_lj_pair(i, j, d, r, rijsq, sw, vpair, fpair, pot, f, do_pot) |
947 |
< |
endif |
948 |
< |
|
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. & |
954 |
< |
PropertyMap(me_j)%is_Electrostatic) then |
955 |
< |
call doElectrostaticPair(i, j, d, r, rijsq, sw, vpair, fpair, & |
956 |
< |
pot, eFrame, f, t, do_pot) |
957 |
< |
endif |
958 |
< |
|
959 |
< |
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 |
< |
|
966 |
< |
if (FF_uses_Sticky .and. SIM_uses_sticky) then |
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 ( PropertyMap(me_i)%is_Sticky .and. PropertyMap(me_j)%is_Sticky) then |
971 |
< |
call do_sticky_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
972 |
< |
pot, A, f, t, do_pot) |
976 |
< |
endif |
977 |
< |
|
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 |
< |
if (FF_uses_StickyPower .and. SIM_uses_stickypower) then |
976 |
< |
if ( PropertyMap(me_i)%is_StickyPower .and. & |
977 |
< |
PropertyMap(me_j)%is_StickyPower) then |
983 |
< |
call do_sticky_power_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
984 |
< |
pot, A, f, t, do_pot) |
985 |
< |
endif |
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 (FF_uses_GayBerne .and. SIM_uses_GayBerne) then |
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 ( PropertyMap(me_i)%is_GayBerne .and. & |
986 |
< |
PropertyMap(me_j)%is_GayBerne) then |
987 |
< |
call do_gb_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
993 |
< |
pot, A, f, t, do_pot) |
994 |
< |
endif |
995 |
< |
|
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 |
< |
if (FF_uses_EAM .and. SIM_uses_EAM) then |
991 |
< |
|
992 |
< |
if ( PropertyMap(me_i)%is_EAM .and. PropertyMap(me_j)%is_EAM) then |
1001 |
< |
call do_eam_pair(i, j, d, r, rijsq, sw, vpair, fpair, pot, f, & |
1002 |
< |
do_pot) |
1003 |
< |
endif |
1004 |
< |
|
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 |
< |
|
996 |
< |
! write(*,*) PropertyMap(me_i)%is_Shape,PropertyMap(me_j)%is_Shape |
997 |
< |
|
1010 |
< |
if (FF_uses_Shapes .and. SIM_uses_Shapes) then |
1011 |
< |
if ( PropertyMap(me_i)%is_Shape .and. & |
1012 |
< |
PropertyMap(me_j)%is_Shape ) then |
1013 |
< |
call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1014 |
< |
pot, A, f, t, do_pot) |
1015 |
< |
endif |
1016 |
< |
if ( (PropertyMap(me_i)%is_Shape .and. & |
1017 |
< |
PropertyMap(me_j)%is_LennardJones) .or. & |
1018 |
< |
(PropertyMap(me_i)%is_LennardJones .and. & |
1019 |
< |
PropertyMap(me_j)%is_Shape) ) then |
1020 |
< |
call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1021 |
< |
pot, A, f, t, do_pot) |
1022 |
< |
endif |
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 |
< |
|
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 |
1043 |
< |
|
1044 |
< |
integer :: me_i, me_j |
1045 |
< |
|
1046 |
< |
|
1047 |
< |
r = sqrt(rijsq) |
1048 |
< |
if (SIM_uses_molecular_cutoffs) then |
1049 |
< |
rc = sqrt(rcijsq) |
1050 |
< |
else |
1051 |
< |
rc = r |
1052 |
< |
endif |
1053 |
< |
|
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 |
1064 |
< |
|
1065 |
< |
if (PropertyMap(me_i)%is_EAM .and. PropertyMap(me_j)%is_EAM) & |
1066 |
< |
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 |
|
|