intention more clear
This commit is contained in:
parent
66302fa6da
commit
65decfc48a
31
src/math.f90
31
src/math.f90
|
@ -975,14 +975,14 @@ pure function math_eigenvectorBasisSym33(m)
|
|||
real(pReal), dimension(3,3,3) :: N, EB
|
||||
|
||||
I = math_invariantsSym33(m)
|
||||
EB = 0.0_pReal
|
||||
|
||||
P = I(2)-I(1)**2.0_pReal/3.0_pReal
|
||||
Q = -2.0_pReal/27.0_pReal*I(1)**3.0_pReal+product(I(1:2))/3.0_pReal-I(3)
|
||||
|
||||
threeSimilarEigVals: if(all(abs([P,Q]) < TOL)) then
|
||||
v = I(1)/3.0_pReal
|
||||
! this is not really correct, but at least the basis is correct
|
||||
! this is not really correct, but at least the basis is correct
|
||||
EB = 0.0_pReal
|
||||
EB(1,1,1)=1.0_pReal
|
||||
EB(2,2,2)=1.0_pReal
|
||||
EB(3,3,3)=1.0_pReal
|
||||
|
@ -997,18 +997,21 @@ pure function math_eigenvectorBasisSym33(m)
|
|||
N(1:3,1:3,2) = m-v(2)*math_I3
|
||||
N(1:3,1:3,3) = m-v(3)*math_I3
|
||||
twoSimilarEigVals: if(abs(v(1)-v(2)) < TOL) then
|
||||
EB(1:3,1:3,3)=matmul(N(1:3,1:3,1),N(1:3,1:3,2))/((v(3)-v(1))*(v(3)-v(2)))
|
||||
EB(1:3,1:3,1)=math_I3-EB(1:3,1:3,3)
|
||||
EB(1:3,1:3,3) = matmul(N(1:3,1:3,1),N(1:3,1:3,2))/((v(3)-v(1))*(v(3)-v(2)))
|
||||
EB(1:3,1:3,1) = math_I3-EB(1:3,1:3,3)
|
||||
EB(1:3,1:3,2) = 0.0_pReal
|
||||
elseif (abs(v(2)-v(3)) < TOL) then twoSimilarEigVals
|
||||
EB(1:3,1:3,1)=matmul(N(1:3,1:3,2),N(1:3,1:3,3))/((v(1)-v(2))*(v(1)-v(3)))
|
||||
EB(1:3,1:3,2)=math_I3-EB(1:3,1:3,1)
|
||||
EB(1:3,1:3,1) = matmul(N(1:3,1:3,2),N(1:3,1:3,3))/((v(1)-v(2))*(v(1)-v(3)))
|
||||
EB(1:3,1:3,2) = math_I3-EB(1:3,1:3,1)
|
||||
EB(1:3,1:3,3) = 0.0_pReal
|
||||
elseif (abs(v(3)-v(1)) < TOL) then twoSimilarEigVals
|
||||
EB(1:3,1:3,2)=matmul(N(1:3,1:3,3),N(1:3,1:3,1))/((v(2)-v(3))*(v(2)-v(1)))
|
||||
EB(1:3,1:3,1)=math_I3-EB(1:3,1:3,2)
|
||||
EB(1:3,1:3,2) = matmul(N(1:3,1:3,3),N(1:3,1:3,1))/((v(2)-v(3))*(v(2)-v(1)))
|
||||
EB(1:3,1:3,1) = math_I3-EB(1:3,1:3,2)
|
||||
EB(1:3,1:3,3) = 0.0_pReal
|
||||
else twoSimilarEigVals
|
||||
EB(1:3,1:3,1)=matmul(N(1:3,1:3,2),N(1:3,1:3,3))/((v(1)-v(2))*(v(1)-v(3)))
|
||||
EB(1:3,1:3,2)=matmul(N(1:3,1:3,1),N(1:3,1:3,3))/((v(2)-v(3))*(v(2)-v(1)))
|
||||
EB(1:3,1:3,3)=matmul(N(1:3,1:3,1),N(1:3,1:3,2))/((v(3)-v(1))*(v(3)-v(2)))
|
||||
EB(1:3,1:3,1) = matmul(N(1:3,1:3,2),N(1:3,1:3,3))/((v(1)-v(2))*(v(1)-v(3)))
|
||||
EB(1:3,1:3,2) = matmul(N(1:3,1:3,1),N(1:3,1:3,3))/((v(2)-v(3))*(v(2)-v(1)))
|
||||
EB(1:3,1:3,3) = matmul(N(1:3,1:3,1),N(1:3,1:3,2))/((v(3)-v(1))*(v(3)-v(2)))
|
||||
endif twoSimilarEigVals
|
||||
endif threeSimilarEigVals
|
||||
|
||||
|
@ -1025,17 +1028,17 @@ end function math_eigenvectorBasisSym33
|
|||
function math_rotationalPart(m)
|
||||
|
||||
real(pReal), intent(in), dimension(3,3) :: m
|
||||
real(pReal), dimension(3,3) :: math_rotationalPart33
|
||||
real(pReal), dimension(3,3) :: math_rotationalPart
|
||||
real(pReal), dimension(3,3) :: U , Uinv
|
||||
|
||||
U = math_eigenvectorBasisSym33(matmul(transpose(m),m))
|
||||
Uinv = math_inv33(U)
|
||||
|
||||
inversionFailed: if (all(dEq0(Uinv))) then
|
||||
math_rotationalPart33 = math_I3
|
||||
math_rotationalPart = math_I3
|
||||
call IO_warning(650)
|
||||
else inversionFailed
|
||||
math_rotationalPart33 = matmul(m,Uinv)
|
||||
math_rotationalPart = matmul(m,Uinv)
|
||||
endif inversionFailed
|
||||
|
||||
end function math_rotationalPart
|
||||
|
|
Loading…
Reference in New Issue