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.

Variable for iteration count

Please login with a confirmed email address before reporting spam

I am performing a large number of sequential simulations via the matlab livelink. As far as I can tell, 'termination technique' has to be set to 'iterations or tolerance' or, in the case of an unconverged scenario, the whole run will fail. I would like to flag whether or not each simulation was terminated by iterations or by tolerance so I can discard those which were terminated by iterations. The intuitively obvious way of doing this is with a variable for iteration count. Is there such a variable and how can I access it? Thanks, Pete


2 Replies Last Post 2019年8月8日 GMT-4 04:36
Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2019年8月8日 GMT-4 03:32
Updated: 5 years ago 2019年8月8日 GMT-4 06:28

Hi Pete

I don't think such a variable exists.

You can access the solver log using the API:

msg = model.sol('sol1').feature('s1').getString('message');

and check for any error or warning messages.

-------------------
Lars Gregersen
Comsol Denmark
Hi Pete I don't think such a variable exists. You can access the solver log using the API: msg = model.sol('sol1').feature('s1').getString('message'); and check for any error or warning messages.

Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2019年8月8日 GMT-4 04:36
Updated: 5 years ago 2019年8月8日 GMT-4 04:28

Hi Pete and Lars,

I was missing such a variable in some projects too. In some cases I implemented a counter using a global equation. However, this only worked in some cases and in other cases proved to be tricky. How about issuing a feature request to Comsol development?

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Hi Pete and Lars, I was missing such a variable in some projects too. In some cases I implemented a counter using a global equation. However, this only worked in some cases and in other cases proved to be tricky. How about issuing a feature request to Comsol development? Cheers Edgar

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.