[ET Trac] #2735: EinsteinBase: storage declaration simplification

Samuel Cupp trac-noreply at einsteintoolkit.org
Thu Jun 1 17:20:12 CDT 2023


#2735: EinsteinBase: storage declaration simplification

 Reporter: Samuel Cupp
   Status: new
Milestone: ET_2023_11
  Version: 
     Type: enhancement
 Priority: trivial
Component: EinsteinToolkit thorn

Currently, the various \*Base thorns declare storage like

```
if (timelevels == 1)
{
  STORAGE: stress_energy_scalar[1]
  STORAGE: stress_energy_vector[1]
  STORAGE: stress_energy_tensor[1]
}
else if (timelevels == 2)
{
  STORAGE: stress_energy_scalar[2]
  STORAGE: stress_energy_vector[2]
  STORAGE: stress_energy_tensor[2]
}
else if (timelevels == 3)
{
  STORAGE: stress_energy_scalar[3]
  STORAGE: stress_energy_vector[3]
  STORAGE: stress_energy_tensor[3]
}
```

We can instead just say

```
STORAGE: stress_energy_scalar[timelevels]
STORAGE: stress_energy_vector[timelevels]
STORAGE: stress_energy_tensor[timelevels]
```

This, of course, will properly declare the storage depending on the parameter at runtime. As I understand the behavior, this also works for timelevels = 0.

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2735/einsteinbase-storage-declaration
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.einsteintoolkit.org/pipermail/trac/attachments/20230601/3d158d19/attachment-0001.htm>


More information about the Trac mailing list