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

Comparing trunk/OOPSE-2.0/src/UseTheForce/DarkSide/dipole.F90 (file contents):
Revision 1633 by gezelter, Fri Oct 22 20:22:48 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   module dipole_dipole
43    
44    use force_globals
# Line 20 | Line 61 | module dipole_dipole
61    public :: getDipoleMoment
62  
63    type :: MomentList
64 <     integer :: ident
64 >     integer :: c_ident
65       real(kind=DP) :: dipole_moment = 0.0_DP
66    end type MomentList
67  
# Line 28 | Line 69 | contains
69  
70   contains
71  
72 <  subroutine newDipoleType(ident, dipole_moment, status)
73 <    integer,intent(in) :: ident
72 >  subroutine newDipoleType(c_ident, dipole_moment, status)
73 >    integer,intent(in) :: c_ident
74      real(kind=dp),intent(in) :: dipole_moment
75      integer,intent(out) :: status
76 <    integer :: nAtypes
76 >    integer :: nAtypes, myATID
77  
78      status = 0
79 +    myATID = getFirstMatchingElement(atypes, "c_ident", c_ident)
80      
81      !! Be simple-minded and assume that we need a MomentMap that
82      !! is the same size as the total number of atom types
# Line 54 | Line 96 | contains
96        
97      end if
98  
99 <    if (ident .gt. size(MomentMap)) then
99 >    if (myATID .gt. size(MomentMap)) then
100         status = -1
101         return
102      endif
103      
104      ! set the values for MomentMap for this atom type:
105  
106 <    MomentMap(ident)%ident = ident
107 <    MomentMap(ident)%dipole_moment = dipole_moment
106 >    MomentMap(myATID)%c_ident = c_ident
107 >    MomentMap(myATID)%dipole_moment = dipole_moment
108      
109    end subroutine newDipoleType
110  
# Line 80 | Line 122 | contains
122    end function getDipoleMoment
123  
124    subroutine do_dipole_pair(atom1, atom2, d, rij, r2, sw, vpair, fpair, &
125 <       pot, u_l, f, t, do_pot)
125 >       pot, eFrame, f, t, do_pot)
126      
127      logical :: do_pot
128  
# Line 94 | Line 136 | contains
136  
137      real( kind = dp ) :: pot
138      real( kind = dp ), dimension(3) :: d, fpair
139 <    real( kind = dp ), dimension(3,nLocal) :: u_l
139 >    real( kind = dp ), dimension(9,nLocal) :: eFrame
140      real( kind = dp ), dimension(3,nLocal) :: f
141      real( kind = dp ), dimension(3,nLocal) :: t
142      
# Line 110 | Line 152 | contains
152  
153   #ifdef IS_MPI
154      me1 = atid_Row(atom1)
155 <    ul1(1) = u_l_Row(1,atom1)
156 <    ul1(2) = u_l_Row(2,atom1)
157 <    ul1(3) = u_l_Row(3,atom1)
155 >    ul1(1) = eFrame_Row(3,atom1)
156 >    ul1(2) = eFrame_Row(6,atom1)
157 >    ul1(3) = eFrame_Row(9,atom1)
158  
159      me2 = atid_Col(atom2)
160 <    ul2(1) = u_l_Col(1,atom2)
161 <    ul2(2) = u_l_Col(2,atom2)
162 <    ul2(3) = u_l_Col(3,atom2)
160 >    ul2(1) = eFrame_Col(3,atom2)
161 >    ul2(2) = eFrame_Col(6,atom2)
162 >    ul2(3) = eFrame_Col(9,atom2)
163   #else
164      me1 = atid(atom1)
165 <    ul1(1) = u_l(1,atom1)
166 <    ul1(2) = u_l(2,atom1)
167 <    ul1(3) = u_l(3,atom1)
165 >    ul1(1) = eFrame(3,atom1)
166 >    ul1(2) = eFrame(6,atom1)
167 >    ul1(3) = eFrame(9,atom1)
168  
169      me2 = atid(atom2)
170 <    ul2(1) = u_l(1,atom2)
171 <    ul2(2) = u_l(2,atom2)
172 <    ul2(3) = u_l(3,atom2)
170 >    ul2(1) = eFrame(3,atom2)
171 >    ul2(2) = eFrame(6,atom2)
172 >    ul2(3) = eFrame(9,atom2)
173   #endif
174  
175      mu1 = MomentMap(me1)%dipole_moment

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines