HOW TO GET THE NUMBER OF ITERATION?

8 views
Skip to first unread message

EUDE SILVA

unread,
Oct 23, 2025, 4:49:05 PMOct 23
to pysph-users

Hello everyone, I am facing a problem trying to get the number of iterations in my simulation. The print appears on the screen, but I can't automate it.
Every time I try to do:

$ python script.py > program_out.txt

When I look inside program_out.txt, the number of iterations is not there. I can only see it on the screen when I run:

$ python script.py

What can I do to save the number of iterations for my simulation?


Thank you so much!
Best Regards,
Eude Lucas.

EUDE SILVA

unread,
Oct 24, 2025, 8:12:15 AMOct 24
to pysph-users
Hi everyone! I used solver n_iter = getattr(solver, "iteration", 0) in my post_process(). 

This problem was resolved.

Thank you guys!
Best Regards, 
Eude Lucas.

Reply all
Reply to author
Forward
0 new messages