File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 720
720
721
721
and solve the steady-state problem
722
722
723
- >>> DiffusionTerm(coeff=D).solve(var=phi) #doctest: +PYSPARSE_SOLVER
723
+ >>> try:
724
+ ... DiffusionTerm(coeff=D).solve(var=phi)
725
+ ... except:
726
+ ... pass
724
727
>>> if __name__ == '__main__':
725
728
... viewer.plot()
726
729
>>> from fipy import input
727
730
>>> if __name__ == '__main__':
728
- ... input("No-flux - stead -state failure. \
731
+ ... input("No-flux - steady -state failure. \
729
732
... Press <return> to proceed...")
730
733
731
- >>> print(numerix.allclose(phi, 0.0)) #doctest: +PYSPARSE_SOLVER
732
- True
734
+ >>> print(numerix.allclose(phi, 0.2, atol=1e-5))
735
+ False
736
+
737
+ >>> print(phi)
733
738
734
739
.. image:: /figures/examples/diffusion/mesh1D-noflux_steady_fail.*
735
740
:width: 90%
736
741
:align: center
737
742
:alt: (failed) steady-state solution for no-flux boundary conditions
738
743
739
- we find that the value is uniformly zero! What happened to our no-flux boundary
740
- conditions?
744
+ Depending on the solver, we find that the value may be uniformly zero,
745
+ infinity, or NaN, or the solver may just fail!
746
+ What happened to our no-flux boundary conditions?
741
747
742
748
The problem is that in the implicit discretization of :math:`\nabla\cdot(D\nabla\phi) = 0`,
743
749
You can’t perform that action at this time.
0 commit comments