ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/src/UseTheForce/doForces.F90
(Generate patch)

Comparing trunk/OOPSE-3.0/src/UseTheForce/doForces.F90 (file contents):
Revision 1729 by chrisfen, Thu Nov 11 21:46:29 2004 UTC vs.
Revision 1930 by gezelter, Wed Jan 12 22:41:40 2005 UTC

# Line 1 | Line 1
1 + !!
2 + !! Copyright (c) 2005 The University of Notre Dame. All Rights Reserved.
3 + !!
4 + !! The University of Notre Dame grants you ("Licensee") a
5 + !! non-exclusive, royalty free, license to use, modify and
6 + !! redistribute this software in source and binary code form, provided
7 + !! that the following conditions are met:
8 + !!
9 + !! 1. Acknowledgement of the program authors must be made in any
10 + !!    publication of scientific results based in part on use of the
11 + !!    program.  An acceptable form of acknowledgement is citation of
12 + !!    the article in which the program was described (Matthew
13 + !!    A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher
14 + !!    J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented
15 + !!    Parallel Simulation Engine for Molecular Dynamics,"
16 + !!    J. Comput. Chem. 26, pp. 252-271 (2005))
17 + !!
18 + !! 2. Redistributions of source code must retain the above copyright
19 + !!    notice, this list of conditions and the following disclaimer.
20 + !!
21 + !! 3. Redistributions in binary form must reproduce the above copyright
22 + !!    notice, this list of conditions and the following disclaimer in the
23 + !!    documentation and/or other materials provided with the
24 + !!    distribution.
25 + !!
26 + !! This software is provided "AS IS," without a warranty of any
27 + !! kind. All express or implied conditions, representations and
28 + !! warranties, including any implied warranty of merchantability,
29 + !! fitness for a particular purpose or non-infringement, are hereby
30 + !! excluded.  The University of Notre Dame and its licensors shall not
31 + !! be liable for any damages suffered by licensee as a result of
32 + !! using, modifying or distributing the software or its
33 + !! derivatives. In no event will the University of Notre Dame or its
34 + !! licensors be liable for any lost revenue, profit or data, or for
35 + !! direct, indirect, special, consequential, incidental or punitive
36 + !! damages, however caused and regardless of the theory of liability,
37 + !! arising out of the use of or inability to use software, even if the
38 + !! University of Notre Dame has been advised of the possibility of
39 + !! such damages.
40 + !!
41 +
42   !! doForces.F90
43   !! module doForces
44   !! Calculates Long Range forces.
45  
46   !! @author Charles F. Vardeman II
47   !! @author Matthew Meineke
48 < !! @version $Id: doForces.F90,v 1.8 2004-11-11 21:46:29 chrisfen Exp $, $Date: 2004-11-11 21:46:29 $, $Name: not supported by cvs2svn $, $Revision: 1.8 $
48 > !! @version $Id: doForces.F90,v 1.9 2005-01-12 22:40:37 gezelter Exp $, $Date: 2005-01-12 22:40:37 $, $Name: not supported by cvs2svn $, $Revision: 1.9 $
49  
50 +
51   module doForces
52    use force_globals
53    use simulation
# Line 14 | Line 56 | module doForces
56    use switcheroo
57    use neighborLists  
58    use lj
59 <  use sticky_pair
59 >  use sticky
60    use dipole_dipole
61    use charge_charge
62    use reaction_field
# Line 349 | Line 391 | contains
391         endif
392      endif
393  
394 <    if (FF_uses_sticky) then
395 <       call check_sticky_FF(my_status)
396 <       if (my_status /= 0) then
397 <          thisStat = -1
398 <          haveSaneForceField = .false.
399 <          return
400 <       end if
401 <    endif
394 >    !sticky module does not contain check_sticky_FF anymore
395 >    !if (FF_uses_sticky) then
396 >    !   call check_sticky_FF(my_status)
397 >    !   if (my_status /= 0) then
398 >    !      thisStat = -1
399 >    !      haveSaneForceField = .false.
400 >    !      return
401 >    !   end if
402 >    !endif
403  
404      if (FF_uses_EAM) then
405           call init_EAM_FF(my_status)
# Line 396 | Line 439 | contains
439  
440    !! Does force loop over i,j pairs. Calls do_pair to calculates forces.
441    !------------------------------------------------------------->
442 <  subroutine do_force_loop(q, q_group, A, u_l, f, t, tau, pot, &
442 >  subroutine do_force_loop(q, q_group, A, eFrame, f, t, tau, pot, &
443         do_pot_c, do_stress_c, error)
444      !! Position array provided by C, dimensioned by getNlocal
445      real ( kind = dp ), dimension(3, nLocal) :: q
# Line 405 | Line 448 | contains
448      !! Rotation Matrix for each long range particle in simulation.
449      real( kind = dp), dimension(9, nLocal) :: A    
450      !! Unit vectors for dipoles (lab frame)
451 <    real( kind = dp ), dimension(3,nLocal) :: u_l
451 >    real( kind = dp ), dimension(9,nLocal) :: eFrame
452      !! Force array provided by C, dimensioned by getNlocal
453      real ( kind = dp ), dimension(3,nLocal) :: f
454      !! Torsion array provided by C, dimensioned by getNlocal
# Line 480 | Line 523 | contains
523      call gather(q_group, q_group_Col, plan_group_col_3d)
524          
525      if (FF_UsesDirectionalAtoms() .and. SIM_uses_DirectionalAtoms) then
526 <       call gather(u_l, u_l_Row, plan_atom_row_3d)
527 <       call gather(u_l, u_l_Col, plan_atom_col_3d)
526 >       call gather(eFrame, eFrame_Row, plan_atom_row_rotation)
527 >       call gather(eFrame, eFrame_Col, plan_atom_col_rotation)
528        
529         call gather(A, A_Row, plan_atom_row_rotation)
530         call gather(A, A_Col, plan_atom_col_rotation)
# Line 627 | Line 670 | contains
670   #ifdef IS_MPI                      
671                           call do_prepair(atom1, atom2, ratmsq, d_atm, sw, &
672                                rgrpsq, d_grp, do_pot, do_stress, &
673 <                              u_l, A, f, t, pot_local)
673 >                              eFrame, A, f, t, pot_local)
674   #else
675                           call do_prepair(atom1, atom2, ratmsq, d_atm, sw, &
676                                rgrpsq, d_grp, do_pot, do_stress, &
677 <                              u_l, A, f, t, pot)
677 >                              eFrame, A, f, t, pot)
678   #endif                                              
679                        else
680   #ifdef IS_MPI                      
681                           call do_pair(atom1, atom2, ratmsq, d_atm, sw, &
682                                do_pot, &
683 <                              u_l, A, f, t, pot_local, vpair, fpair)
683 >                              eFrame, A, f, t, pot_local, vpair, fpair)
684   #else
685                           call do_pair(atom1, atom2, ratmsq, d_atm, sw, &
686                                do_pot,  &
687 <                              u_l, A, f, t, pot, vpair, fpair)
687 >                              eFrame, A, f, t, pot, vpair, fpair)
688   #endif
689  
690                           vij = vij + vpair
# Line 794 | Line 837 | contains
837                  
838                  !! The reaction field needs to include a self contribution
839                  !! to the field:
840 <                call accumulate_self_rf(i, mu_i, u_l)
840 >                call accumulate_self_rf(i, mu_i, eFrame)
841                  !! Get the reaction field contribution to the
842                  !! potential and torques:
843 <                call reaction_field_final(i, mu_i, u_l, rfpot, t, do_pot)
843 >                call reaction_field_final(i, mu_i, eFrame, rfpot, t, do_pot)
844   #ifdef IS_MPI
845                  pot_local = pot_local + rfpot
846   #else
# Line 837 | Line 880 | contains
880    end subroutine do_force_loop
881    
882    subroutine do_pair(i, j, rijsq, d, sw, do_pot, &
883 <       u_l, A, f, t, pot, vpair, fpair)
883 >       eFrame, A, f, t, pot, vpair, fpair)
884  
885      real( kind = dp ) :: pot, vpair, sw
886      real( kind = dp ), dimension(3) :: fpair
887      real( kind = dp ), dimension(nLocal)   :: mfact
888 <    real( kind = dp ), dimension(3,nLocal) :: u_l
888 >    real( kind = dp ), dimension(9,nLocal) :: eFrame
889      real( kind = dp ), dimension(9,nLocal) :: A
890      real( kind = dp ), dimension(3,nLocal) :: f
891      real( kind = dp ), dimension(3,nLocal) :: t
# Line 890 | Line 933 | contains
933        
934         if ( PropertyMap(me_i)%is_Dipole .and. PropertyMap(me_j)%is_Dipole) then
935            call do_dipole_pair(i, j, d, r, rijsq, sw, vpair, fpair, &
936 <               pot, u_l, f, t, do_pot)
936 >               pot, eFrame, f, t, do_pot)
937            if (FF_uses_RF .and. SIM_uses_RF) then
938 <             call accumulate_rf(i, j, r, u_l, sw)
939 <             call rf_correct_forces(i, j, d, r, u_l, sw, f, fpair)
938 >             call accumulate_rf(i, j, r, eFrame, sw)
939 >             call rf_correct_forces(i, j, d, r, eFrame, sw, f, fpair)
940            endif
941         endif
942  
# Line 914 | Line 957 | contains
957         if ( PropertyMap(me_i)%is_GayBerne .and. &
958              PropertyMap(me_j)%is_GayBerne) then
959            call do_gb_pair(i, j, d, r, rijsq, sw, vpair, fpair, &
960 <               pot, u_l, f, t, do_pot)
960 >               pot, A, f, t, do_pot)
961         endif
962        
963      endif
# Line 943 | Line 986 | contains
986    end subroutine do_pair
987  
988    subroutine do_prepair(i, j, rijsq, d, sw, rcijsq, dc, &
989 <       do_pot, do_stress, u_l, A, f, t, pot)
989 >       do_pot, do_stress, eFrame, A, f, t, pot)
990  
991     real( kind = dp ) :: pot, sw
992 <   real( kind = dp ), dimension(3,nLocal) :: u_l
992 >   real( kind = dp ), dimension(9,nLocal) :: eFrame
993     real (kind=dp), dimension(9,nLocal) :: A
994     real (kind=dp), dimension(3,nLocal) :: f
995     real (kind=dp), dimension(3,nLocal) :: t
# Line 1061 | Line 1104 | contains
1104     q_group_Row = 0.0_dp
1105     q_group_Col = 0.0_dp  
1106    
1107 <   u_l_Row = 0.0_dp
1108 <   u_l_Col = 0.0_dp
1107 >   eFrame_Row = 0.0_dp
1108 >   eFrame_Col = 0.0_dp
1109    
1110     A_Row = 0.0_dp
1111     A_Col = 0.0_dp
# Line 1237 | Line 1280 | end module doForces
1280  
1281   end subroutine initFortranFF
1282  
1283 <  subroutine doForceloop(q, q_group, A, u_l, f, t, tau, pot, &
1283 >  subroutine doForceloop(q, q_group, A, eFrame, f, t, tau, pot, &
1284         do_pot_c, do_stress_c, error)
1285        
1286         use definitions, ONLY: dp
# Line 1250 | Line 1293 | end module doForces
1293      !! Rotation Matrix for each long range particle in simulation.
1294      real( kind = dp), dimension(9, nLocal) :: A    
1295      !! Unit vectors for dipoles (lab frame)
1296 <    real( kind = dp ), dimension(3,nLocal) :: u_l
1296 >    real( kind = dp ), dimension(9,nLocal) :: eFrame
1297      !! Force array provided by C, dimensioned by getNlocal
1298      real ( kind = dp ), dimension(3,nLocal) :: f
1299      !! Torsion array provided by C, dimensioned by getNlocal
# Line 1262 | Line 1305 | end module doForces
1305      logical ( kind = 2) :: do_pot_c, do_stress_c
1306      integer :: error
1307      
1308 <    call do_force_loop(q, q_group, A, u_l, f, t, tau, pot, &
1308 >    call do_force_loop(q, q_group, A, eFrame, f, t, tau, pot, &
1309         do_pot_c, do_stress_c, error)
1310        
1311   end subroutine doForceloop

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines