[petsc-users] setting Sundials options within petsc4py

Jed Brown jed at jedbrown.org
Wed Apr 23 18:23:56 CDT 2014


Veltz Romain <romain.veltz at inria.fr> writes:

> Dear pets users,
>
> I have been trying to set some sundials options from petsc4py but I am
> unsuccessful. I hope somebody will have a good pointer.  For example I
> can pass -ts_sundials_type bdf to python in the command line.
>
> I would like to call TSSundialsSetTolerance to set the
> tolerance. Hence I need to pass some options in the command line (I
> don't know if this is possible for this particular function) or call
> TSSundialsSetTolerance(…) from petsc4py. So far, I am clueless.

These functions are not yet implemented in petsc4py.  You could clone
the repository (https://bitbucket.org/petsc/petsc4py) and add the
interfaces you need.  It should be straightforward based on similar
interfaces that already exist.  We can accept patches/pull requests, but
don't always have time to ensure that every function is exposed via
petsc4py.

> Also, I would like to limit the step sizes. This is not documented in
> petsc_manual.pdf. But in sundial.c, there is PetscErrorCode
> TSSundialsSetMaxTimeStep_Sundials(TS ts,PetscReal maxdt) which I would
> like to call also from petsc4py.
>
> Thank you for your help,
>
> Best regards,
>
>
> Veltz Romain
>
> Neuromathcomp Project Team 
> Inria Sophia Antipolis Méditerranée 
> 2004 Route des Lucioles-BP 93 
> FR-06902 Sophia Antipolis
> http://www-sop.inria.fr/members/Romain.Veltz/public_html/Home.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140423/293d7947/attachment.pgp>


More information about the petsc-users mailing list