4 |
|
|
5 |
|
!! @author Charles F. Vardeman II |
6 |
|
!! @author Matthew Meineke |
7 |
< |
!! @version $Id: do_Forces.F90,v 1.45 2004-01-06 18:54:57 chuckv Exp $, $Date: 2004-01-06 18:54:57 $, $Name: not supported by cvs2svn $, $Revision: 1.45 $ |
7 |
> |
!! @version $Id: do_Forces.F90,v 1.49 2004-04-15 16:18:26 tim Exp $, $Date: 2004-04-15 16:18:26 $, $Name: not supported by cvs2svn $, $Revision: 1.49 $ |
8 |
|
|
9 |
|
module do_Forces |
10 |
|
use force_globals |
15 |
|
use lj |
16 |
|
use sticky_pair |
17 |
|
use dipole_dipole |
18 |
+ |
use charge_charge |
19 |
|
use reaction_field |
20 |
|
use gb_pair |
21 |
|
use vector_class |
39 |
|
logical, save :: haveSaneForceField = .false. |
40 |
|
logical, save :: FF_uses_LJ |
41 |
|
logical, save :: FF_uses_sticky |
42 |
+ |
logical, save :: FF_uses_charges |
43 |
|
logical, save :: FF_uses_dipoles |
44 |
|
logical, save :: FF_uses_RF |
45 |
|
logical, save :: FF_uses_GB |
46 |
|
logical, save :: FF_uses_EAM |
47 |
|
logical, save :: SIM_uses_LJ |
48 |
|
logical, save :: SIM_uses_sticky |
49 |
+ |
logical, save :: SIM_uses_charges |
50 |
|
logical, save :: SIM_uses_dipoles |
51 |
|
logical, save :: SIM_uses_RF |
52 |
|
logical, save :: SIM_uses_GB |
76 |
|
logical :: is_dp = .false. |
77 |
|
logical :: is_gb = .false. |
78 |
|
logical :: is_eam = .false. |
79 |
+ |
logical :: is_charge = .false. |
80 |
+ |
real(kind=DP) :: charge = 0.0_DP |
81 |
|
real(kind=DP) :: dipole_moment = 0.0_DP |
82 |
|
end type Properties |
83 |
|
|
119 |
|
do i = 1, nAtypes |
120 |
|
call getElementProperty(atypes, i, "is_LJ", thisProperty) |
121 |
|
PropertyMap(i)%is_LJ = thisProperty |
122 |
+ |
|
123 |
+ |
call getElementProperty(atypes, i, "is_Charge", thisProperty) |
124 |
+ |
PropertyMap(i)%is_Charge = thisProperty |
125 |
+ |
|
126 |
+ |
if (thisProperty) then |
127 |
+ |
call getElementProperty(atypes, i, "charge", thisDPproperty) |
128 |
+ |
PropertyMap(i)%charge = thisDPproperty |
129 |
+ |
endif |
130 |
+ |
|
131 |
|
call getElementProperty(atypes, i, "is_DP", thisProperty) |
132 |
|
PropertyMap(i)%is_DP = thisProperty |
133 |
|
|
151 |
|
subroutine setSimVariables() |
152 |
|
SIM_uses_LJ = SimUsesLJ() |
153 |
|
SIM_uses_sticky = SimUsesSticky() |
154 |
+ |
SIM_uses_charges = SimUsesCharges() |
155 |
|
SIM_uses_dipoles = SimUsesDipoles() |
156 |
|
SIM_uses_RF = SimUsesRF() |
157 |
|
SIM_uses_GB = SimUsesGB() |
251 |
|
|
252 |
|
FF_uses_LJ = .false. |
253 |
|
FF_uses_sticky = .false. |
254 |
+ |
FF_uses_charges = .false. |
255 |
|
FF_uses_dipoles = .false. |
256 |
|
FF_uses_GB = .false. |
257 |
|
FF_uses_EAM = .false. |
258 |
|
|
259 |
|
call getMatchingElementList(atypes, "is_LJ", .true., nMatches, MatchList) |
260 |
|
if (nMatches .gt. 0) FF_uses_LJ = .true. |
261 |
< |
|
261 |
> |
|
262 |
> |
call getMatchingElementList(atypes, "is_Charge", .true., nMatches, MatchList) |
263 |
> |
if (nMatches .gt. 0) FF_uses_charges = .true. |
264 |
> |
|
265 |
|
call getMatchingElementList(atypes, "is_DP", .true., nMatches, MatchList) |
266 |
|
if (nMatches .gt. 0) FF_uses_dipoles = .true. |
267 |
|
|
805 |
|
if (FF_RequiresPostpairCalc() .and. SIM_requires_postpair_calc) then |
806 |
|
|
807 |
|
if (FF_uses_RF .and. SIM_uses_RF) then |
808 |
< |
|
808 |
> |
|
809 |
|
#ifdef IS_MPI |
810 |
|
call scatter(rf_Row,rf,plan_row3d) |
811 |
|
call scatter(rf_Col,rf_Temp,plan_col3d) |
886 |
|
real ( kind = dp ), intent(inout) :: rijsq |
887 |
|
real ( kind = dp ) :: r |
888 |
|
real ( kind = dp ), intent(inout) :: d(3) |
870 |
– |
logical :: is_LJ_i, is_LJ_j |
871 |
– |
logical :: is_DP_i, is_DP_j |
872 |
– |
logical :: is_GB_i, is_GB_j |
873 |
– |
logical :: is_EAM_i,is_EAM_j |
874 |
– |
logical :: is_Sticky_i, is_Sticky_j |
889 |
|
integer :: me_i, me_j |
890 |
< |
integer :: propPack_i |
877 |
< |
integer :: propPack_j |
890 |
> |
|
891 |
|
r = sqrt(rijsq) |
892 |
|
|
893 |
|
#ifdef IS_MPI |
894 |
|
if (tagRow(i) .eq. tagColumn(j)) then |
895 |
|
write(0,*) 'do_pair is doing', i , j, tagRow(i), tagColumn(j) |
896 |
|
endif |
884 |
– |
|
897 |
|
me_i = atid_row(i) |
898 |
|
me_j = atid_col(j) |
887 |
– |
|
899 |
|
#else |
889 |
– |
|
900 |
|
me_i = atid(i) |
901 |
|
me_j = atid(j) |
892 |
– |
|
902 |
|
#endif |
903 |
|
|
904 |
|
if (FF_uses_LJ .and. SIM_uses_LJ) then |
905 |
< |
|
906 |
< |
if ( PropertyMap(me_i)%is_LJ .and. PropertyMap(me_j)%is_LJ ) & |
907 |
< |
call do_lj_pair(i, j, d, r, rijsq, pot, f, do_pot, do_stress) |
908 |
< |
|
905 |
> |
|
906 |
> |
if ( PropertyMap(me_i)%is_LJ .and. PropertyMap(me_j)%is_LJ ) then |
907 |
> |
call do_lj_pair(i, j, d, r, rijsq, pot, f, do_pot, do_stress) |
908 |
> |
endif |
909 |
> |
|
910 |
|
endif |
911 |
< |
|
911 |
> |
|
912 |
> |
if (FF_uses_charges .and. SIM_uses_charges) then |
913 |
> |
|
914 |
> |
if (PropertyMap(me_i)%is_Charge .and. PropertyMap(me_j)%is_Charge) then |
915 |
> |
call do_charge_pair(i, j, d, r, rijsq, pot, f, do_pot, do_stress) |
916 |
> |
endif |
917 |
> |
|
918 |
> |
endif |
919 |
> |
|
920 |
|
if (FF_uses_dipoles .and. SIM_uses_dipoles) then |
921 |
|
|
922 |
|
if ( PropertyMap(me_i)%is_DP .and. PropertyMap(me_j)%is_DP) then |
925 |
|
if (FF_uses_RF .and. SIM_uses_RF) then |
926 |
|
call accumulate_rf(i, j, r, u_l) |
927 |
|
call rf_correct_forces(i, j, d, r, u_l, f, do_stress) |
928 |
< |
endif |
911 |
< |
|
928 |
> |
endif |
929 |
|
endif |
930 |
+ |
|
931 |
|
endif |
932 |
|
|
933 |
|
if (FF_uses_Sticky .and. SIM_uses_sticky) then |
936 |
|
call do_sticky_pair(i, j, d, r, rijsq, A, pot, f, t, & |
937 |
|
do_pot, do_stress) |
938 |
|
endif |
939 |
+ |
|
940 |
|
endif |
941 |
|
|
942 |
|
|
948 |
|
endif |
949 |
|
|
950 |
|
endif |
951 |
< |
|
952 |
< |
|
953 |
< |
|
954 |
< |
if (FF_uses_EAM .and. SIM_uses_EAM) then |
955 |
< |
|
956 |
< |
if ( PropertyMap(me_i)%is_EAM .and. PropertyMap(me_j)%is_EAM) then |
957 |
< |
call do_eam_pair(i, j, d, r, rijsq, pot, f, do_pot, do_stress) |
958 |
< |
endif |
940 |
< |
|
941 |
< |
endif |
951 |
> |
|
952 |
> |
if (FF_uses_EAM .and. SIM_uses_EAM) then |
953 |
> |
|
954 |
> |
if ( PropertyMap(me_i)%is_EAM .and. PropertyMap(me_j)%is_EAM) then |
955 |
> |
call do_eam_pair(i, j, d, r, rijsq, pot, f, do_pot, do_stress) |
956 |
> |
endif |
957 |
> |
|
958 |
> |
endif |
959 |
|
|
960 |
|
end subroutine do_pair |
961 |
|
|