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 |
117 |
|
integer :: currentAddition = 0 |
118 |
|
|
119 |
|
type (EAMtype), pointer :: EAMParams(:) => null() |
120 |
+ |
integer, pointer :: atidToEAMType(:) => null() |
121 |
|
end type EAMTypeList |
122 |
|
|
123 |
|
|
134 |
|
public :: calc_eam_preforce_Frho |
135 |
|
public :: clean_EAM |
136 |
|
public :: destroyEAMTypes |
137 |
+ |
public :: getEAMCut |
138 |
|
|
139 |
|
contains |
140 |
|
|
154 |
|
integer :: eam_ident |
155 |
|
integer :: status |
156 |
|
|
157 |
< |
integer :: nAtypes |
157 |
> |
integer :: nAtypes,nEAMTypes,myATID |
158 |
|
integer :: maxVals |
159 |
|
integer :: alloc_stat |
160 |
|
integer :: current |
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", eam_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 |
188 |
|
return |
189 |
|
end if |
190 |
|
|
191 |
< |
! this is a possible bug, we assume a correspondence between the vector atypes and |
186 |
< |
! EAMAtypes |
187 |
< |
|
191 |
> |
|
192 |
|
EAMList%EAMParams(current)%eam_atype = eam_ident |
193 |
|
EAMList%EAMParams(current)%eam_lattice = lattice_constant |
194 |
|
EAMList%EAMParams(current)%eam_nrho = eam_nrho |
219 |
|
eamList%currentAddition = 0 |
220 |
|
|
221 |
|
end subroutine destroyEAMtypes |
222 |
+ |
|
223 |
+ |
function getEAMCut(atomID) result(cutValue) |
224 |
+ |
integer, intent(in) :: atomID |
225 |
+ |
real(kind=dp) :: cutValue |
226 |
+ |
|
227 |
+ |
cutValue = eamList%EAMParams(atomID)%eam_rcut |
228 |
+ |
|
229 |
+ |
end function getEAMCut |
230 |
|
|
231 |
|
subroutine init_EAM_FF(status) |
232 |
|
integer :: status |