Skip to content
Snippets Groups Projects
Commit 79a6dda5 authored by Lars Hubatsch's avatar Lars Hubatsch
Browse files

create_mesh works for v==0.

parent 1e4abf93
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment