corrected math_misorientation
This commit is contained in:
parent
ac080e0b52
commit
aee0721ab2
|
@ -303,12 +303,8 @@ subroutine math_misorientation(axis, angle, rot, ori1, ori2, symmetryType)
|
||||||
do s1 = 1,NsymOperations
|
do s1 = 1,NsymOperations
|
||||||
ori1sym = math_mul33x33(mySymOperations(:,:,s1), ori1)
|
ori1sym = math_mul33x33(mySymOperations(:,:,s1), ori1)
|
||||||
|
|
||||||
! apply symmetry operation to 2nd orientation
|
! calculate possible net rotation
|
||||||
do s2 = 1,NsymOperations
|
this_rot = math_mul33x33(ori1sym, transpose(ori2))
|
||||||
ori2sym = math_mul33x33(mySymOperations(:,:,s2), ori2)
|
|
||||||
|
|
||||||
! calculate 2 possible net rotations
|
|
||||||
this_rot = math_mul33x33(ori1sym, transpose(ori2sym))
|
|
||||||
|
|
||||||
! store smallest misorientation for an axis inside standard orientation triangle
|
! store smallest misorientation for an axis inside standard orientation triangle
|
||||||
! calculate rotation axis
|
! calculate rotation axis
|
||||||
|
@ -319,20 +315,14 @@ subroutine math_misorientation(axis, angle, rot, ori1, ori2, symmetryType)
|
||||||
this_axis(2) = (this_rot(3,1) - this_rot(1,3)) * invNorm
|
this_axis(2) = (this_rot(3,1) - this_rot(1,3)) * invNorm
|
||||||
this_axis(3) = (this_rot(1,2) - this_rot(2,1)) * invNorm
|
this_axis(3) = (this_rot(1,2) - this_rot(2,1)) * invNorm
|
||||||
|
|
||||||
if ( (this_axis(1) >= 0.0_pReal) .and. (this_axis(2) >= 0.0_pReal) .and. (this_axis(3) >= 0.0_pReal) &
|
|
||||||
.and. (this_axis(1) <= this_axis(2)) .and. (this_axis(2) <= this_axis(3)) ) then
|
|
||||||
|
|
||||||
! calculate rotation angle
|
! calculate rotation angle
|
||||||
this_angle = acos(0.5_pReal * (this_rot(1,1) + this_rot(2,2) + this_rot(3,3) - 1.0_pReal))
|
this_angle = abs(0.5_pReal * pi - asin(0.4999999_pReal * (this_rot(1,1) + this_rot(2,2) + this_rot(3,3) - 1.0_pReal)))
|
||||||
|
|
||||||
if (abs(this_angle) < angle) then
|
if (abs(this_angle) < angle) then
|
||||||
angle = this_angle
|
angle = this_angle
|
||||||
rot = this_rot
|
rot = this_rot
|
||||||
axis = this_axis
|
axis = this_axis
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif
|
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
! convert angle to degrees
|
! convert angle to degrees
|
||||||
|
|
Loading…
Reference in New Issue