Routine to calculate the elemental mass/stiffness matrix based on the derivatives of the basis functions.
Currently only zero-th and first order derivatives are supported. Second order derivatives need to be reduced to first order derivatives in the problem formulation using Green's Theorem (i.e. derivation by parts)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | N | Number of nodes in basis function |
||
| integer, | intent(in) | :: | d1 | Derivative of the first basis function |
||
| integer, | intent(in) | :: | d2 | Derivative of the second basis function |
||
| real(kind=wp), | intent(in), | dimension(N) | :: | xy | Coordinates of the 1D line element |
Output elemental matrix
module function assembleElementalMatrix1D(N, d1, d2, xy) result(Ie)
!* Routine to calculate the elemental mass/stiffness matrix
! based on the derivatives of the basis functions.
!
! Currently only zero-th and first order derivatives are
! supported. Second order derivatives need to be reduced to
! first order derivatives in the problem formulation using
! Green's Theorem (i.e. derivation by parts)
integer, intent(in) :: N !! Number of nodes in basis function
integer, intent(in) :: d1 !! Derivative of the first basis function
integer, intent(in) :: d2 !! Derivative of the second basis function
real(wp), intent(in), dimension(N) :: xy !! Coordinates of the 1D line element
real(wp), dimension(N,N) :: Ie !! Output elemental matrix
integer :: ii, jj, order
Ie = 0._wp
order = N-1
do ii = 1, N
Ie(ii, :) = [( integrate_basis_1d_Ie(order, ii, jj, d1, d2, xy), jj = 1, order+1 )]
enddo
return
end function assembleElementalMatrix1D