questions about TS functions

tsjb00 tsjb00 at hotmail.com
Tue Sep 9 12:22:54 CDT 2008


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!
[0]PETSC ERROR: ------------------------------------------------------------------------
............................................................................................


[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: TSCreate_CN() line 383 in src/ts/impls/implicit/cn/cn.c
[0]PETSC ERROR: TSSetType() line 74 in src/ts/interface/tsreg.c
[0]PETSC ERROR: main() line 183 in diffVP.c
[1]PETSC ERROR: ---------------------------------------------------------------------
..............................................................................................


[1]PETSC ERROR: ---------------------  Stack Frames ------------------------------------
[1]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,
[1]PETSC ERROR:       INSTEAD the line number of the start of the function
[1]PETSC ERROR:       is given.
[1]PETSC ERROR: [1] PetscTraceBackErrorHandler line 120 src/sys/error/errtrace.c
[1]PETSC ERROR: [1] PetscError line 454 src/sys/error/err.c
[1]PETSC ERROR: [1] TSCreate_CN line 353 src/ts/impls/implicit/cn/cn.c
[1]PETSC ERROR: [1] TSSetType line 52 src/ts/interface/tsreg.c
[1]PETSC ERROR: --------------------- Error Message ------------------------------------

Does this mean that I could not use TSDefaultComputeJacobian if after that I define:
 TSSetType(ts,TS_CN)


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.

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




More information about the petsc-users mailing list