Merge pull request #21 from aselimov/ft--group-delete

Added delete option and update readme
master
aselimov 5 years ago committed by GitHub
commit 4b7d12cc0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -219,6 +219,14 @@ remesh esize
This command remeshes the atoms/elements within the group to the new element size `esize`. Currently only accepts an `esize` of 2 which refines it to full atomistics. This command remeshes the atoms/elements within the group to the new element size `esize`. Currently only accepts an `esize` of 2 which refines it to full atomistics.
**Delete**
```
delete
```
This command deletes all selected atoms and elements within the group.
### Option overwrite ### Option overwrite
``` ```

@ -11,7 +11,7 @@ module opt_group
integer :: group_ele_num, group_atom_num, remesh_size integer :: group_ele_num, group_atom_num, remesh_size
character(len=15) :: type, shape !Type indicates what element type is selected and shape is the group shape character(len=15) :: type, shape !Type indicates what element type is selected and shape is the group shape
real(kind=dp) :: block_bd(6), disp_vec(3) real(kind=dp) :: block_bd(6), disp_vec(3)
logical :: displace logical :: displace, delete
integer, allocatable :: element_index(:), atom_index(:) integer, allocatable :: element_index(:), atom_index(:)
@ -27,6 +27,9 @@ module opt_group
group_ele_num = 0 group_ele_num = 0
group_atom_num = 0 group_atom_num = 0
remesh_size=0 remesh_size=0
displace=.false.
delete=.false.
if(allocated(element_index)) deallocate(element_index) if(allocated(element_index)) deallocate(element_index)
if(allocated(atom_index)) deallocate(atom_index) if(allocated(atom_index)) deallocate(atom_index)
@ -38,6 +41,8 @@ module opt_group
if(displace) call displace_group if(displace) call displace_group
if(remesh_size > 0) call remesh_group if(remesh_size > 0) call remesh_group
if(delete) call delete_group
end subroutine group end subroutine group
subroutine parse_group(arg_pos) subroutine parse_group(arg_pos)
@ -101,6 +106,9 @@ module opt_group
call get_command_argument(arg_pos, textholder, arglen) call get_command_argument(arg_pos, textholder, arglen)
if (arglen==0) stop "Missing remesh element size in group command" if (arglen==0) stop "Missing remesh element size in group command"
read(textholder, *) remesh_size read(textholder, *) remesh_size
case('delete')
arg_pos = arg_pos + 1
delete=.true.
case default case default
!If it isn't an available option to opt_disl then we just exit !If it isn't an available option to opt_disl then we just exit
exit exit
@ -246,4 +254,17 @@ module opt_group
end subroutine remesh_group end subroutine remesh_group
subroutine delete_group
!This subroutine deletes all atoms/elements within a group
print *, "Deleting group containing ", group_atom_num, " atoms and ", group_ele_num, " elements."
!Delete atoms
call delete_atoms(group_atom_num, atom_index)
!Delete elements
call delete_elements(group_ele_num, element_index)
end subroutine delete_group
end module opt_group end module opt_group
Loading…
Cancel
Save