Difference between revisions of "Prolongation/Notes"

From Einstein Toolkit Documentation
Jump to: navigation, search
(2017-08-09: Schedule)
(2017-08-09: Schedule)
Line 70: Line 70:
 
|-
 
|-
 
|CCTK_EVOL
 
|CCTK_EVOL
|Time and iteration variables advanced. Time and iteration variables advanced
+
|Time and iteration variables advanced.
 
|
 
|
 
|-
 
|-

Revision as of 22:39, 14 August 2017

2017-08-08: Algorithm notes

Have three sets of equations:

1. RK4 2. ys in ks 3. ks in ys

Algorithm for unigrid evolution of existing data at t_n:

  • Use RK4 to set y_{n+1}
  • Repeat

Algorithm for 2-level evolution of existing data at t_n:

  • Evolve coarse grid using RK4. Keeps the ks in gridfunctions and y_n and y_{n+1}.
  • Spatially prolongate the coarse ks to the fine ks in the RB
  • Save y_{n+1} on the RB using "ys in ks" and the prolongated coarse grid ks
  • Compute fine ks from coarse ks on the RB using "ys in ks" at th=0 then "ks in ys"
  • Compute f(Y1) using the RHS function on the interior
  • Set k1 using RK4 on the interior
  • k1 is now set everywhere
  • Set Y2 using RK4
  • Set k2 using RK4 on the interior
  • Already have fine k2 on RB
  • Set Y3 using RK4
  • Set k3 using RK4 on the interior
  • Already have fine k3 on RB
  • Set Y4 from RK4
  • Set k4 from RK4 on the interior
  • Do not have k4 on the RB
  • Set y_{n+1} using RK4 on the interior
  • Restore the saved y_{n+1} on the RB
  • Now have y_{n+1} everywhere
  • Spatially prolongate the coarse ks to the fine ks in the RB (either do this again, or don't overwrite the ks. if we are using efficient RK4, we might not be setting the same k variables directly * anyway, so this isn't an issue?)
  • Compute the fine grid ks from the coarse ks in the RB using "ys in ks" at th=1 then "ks in ys"
  • Repeat RK4 steps to advance fine grid to t_{n+2}

Current Carpet/MoL algorithm:

  • t_n, t_{n-1} and t_{n-2} initialised by ID
  • Compute f in interior
  • MoL_Add to compute Y2
  • Prolongate Y2 from coarse grid
  • Compute f in interior
  • MoL_Add to compute Y3
  • Prolongate Y2 from coarse grid
  • Compute f in interior
  • MoL_Add to compute Y4
  • Prolongate Y2 from coarse grid
  • Compute f in interior
  • Accumulate vars into y_{n+1}
  • Prolongate Y2 from coarse grid

How can we implement the new algorithm?

Suppose we only prolongate the ks once, at t_n. RHSs computed as normal on the interior. Schedule a new function before MoL_Add to set the rhs variables to 1/dt k_i where these k_i are computed using the prolongated k variables using ks in ys and ys in ks.


2017-08-09: Schedule

When Old New
CCTK_INITIAL State vector set at t=0 ks, kTildes undefined (they are set during evolution)
CCTK_EVOL Time and iteration variables advanced.
MoL_SetCounter Disable Carpet prolongation (for buffer zone method)
MoL_ProlongateKs Prolongate ks into RBs. Copy ks into kTildes everywhere (in future, only on the RBs).
Loop over steps:
MoL_CalcRHS Physics thorns compute RHSs on the grid interior
MoL_RHSBoundaries Compute RHS in RB using kTildes (currently also compute in ghost zones)
MoL_SetKs Compute and store the k variables from the RHS variables into the ks over the whole grid. Apply BCs for the interprocessor and outer boundaries of the ks. Prolongation is still disabled.
MoL_Add MoL performs one update step
MoL_PostStep Sync evolved variable ghost zones, apply BCs. Prolongate RBs of evolved variables. Don't prolongate evolved variables.
MoL::MoL_ReenableProlongation Re-enable prolongation