functions without side-effects are 'pure'

basically all 'getter' functions should be pure
This commit is contained in:
Martin Diehl 2021-12-30 21:55:49 +01:00
parent 95c64f7a0a
commit de9183af4e
2 changed files with 6 additions and 6 deletions

View File

@ -168,17 +168,17 @@ submodule(phase) mechanical
integer, intent(in) :: ph,en integer, intent(in) :: ph,en
end function plastic_dislotwin_homogenizedC end function plastic_dislotwin_homogenizedC
module function elastic_C66(ph,en) result(C66) pure module function elastic_C66(ph,en) result(C66)
real(pReal), dimension(6,6) :: C66 real(pReal), dimension(6,6) :: C66
integer, intent(in) :: ph, en integer, intent(in) :: ph, en
end function elastic_C66 end function elastic_C66
module function elastic_mu(ph,en) result(mu) pure module function elastic_mu(ph,en) result(mu)
real(pReal) :: mu real(pReal) :: mu
integer, intent(in) :: ph, en integer, intent(in) :: ph, en
end function elastic_mu end function elastic_mu
module function elastic_nu(ph,en) result(nu) pure module function elastic_nu(ph,en) result(nu)
real(pReal) :: nu real(pReal) :: nu
integer, intent(in) :: ph, en integer, intent(in) :: ph, en
end function elastic_nu end function elastic_nu

View File

@ -86,7 +86,7 @@ end subroutine elastic_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief return 6x6 elasticity tensor !> @brief return 6x6 elasticity tensor
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module function elastic_C66(ph,en) result(C66) pure module function elastic_C66(ph,en) result(C66)
integer, intent(in) :: & integer, intent(in) :: &
ph, & ph, &
@ -140,7 +140,7 @@ end function elastic_C66
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief return shear modulus !> @brief return shear modulus
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module function elastic_mu(ph,en) result(mu) pure module function elastic_mu(ph,en) result(mu)
integer, intent(in) :: & integer, intent(in) :: &
ph, & ph, &
@ -157,7 +157,7 @@ end function elastic_mu
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief return Poisson ratio !> @brief return Poisson ratio
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module function elastic_nu(ph,en) result(nu) pure module function elastic_nu(ph,en) result(nu)
integer, intent(in) :: & integer, intent(in) :: &
ph, & ph, &