Re: source term that is a discontinuous function of time

2019-02-01 Thread Guyer, Jonathan E. Dr. (Fed) via fipy
The issue is that while stepFunc() is a Python function, it is not a Variable operator expression as far as FiPy is concerned. FiPy Variable operator expressions tend to be things that can be expressed as arithmetic expressions. Python conditionals don't work; greater/less-than expressions do.

Re: source term that is a discontinuous function of time

2019-02-01 Thread Bill Greene
Your suggestion certainly works and I appreciate the quick response. However, in general, I would like to define more complicated functions of time that are best implemented in a function. So I am still interested in WHY the function approach doesn't work. Is there a way to tell FiPy to call that

Re: source term that is a discontinuous function of time

2019-02-01 Thread Guyer, Jonathan E. Dr. (Fed) via fipy
`time` is a Variable as FiPy understands it, but stepFunc() simply returns an integer, so eqI is defined with a source that is the integer 0. I'd try eqI = fipy.TransientTerm(coeff=1.) == ((time < 0.1) * 0. + (time >= 0.1) * 1.) > On Feb 1, 2019, at 6:05 AM, Bill Greene wrote: > > I am

source term that is a discontinuous function of time

2019-02-01 Thread Bill Greene
I am trying to solve an equation where the source term is a discontinuous function of time. I have followed examples where the source term is a simple, continuous function of time and these appear to work correctly. The key parts of my code are shown below: def stepFunc(t): if(t.value<.1):