Subroutine to assemble elemental matrices in the solver matrices
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(MAT_SOLV), | intent(inout) | :: | mat | mat_solv type |
||
integer(kind=I4), | intent(in) | :: | num | element number |
||
integer(kind=I4), | intent(in) | :: | nelt | size of elemental matrix |
||
integer(kind=I4), | intent(in) | :: | nline | number of lines |
||
integer(kind=I4), | intent(in), | dimension(nelt) | :: | tind | index table of elemental matrix |
|
real(kind=R8), | intent(in), | dimension(nelt, nelt) | :: | m_elt | elemental matrix |
|
integer(kind=I4), | intent(inout), | dimension(2) | :: | compt | number to index the position in the solver matrix |
subroutine assemble_in_mat_sol(mat, num, nelt, nline, tind, m_elt, compt)
implicit none
type(MAT_SOLV), intent(inout) :: mat !! *mat_solv type*
integer(kind=I4), intent(in ) :: num !! *element number*
integer(kind=I4), intent(in ) :: nelt !! *size of elemental matrix*
integer(kind=I4), intent(in ) :: nline !! *number of lines*
integer(kind=I4), intent(in ), dimension(nelt) :: tind !! *index table of elemental matrix*
real(kind=R8), intent(in ), dimension(nelt, nelt) :: m_elt !! *elemental matrix*
integer(kind=I4), intent(inout), dimension(2) :: compt !! *number to index the position in the solver matrix*
integer(kind=I4) :: i, j
! check compt
if (compt(2) > mat%nt) stop 'compt > matrix size in assemble_in_mat_sol'
do j = 1, nline
mat%eltvar(compt(1)) = tind(j)
compt(1) = compt(1) +1
enddo
mat%eltptr(num+1) = compt(1)
do j = 1, nelt
do i = 1, nelt
mat%a_elt(compt(2)) = m_elt(i, j)
compt(2) = compt(2) + 1
enddo
enddo
return
endsubroutine assemble_in_mat_sol