45 |
|
|
46 |
|
!! @author Charles F. Vardeman II |
47 |
|
!! @author Matthew Meineke |
48 |
< |
!! @version $Id: doForces.F90,v 1.18 2005-05-18 18:31:40 chrisfen Exp $, $Date: 2005-05-18 18:31:40 $, $Name: not supported by cvs2svn $, $Revision: 1.18 $ |
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 |
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 |
944 |
> |
iMap = InteractionMap(me_i, me_j)%InteractionHash |
945 |
|
|
946 |
< |
if (FF_uses_LennardJones .and. SIM_uses_LennardJones) then |
947 |
< |
|
945 |
< |
if ( PropertyMap(me_i)%is_LennardJones .and. & |
946 |
< |
PropertyMap(me_j)%is_LennardJones ) then |
947 |
< |
call do_lj_pair(i, j, d, r, rijsq, sw, vpair, fpair, pot, f, do_pot) |
948 |
< |
endif |
949 |
< |
|
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. & |
955 |
< |
PropertyMap(me_j)%is_Electrostatic) then |
956 |
< |
call doElectrostaticPair(i, j, d, r, rijsq, sw, vpair, fpair, & |
957 |
< |
pot, eFrame, f, t, do_pot, ebalance) |
958 |
< |
endif |
959 |
< |
|
960 |
< |
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) |
977 |
< |
endif |
978 |
< |
|
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 |
984 |
< |
call do_sticky_power_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
985 |
< |
pot, A, f, t, do_pot, ebalance) |
986 |
< |
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 |
981 |
< |
|
982 |
< |
if ( PropertyMap(me_i)%is_GayBerne .and. & |
983 |
< |
PropertyMap(me_j)%is_GayBerne) then |
993 |
< |
call do_gb_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
994 |
< |
pot, A, f, t, do_pot) |
995 |
< |
endif |
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 ( 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 |
1002 |
< |
call do_eam_pair(i, j, d, r, rijsq, sw, vpair, fpair, pot, f, & |
1003 |
< |
do_pot) |
1004 |
< |
endif |
1005 |
< |
|
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 |
< |
|
1011 |
< |
if (FF_uses_Shapes .and. SIM_uses_Shapes) then |
1012 |
< |
if ( PropertyMap(me_i)%is_Shape .and. & |
1013 |
< |
PropertyMap(me_j)%is_Shape ) then |
1014 |
< |
call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1015 |
< |
pot, A, f, t, do_pot) |
1016 |
< |
endif |
1017 |
< |
if ( (PropertyMap(me_i)%is_Shape .and. & |
1018 |
< |
PropertyMap(me_j)%is_LennardJones) .or. & |
1019 |
< |
(PropertyMap(me_i)%is_LennardJones .and. & |
1020 |
< |
PropertyMap(me_j)%is_Shape) ) then |
1021 |
< |
call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1022 |
< |
pot, A, f, t, do_pot) |
1023 |
< |
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 |
1044 |
< |
|
1045 |
< |
integer :: me_i, me_j |
1046 |
< |
|
1047 |
< |
|
1048 |
< |
r = sqrt(rijsq) |
1049 |
< |
if (SIM_uses_molecular_cutoffs) then |
1050 |
< |
rc = sqrt(rcijsq) |
1051 |
< |
else |
1052 |
< |
rc = r |
1053 |
< |
endif |
1054 |
< |
|
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 |
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 ) |
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 |
|
|