|
|
@ -22,6 +22,8 @@ module opt_group
|
|
|
|
!Main calling function for the group option
|
|
|
|
!Main calling function for the group option
|
|
|
|
integer, intent(inout) :: arg_pos
|
|
|
|
integer, intent(inout) :: arg_pos
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print *, '-----------------------Option Group-------------------------'
|
|
|
|
|
|
|
|
|
|
|
|
group_ele_num = 0
|
|
|
|
group_ele_num = 0
|
|
|
|
group_atom_num = 0
|
|
|
|
group_atom_num = 0
|
|
|
|
remesh_size=0
|
|
|
|
remesh_size=0
|
|
|
@ -117,6 +119,9 @@ module opt_group
|
|
|
|
|
|
|
|
|
|
|
|
select case(trim(adjustl(shape)))
|
|
|
|
select case(trim(adjustl(shape)))
|
|
|
|
case('block')
|
|
|
|
case('block')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print *, "Group has block shape with boundaries: ", block_bd
|
|
|
|
|
|
|
|
|
|
|
|
!Allocate variables to arbitrary size
|
|
|
|
!Allocate variables to arbitrary size
|
|
|
|
allocate(element_index(1024), atom_index(1024))
|
|
|
|
allocate(element_index(1024), atom_index(1024))
|
|
|
|
!Check the type to see whether we need to find the elements within the group
|
|
|
|
!Check the type to see whether we need to find the elements within the group
|
|
|
@ -162,6 +167,8 @@ module opt_group
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end select
|
|
|
|
end select
|
|
|
|
end select
|
|
|
|
end select
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print *, 'Group contains ', group_ele_num, " elements and ", group_atom_num, " atoms."
|
|
|
|
end subroutine get_group
|
|
|
|
end subroutine get_group
|
|
|
|
|
|
|
|
|
|
|
|
subroutine displace_group
|
|
|
|
subroutine displace_group
|
|
|
@ -169,6 +176,8 @@ module opt_group
|
|
|
|
|
|
|
|
|
|
|
|
integer :: i, inod, ibasis
|
|
|
|
integer :: i, inod, ibasis
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print *, "Elements/atoms in group displaced by ", disp_vec
|
|
|
|
|
|
|
|
|
|
|
|
!Displace atoms
|
|
|
|
!Displace atoms
|
|
|
|
do i = 1, group_atom_num
|
|
|
|
do i = 1, group_atom_num
|
|
|
|
r_atom(:,atom_index(i)) = r_atom(:,atom_index(i)) + disp_vec
|
|
|
|
r_atom(:,atom_index(i)) = r_atom(:,atom_index(i)) + disp_vec
|
|
|
@ -207,7 +216,7 @@ module opt_group
|
|
|
|
subroutine remesh_group
|
|
|
|
subroutine remesh_group
|
|
|
|
!This command is used to remesh the group to a desired element size
|
|
|
|
!This command is used to remesh the group to a desired element size
|
|
|
|
|
|
|
|
|
|
|
|
integer :: i, j, ie, type_interp(max_basisnum*max_esize**3), add_atom_num
|
|
|
|
integer :: i, j, ie, type_interp(max_basisnum*max_esize**3), add_atom_num, orig_atom_num
|
|
|
|
real(kind=dp) :: r_interp(3, max_basisnum*max_esize**3)
|
|
|
|
real(kind=dp) :: r_interp(3, max_basisnum*max_esize**3)
|
|
|
|
|
|
|
|
|
|
|
|
!Refining to atoms and remeshing to elements are different processes so check which code we need to run
|
|
|
|
!Refining to atoms and remeshing to elements are different processes so check which code we need to run
|
|
|
@ -216,6 +225,7 @@ module opt_group
|
|
|
|
!Refining to atoms
|
|
|
|
!Refining to atoms
|
|
|
|
case(2)
|
|
|
|
case(2)
|
|
|
|
if(group_ele_num > 0) then
|
|
|
|
if(group_ele_num > 0) then
|
|
|
|
|
|
|
|
orig_atom_num = atom_num
|
|
|
|
!Estimate number of atoms we are adding, this doesn't have to be exact
|
|
|
|
!Estimate number of atoms we are adding, this doesn't have to be exact
|
|
|
|
add_atom_num = group_ele_num*basisnum(lat_ele(element_index(1)))*size_ele(element_index(1))**3
|
|
|
|
add_atom_num = group_ele_num*basisnum(lat_ele(element_index(1)))*size_ele(element_index(1))**3
|
|
|
|
call grow_ele_arrays(0,add_atom_num)
|
|
|
|
call grow_ele_arrays(0,add_atom_num)
|
|
|
@ -236,6 +246,8 @@ module opt_group
|
|
|
|
!Once all atoms are added we delete all of the elements
|
|
|
|
!Once all atoms are added we delete all of the elements
|
|
|
|
call delete_elements(group_ele_num, element_index)
|
|
|
|
call delete_elements(group_ele_num, element_index)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print *, group_ele_num, " elements of group are refined to ", atom_num -orig_atom_num, " atoms."
|
|
|
|
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
!Remeshing to elements, currently not available
|
|
|
|
!Remeshing to elements, currently not available
|
|
|
|
case default
|
|
|
|
case default
|
|
|
|