material Function

public pure function material(dim, E, nu) result(D)

Isotropic elasticity matrix in Voigt notation: bar (1D), plane strain (2D), solid (3D)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: dim
real(kind=dp), intent(in) :: E
real(kind=dp), intent(in) :: nu

Return Value ../../../real(kind=dp), (dim*(dim+1)/2,dim*(dim+1)/2)


Source Code

pure function material(dim, E, nu) result(D)
  !! Isotropic elasticity matrix in Voigt notation: bar (1D), plane strain (2D), solid (3D)
  integer, intent(in) :: dim
  real(dp), intent(in) :: E, nu
  real(dp) :: D(dim*(dim+1)/2, dim*(dim+1)/2)
  integer :: i

  D = 0
  if (dim == 1) then
    D(1,1) = E
    return
  end if
  D(1:dim, 1:dim) = nu
  do i = 1, dim
    D(i,i) = 1 - nu
  end do
  do i = dim+1, size(D,1)
    D(i,i) = (1 - 2*nu)/2
  end do
  D = E/((1 + nu)*(1 - 2*nu))*D
end function material