[ET Trac] #2631: Meudon_BinNS fails if initial_dtshift or initial_dtlapse is set to an unexpected value

Roland Haas trac-noreply at einsteintoolkit.org
Fri Aug 19 14:09:12 CDT 2022


#2631: Meudon_BinNS fails if initial_dtshift or initial_dtlapse is set to an unexpected value

 Reporter: Roland Haas
   Status: new
Milestone: 
  Version: 
     Type: bug
 Priority: minor
Component: 

Meudon\_BinNS contains code like this:

‌

```c
    if (CCTK_EQUALS(initial_lapse, "Meudon_Bin_NS")) { 
      if (CCTK_EQUALS (initial_dtlapse, "Meudon_Bin_NS")) {
        CCTK_INFO ("Calculating time derivatives of lapse");
        set_dt_from_domega (CCTK_PASS_CTOC, alp, dtalp, omega);
      } else if (CCTK_EQUALS (initial_dtlapse, "none") or CCTK_EQUALS(initial_dtlapse,"zero")) {
        // do nothing
      } else {
        CCTK_WARN (CCTK_WARN_ABORT, "internal error");
      }
    }
```

which fails if `initial_lapse` is set to `Meudon_Bin_NS` but `initial_dtlapse` is set to an unexpected value \(and similar for `shift`\). It also only sets `dtalp` if it sets `alp`. 

Neither is correct. The correct way, documented here [https://www.einsteintoolkit.org/thornguide/EinsteinBase/ADMBase/documentation.html#x1-80003.2](https://www.einsteintoolkit.org/thornguide/EinsteinBase/ADMBase/documentation.html#x1-80003.2), is to inspect each parameter independently and then, if the the parameter has a value matching one of the values that `Meudon_Bin_NS` added to the list of allowed keyword values, set the variable accordingly.

That is something along the lines:

```c
  for (int i=0; i<npoints; ++i) {
    if (CCTK_EQUALS(initial_lapse, "Meudon_Bin_NS")) { 
      alp[i] = bin_ns.nnn[i];
    }
  }
  if (CCTK_EQUALS (initial_dtlapse, "Meudon_Bin_NS")) {
    // use bin_ns.nnn to compute derivs of lapse in case alp is not set by us
    set_dt_from_domega (CCTK_PASS_CTOC, bin_ns.nnn, dtalp, omega);
  }
```

‌

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2631/meudon_binns-fails-if-initial_dtshift-or
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/trac/attachments/20220819/4943ab0e/attachment.html 


More information about the Trac mailing list