From 79a6dda51b585ffd2cadc3a740d717f329eac65d Mon Sep 17 00:00:00 2001 From: Lars Hubatsch <hubatsch@pks.mpg.de> Date: Mon, 21 Sep 2020 09:41:43 +0200 Subject: [PATCH] create_mesh works for v==0. --- @Ternary_model/create_mesh.m | 4 ++-- prob_laplace.m | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/@Ternary_model/create_mesh.m b/@Ternary_model/create_mesh.m index 0a1b0f4..74c139c 100644 --- a/@Ternary_model/create_mesh.m +++ b/@Ternary_model/create_mesh.m @@ -2,7 +2,7 @@ function create_mesh(T) %CREATE_MESH creates mesh for solving Ternary_model. % Mesh density larger for steeper gradients. -if strcmp(T.mode, 'Constituent') +if strcmp(T.mode, 'Constituent') | T.v == 0 % Start with left side of mesh, at r=0/x=0, with a given step size x = linspace(0, 0.75, 40); x = [x, x(end)+0.001/T.precision]; @@ -29,7 +29,7 @@ if strcmp(T.mode, 'Constituent') ceil((T.x(ind+20)-T.x(ind-20))*200)),... T.x(ind+21:end)]; end -elseif strcmp(T.mode, 'Client') +elseif strcmp(T.mode, 'Client') && T.v ~= 0 T.x = linspace(0, T.system_size, 24000); end end diff --git a/prob_laplace.m b/prob_laplace.m index 1ae5a47..685f207 100644 --- a/prob_laplace.m +++ b/prob_laplace.m @@ -155,11 +155,13 @@ si_t = size(t_snap); x0 = sort(10-T_mov.v*t_snap-direction*repmat(0:0.02:4.01, [si_t(1), 1]), 2); %% Run simulations for 'delta' IC across outside F = {}; +t = linspace(0, 10, 101); v = T_mov.v; +params = params_mov_bound; +params{end-1} = 0; for i = 1:si_t(2) tic parfor j = 1:si_t(1) - F{i, j} = Ternary_model(0, 'Gauss', params_mov_bound, t, 0); F{i, j} = Ternary_model(0, 'Gauss', params, t, 0.1); F{i, j}.x0 = x0(j, i); F{i, j}.a = -10+v*t_snap(i); -- GitLab