Added group shape all to seleect all of a specific type
This commit is contained in:
parent
9ed8dca69c
commit
1e1c08e546
@ -8,7 +8,7 @@ module opt_group
|
||||
use box
|
||||
implicit none
|
||||
|
||||
integer :: group_ele_num, group_atom_num, remesh_size,normal, dim1, dim2, random_num, group_type
|
||||
integer :: group_ele_num, group_atom_num, remesh_size,normal, dim1, dim2, random_num, group_type, notsize
|
||||
character(len=15) :: type, shape !Type indicates what element type is selected and shape is the group shape
|
||||
real(kind=dp) :: block_bd(6), centroid(3), vertices(3,3),disp_vec(3), radius, bwidth
|
||||
logical :: displace, delete, max_remesh, refine, group_nodes, flip
|
||||
@ -29,6 +29,7 @@ module opt_group
|
||||
remesh_size=0
|
||||
random_num=0
|
||||
group_type=0
|
||||
notsize=0
|
||||
displace=.false.
|
||||
delete=.false.
|
||||
max_remesh=.false.
|
||||
@ -334,6 +335,10 @@ module opt_group
|
||||
if (arglen==0) STOP "Missing sphere radius in group command"
|
||||
read(textholder, *) radius
|
||||
|
||||
case('all')
|
||||
!Do nothing if the shape is all
|
||||
continue
|
||||
|
||||
case default
|
||||
print *, "Group shape ", trim(adjustl(shape)), " is not currently accepted. Please check documentation ", &
|
||||
"for accepted group shapes."
|
||||
@ -382,6 +387,12 @@ module opt_group
|
||||
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('notsize')
|
||||
arg_pos = arg_pos + 1
|
||||
call get_command_argument(arg_pos, textholder, arglen)
|
||||
if(arglen ==0) stop "Missing notsize size"
|
||||
read(textholder, *) notsize
|
||||
print *, "Ignoring elements with size ", notsize
|
||||
case default
|
||||
!If it isn't an available option to opt_disl then we just exit
|
||||
exit
|
||||
@ -409,6 +420,8 @@ module opt_group
|
||||
return
|
||||
case('sphere')
|
||||
print *, "Group has sphere shape with centroid ", centroid(:), " and radius ", radius
|
||||
case('all')
|
||||
print *, "Group has all of type ", type
|
||||
end select
|
||||
|
||||
!Reset group if needed
|
||||
@ -429,7 +442,7 @@ module opt_group
|
||||
end do
|
||||
end do
|
||||
|
||||
if (in_group(r_center).neqv.flip) then
|
||||
if ((in_group(r_center).neqv.flip).and.(size_ele(i)/= notsize)) then
|
||||
group_ele_num = group_ele_num + 1
|
||||
if(group_ele_num > size(element_index)) then
|
||||
allocate(resize_array(size(element_index) + 1024))
|
||||
@ -447,7 +460,7 @@ module opt_group
|
||||
r_center(:) = 0.0_dp
|
||||
do inod = 1, ng_node(lat_ele(i))
|
||||
do ibasis = 1, basisnum(lat_ele(i))
|
||||
if (in_group(r_node(:,ibasis,inod,i)).neqv.flip) then
|
||||
if ((in_group(r_node(:,ibasis,inod,i)).neqv.flip).and.(size_ele(i)/=notsize)) then
|
||||
group_ele_num = group_ele_num + 1
|
||||
if(group_ele_num > size(element_index)) then
|
||||
allocate(resize_array(size(element_index) + 1024))
|
||||
@ -919,6 +932,8 @@ module opt_group
|
||||
else
|
||||
in_group = .false.
|
||||
end if
|
||||
case('all')
|
||||
in_group = .true.
|
||||
end select
|
||||
end function in_group
|
||||
end module opt_group
|
||||
|
Loading…
x
Reference in New Issue
Block a user