[petsc-users] Solving a very simple time step problem:

Andrew Spott andrew.spott at gmail.com
Mon Apr 30 18:49:42 CDT 2012


I want to solve a very simple equation:

u_t = F(t) u

Where F(t) = H_0 + a(t) H' (H_0 and H' are constant matrices, and a(t) is a time dependent scalar).

But I'm not sure how to go about doing this using the TS context.

I don't have a Jacobian that I need to be worried about, so should I be doing:

TSSetRHSFunction(ts,PETSC_NULL,myRHSFunction,&appctx);
TSSetRHSJacobian(ts,A,A,TSComputeRHSJacobianConstant,&appctx);

Where:
myRHSFunction(TS ts,PetscReal t,Vec u,Vec F,void *ctx)
{
	//Create temporary matrix A = H_0 + a(t) H'
	//then do F = A u
}

Or should I be doing something else?

Thanks for the help, unfortunately, it looks like the documentation on TS in the manual isn't accurate.

-Andrew


More information about the petsc-users mailing list