Hello,
On Mon, Feb 2, 2009 at 2:36 PM, <[email protected]> wrote:
..
> Have you gone through the Frequently Asked Questions in the manual? We go
> through each type of Term that FiPy can solve in FAQ 6.1. In Chapter 3, we
> go through more of the theoretical details of how each type of Term is
> rendered into a matrix equation.
Thank you very much, I understood now.
And, yes, I went through FAQ in the manual.
>> I also modify the equation in this way, but I received an error.
>>
>> Traceback (most recent call last):
>> File "mytestsimul.py", line 43, in <module>
>> eqch = TransientTerm() == -DiffusionTerm((h**3, 1)) +
>> (fDerivative.getFaceGrad() * h**3).getDivergence()
>> AttributeError: 'binOp' object has no attribute 'getFaceGrad'
>
> That would lead me to believe that fDerivative is not a CellVariable. What
> is the definition of fDerivative?
see below
>> To compare the equation with the example here I included also f(\phi):
>>
>> \partial_t \phi=-\nabla\{\phi^3\nabla[\triangle \phi -\partial_\phi
>> f(\phi)]\}
>>
>> where f(\phi) = \frac{b}{2\phi^2}-e^{-\phi}
>
> Please show us how you have written f(\phi) and \partial_\phi f(\phi) in
> Python.
in the equations appears just derivative of "f", so I wrote the
derivative of "f" as:
from math import e
....
from fipy.variables.cellVariable import CellVariable
from fipy.tools.numerix import random
var = CellVariable(name = "Simulations",
mesh = mesh,
value = random.random(nx * ny))
faceVar = var.getArithmeticFaceValue()
fDerivative = e**(-faceVar)-(b/(faceVar**3))
Regards,
Ionut