diff --git a/src/IO.f90 b/src/IO.f90 index c3bfb9742..6e467cb89 100644 --- a/src/IO.f90 +++ b/src/IO.f90 @@ -44,6 +44,7 @@ contains subroutine IO_init write(6,'(/,a)') ' <<<+- IO init -+>>>'; flush(6) + call unitTest end subroutine IO_init @@ -651,7 +652,7 @@ end function verifyFloatValue !-------------------------------------------------------------------------------------------------- -!> @brief check correctness of IO functions +!> @brief check correctness of some IO functions !-------------------------------------------------------------------------------------------------- subroutine unitTest diff --git a/src/lattice.f90 b/src/lattice.f90 index b41a7f261..aae5564bf 100644 --- a/src/lattice.f90 +++ b/src/lattice.f90 @@ -502,15 +502,10 @@ subroutine lattice_init lattice_C66(1:6,1:6,p) = applyLatticeSymmetryC66(lattice_C66(1:6,1:6,p),structure) - ! (C11iso-C12iso)/2 with C11iso=(3*C11+2*C12+4*C44)/5 and C12iso=(C11+4*C12-2*C44)/5 - lattice_mu(p) = 0.2_pReal *(lattice_C66(1,1,p) -lattice_C66(1,2,p) +3.0_pReal*lattice_C66(4,4,p)) - - ! C12iso/(C11iso+C12iso) with C11iso=(3*C11+2*C12+4*C44)/5 and C12iso=(C11+4*C12-2*C44)/5 - lattice_nu(p) = ( lattice_C66(1,1,p) +4.0_pReal*lattice_C66(1,2,p) -2.0_pReal*lattice_C66(4,4,p)) & - / (4.0_pReal*lattice_C66(1,1,p) +6.0_pReal*lattice_C66(1,2,p) +2.0_pReal*lattice_C66(4,4,p)) + lattice_mu(p) = equivalent_mu(lattice_C66(1:6,1:6,p),'voigt') + lattice_nu(p) = equivalent_nu(lattice_C66(1:6,1:6,p),'voigt') lattice_C66(1:6,1:6,p) = math_sym3333to66(math_Voigt66to3333(lattice_C66(1:6,1:6,p))) ! Literature data is in Voigt notation - do i = 1, 6 if (abs(lattice_C66(i,i,p)) @brief check correctness of some lattice functions +!-------------------------------------------------------------------------------------------------- +subroutine unitTest + + real(pReal), dimension(:,:,:), allocatable :: CoSy + real(pReal), dimension(:,:), allocatable :: system + + real(pReal), dimension(6,6) :: C + real(pReal), dimension(2) :: r + real(pReal) :: lambda + + call random_number(r) + + system = reshape([1.0_pReal+r(1),0.0_pReal,0.0_pReal, 0.0_pReal,1.0_pReal+r(2),0.0_pReal],[6,1]) + CoSy = buildCoordinateSystem([1],[1],system,'fcc',0.0_pReal) + + if(any(dNeq(CoSy(1:3,1:3,1),math_I3))) & + call IO_error(0) + + call random_number(C) + C(1,1) = C(1,1) + 1.0_pReal + C = applyLatticeSymmetryC66(C,'iso') + if(dNeq(C(6,6),equivalent_mu(C,'voigt'),1.0e-12_pReal)) & + call IO_error(0,ext_msg='equivalent_mu/voigt') + if(dNeq(C(6,6),equivalent_mu(C,'voigt'),1.0e-12_pReal)) & + call IO_error(0,ext_msg='equivalent_mu/reuss') + lambda = C(1,2) + if(dNeq(lambda*0.5_pReal/(lambda+equivalent_mu(C,'voigt')),equivalent_nu(C,'voigt'),1.0e-12_pReal)) & + call IO_error(0,ext_msg='equivalent_nu/voigt') + if(dNeq(lambda*0.5_pReal/(lambda+equivalent_mu(C,'reuss')),equivalent_nu(C,'reuss'),1.0e-12_pReal)) & + call IO_error(0,ext_msg='equivalent_nu/reuss') + +end subroutine unitTest + end module lattice diff --git a/src/math.f90 b/src/math.f90 index 0be62e3fa..c8242d678 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -1213,7 +1213,7 @@ end function math_clip !-------------------------------------------------------------------------------------------------- -!> @brief check correctness of (some) math functions +!> @brief check correctness of some math functions !-------------------------------------------------------------------------------------------------- subroutine unitTest diff --git a/src/prec.f90 b/src/prec.f90 index 8ced9813a..5f324f148 100644 --- a/src/prec.f90 +++ b/src/prec.f90 @@ -241,7 +241,7 @@ end function cNeq !-------------------------------------------------------------------------------------------------- -!> @brief check correctness of (some) prec functions +!> @brief check correctness of some prec functions !-------------------------------------------------------------------------------------------------- subroutine unitTest diff --git a/src/quaternions.f90 b/src/quaternions.f90 index 4e40ecc4e..8d62fe6aa 100644 --- a/src/quaternions.f90 +++ b/src/quaternions.f90 @@ -455,7 +455,7 @@ end function inverse !-------------------------------------------------------------------------------------------------- -!> @brief check correctness of (some) quaternions functions +!> @brief check correctness of some quaternions functions !-------------------------------------------------------------------------------------------------- subroutine unitTest diff --git a/src/rotations.f90 b/src/rotations.f90 index c1fb1f2cf..7ce366f74 100644 --- a/src/rotations.f90 +++ b/src/rotations.f90 @@ -1222,7 +1222,7 @@ end function cu2ho !-------------------------------------------------------------------------------------------------- -!> @brief check correctness of (some) rotations functions +!> @brief check correctness of some rotations functions !-------------------------------------------------------------------------------------------------- subroutine unitTest