On Feb 23, 2010, at 6:16 AM, John-Oliver Engler wrote:
1. When I follow exactly what's written in the manual, i.e. if I
want to have a non-constant anisotropic diffusion coefficient
similar to
x, y = mesh.getCellCenters()
DiffusionTerm([[[x**2, x * y], [-x * y, -y**2]]])
I get the following message
Traceback (most recent call last):
File "C:\Dokumente und Einstellungen\Oliver\Desktop\Programme ETH
\ETH Zürich\CIR-VR\FPE\FPE_Oscillator.py", line 37, in <module>
eq1 = TransientTerm() == DiffusionTerm([[[0, 0], [0, -y**2]]])
This is a bit different from what's in the manual. `y` has as the
length of the number of Cells in your mesh, but `0` has a length of 1.
NumPy (underlying FiPy) is incapable of understanding how to construct
an array from lists of different lengths.
I'd be inclined to do something like:
D = CellVariable(mesh=mesh, rank=2, value=0.)
D[1, 1, ...] = -y**2
Actually, because the coefficient of a DiffusionTerm is ultimately
applied at faces, I'd do:
X, Y = mesh.getFaceCenters()
D = FaceVariable(mesh=mesh, rank=2, value=0.)
D[1, 1, ...] = -Y**2
2. Like I said, the corresponding SDE is stiff which has already
turned that implementation into quite a painful experience. I do not
have the time right now to sift through the literature, so I am
wondering whether FiPy can be used at all to tackle this simulation.
Or do I have to use a specially-designed algorithm to simulate this?
We're going to need to know a lot more information about what you're
trying to solve. Definitions of "FPE" and "SDE" would be good places
to start.