[petsc-dev] FAS with TS

Jed Brown jedbrown at mcs.anl.gov
Tue Feb 7 18:40:10 CST 2012


Suppose I want to solve a finite time step problem using FAS. The time step
will be defined something like

static PetscErrorCode SNESTSFormFunction_ARKIMEX(SNES snes,Vec X,Vec F,TS
ts)
{
  TS_ARKIMEX     *ark = (TS_ARKIMEX*)ts->data;
  PetscErrorCode ierr;

  PetscFunctionBegin;
  ierr =
VecAXPBYPCZ(ark->Ydot,-ark->shift,ark->shift,0,ark->Z,X);CHKERRQ(ierr); /*
Ydot = shift*(X-Z) */
  ierr =
TSComputeIFunction(ts,ark->stage_time,X,ark->Ydot,F,ark->imex);CHKERRQ(ierr);
  PetscFunctionReturn(0);
}


where ark->Z was determined from previous stages and ark->Ydot is a work
vector. So FAS creates some hierarchy, but it isn't very forthcoming about
showing the hierarchy to the user. But I need a way to

1. Restrict ark->Z to the coarse level and obtain the work vector ark->Ydot
somewhere that I can reuse it. The user might also have to restrict
"auxiliary" variables to coarse grids. It's conceivable that they would
want to do this in a different way from the restriction/prolongation for
the solution variables. For example, if you were using upwinded R and P for
a hyperbolic problem, but you needed to restrict coefficients (like
bathymetry). Or they might want to sample differently out of some file. So
I think we need an auxiliary transfer callback that is at least called
every top-level SNESSolve() and optionally also called in every transfer
(because it could be homogenizing coefficient structure that is a nonlinear
function of state).

2. Put the DM from this SNES into the TS that calls the user's IFunction.
The easiest way is to have TSPushDM(TS,DM) that just jams it in there,
caching the old DM (so the user's call to TSGetDM() works correctly), and
TSPopDM(TS). This is ugly and is scary if the user does something weird
like TSGetSolution() (returning the state at the beginning of the step, not
the current value at the stage). This is something that doesn't make
semantic sense except maybe if they have some weird diagnostics, but
TSGetIJacobian() might be used for caching, and I'm scared of the semantics
it would involve to support this sort of caching.

The alternative is to make different TSs for each level and somehow locate
the correct TS (maybe cache it in the SNES hierarchy). I think this could
be quite confusing to restrict all the members to the coarse grid. But
having a multi-level TS object may eventually be sensible because
multilevel time integration schemes exist. Spectral deferred correction is
one example where coarse grids (in space and time) can be used to
accelerate convergence to a high-order solution. But these somewhat
naturally expose additional parallelism in time (usually more
communication, but also more concurrency), so it likely needs a more
complete solution that includes ways to instantiate entire models on
sub-communicators (we'll also want an interface of this type for UQ).


Preferences or suggestions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120208/9f69cf1e/attachment.html>


More information about the petsc-dev mailing list