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

Comparing trunk/OOPSE-4/src/UseTheForce/doForces.F90 (file contents):
Revision 2375 by gezelter, Mon Oct 17 19:12:45 2005 UTC vs.
Revision 2390 by chrisfen, Wed Oct 19 19:24:40 2005 UTC

# Line 45 | Line 45
45  
46   !! @author Charles F. Vardeman II
47   !! @author Matthew Meineke
48 < !! @version $Id: doForces.F90,v 1.59 2005-10-17 19:12:34 gezelter Exp $, $Date: 2005-10-17 19:12:34 $, $Name: not supported by cvs2svn $, $Revision: 1.59 $
48 > !! @version $Id: doForces.F90,v 1.61 2005-10-19 19:24:29 chrisfen Exp $, $Date: 2005-10-19 19:24:29 $, $Name: not supported by cvs2svn $, $Revision: 1.61 $
49  
50  
51   module doForces
# Line 58 | Line 58 | module doForces
58    use lj
59    use sticky
60    use electrostatic_module
61  use reaction_field_module
61    use gayberne
62    use shapes
63    use vector_class
# Line 681 | Line 680 | contains
680  
681      haveSaneForceField = .true.
682  
684    !! check to make sure the reaction field setting makes sense
685
686    if (FF_uses_Dipoles) then
687       if (electrostaticSummationMethod == REACTION_FIELD) then
688          dielect = getDielect()
689          call initialize_rf(dielect)
690       endif
691    else
692       if (electrostaticSummationMethod == REACTION_FIELD) then
693          write(default_error,*) 'Using Reaction Field with no dipoles?  Huh?'
694          thisStat = -1
695          haveSaneForceField = .false.
696          return
697       endif
698    endif
699
683      if (FF_uses_EAM) then
684         call init_EAM_FF(my_status)
685         if (my_status /= 0) then
# Line 1101 | Line 1084 | contains
1084      endif
1085   #endif
1086  
1087 <    if (FF_RequiresPostpairCalc() .and. SIM_requires_postpair_calc) then
1088 <
1089 <       if (electrostaticSummationMethod == REACTION_FIELD) then
1090 <
1091 < #ifdef IS_MPI
1092 <          call scatter(rf_Row,rf,plan_atom_row_3d)
1093 <          call scatter(rf_Col,rf_Temp,plan_atom_col_3d)
1094 <          do i = 1,nlocal
1112 <             rf(1:3,i) = rf(1:3,i) + rf_Temp(1:3,i)
1113 <          end do
1087 >    if (SIM_requires_postpair_calc) then
1088 >      
1089 > #ifdef IS_MPI
1090 >       call scatter(rf_Row,rf,plan_atom_row_3d)
1091 >       call scatter(rf_Col,rf_Temp,plan_atom_col_3d)
1092 >       do i = 1,nlocal
1093 >          rf(1:3,i) = rf(1:3,i) + rf_Temp(1:3,i)
1094 >       end do
1095   #endif
1096  
1097 <          do i = 1, nLocal
1098 <
1099 <             rfpot = 0.0_DP
1097 >       do i = 1, nLocal
1098 >          
1099 >          rfpot = 0.0_DP
1100   #ifdef IS_MPI
1101 <             me_i = atid_row(i)
1101 >          me_i = atid_row(i)
1102   #else
1103 <             me_i = atid(i)
1103 >          me_i = atid(i)
1104   #endif
1105 <             iHash = InteractionHash(me_i,me_j)
1105 >          iHash = InteractionHash(me_i,me_j)
1106 >          
1107 >          if ( iand(iHash, ELECTROSTATIC_PAIR).ne.0 ) then
1108              
1109 <             if ( iand(iHash, ELECTROSTATIC_PAIR).ne.0 ) then
1110 <
1111 <                mu_i = getDipoleMoment(me_i)
1112 <
1113 <                !! The reaction field needs to include a self contribution
1114 <                !! to the field:
1115 <                call accumulate_self_rf(i, mu_i, eFrame)
1116 <                !! Get the reaction field contribution to the
1134 <                !! potential and torques:
1135 <                call reaction_field_final(i, mu_i, eFrame, rfpot, t, do_pot)
1109 >             mu_i = getDipoleMoment(me_i)
1110 >            
1111 >             !! The reaction field needs to include a self contribution
1112 >             !! to the field:
1113 >             call accumulate_self_rf(i, mu_i, eFrame)
1114 >             !! Get the reaction field contribution to the
1115 >             !! potential and torques:
1116 >             call reaction_field_final(i, mu_i, eFrame, rfpot, t, do_pot)
1117   #ifdef IS_MPI
1118 <                pot_local(ELECTROSTATIC_POT) = pot_local(ELECTROSTATIC_POT) + rfpot
1118 >             pot_local(ELECTROSTATIC_POT) = pot_local(ELECTROSTATIC_POT) + rfpot
1119   #else
1120 <                pot(ELECTROSTATIC_POT) = pot(ELECTROSTATIC_POT) + rfpot
1121 <
1120 >             pot(ELECTROSTATIC_POT) = pot(ELECTROSTATIC_POT) + rfpot
1121 >            
1122   #endif
1123 <             endif
1124 <          enddo
1144 <       endif
1123 >          endif
1124 >       enddo
1125      endif
1126 <
1147 <
1126 >    
1127   #ifdef IS_MPI
1128  
1129      if (do_pot) then
# Line 1496 | Line 1475 | contains
1475      logical :: doesit
1476      doesit = FF_uses_EAM
1477    end function FF_RequiresPrepairCalc
1499
1500  function FF_RequiresPostpairCalc() result(doesit)
1501    logical :: doesit
1502    if (electrostaticSummationMethod == REACTION_FIELD) doesit = .true.
1503  end function FF_RequiresPostpairCalc
1478  
1479   #ifdef PROFILE
1480    function getforcetime() result(totalforcetime)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines