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 2f74e0d070
commit b34655b7fc
2 changed files with 6 additions and 6 deletions

View File

@ -168,17 +168,17 @@ submodule(phase) mechanical
integer, intent(in) :: ph,en
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
integer, intent(in) :: ph, en
end function elastic_C66
module function elastic_mu(ph,en) result(mu)
pure module function elastic_mu(ph,en) result(mu)
real(pReal) :: mu
integer, intent(in) :: ph, en
end function elastic_mu
module function elastic_nu(ph,en) result(nu)
pure module function elastic_nu(ph,en) result(nu)
real(pReal) :: nu
integer, intent(in) :: ph, en
end function elastic_nu

View File

@ -86,7 +86,7 @@ end subroutine elastic_init
!--------------------------------------------------------------------------------------------------
!> @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) :: &
ph, &
@ -140,7 +140,7 @@ end function elastic_C66
!--------------------------------------------------------------------------------------------------
!> @brief return shear modulus
!--------------------------------------------------------------------------------------------------
module function elastic_mu(ph,en) result(mu)
pure module function elastic_mu(ph,en) result(mu)
integer, intent(in) :: &
ph, &
@ -157,7 +157,7 @@ end function elastic_mu
!--------------------------------------------------------------------------------------------------
!> @brief return Poisson ratio
!--------------------------------------------------------------------------------------------------
module function elastic_nu(ph,en) result(nu)
pure module function elastic_nu(ph,en) result(nu)
integer, intent(in) :: &
ph, &