Skip to content

Commit

Permalink
added resilience to missing solution in Comsol object
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanengblom committed Mar 16, 2017
1 parent 19efac3 commit c5de135
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion urdme/comsol/comsol2urdme.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,18 @@

% Get extended mesh data
l_info(verbose,1,'Start mphxmeshinfo...');
xmi = mphxmeshinfo(fem);
try
xmi = mphxmeshinfo(fem);
catch ME
% Comsol-problems: sometimes the solution is lost and a model
% re-run is the most immediate solution.
if strcmp(ME.message,'The model does not contain any solutions')
warning(['No solution found in the Comsol object. ' ...
'Will now try to execute model.sol.run().']);
fem.sol.run()
xmi = mphxmeshinfo(fem);
end
end
l_info(verbose,1,' ...done.\n');

% Get number of species and number of cells.
Expand Down

0 comments on commit c5de135

Please sign in to comment.