working changes to bcc files

development
Alex Selimov 5 years ago
parent f6c0cf93f2
commit acd902db4b

@ -27,7 +27,7 @@ module elements
integer :: atom_types = 0
!Variables for creating elements based on primitive cells
real(kind=dp) :: cubic_cell(3,8), fcc_cell(3,8), fcc_mat(3,3), fcc_inv(3,3)
real(kind=dp) :: cubic_cell(3,8), fcc_cell(3,8), fcc_mat(3,3), fcc_inv(3,3), bcc_cell(3,8), bcc_mat(3,3), bcc_inv(3,3)
integer :: cubic_faces(4,6)
!Below are lattice type arrays which provide information on the general form of the elements.
@ -86,7 +86,26 @@ module elements
0.0_dp, 0.5_dp, 0.5_dp, &
0.5_dp, 0.0_dp, 0.5_dp /), &
shape(fcc_mat))
!Initialize the bcc primitive cell
bcc_cell = reshape((/ 0.0_dp, 0.0_dp, 0.0_dp, &
0.5_dp, -0.5_dp, 0.5_dp, &
1.0_dp, 0.0_dp, 1.0_dp, &
0.5_dp, 0.5_dp, 0.5_dp, &
0.5_dp, 0.5_dp, -0.5_dp, &
0.0_dp, 0.0_dp, 1.0_dp, &
0.5_dp, 0.5_dp, 1.5_dp /), &
shape(bcc_cell))
bcc_mat = reshape((/ 0.5_dp, 0.5_dp, -0.5_dp, &
-0.5_dp, 0.5_dp, 0.5_dp, &
0.5_dp, 0.5_dp, 0.5_dp /), &
shape(bcc_mat))
call matrix_inverse(fcc_mat,3,fcc_inv)
call matrix_inverse(bcc_mat,3,bcc_inv)
max_basisnum = 0
basisnum(:) = 0
@ -300,6 +319,8 @@ module elements
select case(trim(adjustl(element_types(i))))
case('fcc')
ng_node(i) = 8
case('bcc')
ng_node(i) = 8
end select
if(ng_node(i) > max_ng_node) max_ng_node = ng_node(i)
@ -345,7 +366,7 @@ module elements
end select
select case(trim(adjustl(type)))
case('fcc')
case('fcc','bcc')
allocate(a_shape(8))
!Now loop over all the possible sites
do it = 1, esize
@ -632,4 +653,4 @@ module elements
end select
end subroutine
end module elements
end module elements

@ -63,10 +63,17 @@ module mode_create
do i = 1, 8
box_vert(:,i) = duplicate(:)*esize*lattice_space(:)*cubic_cell(:,i) + (origin(:)/lattice_parameter)
end do
!Now get the rotated box vertex positions in lattice space. Should be integer units
box_lat_vert = int(matmul(fcc_inv, matmul(orient_inv, box_vert)))+1
!Now get the rotated box vertex positions in lattice space. Should be integer units and get the new maxlen
select case(trim(adjustl(element_type)))
case('fcc')
box_lat_vert = int(matmul(fcc_inv, matmul(orient_inv, box_vert)))+1
maxbd = maxval(matmul(orient,matmul(fcc_mat,box_lat_vert)),2)
case('bcc')
box_lat_vert = int(matmul(bcc_inv, matmul(orient_inv, box_vert)))+1
maxbd = maxval(matmul(orient,matmul(bcc_mat,box_lat_vert)),2)
end select
!Find the new maxlen
maxbd = maxval(matmul(orient,matmul(fcc_mat,box_lat_vert)),2)
do i = 1, 3
box_bd(2*i) = maxval(box_vert(i,:)) - 0.25_dp*lattice_space(i)
box_bd(2*i-1) = origin(i)-0.25_dp*lattice_space(i)
@ -83,7 +90,12 @@ module mode_create
box_vert(:,i) = (cubic_cell(:,i)*box_len(:) + origin(:))/lattice_parameter
end do
!Now get the rotated box vertex positions in lattice space. Should be integer units
box_lat_vert = int(matmul(fcc_inv, matmul(orient_inv, box_vert)))+1
select case(trim(adjustl(element_type)))
case('fcc')
box_lat_vert = int(matmul(fcc_inv, matmul(orient_inv, box_vert)))+1
case('bcc')
box_lat_vert = int(matmul(bcc_inv, matmul(orient_inv, box_vert)))+1
end select
!Now get the box_bd in lattice units
do i = 1, 3
@ -117,8 +129,9 @@ module mode_create
!Call the build function with the correct transformation matrix
select case(trim(adjustl(element_type)))
case('fcc')
call build_with_rhomb(box_lat_vert, fcc_mat)
case('bcc')
call build_with_rhomb(box_lat_vert, bcc_mat)
case default
print *, "Element type ", trim(adjustl(element_type)), " not accepted in mode create, please specify a supported ", &
"element type"
@ -270,13 +283,20 @@ module mode_create
lattice_space(i) = 0.5_dp * lattice_space(i)
!Check if one direction is 112
else if ((is_equal(abs(orient(i,1)), abs(orient(i,2))).and.(is_equal(abs(orient(i,3)),2.0_dp*abs(orient(i,1))))).or.&
(is_equal(abs(orient(i,2)), abs(orient(i,3))).and.(is_equal(abs(orient(i,1)),2.0_dp*abs(orient(i,2))))).or.&
(is_equal(abs(orient(i,3)), abs(orient(i,1))).and.(is_equal(abs(orient(i,2)),2.0_dp*abs(orient(i,3))))))&
then
else if((is_equal(abs(orient(i,1)), abs(orient(i,2))).and.(is_equal(abs(orient(i,3)),2.0_dp*abs(orient(i,1))))).or.&
(is_equal(abs(orient(i,2)), abs(orient(i,3))).and.(is_equal(abs(orient(i,1)),2.0_dp*abs(orient(i,2))))).or.&
(is_equal(abs(orient(i,3)), abs(orient(i,1))).and.(is_equal(abs(orient(i,2)),2.0_dp*abs(orient(i,3))))))&
then
lattice_space(i) = 0.5_dp * lattice_space(i)
end if
end do
case('bcc')
do i = 1, 3
!Check if the direction is 111
if((is_equal(abs(orient(i,1)),abs(orient(i,2)))).and.(is_equal(abs(orient(i,2)),abs(orient(i,3))))) then
lattice_space(i) = 0.5_dp * lattice_space(i)
end if
end do
end select
@ -518,4 +538,4 @@ module mode_create
end subroutine error_message
end module mode_create
end module mode_create

Loading…
Cancel
Save