IAS-Astrophysics / athenak

Performance-portable version of the Athena++ astrophysical AMR-MHD code using Kokkos.
BSD 3-Clause "New" or "Revised" License
34 stars 24 forks source link

Coarsened output - [merged] #552

Closed jmstone closed 3 months ago

jmstone commented 8 months ago

In GitLab by @DFielding14 on Feb 16, 2024, 14:13

_Merges coarsenedoutput -> master

Added a new output for calculating coarsened outputs. Users can save the volume weighted average of any quantity they specify in the input file. Coarsening can be by 2 to some power up to the size of a meshblock (e.g. for meshblocks of 128^3 you can coarsen by 2, 4, 8, 16, 32, 64, or 128). Additionally users can also save the 2nd, 3rd, and 4th moments of the quantity in the coarsening kernel (e.g. , <q^2>, <q^3>, and <q^4>). The coarsened fields are saved in the standard binary format. I have added functions to athena_read.py to read in the coarsened data.

I have not tested if this works with AMR and suspect it will not.

Here is an example snippet for an input file to use these outputs


<output1>
file_type  = cbin          # Binary data dump
variable   = mhd_u_bcc     # variables to be output
dt         = 1             # time increment between outputs
coarsen_factor = 8         # coarsening factor
compute_moments = false    # compute moments of the variables in the averaging kernel

<output2>
file_type  = cbin          # Binary data dump
variable   = mhd_u_bcc     # variables to be output
dt         = 1             # time increment between outputs
coarsen_factor = 128       # coarsening factor
compute_moments = true     # compute moments of the variables in the averaging kernel```
jmstone commented 8 months ago

In GitLab by @jmstone216 on Feb 25, 2024, 11:21

Hate to ask this now, so late in the process, but couldn't coarsening just be added to the LoadOutputData() function in the BaseTypeOutput class in the same way, e.g. slicing is implemented there? That way the coarsened data could be output in any format, and wouldn't need a new ".cbin" type.

jmstone commented 8 months ago

In GitLab by @DFielding14 on Mar 4, 2024, 17:17

added 83 commits

Compare with previous version

jmstone commented 8 months ago

In GitLab by @DFielding14 on Mar 4, 2024, 17:26

added 1 commit

Compare with previous version

jmstone commented 8 months ago

In GitLab by @DFielding14 on Mar 4, 2024, 17:34

added 1 commit

Compare with previous version

jmstone commented 8 months ago

In GitLab by @DFielding14 on Mar 4, 2024, 17:37

added 1 commit

Compare with previous version

jmstone commented 8 months ago

In GitLab by @DFielding14 on Mar 4, 2024, 17:45

added 1 commit

Compare with previous version

jmstone commented 8 months ago

In GitLab by @DFielding14 on Mar 4, 2024, 17:48

added 1 commit

Compare with previous version

jmstone commented 8 months ago

In GitLab by @DFielding14 on Mar 4, 2024, 17:54

added 1 commit

Compare with previous version

jmstone commented 8 months ago

In GitLab by @DFielding14 on Mar 4, 2024, 17:55

added 1 commit

Compare with previous version

jmstone commented 8 months ago

In GitLab by @DFielding14 on Mar 4, 2024, 21:26

added 1 commit

Compare with previous version

jmstone commented 8 months ago

In GitLab by @DFielding14 on Mar 4, 2024, 22:02

added 1 commit

Compare with previous version

jmstone commented 8 months ago

In GitLab by @jmstone216 on Mar 5, 2024, 12:55

On the NOUTPUT_CHOICES question, yes this is a terrible design (see Issue #19) and needs to be fixed. In fact, I am waiting to get your new outputs merged to then I can tackle this. I didn't want to start re-designing things when you were working on that part of the code since it would just create horrible conflicts.

jmstone commented 8 months ago

In GitLab by @DFielding14 on Mar 5, 2024, 17:02

added 1 commit

Compare with previous version

jmstone commented 8 months ago

In GitLab by @DFielding14 on Mar 5, 2024, 17:03

added 1 commit

Compare with previous version

jmstone commented 8 months ago

In GitLab by @DFielding14 on Mar 5, 2024, 17:13

added 1 commit

Compare with previous version

jmstone commented 8 months ago

In GitLab by @jmstone216 on Mar 5, 2024, 21:17

mentioned in commit ba3a2c24b813304b4bbfa33ec531121930be88df