4 |
|
|
5 |
|
!! @author Charles F. Vardeman II |
6 |
|
!! @author Matthew Meineke |
7 |
< |
!! @version $Id: do_Forces.F90,v 1.1.1.1 2003-03-21 17:42:12 mmeineke Exp $, $Date: 2003-03-21 17:42:12 $, $Name: not supported by cvs2svn $, $Revision: 1.1.1.1 $ |
7 |
> |
!! @version $Id: do_Forces.F90,v 1.3 2003-03-24 18:33:51 mmeineke Exp $, $Date: 2003-03-24 18:33:51 $, $Name: not supported by cvs2svn $, $Revision: 1.3 $ |
8 |
|
|
9 |
|
module do_Forces |
10 |
|
use force_globals |
196 |
|
nlocal = getNlocal() |
197 |
|
natoms = nlocal |
198 |
|
#endif |
199 |
+ |
|
200 |
+ |
write(*,*) 'u_l', u_l(1,1), u_l(2,1), u_l(3,1) |
201 |
|
|
202 |
+ |
|
203 |
|
call getRcut(rcut,rc2=rcutsq) |
204 |
|
call getRlist(rlist,rlistsq) |
205 |
|
|
326 |
|
|
327 |
|
inner: do j = i+1, natoms |
328 |
|
|
329 |
< |
if (skipThisPair(i,j)) cycle inner |
330 |
< |
|
329 |
> |
if (skipThisPair(i,j)) cycle inner |
330 |
> |
|
331 |
|
call get_interatomic_vector(q(:,i), q(:,j), d, rijsq) |
332 |
|
|
333 |
+ |
|
334 |
|
if (rijsq < rlistsq) then |
335 |
|
|
336 |
|
nlist = nlist + 1 |
536 |
|
|
537 |
|
call do_dipole_pair(i, j, d, r, rijsq, pot, u_l, f, t, & |
538 |
|
do_pot, do_stress) |
535 |
– |
|
539 |
|
if (FF_uses_RF .and. SimUsesRF()) then |
537 |
– |
|
540 |
|
call accumulate_rf(i, j, r, u_l) |
541 |
|
call rf_correct_forces(i, j, d, r, u_l, f, do_stress) |
540 |
– |
|
542 |
|
endif |
543 |
|
|
544 |
|
endif |
548 |
|
|
549 |
|
call getElementProperty(atypes, me_i, "is_Sticky", is_Sticky_i) |
550 |
|
call getElementProperty(atypes, me_j, "is_Sticky", is_Sticky_j) |
551 |
< |
|
551 |
> |
|
552 |
|
if ( is_Sticky_i .and. is_Sticky_j ) then |
553 |
|
call do_sticky_pair(i, j, d, r, rijsq, A, pot, f, t, & |
554 |
|
do_pot, do_stress) |
581 |
|
d_old = d |
582 |
|
! Wrap back into periodic box if necessary |
583 |
|
if ( SimUsesPBC() ) then |
584 |
< |
|
584 |
> |
|
585 |
|
d(1:3) = d(1:3) - box(1:3) * sign(1.0_dp,d(1:3)) * & |
586 |
|
int(abs(d(1:3)/box(1:3)) + 0.5_dp) |
587 |
|
|
588 |
+ |
! write(*,'(a11,3es12.3)') 'wrapped to ', d(1), d(2), d(3) |
589 |
+ |
|
590 |
|
endif |
591 |
|
r_sq = dot_product(d,d) |
592 |
|
|
652 |
|
end subroutine zero_work_arrays |
653 |
|
|
654 |
|
function skipThisPair(atom1, atom2) result(skip_it) |
652 |
– |
|
655 |
|
integer, intent(in) :: atom1 |
656 |
|
integer, intent(in), optional :: atom2 |
657 |
|
logical :: skip_it |
658 |
|
integer :: unique_id_1, unique_id_2 |
659 |
+ |
integer :: me_i,me_j |
660 |
|
integer :: i |
661 |
|
|
662 |
|
skip_it = .false. |
674 |
|
!! in the normal loop, the atom numbers are unique |
675 |
|
unique_id_1 = atom1 |
676 |
|
#endif |
677 |
< |
|
677 |
> |
|
678 |
|
!! We were called with only one atom, so just check the global exclude |
679 |
|
!! list for this atom |
680 |
|
if (.not. present(atom2)) then |
718 |
|
return |
719 |
|
endif |
720 |
|
enddo |
721 |
< |
|
721 |
> |
|
722 |
|
do i = 1, nExcludes_local |
723 |
|
if (excludesLocal(1,i) == unique_id_1) then |
724 |
|
if (excludesLocal(2,i) == unique_id_2) then |