[Users] Carpet innards: restriction usage...

Erik Schnetter schnetter at cct.lsu.edu
Mon Apr 9 20:14:25 CDT 2012


Yes:

void BruiserRestrict(CCTK_ARGUMENTS) {

  DECLARE_CCTK_PARAMETERS;

  CCTK_VInfo(CCTK_THORNSTRING,"reflevel = %d, mglevel = %d", reflevel, mglevel);

  int const nvars = 4;
  int gis[nvars], v0s[nvars]; vis[nvars];

  gis[0] = CCTK_GroupIndex("Bruiser::phigroup");
  assert(gis[0] >= 0);
  v0s[0] = CCTK_FirstVarIndexI(gis[0]);
  assert(v0s[0] >= 0);
  vis[0] = CCTK_VarIndex("Bruiser::phi") - v0s[0];
  assert(vis[0] >= 0);

  gis[1] = ...;
  v0s[1] = ...;
  vis[1] = ...;
  // etc.

  int const tl = 0;
  CCTK_REAL const time = cctk_time;

  for (comm_state state; not state.done(); state.step()) {
    for (int m=0; m<maps; ++m) {
      for (int n=0; n<nvars; ++n) {
        ggf *const gv =
          arrdata.AT(gis[n]).AT(m).data.AT(vis[n]);
        gv->ref_restrict_all (state, tl, reflevel, mglevel, time);
      }
    }
  } // for state
}

-erik

-- 
Erik Schnetter <schnetter at cct.lsu.edu>
http://www.perimeterinstitute.ca/personal/eschnetter/


More information about the Users mailing list