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

Comparing trunk/OOPSE-3.0/src/UseTheForce/DarkSide/eam.F90 (file contents):
Revision 2204 by gezelter, Fri Apr 15 22:04:00 2005 UTC vs.
Revision 2278 by chrisfen, Fri Aug 26 22:39:25 2005 UTC

# Line 44 | Line 44 | module eam
44    use force_globals
45    use status
46    use atype_module
47 <  use Vector_class
47 >  use vector_class
48   #ifdef IS_MPI
49    use mpiSimulation
50   #endif
# Line 117 | Line 117 | module eam
117       integer           :: currentAddition = 0
118  
119       type (EAMtype), pointer  :: EAMParams(:) => null()
120 +     integer, pointer         :: atidToEAMType(:) => null()
121    end type EAMTypeList
122  
123  
# Line 133 | Line 134 | module eam
134    public :: calc_eam_preforce_Frho
135    public :: clean_EAM
136    public :: destroyEAMTypes
137 +  public :: getEAMCut
138  
139   contains
140  
141  
142    subroutine newEAMtype(lattice_constant,eam_nrho,eam_drho,eam_nr,&
143         eam_dr,rcut,eam_Z_r,eam_rho_r,eam_F_rho,&
144 <       eam_ident,status)
144 >       c_ident,status)
145      real (kind = dp )                      :: lattice_constant
146      integer                                :: eam_nrho
147      real (kind = dp )                      :: eam_drho
# Line 149 | Line 151 | contains
151      real (kind = dp ), dimension(eam_nr)   :: eam_Z_r
152      real (kind = dp ), dimension(eam_nr)   :: eam_rho_r
153      real (kind = dp ), dimension(eam_nrho) :: eam_F_rho
154 <    integer                                :: eam_ident
154 >    integer                                :: c_ident
155      integer                                :: status
156  
157 <    integer                                :: nAtypes
157 >    integer                                :: nAtypes,nEAMTypes,myATID
158      integer                                :: maxVals
159      integer                                :: alloc_stat
160      integer                                :: current
# Line 167 | Line 169 | contains
169  
170      ! check to see if this is the first time into
171      if (.not.associated(EAMList%EAMParams)) then
172 <       call getMatchingElementList(atypes, "is_EAM", .true., nAtypes, MatchList)
173 <       EAMList%n_eam_types = nAtypes
174 <       allocate(EAMList%EAMParams(nAtypes))
172 >       call getMatchingElementList(atypes, "is_EAM", .true., nEAMtypes, MatchList)
173 >       EAMList%n_eam_types = nEAMtypes
174 >       allocate(EAMList%EAMParams(nEAMTypes))
175 >       nAtypes = getSize(atypes)
176 >       allocate(EAMList%atidToEAMType(nAtypes))
177      end if
178  
179      EAMList%currentAddition = EAMList%currentAddition + 1
180      current = EAMList%currentAddition
181  
182 +    myATID =  getFirstMatchingElement(atypes, "c_ident", c_ident)
183 +    EAMList%atidToEAMType(myATID) = current
184  
185      call allocate_EAMType(eam_nrho,eam_nr,EAMList%EAMParams(current),stat=alloc_stat)
186      if (alloc_stat /= 0) then
# Line 182 | Line 188 | contains
188         return
189      end if
190  
191 <    ! this is a possible bug, we assume a correspondence between the vector atypes and
192 <    ! EAMAtypes
187 <
188 <    EAMList%EAMParams(current)%eam_atype    = eam_ident
191 >  
192 >    EAMList%EAMParams(current)%eam_atype    = c_ident
193      EAMList%EAMParams(current)%eam_lattice  = lattice_constant
194      EAMList%EAMParams(current)%eam_nrho     = eam_nrho
195      EAMList%EAMParams(current)%eam_drho     = eam_drho
# Line 215 | Line 219 | contains
219      eamList%currentAddition = 0
220  
221    end subroutine destroyEAMtypes
222 +
223 +  function getEAMCut(atomID) result(cutValue)
224 +    integer, intent(in) :: atomID
225 +    integer :: eamID
226 +    real(kind=dp) :: cutValue
227 +    
228 +    eamID = EAMList%atidToEAMType(atomID)
229 +    cutValue = EAMList%EAMParams(eamID)%eam_rcut
230  
231 +  end function getEAMCut
232 +
233    subroutine init_EAM_FF(status)
234      integer :: status
235      integer :: i,j

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines