/ concept-collection / turing-surface
Sign in
concept-collection / turing-surface
35 lines · 980 BCodeBlameHistory
62e6cc4Simplify UI text and built-in .m script commentsJeremy Magland 1% Allen-Cahn on a closed surface: interfaces form, then coarsen.
3% du/dt = eps2*lap_g(u) + u - u^3
4%
62e6cc4Simplify UI text and built-in .m script commentsJeremy Magland 5% Same scheme as models/schnakenberg.m.
7function [U, u] = init(noise)
8 U = analys(noise);
9 u = synth(U);
10end
591a4f5Reduce the Laplace-Beltrami matvec to 6 transforms per species per iterationDan Fortunato 12function [Un, u] = step(U, lam, filt, gx, gy, gz, p1, p2, q2, r, eps2, dt, niter)
0af3386Reaction-diffusion on spherical-harmonic surfacesJeremy Magland 13 u = synth(U);
15 Bu = U + dt * analys(u - u.^3);
16 Un = Bu ./ (1 + (dt * eps2) * lam);
18 for k = 1:niter
591a4f5Reduce the Laplace-Beltrami matvec to 6 transforms per species per iterationDan Fortunato 19 % dlap = lap_g - lap_s, evaluated at the current iterate in flux form
20 % (see models/schnakenberg.m, docs/richardson-iteration.md and
21 % docs/reduced-transforms.md for the derivation).
24 Fpu = synth(dphic(Fu));
25 Pu = p1 .* Ftu + p2 .* Fpu;
26 Qu = p2 .* Ftu + q2 .* Fpu;
27 Pcu = analys(Pu) .* filt;
28 Qcu = analys(Qu) .* filt;
29 scu = dthetac(Pcu) + dphic(Qcu);
30 lapu = r .* synth(scu);
0af3386Reaction-diffusion on spherical-harmonic surfacesJeremy Magland 33 Un = (Bu + (dt * eps2) * dLu) ./ (1 + (dt * eps2) * lam);
34 end
35end
moveopenescclose