module coeficientes_e_fontes

use variaveis
use dados

contains

!--------------------------------------------------------------------

subroutine coef_internos

	! Nós internos
	do i = 2, Nv2-1
		
		aux1 = (i-1)*Nv1

		do j = 2, Nv1-1

			aux2 = aux1 + j

			ae (aux2) =        alpha(aux2) + 0.5d0*P(aux2)/Jac(aux2)**2
			aw (aux2) =        alpha(aux2) - 0.5d0*P(aux2)/Jac(aux2)**2
			an (aux2) =        gama(aux2)  + 0.5d0*Q(aux2)/Jac(aux2)**2
			as (aux2) =        gama(aux2)  - 0.5d0*Q(aux2)/Jac(aux2)**2
			ane(aux2) = -0.5d0*beta(aux2)
			anw(aux2) =  0.5d0*beta(aux2)
			ase(aux2) =  0.5d0*beta(aux2)
			asw(aux2) = -0.5d0*beta(aux2)
			ap (aux2) = ae(aux2) + aw(aux2) + an(aux2) + as(aux2)
		
		end do

	end do

end subroutine coef_internos

!--------------------------------------------------------------------

subroutine funcoes_P_Q

	select case (fP)
	case (2)

	case default
		
		P = 0.0d0

	end select

	select case (fQ)
	case (2)

	case default
		
		Q = 0.0d0

	end select


end subroutine funcoes_P_Q

!--------------------------------------------------------------------

end module coeficientes_e_fontes