← Back to team overview

dolfin team mailing list archive

[Question #105304]: have trouble to understand cahn-hilliard demo code

 

New question #105304 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/105304

There is a demo code under src/demo/pde/cahn-hilliard/ to solve the Cahn-Hilliard equation, which is a fourth-order nonlinear time-dependent problem. Since my problem is also nonlinear initial value problem, I want to follow this code as an example.
I have gone through the nonlinear and time-dependent prob parts in the tutorial.  But I still have trouble to understand the approach the author did. He seems to split the original eqn into 2 eqns. Does anybody know the original eqn and the derivations?

I also have trouble to understand the following code:
dk, dc = split(du)

class CahnHilliardEquation(NonlinearProblem):
    def __init__(self, a, L):
        NonlinearProblem.__init__(self)
        self.L = L
        self.a = a
        self.reset_sparsity = True
    def F(self, b, x):
        assemble(self.L, tensor=b)
    def J(self, A, x):
        assemble(self.a, tensor=A, reset_sparsity=self.reset_sparsity)
        self.reset_sparsity = False

They haven't been covered in the tutorial. Are there any other documents to learn these? 
Any help will be appreciated.

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.



Follow ups