(Deleted) Meinhardt-Gierer Substrate-depletion


16
views
0
4 months ago by
I was trying to obtain the pattern formation in Meinhardt-Gierer Substrate-depletion using fenics but was able to arrive at the homogeneous steady state solution as opposed to the  pattern formation being observed. Could someone point out to me where I might have gone wrong with the code which has been attached below ??


Thanks in advance
from dolfin import *
D_u = 0.1; D_v =   1; c = 0.1; p0 = 0.03; p = 1.0; mu = 1.2; c0 = 1;eta = 0.09; dt = 1.0;

class InitialConditions(Expression):
    
    def eval(self, values, x):
            values[1] = 9.88
            values[0] = 0.03+0.03*(1+cos(pi*x[0])*cos(pi*x[1]))
    def value_shape(self):
        return (2,)
            
class Meinhardt(NonlinearProblem):
    def __init__(self,a,L):
        NonlinearProblem.__init__(self)
        self.a = a
        self.L = L
    def F(self, b,x):
        assemble(self.L, tensor = b)
    def J(self,A,x):
        assemble(self.a, tensor = A)


mesh = UnitSquareMesh(100,100)

P = FiniteElement("CG", mesh.ufl_cell(), 1)

V = FunctionSpace(mesh, P*P)

X_init = InitialConditions(degree = 1)
phi = TestFunction(V)
du = TrialFunction(V)
X = Function(V)
X0 = Function(V)


X0  = interpolate(X_init,V)
X = interpolate(X_init,V)
u0, v0 = split(X0)
u,v = split(X)
q,w = split(phi)

L1 = u*q*dx - u0*q*dx + D_u*inner(grad(u), grad(q))*dt*dx - (p0*p + c*p*u*u*v*v - mu*u)*q*dt*dx  
L2 = v*w*dx - v0*w*dx + D_v*inner(grad(v), grad(w))*dt*dx - (c0 - c*p*u*u*v*v - eta*v)*w*dt*dx
L = L1 + L2


a= derivative(L, X,du)
problem = Meinhardt(a, L)
solver = NewtonSolver()
solver.parameters["linear_solver"] = "lu"
solver.parameters["convergence_criterion"] = "incremental"
solver.parameters["relative_tolerance"] = 1e-5

t = 0.0
T = 200


while (t < T):
    t += dt
    X0.vector()[:] = X.vector()
    solver.solve(problem, X.vector())
plot(X.split()[1])​
Community: FEniCS Project
Please login to add an answer/comment or follow this question.
The thread is closed. No new answer/comment may be added.

Similar posts:
Search »
  • Nothing matches yet.