I am solving the Poisson equation for heterojunction using Fortran90. I use the SOR algorithm to arrive at the potential profile.

  1. I see the weird behavior where the error (the difference between the $n$-th and $(n-1)$-th iteration of the solution) abruptly falls to zero when the error reaches 1e-7 range. Is this behavior expected?

  2. Also, the solution is depending weakly on the choice of the mesh, e.g. potential profiles are off by about 0.02 eV when I choose a coarser mesh. Is this behavior to be expected?

Let me know if I need to provide any additional details.

  • 1
    $\begingroup$ You need to give us more information. What is the matrix size for example? Or are you declaring your variables as floats or doubles? SOR solver is not a so-called optimal solver for your problem - number of iterations to convergence may increase as you refine the mesh. $\endgroup$ Aug 8 '20 at 6:21
  • 2
    $\begingroup$ Is your error measure a relative or absolute difference between iterates? Are you using single or double precision? $\endgroup$ Aug 8 '20 at 14:09
  • $\begingroup$ @AbdullahAliSivas The matrix is about 40000-by-40000. And as you said, the size of the matrix varies with the mesh. All the variables I declare are using selected_real_kind(10,30), which gives a double precision. $\endgroup$
    – prananna
    Aug 9 '20 at 8:05
  • $\begingroup$ @BrianBorchers It is the absolute difference between the iterates. I take the maximum of the absolute value of the matrix resulting from the difference between the two iterates and I use this value to compare with the tolerance in the stopping criteria. $\endgroup$
    – prananna
    Aug 9 '20 at 8:09
  • 1
    $\begingroup$ Are you sure that all of your variables are double precision? What your reporting looks as though the method has converged to single precision and can't make any further progress. What are the computed residuals at the end? $\endgroup$ Aug 10 '20 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.