Merge pull request #31 from aselimov/ft--vdisl-loop

vacancydisloop option added
master
aselimov 5 years ago committed by GitHub
commit 6d8a4be625
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -165,9 +165,9 @@ This options adds an arbitrarily oriented dislocation into your model based on u
-disloop loop_normal radius x y z bx by bz poisson -disloop loop_normal radius x y z bx by bz poisson
```` ````
This option deletes vacancies on a plane which when minimized should result in a dislocation loop structure. The arguments are below: This option imposes the displacement field for a dislocation in order to create a loop. This loop is unstable and will close if stress isn't applied.
`dim` - The box dimension which defines the normal to the loop plane. As of now this dimension must be a closed back direction, meaning that for fcc a box dimension has to be of the (111) family of planes. Either `x`, `y`, or `z`. `loop_normal` - The box dimension which defines the normal to the loop plane. As of now this dimension must be a closed back direction, meaning that for fcc a box dimension has to be of the (111) family of planes. Either `x`, `y`, or `z`.
`n` - The number of atoms to delete on the loop plane `n` - The number of atoms to delete on the loop plane
@ -177,6 +177,14 @@ This option deletes vacancies on a plane which when minimized should result in a
`poisson` - Poisson ratio for continuum solution `poisson` - Poisson ratio for continuum solution
### Option vacancy_disloop
```
-vacancydisloop loop_normal radius x y z
```
This option creates a circular planar vacancy cluster of radius `radius` normal to the `loop_normal` centered on position `x y z`. Upon relaxing or energy minimization this cluster should become a prismatic dislocation loop.
### Option Group ### Option Group
`-group select_type group_shape shape_arguments additional keywords` `-group select_type group_shape shape_arguments additional keywords`

@ -1,6 +1,6 @@
FC=ifort FC=ifort
#FFLAGS=-mcmodel=large -g -O0 -stand f08 -fpe0 -traceback -check bounds,uninit -warn all -implicitnone -no-wrap-margin -heap-arrays FFLAGS=-mcmodel=large -g -O0 -stand f08 -fpe0 -traceback -check bounds,uninit -warn all -implicitnone -no-wrap-margin -heap-arrays
FFLAGS=-mcmodel=large -Ofast -no-wrap-margin -heap-arrays #FFLAGS=-mcmodel=large -Ofast -no-wrap-margin -heap-arrays
MODES=mode_create.o mode_merge.o mode_convert.o MODES=mode_create.o mode_merge.o mode_convert.o
OPTIONS=opt_disl.o opt_group.o opt_orient.o opt_delete.o OPTIONS=opt_disl.o opt_group.o opt_orient.o opt_delete.o
OBJECTS=main.o elements.o io.o subroutines.o functions.o atoms.o call_mode.o box.o $(MODES) $(OPTIONS) call_option.o OBJECTS=main.o elements.o io.o subroutines.o functions.o atoms.o call_mode.o box.o $(MODES) $(OPTIONS) call_option.o

@ -11,7 +11,7 @@ subroutine call_option(option, arg_pos)
character(len=100), intent(in) :: option character(len=100), intent(in) :: option
select case(trim(adjustl(option))) select case(trim(adjustl(option)))
case('-dislgen', '-disloop') case('-dislgen', '-disloop','-vacancydisloop')
call dislocation(option, arg_pos) call dislocation(option, arg_pos)
case('-group') case('-group')
call group(arg_pos) call group(arg_pos)

