On Oct 24, 2013, at 12:59 PM, Jon Alm Eriksen <[email protected]> wrote:

> First of all, thanks for putting this out there. I'm new to fipy, but
> it seems like it is exactly the tool I need.

We're happy to hear that it's useful to you.


> I'm trying to couple two
> Cahn-Hilliard type equations,
> 
> http://folk.uio.no/jonaerik/files/ch2_simple.py
> 
> The equations are of course not coupled, but it serves as a minimal
> example. The code crashes, and I get this Traceback:
> 
> http://folk.uio.no/jonaerik/files/errormsg.txt
> 
> When I replace 'eqn' with either 'eq1' or 'eq2' in the sweep method,
> everything works fine. And, when I replace the right hand side of both
> equations with a simple diffusion term (DiffusionTerm(var=A (or B),
> coeff=1)), the code runs fine.
> 
> Is this expected behaviour? Or is there anything I can do to fix my problem?

I think the issue is that the original, recursive CH implementation doesn't 
play nicely with coupled (and probably won't ever). 

In principle, you can split CH into two 2nd order equations and solve them in a 
coupled fashion (see 
http://www.ctcms.nist.gov/fipy/examples/cahnHilliard/generated/examples.cahnHilliard.mesh2DCoupled.html).
 In your case, then, you'd have two sets of two 2nd order equations for a 
coupled system of four equations. Unfortunately, there are known problems with 
this formulation: http://matforge.org/fipy/ticket/582 that we have not had a 
chance to diagnose yet.


> Also, a completely unrelated question:
> Is the SimpleLUSolver really iterative? It says in the documentation
> that it is a "wrapper for PySparse superlu.factorize()", but this
> documentation (http://pysparse.sourceforge.net/fact.html) lists it
> under direct solvers (isn't LU factorisation just a way to invert the
> matrix and solve the equation directly anyways?). What confuses me is
> that SimpleLUSolver takes tolerance and iterations arguments. How does
> it work?

Daniel can (and should) correct me on the details, but our LinearLUSolver is 
kind of hybrid. The underlying PySparse (or anybody else's for that matter) LU 
solver is direct, but we found that due to non-linear coefficients, it doesn't 
always converge that well on a single iteration. As a result, we set up our 
LinearLUSolver to iterate until a convergence criterion, just like the "normal" 
iterative solvers. 
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to