disorientation with symmetryType == 0 returns plain misorientation
complain about unknown symmetryType
This commit is contained in:
parent
adaeb0e1ef
commit
cecffffe2b
|
@ -1075,6 +1075,8 @@ endfunction
|
||||||
msg = 'This material can only be used with elements with three direct stress components'
|
msg = 'This material can only be used with elements with three direct stress components'
|
||||||
case (500)
|
case (500)
|
||||||
msg = 'Unknown lattice type specified'
|
msg = 'Unknown lattice type specified'
|
||||||
|
case (550)
|
||||||
|
msg = 'Unknown symmetry type specified'
|
||||||
case (600)
|
case (600)
|
||||||
msg = 'Convergence not reached'
|
msg = 'Convergence not reached'
|
||||||
case (610)
|
case (610)
|
||||||
|
|
|
@ -122,6 +122,8 @@ real(pReal), dimension(4,36), parameter :: math_symOperations = &
|
||||||
use numerics, only: fixedSeed
|
use numerics, only: fixedSeed
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
|
real(pReal), dimension(3,3) :: R
|
||||||
|
real(pReal), dimension(4) :: q
|
||||||
integer (pInt), dimension(1) :: randInit
|
integer (pInt), dimension(1) :: randInit
|
||||||
integer (pInt) seed
|
integer (pInt) seed
|
||||||
|
|
||||||
|
@ -142,7 +144,7 @@ real(pReal), dimension(4,36), parameter :: math_symOperations = &
|
||||||
|
|
||||||
call halton_seed_set(seed)
|
call halton_seed_set(seed)
|
||||||
call halton_ndim_set(3)
|
call halton_ndim_set(3)
|
||||||
|
|
||||||
ENDSUBROUTINE
|
ENDSUBROUTINE
|
||||||
|
|
||||||
|
|
||||||
|
@ -1512,6 +1514,8 @@ pure function math_QuaternionInSST(Q, symmetryType)
|
||||||
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
!**************************************************************************
|
!**************************************************************************
|
||||||
! calculates the disorientation for 2 orientations Q1 and Q2 (needs quaternions)
|
! calculates the disorientation for 2 orientations Q1 and Q2 (needs quaternions)
|
||||||
!**************************************************************************
|
!**************************************************************************
|
||||||
|
@ -1536,21 +1540,29 @@ pure function math_QuaternionDisorientation(Q1, Q2, symmetryType)
|
||||||
dQ = math_qMul(math_qConj(Q1),Q2)
|
dQ = math_qMul(math_qConj(Q1),Q2)
|
||||||
math_QuaternionDisorientation = dQ
|
math_QuaternionDisorientation = dQ
|
||||||
|
|
||||||
if (symmetryType > 0_pInt .and. symmetryType <= 2_pInt) then
|
select case (symmetryType)
|
||||||
s = sum(math_NsymOperations(1:symmetryType-1))
|
case (0)
|
||||||
do i = 1,2
|
if math_QuaternionMisorientation(1) < 0.0_pReal &
|
||||||
dQ = math_qConj(dQ) ! switch order of "from -- to"
|
math_QuaternionMisorientation = -math_QuaternionMisorientation ! keep omega within 0 to 180 deg
|
||||||
do j = 1,math_NsymOperations(symmetryType) ! run through first crystals symmetries
|
|
||||||
dQsymA = math_qMul(math_symOperations(:,s+j),dQ) ! apply sym
|
case (1,2)
|
||||||
do k = 1,math_NsymOperations(symmetryType) ! run through 2nd crystals symmetries
|
s = sum(math_NsymOperations(1:symmetryType-1))
|
||||||
mis = math_qMul(dQsymA,math_symOperations(:,s+k)) ! apply sym
|
do i = 1,2
|
||||||
if (mis(1) < 0) & ! want positive angle
|
dQ = math_qConj(dQ) ! switch order of "from -- to"
|
||||||
mis = -mis
|
do j = 1,math_NsymOperations(symmetryType) ! run through first crystals symmetries
|
||||||
if (mis(1)-math_QuaternionDisorientation(1) > -1e-8_pReal .and. &
|
dQsymA = math_qMul(math_symOperations(:,s+j),dQ) ! apply sym
|
||||||
math_QuaternionInSST(mis,symmetryType)) &
|
do k = 1,math_NsymOperations(symmetryType) ! run through 2nd crystals symmetries
|
||||||
math_QuaternionDisorientation = mis ! found better one
|
mis = math_qMul(dQsymA,math_symOperations(:,s+k)) ! apply sym
|
||||||
enddo; enddo; enddo
|
if (mis(1) < 0) & ! want positive angle
|
||||||
endif
|
mis = -mis
|
||||||
|
if (mis(1)-math_QuaternionDisorientation(1) > -1e-8_pReal .and. &
|
||||||
|
math_QuaternionInSST(mis,symmetryType)) &
|
||||||
|
math_QuaternionDisorientation = mis ! found better one
|
||||||
|
enddo; enddo; enddo
|
||||||
|
|
||||||
|
case default
|
||||||
|
IO_error(550,symmetryType) ! complain
|
||||||
|
end select
|
||||||
|
|
||||||
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
Loading…
Reference in New Issue