Now, the solver needs to be an input parameter of the case, to select if it is for charged or neutral particles. Resolution of Poisson equation with Dirichlet boundary conditions is possible. The source vector is the charge density. This resolution is done in two steps to save computational time: 1. When reading the mesh, the PLU factorization of the K matrix is computed. 2. In each iteration, the system K*u = f is solved, in which f is the source vector (charge density) and u is the solution (potential) in each node. No case has been added to the repository. This will be done in next commit. The 'non-analog' scheme has been commented. It still needs to split the particle to avoid 'overweight' particles.
43 lines
1.1 KiB
Fortran
43 lines
1.1 KiB
Fortran
!moduleErrors: Manages the different type of errors the program can produce.
|
|
! By errors we understand critical errors (that stop the program),
|
|
! warnings (that only output a message with a WARNING tag),
|
|
! o verbose outputs that can be used for debugging porpouse.
|
|
MODULE moduleErrors
|
|
CONTAINS
|
|
SUBROUTINE criticalError(msg, pgr)
|
|
IMPLICIT NONE
|
|
|
|
CHARACTER(*), INTENT(in):: msg, pgr
|
|
CHARACTER(:), ALLOCATABLE:: errorMsg
|
|
|
|
errorMsg = "CRITICAL error in " // pgr // " with message:" // NEW_LINE('A') // msg
|
|
|
|
ERROR STOP errorMsg
|
|
|
|
END SUBROUTINE criticalError
|
|
|
|
SUBROUTINE warningError(msg)
|
|
IMPLICIT NONE
|
|
|
|
CHARACTER(*), INTENT(in):: msg
|
|
CHARACTER(:), ALLOCATABLE:: errorMsg
|
|
|
|
errorMsg = "WARNING: " // msg
|
|
|
|
WRITE (*, '(A)') errorMsg
|
|
|
|
END SUBROUTINE warningError
|
|
|
|
SUBROUTINE verboseError(msg)
|
|
IMPLICIT NONE
|
|
|
|
CHARACTER(*), INTENT(in):: msg
|
|
CHARACTER(:), ALLOCATABLE:: errorMsg
|
|
|
|
errorMsg = msg
|
|
|
|
WRITE (*, '(A)') errorMsg
|
|
|
|
END SUBROUTINE verboseError
|
|
|
|
END MODULE moduleErrors
|