about initial condition of cahn-hilliard equation

Asked by jiezhou

hi, everyone.
             I run the cahn-hilliard equation codes. I want to know the initial condition of cahn-hilliard equation.
in the demo examples . If you know , could you tell me ?
thanks

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Johan Hake (johan-hake) said :
#1

On 12/04/2012 11:01 PM, jiezhou wrote:
> New question #215979 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/215979
>
> hi, everyone.
> I run the cahn-hilliard equation codes. I want to know the initial condition of cahn-hilliard equation.
> in the demo examples . If you know , could you tell me ?
> thanks
>

It is a randomly generated. This expression govern that:

class InitialConditions(Expression):
    def __init__(self):
        random.seed(2 + MPI.process_number())
    def eval(self, values, x):
        values[0] = 0.63 + 0.02*(0.5 - random.random())
        values[1] = 0.0
    def value_shape(self):
        return (2,)

Johan

Can you help with this problem?

Provide an answer of your own, or ask jiezhou for more information if necessary.

To post a message you must log in.