Puzzled by FiPy's use of "=="

Robert Kern robert.kern at gmail.com
Mon Mar 26 14:16:07 CEST 2012


On 3/26/12 12:47 PM, André Roberge wrote:
> In FiPy (a finite volume PDE solver), equations are "magically" set up as
>
> eqX = TransientTerm() == ExplicitDiffusionTerm(coeff=D)
>
> and solved via
>
> eqX.solve(...)
>
> How can eqX be anything than True or False?...  This must be via a redefinition of "==" but I can't see how that is done.  I did look at many of the source files, thinking that it must be via a redefinition of "__eq__" somewhere but with no luck.   Any pointers would be appreciated.

It's in the root base class Term:

   http://matforge.org/fipy/browser/trunk/fipy/terms/term.py#L374

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list