Stop simulation based on residual using python/batch script

Provides a system for patient-specific cardiovascular modeling and simulation.
POST REPLY
User avatar
Jimmy Azarnoosh
Posts: 25
Joined: Mon Oct 05, 2020 5:43 pm

Stop simulation based on residual using python/batch script

Post by Jimmy Azarnoosh » Wed Apr 05, 2023 2:59 pm

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

User avatar
David Parker
Posts: 1652
Joined: Tue Aug 23, 2005 2:43 pm

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

Post by David Parker » Fri Apr 07, 2023 11:48 am

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

User avatar
Jimmy Azarnoosh
Posts: 25
Joined: Mon Oct 05, 2020 5:43 pm

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

Post by Jimmy Azarnoosh » Sun Apr 09, 2023 5:46 pm

Thank you Dave

Jimmy

POST REPLY