4 |
|
|
5 |
|
!! @author Charles F. Vardeman II |
6 |
|
!! @author Matthew Meineke |
7 |
< |
!! @version $Id: doForces.F90,v 1.5.2.1 2004-12-09 20:27:45 gezelter Exp $, $Date: 2004-12-09 20:27:45 $, $Name: not supported by cvs2svn $, $Revision: 1.5.2.1 $ |
7 |
> |
!! @version $Id: doForces.F90,v 1.5.2.2 2004-12-09 20:42:47 gezelter Exp $, $Date: 2004-12-09 20:42:47 $, $Name: not supported by cvs2svn $, $Revision: 1.5.2.2 $ |
8 |
|
|
9 |
|
module doForces |
10 |
|
use force_globals |
396 |
|
|
397 |
|
!! Does force loop over i,j pairs. Calls do_pair to calculates forces. |
398 |
|
!-------------------------------------------------------------> |
399 |
< |
subroutine do_force_loop(q, q_group, A, u_l, f, t, tau, pot, & |
399 |
> |
subroutine do_force_loop(q, q_group, A, eFrame, f, t, tau, pot, & |
400 |
|
do_pot_c, do_stress_c, error) |
401 |
|
!! Position array provided by C, dimensioned by getNlocal |
402 |
|
real ( kind = dp ), dimension(3, nLocal) :: q |
405 |
|
!! Rotation Matrix for each long range particle in simulation. |
406 |
|
real( kind = dp), dimension(9, nLocal) :: A |
407 |
|
!! Unit vectors for dipoles (lab frame) |
408 |
< |
real( kind = dp ), dimension(3,nLocal) :: u_l |
408 |
> |
real( kind = dp ), dimension(9,nLocal) :: eFrame |
409 |
|
!! Force array provided by C, dimensioned by getNlocal |
410 |
|
real ( kind = dp ), dimension(3,nLocal) :: f |
411 |
|
!! Torsion array provided by C, dimensioned by getNlocal |
480 |
|
call gather(q_group, q_group_Col, plan_group_col_3d) |
481 |
|
|
482 |
|
if (FF_UsesDirectionalAtoms() .and. SIM_uses_DirectionalAtoms) then |
483 |
< |
call gather(u_l, u_l_Row, plan_atom_row_3d) |
484 |
< |
call gather(u_l, u_l_Col, plan_atom_col_3d) |
483 |
> |
call gather(eFrame, eFrame_Row, plan_atom_row_rotation) |
484 |
> |
call gather(eFrame, eFrame_Col, plan_atom_col_rotation) |
485 |
|
|
486 |
|
call gather(A, A_Row, plan_atom_row_rotation) |
487 |
|
call gather(A, A_Col, plan_atom_col_rotation) |
627 |
|
#ifdef IS_MPI |
628 |
|
call do_prepair(atom1, atom2, ratmsq, d_atm, sw, & |
629 |
|
rgrpsq, d_grp, do_pot, do_stress, & |
630 |
< |
u_l, A, f, t, pot_local) |
630 |
> |
eFrame, A, f, t, pot_local) |
631 |
|
#else |
632 |
|
call do_prepair(atom1, atom2, ratmsq, d_atm, sw, & |
633 |
|
rgrpsq, d_grp, do_pot, do_stress, & |
634 |
< |
u_l, A, f, t, pot) |
634 |
> |
eFrame, A, f, t, pot) |
635 |
|
#endif |
636 |
|
else |
637 |
|
#ifdef IS_MPI |
638 |
|
call do_pair(atom1, atom2, ratmsq, d_atm, sw, & |
639 |
|
do_pot, & |
640 |
< |
u_l, A, f, t, pot_local, vpair, fpair) |
640 |
> |
eFrame, A, f, t, pot_local, vpair, fpair) |
641 |
|
#else |
642 |
|
call do_pair(atom1, atom2, ratmsq, d_atm, sw, & |
643 |
|
do_pot, & |
644 |
< |
u_l, A, f, t, pot, vpair, fpair) |
644 |
> |
eFrame, A, f, t, pot, vpair, fpair) |
645 |
|
#endif |
646 |
|
|
647 |
|
vij = vij + vpair |
794 |
|
|
795 |
|
!! The reaction field needs to include a self contribution |
796 |
|
!! to the field: |
797 |
< |
call accumulate_self_rf(i, mu_i, u_l) |
797 |
> |
call accumulate_self_rf(i, mu_i, eFrame) |
798 |
|
!! Get the reaction field contribution to the |
799 |
|
!! potential and torques: |
800 |
< |
call reaction_field_final(i, mu_i, u_l, rfpot, t, do_pot) |
800 |
> |
call reaction_field_final(i, mu_i, eFrame, rfpot, t, do_pot) |
801 |
|
#ifdef IS_MPI |
802 |
|
pot_local = pot_local + rfpot |
803 |
|
#else |
837 |
|
end subroutine do_force_loop |
838 |
|
|
839 |
|
subroutine do_pair(i, j, rijsq, d, sw, do_pot, & |
840 |
< |
u_l, A, f, t, pot, vpair, fpair) |
840 |
> |
eFrame, A, f, t, pot, vpair, fpair) |
841 |
|
|
842 |
|
real( kind = dp ) :: pot, vpair, sw |
843 |
|
real( kind = dp ), dimension(3) :: fpair |
844 |
|
real( kind = dp ), dimension(nLocal) :: mfact |
845 |
< |
real( kind = dp ), dimension(3,nLocal) :: u_l |
845 |
> |
real( kind = dp ), dimension(9,nLocal) :: eFrame |
846 |
|
real( kind = dp ), dimension(9,nLocal) :: A |
847 |
|
real( kind = dp ), dimension(3,nLocal) :: f |
848 |
|
real( kind = dp ), dimension(3,nLocal) :: t |
888 |
|
|
889 |
|
if ( PropertyMap(me_i)%is_Dipole .and. PropertyMap(me_j)%is_Dipole) then |
890 |
|
call do_dipole_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
891 |
< |
pot, u_l, f, t, do_pot) |
891 |
> |
pot, eFrame, f, t, do_pot) |
892 |
|
if (FF_uses_RF .and. SIM_uses_RF) then |
893 |
< |
call accumulate_rf(i, j, r, u_l, sw) |
894 |
< |
call rf_correct_forces(i, j, d, r, u_l, sw, f, fpair) |
893 |
> |
call accumulate_rf(i, j, r, eFrame, sw) |
894 |
> |
call rf_correct_forces(i, j, d, r, eFrame, sw, f, fpair) |
895 |
|
endif |
896 |
|
endif |
897 |
|
|
912 |
|
if ( PropertyMap(me_i)%is_GayBerne .and. & |
913 |
|
PropertyMap(me_j)%is_GayBerne) then |
914 |
|
call do_gb_pair(i, j, d, r, rijsq, sw, vpair, fpair, & |
915 |
< |
pot, u_l, f, t, do_pot) |
915 |
> |
pot, A, f, t, do_pot) |
916 |
|
endif |
917 |
|
|
918 |
|
endif |
939 |
|
end subroutine do_pair |
940 |
|
|
941 |
|
subroutine do_prepair(i, j, rijsq, d, sw, rcijsq, dc, & |
942 |
< |
do_pot, do_stress, u_l, A, f, t, pot) |
942 |
> |
do_pot, do_stress, eFrame, A, f, t, pot) |
943 |
|
|
944 |
|
real( kind = dp ) :: pot, sw |
945 |
< |
real( kind = dp ), dimension(3,nLocal) :: u_l |
945 |
> |
real( kind = dp ), dimension(9,nLocal) :: eFrame |
946 |
|
real (kind=dp), dimension(9,nLocal) :: A |
947 |
|
real (kind=dp), dimension(3,nLocal) :: f |
948 |
|
real (kind=dp), dimension(3,nLocal) :: t |
1057 |
|
q_group_Row = 0.0_dp |
1058 |
|
q_group_Col = 0.0_dp |
1059 |
|
|
1060 |
< |
u_l_Row = 0.0_dp |
1061 |
< |
u_l_Col = 0.0_dp |
1060 |
> |
eFrame_Row = 0.0_dp |
1061 |
> |
eFrame_Col = 0.0_dp |
1062 |
|
|
1063 |
|
A_Row = 0.0_dp |
1064 |
|
A_Col = 0.0_dp |
1233 |
|
|
1234 |
|
end subroutine initFortranFF |
1235 |
|
|
1236 |
< |
subroutine doForceloop(q, q_group, A, u_l, f, t, tau, pot, & |
1236 |
> |
subroutine doForceloop(q, q_group, A, eFrame, f, t, tau, pot, & |
1237 |
|
do_pot_c, do_stress_c, error) |
1238 |
|
|
1239 |
|
use definitions, ONLY: dp |
1246 |
|
!! Rotation Matrix for each long range particle in simulation. |
1247 |
|
real( kind = dp), dimension(9, nLocal) :: A |
1248 |
|
!! Unit vectors for dipoles (lab frame) |
1249 |
< |
real( kind = dp ), dimension(3,nLocal) :: u_l |
1249 |
> |
real( kind = dp ), dimension(9,nLocal) :: eFrame |
1250 |
|
!! Force array provided by C, dimensioned by getNlocal |
1251 |
|
real ( kind = dp ), dimension(3,nLocal) :: f |
1252 |
|
!! Torsion array provided by C, dimensioned by getNlocal |
1258 |
|
logical ( kind = 2) :: do_pot_c, do_stress_c |
1259 |
|
integer :: error |
1260 |
|
|
1261 |
< |
call do_force_loop(q, q_group, A, u_l, f, t, tau, pot, & |
1261 |
> |
call do_force_loop(q, q_group, A, eFrame, f, t, tau, pot, & |
1262 |
|
do_pot_c, do_stress_c, error) |
1263 |
|
|
1264 |
|
end subroutine doForceloop |