Fix group implementation to abide by new atom type formulation

development
Alex Selimov 3 years ago
parent a9833f53bf
commit 612cea3891

@ -2,6 +2,7 @@ module opt_group
!This module contains all code associated with dislocations !This module contains all code associated with dislocations
use atoms
use parameters use parameters
use elements use elements
use subroutines use subroutines
@ -106,7 +107,7 @@ module opt_group
integer :: i, j, arglen, in_num integer :: i, j, arglen, in_num
character(len=100) :: textholder, type_spec character(len=100) :: textholder, type_spec
real(kind=dp) H real(kind=dp) H, mass
!Parse type and shape command !Parse type and shape command
arg_pos = arg_pos + 1 arg_pos = arg_pos + 1
@ -493,7 +494,8 @@ module opt_group
arg_pos = arg_pos + 1 arg_pos = arg_pos + 1
call get_command_argument(arg_pos, textholder, arglen) call get_command_argument(arg_pos, textholder, arglen)
if (arglen==0) stop "Missing atom type for group" if (arglen==0) stop "Missing atom type for group"
call add_atom_type(textholder, group_type) call atommass(textholder, mass)
call add_atom_type(mass, group_type)
case('notsize') case('notsize')
arg_pos = arg_pos + 1 arg_pos = arg_pos + 1
call get_command_argument(arg_pos, textholder, arglen) call get_command_argument(arg_pos, textholder, arglen)
@ -521,7 +523,8 @@ module opt_group
arg_pos=arg_pos+1 arg_pos=arg_pos+1
call get_command_argument(arg_pos, textholder, arglen) call get_command_argument(arg_pos, textholder, arglen)
if (arglen==0) stop "Missing element type for insert command" if (arglen==0) stop "Missing element type for insert command"
call add_atom_type(textholder, insert_type) call atommass(textholder, mass)
call add_atom_type(mass, insert_type)
arg_pos=arg_pos + 1 arg_pos=arg_pos + 1
call get_command_argument(arg_pos, textholder, arglen) call get_command_argument(arg_pos, textholder, arglen)
select case(trim(adjustl(textholder))) select case(trim(adjustl(textholder)))
@ -643,15 +646,6 @@ module opt_group
end if end if
end select end select
j = 0
do i = 1, group_atom_num
if (atom_index(i) == 23318348) then
j = j + 1
end if
end do
if (j > 1) stop "Code broken"
print *, 'Group contains ', group_ele_num, " elements and ", group_atom_num, " atoms." print *, 'Group contains ', group_ele_num, " elements and ", group_atom_num, " atoms."
end subroutine get_group end subroutine get_group
@ -1193,7 +1187,7 @@ module opt_group
subroutine alloy_group subroutine alloy_group
!This subroutine randomizes the atom types to reach desired concentrations, this only operates on atoms !This subroutine randomizes the atom types to reach desired concentrations, this only operates on atoms
integer :: i, j, ia, type_map(10), added_types(num_species) integer :: i, j, ia, type_map(10), added_types(num_species)
real(kind=dp) :: rand real(kind=dp) :: rand, mass
print *, "Alloying group with desired fractions", s_fractions(1:num_species) print *, "Alloying group with desired fractions", s_fractions(1:num_species)
@ -1203,7 +1197,8 @@ module opt_group
!Now get the atom type maps for all the atoms and make the fractions a running sum !Now get the atom type maps for all the atoms and make the fractions a running sum
do i = 1, num_species do i = 1, num_species
call add_atom_type(species_type(i), type_map(i)) call atommass(species_type(i), mass)
call add_atom_type(mass, type_map(i))
if(i > 1) s_fractions(i) = s_fractions(i) + s_fractions(i-1) if(i > 1) s_fractions(i) = s_fractions(i) + s_fractions(i-1)
end do end do
!Now randomize the atom types !Now randomize the atom types

Loading…
Cancel
Save