<br>i&#39;ve tried to run rober.py with  ts.setIJacobian line skipped, and with --( python rober2.py -snes_mfš )<br>got the following ---<br><br>Traceback (most recent call last):<br>š File &quot;rober2.py&quot;, line 59, in &lt;module&gt;<br>
ššš ts.setFromOptions()<br>š File &quot;TS.pyx&quot;, line 83, in petsc4py.PETSc.TS.setFromOptions (src/petsc4py.PETSc.c:90385)<br>petsc4py.PETSc.Error: error code 73<br>[0] TSSetFromOptions() line 136 in src/ts/interface/ts.c<br>
[0] SNESSetFromOptions() line 420 in src/snes/interface/snes.c<br>[0] SNESSetUpMatrixFree_Private() line 190 in src/snes/interface/snes.c<br>[0] MatCreateSNESMF() line 131 in src/snes/mf/snesmfj.c<br>[0] Object is in wrong state<br>
[0] SNESSetFunction() must be called first<br><br>what is SNESSetFunction()?<br><br><div class="gmail_quote">2010/9/26 Jed Brown <span dir="ltr">&lt;<a href="mailto:jed@59a2.org">jed@59a2.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
2010/9/26 îÉËÏÌÁÊ ëÕÔÕÚÏ× &lt;<a href="mailto:kutuzovnp@gmail.com">kutuzovnp@gmail.com</a>&gt;:<br>
<div class="im">&gt; 1) First of all, can you describe in aš bit more detailed way the usage of<br>
&gt; AppCtx class of matfree.py module to solve ODE systems<br>
&gt; (determined as in rober.py), without jacobian initialisation, in other words<br>
&gt; how can change rober.py to solve this issue?<br>
<br>
</div>You can just skip the ts.setIJacobian call and run with -snes_mf. šOr<br>
set an approximate Jacobian that way, but use it only for<br>
preconditioning, with -snes_mf_operator. šRun with -ts_view to confirm<br>
that you are running what you think you are.<br>
<div class="im"><br>
&gt; 2) Does THETA integration implement time step adaptation?<br>
<br>
</div>No, and it doesn&#39;t come with a built-in error estimate. šTSGL does<br>
adaptation, but the controller for adaptive order (-ts_adapt_type<br>
both) is not at all robust, so I recommend using -ts_adapt_type step<br>
or writing your own controller (see src/ts/impls/implicit/gl/gladapt.c<br>
for examples).<br>
<div class="im"><br>
&gt; 3) Suppose i have a large ODE system, how can i implement multiprocessor<br>
&gt; (parallel) integration in a way similar with those (function definition and<br>
&gt; plotting) in rober.py?<br>
<br>
</div>Lisandro might have other suggestions, but<br>
src/ts/examples/tutorials/ex8.py solves a transient Bratu problem in<br>
parallel. šGet it from dev, the copy in 3.1 does not work correctly in<br>
parallel for superficial indexing reasons:<br>
<br>
<a href="http://petsc.cs.iit.edu/petsc/petsc-dev/file/c03db8f211dd/src/ts/examples/tutorials/ex8.py" target="_blank">http://petsc.cs.iit.edu/petsc/petsc-dev/file/c03db8f211dd/src/ts/examples/tutorials/ex8.py</a><br>
<br>
You can run it like (it uses TSGL by default)<br>
<br>
šmpiexec -n 4 python ex8.py -M 40 -ts_monitor -ts_monitor_solution<br>
-ts_max_steps 1000 -ts_adapt_type size<br>
<br>
Note that theta=0.5 is highly oscillatory for this problem, use<br>
something like -ts_type theta -ts_theta_theta 0.8 for a more stable<br>
solution.<br>
<br>
You could of course plot the solution using Matplotlib (as in, e.g.<br>
bratu2d.py) instead, but you would have to gather it to process 0<br>
because Matplotlib is not parallel. šOther options include just<br>
writing out the state at the time steps you are interested in, or<br>
(much more effort) using libsim from VisIt to get live visualization<br>
and interaction with your running parallel program.<br>
<font color="#888888"><br>
Jed<br>
</font></blockquote></div><br>