Research Article

Efficient Alternative for Construction of the Linear System Stemming from Numerical Solution of Heat Transfer Problems via FEM

Code 1

Piece of the code that constructs the global linear system.
ka = 1
do i = 1,NNost
 do j = 1,8
  if(KNN(i,j).eq.0) then
  go to (1)
  end if
  do jj = 1,NNos
   if(KCONEC(KNN(i,j),jj).eq.i) then  !KCONEC is the connectivity matrix conform Table 1
   iAUX = jj   ! discover of which line of the element is the contribution
   go to (2)
   end if
  end do
(2) do ii = 1,NNos 
   do jj = ka,k
    if(Mjcol(jj).eq.KCONEC(KNN(i,j),ii).and.Mirow(jj).eq.i) then
    GG(jj) = GG(jj) + G(iAUX,ii) !G is the element matrix
    iAUXj = jj + 1
    go to (3)
    end if
   end do
(3) continue
  end do
 end do
(1) continue
ka = iAUXj
end do