[petsc-users] Question for time dependent problems

Barry Smith bsmith at mcs.anl.gov
Tue Jul 5 15:35:37 CDT 2011


On Jul 5, 2011, at 2:38 PM, Travis C. Fisher wrote:

> I am wondering if there is a "right way" to set up preconditioning for time dependent nonlinear problems (using precondtioned matrix free SNES). For example, I want to use implicit Runge Kutta, and freeze my preconditioner at the beginning of each step. Currently how I do this is:
> 
> Problem set up:
> 1. Specify nonzero structure of precondtioner matrix.
> 2. Specify MAT_NEW_NONZERO_LOCATION_ERR and MAT_KEEP_NONZERO_PATTERN.
> 
> Beginning of a time step (1st implicit stage of RK scheme):
> 1. Use MatZeroEntries on the preconditioner

  Do not call MatZeroEntries on a freshly created matrix (that destroys the preallocation pattern) so skip the MatZeroEntries the first time.

> 2. Calculate and assemble preconditioning matrix
> 3. In the jacobian evaluation routine, use flag = SAME_NONZERO_PATTERN (I'd like it to use the nonzero structure I've already specified)
> 
> Subsequent nonlinear solves in time step:
> 1. Use flag = SAME_PRECONDITIONER in the jacobian evaluation
> 
> In this way, I only initialize the preconditioning matrix structure once. I am wondering if I have made any large mistakes here or if I am misunderstanding the character of the solver?
> 
> Is there a tutorial case for this situation? I want to note that my initial nonzero structure may contain entries that are zero, but may not be zero in subsequent calculations.

   Just make sure you put the zeros into the matrix the first time you build it and PETSc will keep the space around for the later calculations. 

> I am wondering what PETSC does with these during ASM/ILU preconditioning? i.e. Does it remove them from my originally specified nonzero structure?

   It does not remove zeros so long as you put them in.

   Barry

> 
> I appreciate any direction you can give me.
> 
> Thanks,
> 
> Travis Fisher



More information about the petsc-users mailing list