Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

How to get the state at the last solver step before error?

Please login with a confirmed email address before reporting spam

From time to time I'm getting errors such as

"Nonlinear solver did not converge.
Error in user-defined function."

What would help is if I could get the values of the dependent variables as they were at the beginning of the time step or iteration which did not converge.

One way that almost works is selecting "Results While Solving", and putting in the appropriate graph, "Update at" "Steps taken by solver". (Not "Output from solver", because that's much more coarse.)
This is not satisfactory, because the simulation slows down as a result of repetitive plotting such that it never reaches the error in reasonable time. The error occurs after tens of thousands of time steps, and the simulation slows down to a crawl well before then, and has to be cancelled.

The annoying thing is that the values that I need are right there inside Comsol, only I can't find any way to display them.

1 Reply Last Post Apr 30, 2012, 10:00 p.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 30, 2012, 10:00 p.m. EDT
Hi,

We are also trying to sort out something similar i.e. try to recover the last saved model before the error.

Comsol does save recovery files (search recovery files in Comsol help). The documentation says we could go back to the last solved time step or last parameter value (if parameteric simulation) before error. In the file drop down menu, click recovery files (although when i tried it, i did not get the model with data till last time step but the model i initially started with). So i need to check the defaults.

On linux cluster you can specify the recovery directory using -recoverydir <path> . This generates a recovery folder with .mphbin files at the given path. But still we don't know how to extract the dynamically saved solution at any given time instant.

If you have any additional information, please share on this thread. I will keep you posted if get any success.
Hi, We are also trying to sort out something similar i.e. try to recover the last saved model before the error. Comsol does save recovery files (search recovery files in Comsol help). The documentation says we could go back to the last solved time step or last parameter value (if parameteric simulation) before error. In the file drop down menu, click recovery files (although when i tried it, i did not get the model with data till last time step but the model i initially started with). So i need to check the defaults. On linux cluster you can specify the recovery directory using -recoverydir . This generates a recovery folder with .mphbin files at the given path. But still we don't know how to extract the dynamically saved solution at any given time instant. If you have any additional information, please share on this thread. I will keep you posted if get any success.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.