Thanks for answers Jonathan,

On Thu, Oct 24, 2013 at 2:32 PM, Guyer, Jonathan E. Dr.
<[email protected]> wrote:
> On Oct 24, 2013, at 12:59 PM, Jon Alm Eriksen <[email protected]> 
> wrote:
>> 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.

Bad news I guess, in the end I need to scale up my system. So close!
Anyways, if I try your suggestion, will it matter if I formulate a
vector equation with four components, rather that a coupled set of
four equations, for the issue you mention. Or is there any distinction
in the implementation of vector equation vs. coupled equation?

>> 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.

I understand that iterations are necessary for a non-linear equation.
But if I solve a linear equation, is there any reason for iterating
with the LinearLUSolver? Or is there a newtons method algorithm in the
solver that converges on the first step for linear problems with the
solve method? At the end of the day, I only care about residuals for
my application, but I would like to know what goes on behind the
curtains.

best,
Jon

_______________________________________________
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