0

I am solving Poisson Equation for heterostructure (AlGaN-GaN system specifically) using SOR method, in FORTRAN. For a specific initialization, the solver gives NAN as output and stops (as I have set the ffpe-trap flag), and for a different initialization the solver runs well.

  1. Should the solution of the poisson equation depend on the choice of the initial potential?

  2. How do I understand the reason for NAN in general iteration method?

Peter Meisrimel
  • 392
  • 2
  • 10
prananna
  • 31
  • 5

1 Answers1

0

The more aggressive solvers converge faster, but tend to have also a smaller basin of attraction. If you start too far away from that, you might enter regions where the method becomes ill-conditioned. This could be caused by too much of the over-relaxation in the SOR method.

It may also happen that the solver diverges, a good solver should check for such rapidly increasing iteration sequences.

Of course, it could also be a "stupid" error in encoding the problem, for that automatic translators from mathematical formulas to the mesh grid equations were invented.

Without more details on the problem and the origin of the error, there is nothing more specific to be said. If you suspect a problem in the encoding of the discretized PDE, then add code here. If you think the problem is more related in the solver setup, or the solver itself, ask a question with more details in scientific computing, scicomp.SE.

Lutz Lehmann
  • 25,219
  • 2
  • 22
  • 51
  • I am able to understand where the error is coming from but I am not sure why. Basically there is a rogue allocatable variable (by rogue I mean it is not used anywhere in the code). Deleting/commenting this statement out solves the problem, but I am unsure as to why this occurs. The statement that I have is the following : real(kind=8),dimension(:,:),allocatable :: abc allocate(abc(size(2d_array,1),size(2d_array,2))) deallocate(abc) – prananna Aug 06 '20 at 01:45
  • An unused variable should have no effect at all. You could try to reduce your code to a minimal situation that still shows this behavior. Then ask a question with this MWE about this strange behavior. // Does the compiler have flags for range-checking? – Lutz Lehmann Aug 06 '20 at 06:37