@ -8,7 +8,7 @@ module opt_disl
use box use box
implicit none implicit none
integer :: vloop_size ! Number of atoms to remove in planar vacancy cluster
real(kind=dp), dimension(3) :: line, slip_plane, centroid!dislocation line, slip plane vectors, centroid, real(kind=dp), dimension(3) :: line, slip_plane, centroid!dislocation line, slip plane vectors, centroid,
real(kind=dp) :: burgers(3) !burgers vector of loop real(kind=dp) :: burgers(3) !burgers vector of loop
real(kind=dp) :: poisson, char_angle, lattice_parameter!Poisson ratio and character angle, lattice_parameter for burgers vector real(kind=dp) :: poisson, char_angle, lattice_parameter!Poisson ratio and character angle, lattice_parameter for burgers vector
@ -37,6 +37,9 @@ module opt_disl
case('-disloop') case('-disloop')
call parse_disloop(arg_pos) call parse_disloop(arg_pos)
call disloop call disloop
case('-vacancydisloop')
call parse_vacancydisloop(arg_pos)
call vacancy_disloop
end select end select
end subroutine dislocation end subroutine dislocation
@ -210,7 +213,7 @@ module opt_disl
arg_pos = arg_pos + 1 arg_pos = arg_pos + 1
loop_radius = 0 loop_radius = 0
call get_command_argument(arg_pos, textholder, arglen) call get_command_argument(arg_pos, textholder, arglen)
if (arglen==0) STOP "Missing loop_size in disloop command" if (arglen==0) STOP "Missing loop_radius in disloop command"
read(textholder, *) loop_radius read(textholder, *) loop_radius
do i = 1, 3 do i = 1, 3
@ -470,61 +473,113 @@ module opt_disl
! !
END FUNCTION DisloSeg_displacement_iso END FUNCTION DisloSeg_displacement_iso
! !
!This code simply creates a planar vacancy cluster and does not apply the dislocation loop displacement field.
! subroutine disloop
! !This subroutine actually creates the dislocation loop.
! real(kind=dp) :: neighbor_dis(loop_size), temp_box(6), dis subroutine parse_vacancydisloop(arg_pos)
! integer :: i, j, index(loop_size) !This subroutine parses the disloop command
! neighbor_dis(:) = HUGE(1.0_dp) integer, intent(inout) :: arg_pos
! index(:) = 0
! !First find the nearest atom to the centroid integer :: i,arglen
! do i = 1, atom_num character(len=100) :: textholder
! if(norm2(r_atom(:,i) - centroid) < neighbor_dis(1)) then
! neighbor_dis(1) = norm2(r_atom(:,i) - centroid) !Parse all of the commands
! index(1) = i arg_pos = arg_pos + 1
! end if loop_normal = ' '
! end do call get_command_argument(arg_pos, loop_normal, arglen)
if (arglen==0) STOP "Missing loop_normal in disloop command"
! !Define a new box, this box tries to isolate all atoms on the plane of the atom !Convert the loop_normal to the dimension
! !closest to the user defined centroid. select case(loop_normal)
! temp_box(:) = box_bd(:) case('x','X', 'y', 'Y', 'z', 'Z')
! temp_box(2*loop_normal) = r_atom(loop_normal,index(1)) + 10.0_dp**(-2.0_dp) continue
! temp_box(2*loop_normal-1) = r_atom(loop_normal,index(1)) - 10.0_dp**(-2.0_dp) case default
print *, "Dimension argument must either be x, y, or z not", loop_normal
! !Now reset the list for the scanning algorithm stop 3
! index(1) = 0 end select
! neighbor_dis(1) = HUGE(1.0_dp)
arg_pos = arg_pos + 1
! !Now scan over all atoms again and find the closest loop_size number of atoms to the initial atom loop_radius = 0
! !that reside on the same plane. call get_command_argument(arg_pos, textholder, arglen)
if (arglen==0) STOP "Missing loop_radius in disloop command"
! do i = 1, atom_num read(textholder, *) loop_radius
! !Check to see if it is on the same plane
! if (in_block_bd(r_atom(:,i), temp_box)) then do i = 1, 3
! dis = norm2(r_atom(:,i) - centroid) arg_pos = arg_pos + 1
! do j = 1, loop_size call get_command_argument(arg_pos, textholder, arglen)
! !Check to see if it is closer than other atoms if (arglen==0) STOP "Missing centroid in disloop command"
! if (dis < neighbor_dis(j)) then call parse_pos(i, textholder, centroid(i))
! !Move values in the neighbor array and add the new neighbor end do
! if(j < loop_size) then
! neighbor_dis(j+1:loop_size) = neighbor_dis(j:loop_size-1) arg_pos=arg_pos+1
! index(j+1:loop_size) = index(j:loop_size-1)
! end if !Now check to make sure that the dimension selected is actually a 1 1 1 direction.
! neighbor_dis(j) = dis ! call in_sub_box(centroid, sbox)
! index(j) = i ! if(.not.((abs(sub_box_ori(loop_normal,1,sbox)) == abs(sub_box_ori(loop_normal,2,sbox))).and. &
! exit ! (abs(sub_box_ori(loop_normal,2,sbox)) == abs(sub_box_ori(loop_normal,3,sbox))).and. &
! end if ! (abs(sub_box_ori(loop_normal,3,sbox)) == abs(sub_box_ori(loop_normal,1,sbox))))) then
! end do
! print *, "The selected dimension ", loop_normal, " for sub_box ", sbox, " is ", &
! sub_box_ori(loop_normal,:,sbox), " which is not in the (111) family of planes"
! STOP 3
! end if ! end if
! end do
! !Now delete the atoms
! call delete_atoms(loop_size, index)
! return end subroutine parse_vacancydisloop
! end subroutine disloop
!This code simply creates a planar vacancy cluster and does not apply the dislocation loop displacement field.
subroutine vacancy_disloop
!This subroutine actually creates the dislocation loop.
real(kind=dp) :: neighbor_dis, temp_box(6), dis, normal_dim
integer :: i, j, index, delete_num, delete_index(atom_num)
neighbor_dis = HUGE(1.0_dp)
index= 0
!First find the nearest atom to the centroid
do i = 1, atom_num
if(norm2(r_atom(:,i) - centroid) < neighbor_dis) then
neighbor_dis = norm2(r_atom(:,i) - centroid)
index = i
end if
end do
!Define a new box, this box tries to isolate all atoms on the plane of the atom
select case(trim(adjustl(loop_normal)))
case('x','X')
normal_dim=1
case('y','Y')
normal_dim=2
case('z','Z')
normal_dim=3
end select
temp_box(:) = box_bd(:)
temp_box(2*normal_dim) = r_atom(normal_dim,index) + 10.0_dp**(-2.0_dp)
temp_box(2*normal_dim-1) = r_atom(normal_dim,index) - 10.0_dp**(-2.0_dp)
!Define the new centroid starting on the nearest atom
centroid = r_atom(:,index)
!Now reset the list for the scanning algorithm
!Now scan over all atoms again and find the closest vloop_size number of atoms to the initial atom
!that reside on the same plane.
delete_num = 0
do i = 1, atom_num
!Check to see if it is on the same plane
if (in_block_bd(r_atom(:,i), temp_box)) then
dis = norm2(r_atom(:,i) - centroid)
!Check to see if it is within the loop radius, if so then add it to the delete list
if (dis < loop_radius) then
delete_num = delete_num + 1
delete_index(delete_num) = i
end if
end if
end do
!Now delete the atoms
call delete_atoms(delete_num, delete_index(1:delete_num))
return
end subroutine vacancy_disloop
end module opt_disl end module opt_disl
Loading…
Cancel
Save