Hi folks,
Just a quick question about Cahn-Hilliard equation. Consider (from demo):
# Class representing the intial conditions
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,)
Let us assume that instead of "0.63 + 0.02*(0.5 - random.random())
" for values[0]
, we want to assign a function instead. In other words, assume that our initial guess for the Newton solver is given by a function.
I would be grateful if you could let me know how to implement it.
Cheers,
Mo