fix error
This commit is contained in:
@@ -130,6 +130,7 @@ while t < tend
|
||||
if dt >= dtmax(k)
|
||||
dt = dtmax(k);
|
||||
end
|
||||
emit_progress(w, sprintf('Progress: %.4f / %.4f day', t, sum(time)), count, t, dt);
|
||||
if i ~= Nmax
|
||||
% waitbar(t / tend);
|
||||
% disp(t);
|
||||
@@ -147,7 +148,21 @@ trun.leqs_solve_time=leqs_solve_time;
|
||||
trun.total_simulation_time = etime(clock,t_start);
|
||||
trun.Newton_step=Newton_step;
|
||||
trun.Newtons_vs_time=Newtons_vs_time;
|
||||
emit_progress(w, 'Calculation completed', count, t, dt);
|
||||
fprintf('计算完成');
|
||||
% close(h0);
|
||||
end
|
||||
|
||||
function emit_progress(w, message, step, time_value, dt_value)
|
||||
if ~isfield(w, 'progress_callback') || isempty(w.progress_callback)
|
||||
return;
|
||||
end
|
||||
|
||||
meta = struct( ...
|
||||
'step', step, ...
|
||||
'time', time_value, ...
|
||||
'dt', dt_value, ...
|
||||
'status', 'Running...');
|
||||
|
||||
feval(w.progress_callback, message, meta);
|
||||
end
|
||||
|
||||
@@ -130,6 +130,7 @@ while t < tend
|
||||
if dt >= dtmax(k)
|
||||
dt = dtmax(k);
|
||||
end
|
||||
emit_progress(w, sprintf('Progress: %.4f / %.4f day', t, sum(time)), count, t, dt);
|
||||
if i ~= Nmax
|
||||
% waitbar(t / tend);
|
||||
% disp(t);
|
||||
@@ -147,7 +148,21 @@ trun.leqs_solve_time=leqs_solve_time;
|
||||
trun.total_simulation_time = etime(clock,t_start);
|
||||
trun.Newton_step=Newton_step;
|
||||
trun.Newtons_vs_time=Newtons_vs_time;
|
||||
emit_progress(w, 'Calculation completed', count, t, dt);
|
||||
fprintf('计算完成');
|
||||
% close(h0);
|
||||
end
|
||||
|
||||
function emit_progress(w, message, step, time_value, dt_value)
|
||||
if ~isfield(w, 'progress_callback') || isempty(w.progress_callback)
|
||||
return;
|
||||
end
|
||||
|
||||
meta = struct( ...
|
||||
'step', step, ...
|
||||
'time', time_value, ...
|
||||
'dt', dt_value, ...
|
||||
'status', 'Running...');
|
||||
|
||||
feval(w.progress_callback, message, meta);
|
||||
end
|
||||
|
||||
@@ -142,6 +142,7 @@ for k = 1:size(well_schedules,1)
|
||||
if dt >= dtmax(k)
|
||||
dt = dtmax(k);
|
||||
end
|
||||
emit_progress(w, sprintf('Progress: %.4f / %.4f day', t, sum(time)), count, t, dt);
|
||||
if i ~= Nmax
|
||||
% waitbar(t / tend);
|
||||
% disp(t);
|
||||
@@ -159,7 +160,21 @@ trun.leqs_solve_time=leqs_solve_time;
|
||||
trun.total_simulation_time = etime(clock,t_start);
|
||||
trun.Newton_step=Newton_step;
|
||||
trun.Newtons_vs_time=Newtons_vs_time;
|
||||
emit_progress(w, 'Calculation completed', count, t, dt);
|
||||
fprintf('计算完成');
|
||||
% close(h0);
|
||||
end
|
||||
|
||||
function emit_progress(w, message, step, time_value, dt_value)
|
||||
if ~isfield(w, 'progress_callback') || isempty(w.progress_callback)
|
||||
return;
|
||||
end
|
||||
|
||||
meta = struct( ...
|
||||
'step', step, ...
|
||||
'time', time_value, ...
|
||||
'dt', dt_value, ...
|
||||
'status', 'Running...');
|
||||
|
||||
feval(w.progress_callback, message, meta);
|
||||
end
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
function [Times, OutputRs, Wellpara, trun] = solver_NR(r, flow_model, f, os, state0, yitap,yitas,omega,Nmax,epsave,epsmax,dtmin,dtmax,Wellc,time,well_schedules)
|
||||
function [Times, OutputRs, Wellpara, trun] = solver_NR(r, flow_model, f, os, state0, yitap,yitas,omega,Nmax,epsave,epsmax,dtmin,dtmax,Wellc,time,well_schedules, progress_callback)
|
||||
if nargin < 17
|
||||
progress_callback = [];
|
||||
end
|
||||
|
||||
w.yitap = yitap;
|
||||
w.yitas = yitas;
|
||||
w.omega = omega;
|
||||
@@ -12,6 +16,7 @@ w.dtmax = dtmax;
|
||||
w.Wellc = Wellc;
|
||||
w.time = time;
|
||||
w.well_schedules = well_schedules;
|
||||
w.progress_callback = progress_callback;
|
||||
%% 计算
|
||||
if r.modelflag==1 || r.modelflag==4 || r.modelflag==5
|
||||
if flow_model == 1
|
||||
@@ -25,4 +30,4 @@ if r.modelflag==1 || r.modelflag==4 || r.modelflag==5
|
||||
end
|
||||
% [Times, OutputRs, Wellpara, trun] = mainRS_MB_2014(r, f, os, w, state0);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user