VolumeIntegrals_vacuum inherits directly from ML_BSSN

Issue #2491 resolved
Roland Haas created an issue

The analysis thorn `VolumeIntegrals_vacuum` in wvuthorns_diagnostics inherits directly from `ML_BSSN` making it impossible to use with another spacetime evolution code eg `Baikal` or `Lean_Public`. The quantities used seem to be the Hamiltonian and momentum constraints.

Comments (8)

  1. Leonardo Werneck

    Hi! I’ve been working on a patch for VolumeIntegrals_vacuum and following Zach’s suggestion I came up with the following “draft”:

    const CCTK_INT timelevel = 0;
    CCTK_REAL* H_gf   = NULL;
    CCTK_REAL* MU0_gf = NULL;
    CCTK_REAL* MU1_gf = NULL;
    CCTK_REAL* MU2_gf = NULL;
    if( CCTK_EQUALS(evolution_method,"Baikal") ) {
      H_gf   = (CCTK_REAL*)(CCTK_VarDataPtr(cctkGH,timelevel,"HGF"  ));
      MU0_gf = (CCTK_REAL*)(CCTK_VarDataPtr(cctkGH,timelevel,"MU0GF"));
      MU1_gf = (CCTK_REAL*)(CCTK_VarDataPtr(cctkGH,timelevel,"MU1GF"));
      MU2_gf = (CCTK_REAL*)(CCTK_VarDataPtr(cctkGH,timelevel,"MU2GF"));
    }
    else if( CCTK_EQUALS(evolution_method,"ML_BSSN") ) {
      H_gf   = (CCTK_REAL*)(CCTK_VarDataPtr(cctkGH,timelevel,"H" ));
      MU0_gf = (CCTK_REAL*)(CCTK_VarDataPtr(cctkGH,timelevel,"M1"));
      MU1_gf = (CCTK_REAL*)(CCTK_VarDataPtr(cctkGH,timelevel,"M2"));
      MU2_gf = (CCTK_REAL*)(CCTK_VarDataPtr(cctkGH,timelevel,"M3"));
    }
    else if( CCTK_EQUALS(evolution_method,"LeanBSSNMoL") ){
      H_gf   = (CCTK_REAL*)(CCTK_VarDataPtr(cctkGH,timelevel,"ham"));
      MU0_gf = (CCTK_REAL*)(CCTK_VarDataPtr(cctkGH,timelevel,"mcx"));
      MU1_gf = (CCTK_REAL*)(CCTK_VarDataPtr(cctkGH,timelevel,"mcy"));
      MU2_gf = (CCTK_REAL*)(CCTK_VarDataPtr(cctkGH,timelevel,"mcz"));
    }
    else {
      CCTK_VError(__LINE__, __FILE__, CCTK_THORNSTRING,
                  "Unsupported ADMBase::evolution_method: %s."
                  "Supported methods are: Baikal, ML_BSSN, and LeanBSSNMoL. ABORTING.",evolution_method);
    }
    

    The idea would then be to use the variables H_gf , MU0_gf, MU1_gf, and MU2_gf throughout the thorn, instead of variables which are specific to the evolution method chosen.

    I don't have much experience with CCTK_VarDataPtr , so any suggestions would be appreciated.

    Thanks!

  2. Zach Etienne

    Hey @Leonardo Werneck . I chatted with Roland about this. He says

    The code itself is actually nice to read, just the method is not going to be quite what we want (and I *like* the fact that he reports with VError that he received unexpected input!).

    The above code has a couple problems. First, if the gridfunction name changes in any of the above thorns, then we’ll end up getting errors. Second, the gridfunction names themselves must be “fully qualified”, meaning “ham” → “LeanBSSNMoL::ham”, etc.

    Roland suggests that we instead require the users to pass the names of gridfunctions through the parameter interface; e.g.,

    H_gf   = (CCTK_REAL*)(CCTK_VarDataPtr(cctkGH,timelevel, HamiltonianVarString)); // HamiltonianVarString is defined in param.ccl
    if(!H_gf) {
      CCTK_VError (__LINE__, __FILE__, CCTK_THORNSTRING, "Couldn't get data pointer of input array variable '%s' ", HamiltonianVarString);
    }
    

    … and similarly for momentum constraints. I’d put in ML_BSSN variable strings as default in the param.ccl; e.g., HamiltonianVarString = “ML_BSSN::H” as default

  3. Log in to comment