45 |
|
|
46 |
|
!! @author Charles F. Vardeman II |
47 |
|
!! @author Matthew Meineke |
48 |
< |
!! @version $Id: doForces.F90,v 1.66 2005-11-02 20:35:34 chrisfen Exp $, $Date: 2005-11-02 20:35:34 $, $Name: not supported by cvs2svn $, $Revision: 1.66 $ |
48 |
> |
!! @version $Id: doForces.F90,v 1.68 2005-11-15 16:01:06 chuckv Exp $, $Date: 2005-11-15 16:01:06 $, $Name: not supported by cvs2svn $, $Revision: 1.68 $ |
49 |
|
|
50 |
|
|
51 |
|
module doForces |
62 |
|
use shapes |
63 |
|
use vector_class |
64 |
|
use eam |
65 |
+ |
use suttonchen |
66 |
|
use status |
67 |
|
#ifdef IS_MPI |
68 |
|
use mpiSimulation |
93 |
|
logical, save :: FF_uses_Dipoles |
94 |
|
logical, save :: FF_uses_GayBerne |
95 |
|
logical, save :: FF_uses_EAM |
96 |
+ |
logical, save :: FF_uses_SC |
97 |
+ |
logical, save :: FF_uses_MEAM |
98 |
+ |
|
99 |
|
|
100 |
|
logical, save :: SIM_uses_DirectionalAtoms |
101 |
|
logical, save :: SIM_uses_EAM |
102 |
+ |
logical, save :: SIM_uses_SC |
103 |
+ |
logical, save :: SIM_uses_MEAM |
104 |
|
logical, save :: SIM_requires_postpair_calc |
105 |
|
logical, save :: SIM_requires_prepair_calc |
106 |
|
logical, save :: SIM_uses_PBC |
164 |
|
logical :: i_is_GB |
165 |
|
logical :: i_is_EAM |
166 |
|
logical :: i_is_Shape |
167 |
+ |
logical :: i_is_SC |
168 |
+ |
logical :: i_is_MEAM |
169 |
|
logical :: j_is_LJ |
170 |
|
logical :: j_is_Elect |
171 |
|
logical :: j_is_Sticky |
173 |
|
logical :: j_is_GB |
174 |
|
logical :: j_is_EAM |
175 |
|
logical :: j_is_Shape |
176 |
+ |
logical :: j_is_SC |
177 |
+ |
logical :: j_is_MEAM |
178 |
|
real(kind=dp) :: myRcut |
179 |
|
|
180 |
+ |
|
181 |
|
status = 0 |
182 |
|
|
183 |
|
if (.not. associated(atypes)) then |
215 |
|
call getElementProperty(atypes, i, "is_GayBerne", i_is_GB) |
216 |
|
call getElementProperty(atypes, i, "is_EAM", i_is_EAM) |
217 |
|
call getElementProperty(atypes, i, "is_Shape", i_is_Shape) |
218 |
+ |
call getElementProperty(atypes, i, "is_SC", i_is_SC) |
219 |
+ |
call getElementProperty(atypes, i, "is_MEAM", i_is_MEAM) |
220 |
|
|
221 |
|
do j = i, nAtypes |
222 |
|
|
230 |
|
call getElementProperty(atypes, j, "is_GayBerne", j_is_GB) |
231 |
|
call getElementProperty(atypes, j, "is_EAM", j_is_EAM) |
232 |
|
call getElementProperty(atypes, j, "is_Shape", j_is_Shape) |
233 |
+ |
call getElementProperty(atypes, j, "is_SC", j_is_SC) |
234 |
+ |
call getElementProperty(atypes, j, "is_MEAM", j_is_MEAM) |
235 |
|
|
236 |
|
if (i_is_LJ .and. j_is_LJ) then |
237 |
|
iHash = ior(iHash, LJ_PAIR) |
253 |
|
iHash = ior(iHash, EAM_PAIR) |
254 |
|
endif |
255 |
|
|
256 |
+ |
if (i_is_SC .and. j_is_SC) then |
257 |
+ |
iHash = ior(iHash, SC_PAIR) |
258 |
+ |
endif |
259 |
+ |
|
260 |
|
if (i_is_GB .and. j_is_GB) iHash = ior(iHash, GAYBERNE_PAIR) |
261 |
|
if (i_is_GB .and. j_is_LJ) iHash = ior(iHash, GAYBERNE_LJ) |
262 |
|
if (i_is_LJ .and. j_is_GB) iHash = ior(iHash, GAYBERNE_LJ) |
588 |
|
subroutine setSimVariables() |
589 |
|
SIM_uses_DirectionalAtoms = SimUsesDirectionalAtoms() |
590 |
|
SIM_uses_EAM = SimUsesEAM() |
591 |
+ |
SIM_uses_SC = SimUsesSC() |
592 |
|
SIM_requires_postpair_calc = SimRequiresPostpairCalc() |
593 |
|
SIM_requires_prepair_calc = SimRequiresPrepairCalc() |
594 |
|
SIM_uses_PBC = SimUsesPBC() |
765 |
|
real( kind = DP ) :: sw, dswdr, swderiv, mf |
766 |
|
real( kind = DP ) :: rVal |
767 |
|
real(kind=dp),dimension(3) :: d_atm, d_grp, fpair, fij |
748 |
– |
real(kind=dp), dimension(3) :: fstrs, f2strs |
768 |
|
real(kind=dp) :: rfpot, mu_i, virial |
769 |
|
integer :: me_i, me_j, n_in_i, n_in_j |
770 |
|
logical :: is_dp_i |
972 |
|
#ifdef IS_MPI |
973 |
|
call do_pair(atom1, atom2, ratmsq, d_atm, sw, & |
974 |
|
do_pot, eFrame, A, f, t, pot_local, vpair, & |
975 |
< |
fpair, d_grp, rgrp, fstrs) |
975 |
> |
fpair, d_grp, rgrp) |
976 |
|
#else |
977 |
|
call do_pair(atom1, atom2, ratmsq, d_atm, sw, & |
978 |
|
do_pot, eFrame, A, f, t, pot, vpair, fpair, & |
979 |
< |
d_grp, rgrp, fstrs) |
979 |
> |
d_grp, rgrp) |
980 |
|
#endif |
962 |
– |
f2strs(1:3) = f2strs(1:3) + fstrs(1:3) |
981 |
|
vij = vij + vpair |
982 |
|
fij(1:3) = fij(1:3) + fpair(1:3) |
983 |
|
endif |
1183 |
|
|
1184 |
|
end subroutine do_force_loop |
1185 |
|
|
1186 |
< |
!!$ subroutine do_pair(i, j, rijsq, d, sw, do_pot, & |
1187 |
< |
!!$ eFrame, A, f, t, pot, vpair, fpair, d_grp, r_grp) |
1170 |
< |
subroutine do_pair(i, j, rijsq, d, sw, do_pot, & |
1171 |
< |
eFrame, A, f, t, pot, vpair, fpair, d_grp, r_grp, fstrs) |
1186 |
> |
subroutine do_pair(i, j, rijsq, d, sw, do_pot, & |
1187 |
> |
eFrame, A, f, t, pot, vpair, fpair, d_grp, r_grp) |
1188 |
|
|
1189 |
|
real( kind = dp ) :: vpair, sw |
1190 |
|
real( kind = dp ), dimension(LR_POT_TYPES) :: pot |
1191 |
|
real( kind = dp ), dimension(3) :: fpair |
1176 |
– |
real( kind = dp ), dimension(3) :: fstrs |
1192 |
|
real( kind = dp ), dimension(nLocal) :: mfact |
1193 |
|
real( kind = dp ), dimension(9,nLocal) :: eFrame |
1194 |
|
real( kind = dp ), dimension(9,nLocal) :: A |
1226 |
|
endif |
1227 |
|
|
1228 |
|
if ( iand(iHash, ELECTROSTATIC_PAIR).ne.0 ) then |
1214 |
– |
!!$ call doElectrostaticPair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1215 |
– |
!!$ pot(ELECTROSTATIC_POT), eFrame, f, t, do_pot) |
1229 |
|
call doElectrostaticPair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1230 |
< |
pot(ELECTROSTATIC_POT), eFrame, f, t, do_pot, fstrs) |
1230 |
> |
pot(ELECTROSTATIC_POT), eFrame, f, t, do_pot) |
1231 |
|
endif |
1232 |
|
|
1233 |
|
if ( iand(iHash, STICKY_PAIR).ne.0 ) then |
1263 |
|
if ( iand(iHash, SHAPE_LJ).ne.0 ) then |
1264 |
|
call do_shape_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1265 |
|
pot(VDW_POT), A, f, t, do_pot) |
1266 |
+ |
endif |
1267 |
+ |
|
1268 |
+ |
if ( iand(iHash, SC_PAIR).ne.0 ) then |
1269 |
+ |
call do_SC_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
1270 |
+ |
pot(METALLIC_POT), f, do_pot) |
1271 |
|
endif |
1272 |
+ |
|
1273 |
+ |
|
1274 |
|
|
1275 |
|
end subroutine do_pair |
1276 |
|
|
1306 |
|
|
1307 |
|
if ( iand(iHash, EAM_PAIR).ne.0 ) then |
1308 |
|
call calc_EAM_prepair_rho(i, j, d, r, rijsq ) |
1309 |
+ |
endif |
1310 |
+ |
|
1311 |
+ |
if ( iand(iHash, SC_PAIR).ne.0 ) then |
1312 |
+ |
call calc_SC_prepair_rho(i, j, d, r, rijsq ) |
1313 |
|
endif |
1314 |
|
|
1315 |
|
end subroutine do_prepair |
1322 |
|
if (FF_uses_EAM .and. SIM_uses_EAM) then |
1323 |
|
call calc_EAM_preforce_Frho(nlocal,pot(METALLIC_POT)) |
1324 |
|
endif |
1325 |
+ |
if (FF_uses_SC .and. SIM_uses_SC) then |
1326 |
+ |
call calc_SC_preforce_Frho(nlocal,pot(METALLIC_POT)) |
1327 |
+ |
endif |
1328 |
|
|
1329 |
|
|
1330 |
|
end subroutine do_preforce |
1508 |
|
|
1509 |
|
function FF_RequiresPrepairCalc() result(doesit) |
1510 |
|
logical :: doesit |
1511 |
< |
doesit = FF_uses_EAM |
1511 |
> |
doesit = FF_uses_EAM .or. FF_uses_SC & |
1512 |
> |
.or. FF_uses_MEAM |
1513 |
|
end function FF_RequiresPrepairCalc |
1514 |
|
|
1515 |
|
#ifdef PROFILE |