Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prettify summary output #333

Merged
merged 14 commits into from
Nov 15, 2020
Merged

Prettify summary output #333

merged 14 commits into from
Nov 15, 2020

Conversation

sloede
Copy link
Member

@sloede sloede commented Nov 13, 2020

Closes #302.

@sloede
Copy link
Member Author

sloede commented Nov 13, 2020

This is the current output:

julia> trixi_include("examples/2d/elixir_advection_amr.jl", tspan=(0.0, 0.1))

████████╗██████╗ ██╗██╗  ██╗██╗
╚══██╔══╝██╔══██╗██║╚██╗██╔╝██║
   ██║   ██████╔╝██║ ╚███╔╝ ██║
   ██║   ██╔══██╗██║ ██╔██╗ ██║
   ██║   ██║  ██║██║██╔╝ ██╗██║
   ╚═╝   ╚═╝  ╚═╝╚═╝╚═╝  ╚═╝╚═╝

┌──────────────────────────────────────────────────────────────────────────────┐
│ SemidiscretizationHyperbolic                                                 │
│ ════════════════════════════                                                 │
│ #spatial dimensions: …………… 2                                                 │
│ equations: ……………………………………… LinearScalarAdvectionEquation2D{Float64}          │
│ initial condition: ………………… initial_condition_gauss                           │
│ boundary conditions: …………… Trixi.BoundaryConditionPeriodic()                 │
│ source terms: ……………………………… nothing                                           │
│ solver: ……………………………………………… DG{Float64,LobattoLegend…,VolumeIntegralWeakForm} │
│ total #DOFs: ………………………………… 4096                                              │
└──────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────┐
│ TreeMesh{2, Trixi.SerialTree{2}}                                             │
│ ════════════════════════════════                                             │
│ center: ……………………………………………… [0.0, 0.0]                                        │
│ length: ……………………………………………… 10.0                                              │
│ periodicity: ………………………………… (true, true)                                      │
│ current number of cells: … 341                                               │
│ maximum number of cells: … 30000                                             │
└──────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────┐
│ LinearScalarAdvectionEquation2D                                              │
│ ═══════════════════════════════                                              │
│ #variables: …………………………………… 1                                                 │
│ │ variable 1: ……………………………… scalar                                            │
└──────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────┐
│ DG{Float64}                                                                  │
│ ═══════════                                                                  │
│ basis: ………………………………………………… LobattoLegendreBasis{Float64}(polydeg=3)          │
│ mortar: ……………………………………………… LobattoLegendreMortarL2{Float64}(polydeg=3)       │
│ surface flux: ……………………………… flux_lax_friedrichs                               │
│ volume integral: ……………………… VolumeIntegralWeakForm()                          │
└──────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────┐
│ AMRCallback                                                                  │
│ ═══════════                                                                  │
│ controller: …………………………………… ControllerThreeLevel(Ind…=0.1, max_threshold=0.6) │
│ interval: ………………………………………… 5                                                 │
│ adapt IC: ………………………………………… yes                                               │
│ │ only refine: …………………………… yes                                               │
└──────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────┐
│ StepsizeCallback                                                             │
│ ════════════════                                                             │
│ CFL number: …………………………………… 1.6                                               │
└──────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────┐
│ SaveRestartCallback                                                          │
│ ═══════════════════                                                          │
│ interval: ………………………………………… 100                                               │
│ save final solution: …………… yes                                               │
│ output directory: …………………… /home/mschlott/gdrive/wo…e/hackathon/Trixi.jl/out │
└──────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────┐
│ SaveSolutionCallback                                                         │
│ ════════════════════                                                         │
│ interval: ………………………………………… 100                                               │
│ solution variables: ……………… primitive                                         │
│ save initial solution: ……… yes                                               │
│ save final solution: …………… yes                                               │
│ output directory: …………………… /home/mschlott/gdrive/wo…e/hackathon/Trixi.jl/out │
└──────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────┐
│ AnalysisCallback                                                             │
│ ════════════════                                                             │
│ interval: ………………………………………… 100                                               │
│ analyzer: ………………………………………… LobattoLegendreAnalyzer{Float64}(polydeg=6)       │
│ │ error 1: ……………………………………… l2_error                                          │
│ │ error 2: ……………………………………… linf_error                                        │
│ │ integral 1: ……………………………… entropy_timederivative                            │
│ │ integral 2: ……………………………… entropy                                           │
│ save analysis to file: ……… no                                                │
└──────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────┐
│ AliveCallback                                                                │
│ ═════════════                                                                │
│ interval: ………………………………………… 10                                                │
└──────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────┐
│ Time integration                                                             │
│ ════════════════                                                             │
│ Start time: …………………………………… 0.0                                               │
│ Final time: …………………………………… 0.1                                               │
│ time integrator: ……………………… CarpenterKennedy2N54                              │
└──────────────────────────────────────────────────────────────────────────────┘

--------------------------------------------------------------------------------
 Simulation running 'LinearScalarAdvectionEquation2D' with polydeg = 3
--------------------------------------------------------------------------------
 #timesteps:                  0                run time:       1.71400000e-06 s
[...]

It would be great to get some feedback on this...

Copy link
Member

@ranocha ranocha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much cleaner than before! Nice work overall, @sloede 👍

@ranocha
Copy link
Member

ranocha commented Nov 13, 2020

Another minor comments/suggestion: What about printing Trixi.BoundaryConditionPeriodic() as boundary_condition_periodic?

@codecov
Copy link

codecov bot commented Nov 13, 2020

Codecov Report

Merging #333 (95c7449) into dev (44c3797) will decrease coverage by 0.08%.
The diff coverage is 86.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #333      +/-   ##
==========================================
- Coverage   88.51%   88.43%   -0.09%     
==========================================
  Files          76       76              
  Lines        8793     8886      +93     
==========================================
+ Hits         7783     7858      +75     
- Misses       1010     1028      +18     
Flag Coverage Δ
unittests 88.43% <86.61%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/basic_types.jl 50.00% <0.00%> (-50.00%) ⬇️
src/solvers/dg/indicators.jl 46.66% <64.28%> (+0.37%) ⬆️
src/callbacks_step/steady_state.jl 71.42% <66.66%> (-1.30%) ⬇️
src/mesh/mesh.jl 80.32% <75.00%> (-0.93%) ⬇️
src/callbacks_step/save_restart.jl 92.30% <80.00%> (+0.87%) ⬆️
src/callbacks_step/save_solution.jl 95.45% <80.00%> (+0.45%) ⬆️
src/callbacks_step/stepsize.jl 94.28% <80.00%> (+0.73%) ⬆️
src/solvers/dg/dg.jl 90.58% <80.00%> (-4.80%) ⬇️
src/callbacks_step/amr.jl 83.10% <84.61%> (-0.31%) ⬇️
src/equations/equations.jl 84.00% <85.71%> (+5.05%) ⬆️
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44c3797...95c7449. Read the comment docs.

@ranocha
Copy link
Member

ranocha commented Nov 13, 2020

Some additional things coming to my mind:

  • SteadyStateCallback should also be adapted.
  • SemidiscretizationEulerGravity and ParametersEulerGravity should be adapted
  • It would be nice to adapt the output of the volume integral types. For example,
    julia> trixi_include("examples/2d/elixir_euler_ec.jl")
    [...]
    ┌──────────────────────────────────────────────────────────────────────────────┐
    │ DG{Float64}                                                                  │
    │ ═══════════                                                                  │
    │ basis: ………………………………………………… LobattoLegendreBasis{Float64}(polydeg=3)          │
    │ mortar: ……………………………………………… LobattoLegendreMortarL2{Float64}(polydeg=3)       │
    │ surface flux: ……………………………… flux_chandrashekar                                │
    │ volume integral: ……………………… VolumeIntegralFluxDifferrixi.flux_chandrashekar) │
    └──────────────────────────────────────────────────────────────────────────────┘
    [...]
    is a bit too short. The same is true for shock capturing.
  • Should we also give a bit more information about the AMR controller?

@sloede
Copy link
Member Author

sloede commented Nov 13, 2020

Another minor comments/suggestion: What about printing Trixi.BoundaryConditionPeriodic() as boundary_condition_periodic?

Is this regarding the way it is shown in the summary callback or do you mean we should adapt/implement a show for BoundaryConditionPeriodic()?

@ranocha
Copy link
Member

ranocha commented Nov 13, 2020

Is this regarding the way it is shown in the summary callback or do you mean we should adapt/implement a show for BoundaryConditionPeriodic()?

Isn't that basically the same? I observed how it was printed by the summary callback from the semidiscretization and thought it might be nice to print it using the exported version boundary_condition_periodic instead of the un-exported version Trixi.BoundaryConditionPeriodic().

@sloede
Copy link
Member Author

sloede commented Nov 13, 2020

  • SteadyStateCallback should also be adapted.
  • SemidiscretizationEulerGravity and ParametersEulerGravity should be adapted
  • It would be nice to adapt the output of the volume integral types. [...] The same is true for shock capturing.
  • Should we also give a bit more information about the AMR controller?

Yes, I fully agree. The first 2 are just missing, I'll see to that.

The other two are probably more difficult to achieve. If you have an idea for how to implement it, feel free to let me know. Otherwise, I will - as discussed today - try to think about a clean solution and if it amounts to nothing, postpone it.

@sloede
Copy link
Member Author

sloede commented Nov 14, 2020

SteadyStateCallback should also be adapted.

Done in ccd07f7

SemidiscretizationEulerGravity and ParametersEulerGravity should be adapted

Done in c7d5848

Co-authored-by: Hendrik Ranocha <ranocha@users.noreply.github.com>
Copy link
Member

@ranocha ranocha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to merge this and open an issue to improve the output of things like split-form & shock-capturing volume integral types or the AMR controller etc.

@sloede
Copy link
Member Author

sloede commented Nov 14, 2020

With the latest commit (e8ed070), we now get the following:

Nested output (examples/2d/elixir_euler_blob_amr.jl)

Volume integral

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ DG{Float64}                                                                                      │
│ ═══════════                                                                                      │
│ polynomial degree: ……………………………… 4                                                                │
│ basis: ……………………………………………………………… LobattoLegendreBasis{Float64}(polydeg=4)                         │
│ mortar: …………………………………………………………… LobattoLegendreMortarL2{Float64}(polydeg=4)                      │
│ surface flux: …………………………………………… flux_lax_friedrichs                                              │
│ volume integral: …………………………………… VolumeIntegralShockCapturingHG                                   │
│ │ volume flux DG: ………………………………… flux_chandrashekar                                               │
│ │ volume flux FV: ………………………………… flux_chandrashekar                                               │
│ │ indicator: ……………………………………………… IndicatorHennemannGassner                                        │
│ │ │ indicator variable: ………………… pressure                                                         │
│ │ │ max. α: ………………………………………………… 0.4                                                              │
│ │ │ min. α: ………………………………………………… 0.0001                                                           │
│ │ │ α smoothing: …………………………………… yes                                                              │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

AMR

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ AMRCallback                                                                                      │
│ ═══════════                                                                                      │
│ controller: ………………………………………………… ControllerThreeLevelCombined                                     │
│ │ primary indicator: ………………………… IndicatorHennemannGassner                                        │
│ │ │ indicator variable: ………………… density                                                          │
│ │ │ max. α: ………………………………………………… 1.0                                                              │
│ │ │ min. α: ………………………………………………… 0.0001                                                           │
│ │ │ α smoothing: …………………………………… no                                                               │
│ │ secondary indicator: …………………… IndicatorHennemannGassner                                        │
│ │ │ indicator variable: ………………… pressure                                                         │
│ │ │ max. α: ………………………………………………… 0.4                                                              │
│ │ │ min. α: ………………………………………………… 0.0001                                                           │
│ │ │ α smoothing: …………………………………… yes                                                              │
│ │ base_level: …………………………………………… 4                                                                │
│ │ med_level: ……………………………………………… 0                                                                │
│ │ max_level: ……………………………………………… 7                                                                │
│ │ med_threshold: …………………………………… 0.0003                                                           │
│ │ max_threshold: …………………………………… 0.003                                                            │
│ │ max_threshold_secondary: ………… 0.4                                                              │
│ interval: ……………………………………………………… 1                                                                │
│ adapt IC: ……………………………………………………… yes                                                              │
│ │ only refine: ………………………………………… yes                                                              │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

Boundary conditions (examples/2d/elixir_hypdiff_nonperiodic.jl)

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ SemidiscretizationHyperbolic                                                                     │
│ ════════════════════════════                                                                     │
│ #spatial dimensions: ………………………… 2                                                                │
│ equations: …………………………………………………… HyperbolicDiffusionEquations2D                                   │
│ initial condition: ……………………………… initial_condition_poisson_nonperiodic                            │
│ boundary conditions: ………………………… 4                                                                │
│ │ negative x: …………………………………………… boundary_condition_poisson_nonperiodic                           │
│ │ positive x: …………………………………………… boundary_condition_poisson_nonperiodic                           │
│ │ negative y: …………………………………………… BoundaryConditionPeriodic()                                      │
│ │ positive y: …………………………………………… BoundaryConditionPeriodic()                                      │
│ source terms: …………………………………………… source_terms_poisson_nonperiodic                                 │
│ solver: …………………………………………………………… DG                                                               │
│ total #DOFs: ……………………………………………… 1600                                                             │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

For reference, here is the output from the example above:

Click to expand
julia> trixi_include("examples/2d/elixir_advection_amr.jl", tspan=(0.0, 1.1))

████████╗██████╗ ██╗██╗  ██╗██╗
╚══██╔══╝██╔══██╗██║╚██╗██╔╝██║
   ██║   ██████╔╝██║ ╚███╔╝ ██║
   ██║   ██╔══██╗██║ ██╔██╗ ██║
   ██║   ██║  ██║██║██╔╝ ██╗██║
   ╚═╝   ╚═╝  ╚═╝╚═╝╚═╝  ╚═╝╚═╝

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ SemidiscretizationHyperbolic                                                                     │
│ ════════════════════════════                                                                     │
│ #spatial dimensions: ………………………… 2                                                                │
│ equations: …………………………………………………… LinearScalarAdvectionEquation2D                                  │
│ initial condition: ……………………………… initial_condition_gauss                                          │
│ boundary conditions: ………………………… 4                                                                │
│ │ negative x: …………………………………………… BoundaryConditionPeriodic()                                      │
│ │ positive x: …………………………………………… BoundaryConditionPeriodic()                                      │
│ │ negative y: …………………………………………… BoundaryConditionPeriodic()                                      │
│ │ positive y: …………………………………………… BoundaryConditionPeriodic()                                      │
│ source terms: …………………………………………… nothing                                                          │
│ solver: …………………………………………………………… DG                                                               │
│ total #DOFs: ……………………………………………… 4096                                                             │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ TreeMesh{2, Trixi.SerialTree{2}}                                                                 │
│ ════════════════════════════════                                                                 │
│ center: …………………………………………………………… [0.0, 0.0]                                                       │
│ length: …………………………………………………………… 10.0                                                             │
│ periodicity: ……………………………………………… (true, true)                                                     │
│ current #cells: ……………………………………… 341                                                              │
│ maximum #cells: ……………………………………… 30000                                                            │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ LinearScalarAdvectionEquation2D                                                                  │
│ ═══════════════════════════════                                                                  │
│ #variables : ……………………………………………… 1                                                                │
│ │ variable 1: …………………………………………… scalar                                                           │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ DG{Float64}                                                                                      │
│ ═══════════                                                                                      │
│ polynomial degree: ……………………………… 3                                                                │
│ basis: ……………………………………………………………… LobattoLegendreBasis{Float64}(polydeg=3)                         │
│ mortar: …………………………………………………………… LobattoLegendreMortarL2{Float64}(polydeg=3)                      │
│ surface flux: …………………………………………… flux_lax_friedrichs                                              │
│ volume integral: …………………………………… VolumeIntegralWeakForm                                           │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ AMRCallback                                                                                      │
│ ═══════════                                                                                      │
│ controller: ………………………………………………… ControllerThreeLevel                                             │
│ │ indicator: ……………………………………………… IndicatorMax                                                     │
│ │ │ indicator variable: ………………… first                                                            │
│ │ base_level: …………………………………………… 4                                                                │
│ │ med_level: ……………………………………………… 5                                                                │
│ │ max_level: ……………………………………………… 6                                                                │
│ │ med_threshold: …………………………………… 0.1                                                              │
│ │ max_threshold: …………………………………… 0.6                                                              │
│ interval: ……………………………………………………… 5                                                                │
│ adapt IC: ……………………………………………………… yes                                                              │
│ │ only refine: ………………………………………… yes                                                              │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ StepsizeCallback                                                                                 │
│ ════════════════                                                                                 │
│ CFL number: ………………………………………………… 1.6                                                              │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ SaveRestartCallback                                                                              │
│ ═══════════════════                                                                              │
│ interval: ……………………………………………………… 100                                                              │
│ save final solution: ………………………… yes                                                              │
│ output directory: ………………………………… /home/mschlott/gdrive/work/code/hackathon/Trixi.jl/out           │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ SaveSolutionCallback                                                                             │
│ ════════════════════                                                                             │
│ interval: ……………………………………………………… 100                                                              │
│ solution variables: …………………………… primitive                                                        │
│ save initial solution: …………………… yes                                                              │
│ save final solution: ………………………… yes                                                              │
│ output directory: ………………………………… /home/mschlott/gdrive/work/code/hackathon/Trixi.jl/out           │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ AnalysisCallback                                                                                 │
│ ════════════════                                                                                 │
│ interval: ……………………………………………………… 100                                                              │
│ analyzer: ……………………………………………………… LobattoLegendreAnalyzer{Float64}(polydeg=6)                      │
│ │ error 1: …………………………………………………… l2_error                                                         │
│ │ error 2: …………………………………………………… linf_error                                                       │
│ │ integral 1: …………………………………………… entropy_timederivative                                           │
│ │ integral 2: …………………………………………… entropy                                                          │
│ save analysis to file: …………………… no                                                               │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ AliveCallback                                                                                    │
│ ═════════════                                                                                    │
│ interval: ……………………………………………………… 10                                                               │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Time integration                                                                                 │
│ ════════════════                                                                                 │
│ Start time: ………………………………………………… 0.0                                                              │
│ Final time: ………………………………………………… 1.1                                                              │
│ time integrator: …………………………………… CarpenterKennedy2N54                                             │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

