Skip to content
Snippets Groups Projects
Verified Commit 4da9d1e7 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Block (without bytecode): avoid silent failures in some corner cases

Either ensure that oo_.determinstic_simulation.status is set, or really error out.
parent dd1ec10e
No related branches found
No related tags found
No related merge requests found
...@@ -143,6 +143,14 @@ for it_=start:incr:finish ...@@ -143,6 +143,14 @@ for it_=start:incr:finish
if verbose if verbose
disp('The singularity of the jacobian matrix could not be corrected') disp('The singularity of the jacobian matrix could not be corrected')
end end
if is_dynamic
oo_.deterministic_simulation.status = false;
oo_.deterministic_simulation.error = max_res;
oo_.deterministic_simulation.iterations = iter;
oo_.deterministic_simulation.block(Block_Num).status = false;% Convergency failed.
oo_.deterministic_simulation.block(Block_Num).error = max_res;
oo_.deterministic_simulation.block(Block_Num).iterations = iter;
end
info = -Block_Num*10; info = -Block_Num*10;
return return
end end
...@@ -275,17 +283,12 @@ for it_=start:incr:finish ...@@ -275,17 +283,12 @@ for it_=start:incr:finish
end end
end end
else else
if verbose
disp('unknown option : ')
if is_dynamic if is_dynamic
disp(['options_.stack_solve_algo = ' num2str(stack_solve_algo) ' not implemented']) error(['options_.stack_solve_algo = ' num2str(stack_solve_algo) ' not implemented'])
else else
disp(['options_.solve_algo = ' num2str(options.solve_algo) ' not implemented']) error(['options_.solve_algo = ' num2str(options.solve_algo) ' not implemented'])
end end
end end
info = -Block_Num*10;
return
end
iter=iter+1; iter=iter+1;
max_resa = max_res; max_resa = max_res;
end end
......
...@@ -136,6 +136,12 @@ while ~(cvg || iter>maxit_) ...@@ -136,6 +136,12 @@ while ~(cvg || iter>maxit_)
continue continue
else else
disp('The singularity of the jacobian matrix could not be corrected'); disp('The singularity of the jacobian matrix could not be corrected');
oo.deterministic_simulation.status = false;
oo.deterministic_simulation.error = max_res;
oo.deterministic_simulation.iterations = iter;
oo.deterministic_simulation.block(Block_Num).status = false;% Convergency failed.
oo.deterministic_simulation.block(Block_Num).error = max_res;
oo.deterministic_simulation.block(Block_Num).iterations = iter;
return return
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment