<br><br><div class="gmail_quote">On Tue, Feb 7, 2012 at 6:40 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Suppose I want to solve a finite time step problem using FAS. The time step will be defined something like<div><div><br></div><div>static PetscErrorCode SNESTSFormFunction_ARKIMEX(SNES snes,Vec X,Vec F,TS ts)</div>

<div>{</div><div>  TS_ARKIMEX     *ark = (TS_ARKIMEX*)ts->data;</div><div>  PetscErrorCode ierr;</div><div><br></div><div>  PetscFunctionBegin;</div><div>  ierr = VecAXPBYPCZ(ark->Ydot,-ark->shift,ark->shift,0,ark->Z,X);CHKERRQ(ierr); /* Ydot = shift*(X-Z) */</div>

<div>  ierr = TSComputeIFunction(ts,ark->stage_time,X,ark->Ydot,F,ark->imex);CHKERRQ(ierr);</div><div>  PetscFunctionReturn(0);</div><div>}</div></div><div><br></div><div><br></div><div>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</div>

<div><br></div><div>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).</div>

<div><br></div></div></blockquote><div><br>The restriction (injection, etc) might be one step too hard at this point.  We have to define the problem at each level in FAS and grid sequencing so we might as well make it easy.  Is it possible to have the callback for the SNES point to things that have to be prolonged or restricted?  This could be called both before FAS and before grid sequencing to get the coefficients up to the next level.  We could provide some sort of default that goes through a number of user-provided vectors on a level given vectors on another level, and inject them.  A user with user-created multilevel coefficients could provide their own similar callbacks.<br>
 </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>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.</div>

<div><br></div></div></blockquote><div><br>This option seems like it would be scary complex.  I don't like it.<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div></div><div>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).</div>

<div><br></div></div></blockquote><div><br>I'm not sure this would be harmonious with FAS given the coarse problem is redefined with a defect from the fine problem (making a FAS cycle on a actual fine solution do nothing) at each stage.  As I understand it, we'd need a "real" time derivative rather than a derivative of the defect problem.  Therefore, we would be stuck solving at each level and using each level for FAS independently.<br>
<br>However, having a multilevel time integration scheme outside of FAS accessible to FAS to accelerate solution might be an interesting project; are there references? Would this look like grid sequencing + FAS with the grid sequence solutions moved forward in time?<br>
 <br>- Peter<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div><br></div><div>Preferences or suggestions?</div>
</div>
</blockquote></div><br>