────────────────────────────────────────────────────────────────────────────────────────────────────
 Simulation running 'LinearScalarAdvectionEquation2D' with polydeg = 3
────────────────────────────────────────────────────────────────────────────────────────────────────
 #timesteps:                  0                run time:       8.54000000e-07 s
[...]

@sloede sloede requested a review from ranocha November 14, 2020 23:07
Copy link
Member

@ranocha ranocha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice work, @sloede! Once my comments comments are resolved, please feel free to merge this PR.

sloede and others added 2 commits November 15, 2020 07:44
Co-authored-by: Hendrik Ranocha <ranocha@users.noreply.github.com>
@sloede
Copy link
Member Author

sloede commented Nov 15, 2020

Currently I see no sane way of including information about a restart, without adding additional fields to an existing data structure, wit the sole purpose of triggering a different output in the summary callback. Do I understand it correctly, that since restarting right now is essentially stateless, we do not have the capability to distinguish a restart from a regular start?

@sloede sloede requested a review from ranocha November 15, 2020 07:17
@ranocha
Copy link
Member

ranocha commented Nov 15, 2020

Currently I see no sane way of including information about a restart, without adding additional fields to an existing data structure, wit the sole purpose of triggering a different output in the summary callback. Do I understand it correctly, that since restarting right now is essentially stateless, we do not have the capability to distinguish a restart from a regular start?

Yes, you're right.

@sloede sloede merged commit 513708d into dev Nov 15, 2020
@sloede sloede deleted the msl/prettify-summary-output branch November 15, 2020 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants