Working change group type command

development
Alex Selimov 4 years ago
parent c4afde2743
commit 4c75fac13c

@ -28,6 +28,7 @@ module opt_group
group_atom_num = 0
remesh_size=0
random_num=0
group_type=0
displace=.false.
delete=.false.
max_remesh=.false.
@ -61,6 +62,11 @@ module opt_group
call remesh_group
end if
if(group_type > 0) then
call get_group
call change_group_type
end if
end subroutine group
subroutine parse_group(arg_pos)
@ -371,6 +377,11 @@ module opt_group
read(textholder, *) random_num
case('flip')
flip=.true.
case('type')
arg_pos = arg_pos + 1
call get_command_argument(arg_pos, textholder, arglen)
if (arglen==0) stop "Missing atom type for group"
call add_atom_type(textholder, group_type)
case default
!If it isn't an available option to opt_disl then we just exit
exit
@ -851,11 +862,29 @@ module opt_group
end subroutine delete_group
subroutine change_group
subroutine change_group_type
!This subroutine changes all atoms and nodes at atoms within a group to a specific type
integer :: i, j, ltype,ibasis, inod, basis_type(10)
print *, "Changing ", group_atom_num, " atoms and ", group_ele_num, " elements to atom type ", group_type
!Change all atom group types
do i = 1, group_atom_num
j = atom_index(i)
type_atom(j) = group_type
end do
!Map to a new lattice type for all element
do i =1, group_ele_num
j = element_index(i)
ltype = lat_ele(j)
do ibasis = 1, basisnum(ltype)
basis_type(ibasis) = group_type
end do
call lattice_map(basisnum(ltype), basis_type, ng_node(ltype), lapa(ltype), lat_ele(j))
end do
print *, "Changing ", group_atom_num " atoms and ", group_ele_num, " elements to atom type ", group_type
end subroutine change_group
end subroutine change_group_type
function in_group(r)
!This subroutine determines if a point is within the group boundaries

Loading…
Cancel
Save