[petsc-users] petsc4py

Николай Кутузов kutuzovnp at gmail.com
Wed Sep 29 14:16:10 CDT 2010


i've tried to run rober.py with ts.setIJacobian line skipped, and with --(
python rober2.py -snes_mf  )
got the following ---

Traceback (most recent call last):
  File "rober2.py", line 59, in <module>
    ts.setFromOptions()
  File "TS.pyx", line 83, in petsc4py.PETSc.TS.setFromOptions
(src/petsc4py.PETSc.c:90385)
petsc4py.PETSc.Error: error code 73
[0] TSSetFromOptions() line 136 in src/ts/interface/ts.c
[0] SNESSetFromOptions() line 420 in src/snes/interface/snes.c
[0] SNESSetUpMatrixFree_Private() line 190 in src/snes/interface/snes.c
[0] MatCreateSNESMF() line 131 in src/snes/mf/snesmfj.c
[0] Object is in wrong state
[0] SNESSetFunction() must be called first

what is SNESSetFunction()?

2010/9/26 Jed Brown <jed at 59a2.org>

> 2010/9/26 Николай Кутузов <kutuzovnp at gmail.com>:
> > 1) First of all, can you describe in a  bit more detailed way the usage
> of
> > AppCtx class of matfree.py module to solve ODE systems
> > (determined as in rober.py), without jacobian initialisation, in other
> words
> > how can change rober.py to solve this issue?
>
> You can just skip the ts.setIJacobian call and run with -snes_mf.  Or
> set an approximate Jacobian that way, but use it only for
> preconditioning, with -snes_mf_operator.  Run with -ts_view to confirm
> that you are running what you think you are.
>
> > 2) Does THETA integration implement time step adaptation?
>
> No, and it doesn't come with a built-in error estimate.  TSGL does
> adaptation, but the controller for adaptive order (-ts_adapt_type
> both) is not at all robust, so I recommend using -ts_adapt_type step
> or writing your own controller (see src/ts/impls/implicit/gl/gladapt.c
> for examples).
>
> > 3) Suppose i have a large ODE system, how can i implement multiprocessor
> > (parallel) integration in a way similar with those (function definition
> and
> > plotting) in rober.py?
>
> Lisandro might have other suggestions, but
> src/ts/examples/tutorials/ex8.py solves a transient Bratu problem in
> parallel.  Get it from dev, the copy in 3.1 does not work correctly in
> parallel for superficial indexing reasons:
>
>
> http://petsc.cs.iit.edu/petsc/petsc-dev/file/c03db8f211dd/src/ts/examples/tutorials/ex8.py
>
> You can run it like (it uses TSGL by default)
>
>  mpiexec -n 4 python ex8.py -M 40 -ts_monitor -ts_monitor_solution
> -ts_max_steps 1000 -ts_adapt_type size
>
> Note that theta=0.5 is highly oscillatory for this problem, use
> something like -ts_type theta -ts_theta_theta 0.8 for a more stable
> solution.
>
> You could of course plot the solution using Matplotlib (as in, e.g.
> bratu2d.py) instead, but you would have to gather it to process 0
> because Matplotlib is not parallel.  Other options include just
> writing out the state at the time steps you are interested in, or
> (much more effort) using libsim from VisIt to get live visualization
> and interaction with your running parallel program.
>
> Jed
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20100929/272d8c75/attachment-0007.htm>


More information about the petsc-users mailing list