Page 1 of 1

Stop simulation based on residual using python/batch script

Posted: Wed Apr 05, 2023 2:59 pm
by jamaspazarnoosh
Hello,

The simulation stops in Simvascular using a specified number of timesteps. I'm doing steady simulations and want to stop the simulation based on a specified residual, i.e. stop calculation at residual less than 1e-6. How can we do this using Python or batch script?

Thanks,
Jimmy

Re: Stop simulation based on residual using python/batch script

Posted: Fri Apr 07, 2023 11:48 am
by davep
Hi Jimmy,

The third column in the histor.dat file contains the nonlinear residual.

The easiest thing to do would be to write a bash script to launch a svsolver job and then check the value of the residual from the last line in histor.dat. If the residual is smaller than a tolerance then kill the svsolver job.

Cheers,
Dave

Re: Stop simulation based on residual using python/batch script

Posted: Sun Apr 09, 2023 5:46 pm
by jamaspazarnoosh
Thank you Dave

Jimmy