Skip to content
Advertisement

Unable to reproduce results for spherical grid in FIPY

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.

Advertisement

Answer

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.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement