0

I'm trying to reproduce a result from this post (considering fixes provided in answer by jeguyer). But when I try to run the exact same code I receive the following warning:

/home/dmitry/~./conda/envs/FIPY/lib/python3.9/site-packages/fipy/viewers/matplotlibViewer/matplotlibViewer.py:195: UserWarning: Matplotlib is currently using module://matplotlib_inline.backend_inline, which is a non-GUI backend, so cannot show the figure.
  self.fig.show()
/home/dmitry/~./conda/envs/FIPY/lib/python3.9/site-packages/fipy/variables/arithmeticCellToFaceVariable.py:32: RuntimeWarning: invalid value encountered in subtract
  return (cell2 - cell1) * alpha + cell1
/home/dmitry/~./conda/envs/FIPY/lib/python3.9/site-packages/fipy/variables/faceGradVariable.py:124: RuntimeWarning: invalid value encountered in subtract
  N = (N2 - numerix.take(self.var, id1, axis=-1)) / dAP

And resulting array of X_ca all consists of -inf's. Is there any way to fix it? Thank you in advance.

Perfy
  • 15
  • 4
  • I see (close enough) to what you're talking about. I will need to troubleshoot. Thank you for the report. – jeguyer Apr 19 '22 at 14:20
  • @jeguyer, thanks a million, I'm looking forward to the results. – Perfy Apr 21 '22 at 12:45
  • @jeguyer, I discovered, that it occurs only when ran on Ubuntu, when fipy is installed via `conda create --name --channel conda-forge python= fipy`. When I tried to run the same code on Windows, everything was fine. Perhaps it could be useful. – Perfy Apr 25 '22 at 08:02
  • that's helpful to know, thank you – jeguyer Apr 26 '22 at 13:32

1 Answers1

1

As noted in my answer to the question you linked:

Some solvers don't like the spherical mesh, probably because of the enormous range in cell volumes. The SciPy LinearLUSolver seems to work. Judicious preconditioning might help other solvers.

SciPy LU solves. Other solvers, e.g., PETSc LU do not. When you solve on Windows, you get SciPy solvers by default. Ubuntu and macOS default to PETSc.

I don't know what it would take to get other solvers to work.

jeguyer
  • 2,379
  • 1
  • 11
  • 15
  • Thank you very much! Is there any way to change Ubuntu default solvers to scipy version? – Perfy May 11 '22 at 07:40
  • I figured it out, thank you again, problem is solved. – Perfy May 11 '22 at 11:59
  • Glad to hear it. For anybody else, FiPy's default behavior can be modified by a variety of [command-line flags and environment variables](https://www.ctcms.nist.gov/fipy/documentation/USAGE.html#command-line-flags-and-environment-variables). – jeguyer May 11 '22 at 12:23