Merge pull request #15 from aselimov/bg--fix-to-dislgen
Bg fix to dislgen
This commit is contained in:
commit
4e592fb4aa
4 changed files with 72 additions and 28 deletions
|
@ -642,7 +642,11 @@ module io
|
|||
read(11,*) ((sub_box_ori(j, k, sub_box_num+i), j = 1, 3), k = 1, 3)
|
||||
!Read in subbox boundaries
|
||||
read(11,*) sub_box_bd(:,sub_box_num+i)
|
||||
sub_box_bd(:,sub_box_num+i) = sub_box_bd(:, sub_box_num+i) + displace(:)
|
||||
|
||||
do j = 1, 3
|
||||
sub_box_bd(2*j-1,sub_box_num+i) = sub_box_bd(2*j-1, sub_box_num+i) + displace(j)
|
||||
sub_box_bd(2*j,sub_box_num+i) = sub_box_bd(2*j, sub_box_num+i) + displace(j)
|
||||
end do
|
||||
!Read in sub_box_array_bd
|
||||
read(11,*) ((sub_box_array_bd(j, k, sub_box_num+i), j = 1, 2), k = 1, 2)
|
||||
end do
|
||||
|
|
|
@ -70,7 +70,11 @@ module opt_disl
|
|||
call parse_pos(i, textholder, centroid(i))
|
||||
end do
|
||||
|
||||
print *, centroid
|
||||
arg_pos = arg_pos + 1
|
||||
call get_command_argument(arg_pos, textholder, arglen)
|
||||
if (arglen==0) STOP "Missing parameter in dislgen command"
|
||||
read(textholder, *) b
|
||||
|
||||
|
||||
arg_pos = arg_pos + 1
|
||||
call get_command_argument(arg_pos, textholder, arglen)
|
||||
|
@ -84,26 +88,6 @@ module opt_disl
|
|||
read(textholder, *) poisson
|
||||
|
||||
arg_pos = arg_pos + 1
|
||||
call get_command_argument(arg_pos, lattice, arglen)
|
||||
if (arglen==0) STOP "Missing lattice in dislgen command"
|
||||
|
||||
arg_pos = arg_pos + 1
|
||||
call get_command_argument(arg_pos, textholder, arglen)
|
||||
if (arglen==0) STOP "Missing lattice parameter in dislgen command"
|
||||
read(textholder, *) lattice_parameter
|
||||
|
||||
arg_pos = arg_pos + 1
|
||||
!Now set the vurgers vector based on the lattice paarameter and lattice type
|
||||
select case(lattice)
|
||||
case('fcc')
|
||||
b = lattice_parameter / sqrt(2.0_dp)
|
||||
! case('bcc')
|
||||
! b = lattice_parameter * sqrt(3.0_dp) / 2.0_dp
|
||||
case default
|
||||
print *, 'Error: Lattice structure', lattice, ' is not accepted for dislgen option'
|
||||
STOP
|
||||
end select
|
||||
|
||||
end subroutine parse_dislgen
|
||||
|
||||
subroutine dislgen
|
||||
|
@ -168,7 +152,7 @@ module opt_disl
|
|||
do i = 1, ele_num
|
||||
do inod=1, ng_node(lat_ele(i))
|
||||
do ibasis = 1, basisnum(lat_ele(i))
|
||||
r = r_node(:,ibasis,inod,i)
|
||||
r = r_node(:,ibasis,inod,i)-centroid
|
||||
r = matmul(inv_transform, r)
|
||||
if (r(1) == 0) then
|
||||
actan = pi/2
|
||||
|
|
|
@ -186,15 +186,26 @@ module subroutines
|
|||
pos=box_bd(2*i-1)
|
||||
else if ((index(pos_string,'-') > 0).and.(index(pos_string,'inf')>0)) then
|
||||
!Now extract the number we are reducing from infinity
|
||||
read(pos_string(index(pos_string,'-')+1:), *, iostat=iospara) pos
|
||||
if(index(pos_string,'inf') < index(pos_string,'-')) then
|
||||
read(pos_string(index(pos_string,'-')+1:), *, iostat=iospara) pos
|
||||
else
|
||||
read(pos_string(1:index(pos_string,'-')-1), *, iostat=iospara) pos
|
||||
end if
|
||||
pos = box_bd(2*i) - pos
|
||||
else if ((index(pos_string,'+') > 0).and.(index(pos_string,'inf')>0)) then
|
||||
!Now extract the number we are reducing from infinity
|
||||
read(pos_string(index(pos_string,'+')+1:), *, iostat=iospara) pos
|
||||
pos = box_bd(2*i-1) + pos
|
||||
if(index(pos_string,'inf') < index(pos_string,'-')) then
|
||||
read(pos_string(index(pos_string,'+')+1:), *, iostat=iospara) pos
|
||||
else
|
||||
read(pos_string(1:index(pos_string,'+')-1), *, iostat=iospara) pos
|
||||
end if
|
||||
else if ((index(pos_string,'*') > 0).and.(index(pos_string,'inf')>0)) then
|
||||
!Now extract the number we are reducing from infinity
|
||||
read(pos_string(index(pos_string,'*')+1:), *, iostat=iospara) pos
|
||||
if(index(pos_string,'inf') < index(pos_string,'-')) then
|
||||
read(pos_string(index(pos_string,'*')+1:), *, iostat=iospara) pos
|
||||
else
|
||||
read(pos_string(1:index(pos_string,'*')-1), *, iostat=iospara) pos
|
||||
end if
|
||||
pos = (box_bd(2*i)-box_bd(2*i-1))*pos
|
||||
else
|
||||
read(pos_string, *, iostat=iospara) pos
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue