Question

I'm attempting to solve a complex PDE with FiPy. It would appear that FiPY does not support complex arguments and the general advice seems to be to split the PDE, solve separately and then recombine. Is this still the case?

Secondly, I can't see any way to set non constant initial conditions. Suppose I'd like to have my mesh not have an identical value in every cell, is there a simpler way to do that other than using setValue?

Thank you.

Was it helpful?

Solution

FiPy does not support complex arguments, but it does support solving for vectors, which might simplify your task a bit.

See the latter part of this coupled Cahn-Hilliard simulation.

It's certainly possible to set non-uniform initial conditions. See: examples/cahnHilliard/mesh2DCoupled.py for how to set the initial condition to a random field or examples/diffusion/electrostatics.py and and just about anything in examples/phase/ for how to set the initial condition based on coordinates. As you can see in those examples, there are a couple of different syntaxes that work, but setValue() is a perfectly legitimate way to do it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top