questions about TS functions

Matthew Knepley knepley at gmail.com
Tue Sep 9 12:26:40 CDT 2008


2008/9/9 tsjb00 <tsjb00 at hotmail.com>:
>
> Many thanks for your help!
>
> 1. The Error message I get is:
> [0]PETSC ERROR: --------------------- Error Message ------------------------------------
> [0]PETSC ERROR: No support for this operation for this object type!
> [0]PETSC ERROR: The code for Crank-Nicholson is not complete
>         emai petsc-maint at mcs.anl.gov for more info!
> Does this mean that I could not use TSDefaultComputeJacobian if after that I define:
>  TSSetType(ts,TS_CN)

Yes.

> 3. I use TS_BEULER for time advancing, a second-order spacial discretization, with flux evaluated as:
> f(i+1/2)={ u(i+1)-u(i) }/dx,
> du/dt={ f(i+1/2)-f(i-1/2) } * DiffisionCoef. /dx
> u = u0 at x=0 as the b.c.
> When big timesteps are used, the diffusion happens very quickly. u is over-predicted over the domain.
>
> I am wondering if PETSC has options to check the convergence in time advancing? Any PETSc outputs to help me I decide if the overprediction is due to stabilization or precision issue? If it is a matter of precision, what higher-precision implicit methods are available in PETSc? Again, any criteria or equations to calculate the maximum timestep?
>
> Sorry for the lengthy quesions. PETSc is new to me and I am very clueless about the code.

No, all the timestepping methods are very elementary. You can use the
SUNDIALS package
(--download-sundials) for more advanced methods. However, they might
require a Jacobian.

   Matt

> Many thanks!
>
> BJ
>
>
>
> 2008/9/9 tsjb00 :
>> Hi! I have some questions about TS functions.
>>
>> 1. I tried to use TSDefaultComputeJacobian to provide the Jacobian matrix.
>> It worked fine with TS_BEULER, but when I tried to use TS_CN, it didn't
>> work. The error message indicates that it is not supported for
>> Crank-Nicholson. Is it true or I might do something wrong?
>
> Please always send the complete error message. That default just uses finite
> differences to compute the Jacobian. However, for nonlinear problems with
> changing Jacobians, we manipulate the matrix directly in CN. In order to use
> the FD code, we would need to recode this using a MatShell.
>
>> 2. Is there a specific PETSc function to evaluate Jacobian for TS_CN? Any
>> example of using TS_CN that I can refer to?
>
> No. You would need to form the Jacobian yourself.
>
>> 3. I tried to solve a simple time evolving diffusion problem with TS, using
>> TS_BEULER and non-linear solver. When I tried to use big time step, sever
>> over-prediction is observed. I would appreciate any suggestion on the
>> criteria of maximum time step allowed. If I really need to use big time
>> steps, any tips to set up TS to improve the results?
>
> Its not clear from your description whether this is a stability or
> accuracy problem.
>
>    Matt
>
>> Many thanks in advance!
>>
>> BJ
> _________________________________________________________________
> MSN 中文网,最新时尚生活资讯,白领聚集门户。
> http://cn.msn.com
>
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which
their experiments lead.
-- Norbert Wiener




More information about the petsc-users mailing list