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

Level Info TreeMesh without AMR #2104

Merged
merged 4 commits into from
Oct 9, 2024

Conversation

DanielDoehring
Copy link
Contributor

Motivation: Refinement patches for TreeMesh. Example tree_2d_dgsem/elixir_advection_mortar.jl.

Previously:

────────────────────────────────────────────────────────────────────────────────────────────────────
 Simulation running 'LinearScalarAdvectionEquation2D' with DGSEM(polydeg=3)
────────────────────────────────────────────────────────────────────────────────────────────────────
 #timesteps:                  9                run time:       4.80654000e-04 s
 Δt:             1.11111111e-01                └── GC time:    0.00000000e+00 s (0.000%)
 sim. time:      1.00000000e+00 (100.000%)     time/DOF/rhs!:  1.08330120e-08 s
                                               PID:            1.12534647e-08 s
 #DOFs per field:           640                alloc'd memory:        202.493 MiB
 #elements:                  40

 Variable:       scalar        
 L2 error:       1.51884667e-03
 Linf error:     8.44665572e-03
 ∑∂S/∂U  Uₜ :  -1.29388887e-05
 ∑S          :   5.62489671e-01
────────────────────────────────────────────────────────────────────────────────────────────────────

────────────────────────────────────────────────────────────────────────────────────────────────────
Trixi.jl simulation finished.  Final time: 1.0  Time steps: 9 (accepted), 9 (total)
────────────────────────────────────────────────────────────────────────────────────────────────────

 ─────────────────────────────────────────────────────────────────────────────────
            Trixi.jl                     Time                    Allocations      
                                ───────────────────────   ────────────────────────
        Tot / % measured:            710μs /  79.0%           45.5KiB /  71.0%    

 Section                ncalls     time    %tot     avg     alloc    %tot      avg
 ─────────────────────────────────────────────────────────────────────────────────
 rhs!                       46    309μs   55.1%  6.72μs   9.33KiB   28.9%     208B
   volume integral          46    170μs   30.4%  3.70μs     0.00B    0.0%    0.00B
   interface flux           46   34.3μs    6.1%   746ns     0.00B    0.0%    0.00B
   ~rhs!~                   46   27.5μs    4.9%   597ns   9.33KiB   28.9%     208B
   mortar flux              46   18.1μs    3.2%   394ns     0.00B    0.0%    0.00B
   surface integral         46   16.4μs    2.9%   357ns     0.00B    0.0%    0.00B
   prolong2mortars          46   15.8μs    2.8%   343ns     0.00B    0.0%    0.00B
   prolong2interfaces       46   14.4μs    2.6%   313ns     0.00B    0.0%    0.00B
   Jacobian                 46   7.80μs    1.4%   169ns     0.00B    0.0%    0.00B
   reset ∂u/∂t              46   1.91μs    0.3%  41.6ns     0.00B    0.0%    0.00B
   prolong2boundaries       46   1.14μs    0.2%  24.8ns     0.00B    0.0%    0.00B
   boundary flux            46    756ns    0.1%  16.4ns     0.00B    0.0%    0.00B
   source terms             46    679ns    0.1%  14.8ns     0.00B    0.0%    0.00B
 analyze solution            2    252μs   44.8%   126μs   23.0KiB   71.1%  11.5KiB
 calculate dt               10    668ns    0.1%  66.8ns     0.00B    0.0%    0.00B
 ─────────────────────────────────────────────────────────────────────────────────

Now:

 ────────────────────────────────────────────────────────────────────────────────────────────────────
Simulation running 'LinearScalarAdvectionEquation2D' with DGSEM(polydeg=3)
────────────────────────────────────────────────────────────────────────────────────────────────────
#timesteps:                  9                run time:       7.94432000e-04 s
Δt:             1.11111111e-01                └── GC time:    0.00000000e+00 s (0.000%)
sim. time:      1.00000000e+00 (100.000%)     time/DOF/rhs!:  1.92273604e-08 s
                                              PID:            2.00654212e-08 s
#DOFs per field:           640                alloc'd memory:        229.145 MiB
#elements:                  40
├── level 3:                32
└── level 2:                 8

Variable:       scalar        
L2 error:       1.51884667e-03
Linf error:     8.44665572e-03
∑∂S/∂U  Uₜ :  -1.29388887e-05
∑S          :   5.62489671e-01
────────────────────────────────────────────────────────────────────────────────────────────────────

────────────────────────────────────────────────────────────────────────────────────────────────────
Trixi.jl simulation finished.  Final time: 1.0  Time steps: 9 (accepted), 9 (total)
────────────────────────────────────────────────────────────────────────────────────────────────────

─────────────────────────────────────────────────────────────────────────────────
           Trixi.jl                     Time                    Allocations      
                               ───────────────────────   ────────────────────────
       Tot / % measured:           1.16ms /  83.7%           58.5KiB /  77.5%    

Section                ncalls     time    %tot     avg     alloc    %tot      avg
─────────────────────────────────────────────────────────────────────────────────
rhs!                       46    555μs   57.0%  12.1μs   9.33KiB   20.6%     208B
  volume integral          46    301μs   30.9%  6.54μs     0.00B    0.0%    0.00B
  interface flux           46   69.3μs    7.1%  1.51μs     0.00B    0.0%    0.00B
  ~rhs!~                   46   49.6μs    5.1%  1.08μs   9.33KiB   20.6%     208B
  mortar flux              46   35.1μs    3.6%   763ns     0.00B    0.0%    0.00B
  prolong2mortars          46   31.0μs    3.2%   674ns     0.00B    0.0%    0.00B
  surface integral         46   28.8μs    3.0%   627ns     0.00B    0.0%    0.00B
  prolong2interfaces       46   26.4μs    2.7%   573ns     0.00B    0.0%    0.00B
  Jacobian                 46   6.58μs    0.7%   143ns     0.00B    0.0%    0.00B
  reset ∂u/∂t              46   3.44μs    0.4%  74.8ns     0.00B    0.0%    0.00B
  prolong2boundaries       46   1.69μs    0.2%  36.8ns     0.00B    0.0%    0.00B
  boundary flux            46   1.06μs    0.1%  23.2ns     0.00B    0.0%    0.00B
  source terms             46    970ns    0.1%  21.1ns     0.00B    0.0%    0.00B
analyze solution            2    417μs   42.9%   209μs   36.0KiB   79.4%  18.0KiB
calculate dt               10   1.19μs    0.1%   119ns     0.00B    0.0%    0.00B
─────────────────────────────────────────────────────────────────────────────────

Copy link
Contributor

github-actions bot commented Oct 9, 2024

Review checklist

This checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging.

Purpose and scope

  • The PR has a single goal that is clear from the PR title and/or description.
  • All code changes represent a single set of modifications that logically belong together.
  • No more than 500 lines of code are changed or there is no obvious way to split the PR into multiple PRs.

Code quality

  • The code can be understood easily.
  • Newly introduced names for variables etc. are self-descriptive and consistent with existing naming conventions.
  • There are no redundancies that can be removed by simple modularization/refactoring.
  • There are no leftover debug statements or commented code sections.
  • The code adheres to our conventions and style guide, and to the Julia guidelines.

Documentation

  • New functions and types are documented with a docstring or top-level comment.
  • Relevant publications are referenced in docstrings (see example for formatting).
  • Inline comments are used to document longer or unusual code sections.
  • Comments describe intent ("why?") and not just functionality ("what?").
  • If the PR introduces a significant change or new feature, it is documented in NEWS.md with its PR number.

Testing

  • The PR passes all tests.
  • New or modified lines of code are covered by tests.
  • New or modified tests run in less then 10 seconds.

Performance

  • There are no type instabilities or memory allocations in performance-critical parts.
  • If the PR intent is to improve performance, before/after time measurements are posted in the PR.

Verification

  • The correctness of the code was verified using appropriate tests.
  • If new equations/methods are added, a convergence test has been run and the results
    are posted in the PR.

Created with ❤️ by the Trixi.jl community.

Copy link

codecov bot commented Oct 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.34%. Comparing base (480aea9) to head (bdcb57b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2104   +/-   ##
=======================================
  Coverage   96.34%   96.34%           
=======================================
  Files         470      470           
  Lines       37497    37514   +17     
=======================================
+ Hits        36125    36142   +17     
  Misses       1372     1372           
Flag Coverage Δ
unittests 96.34% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JoshuaLampert
Copy link
Member

Ok, so this prints the level information even without AMR, but if we have different levels already initially whereas before the level information was only printed with AMR, right?

Copy link
Member

@JoshuaLampert JoshuaLampert left a comment

Choose a reason for hiding this comment

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

Thanks. LGTM (after fixing a comment).

src/callbacks_step/analysis.jl Show resolved Hide resolved
@DanielDoehring DanielDoehring enabled auto-merge (squash) October 9, 2024 13:56
@DanielDoehring DanielDoehring merged commit 1d7b256 into trixi-framework:main Oct 9, 2024
36 of 37 checks passed
@DanielDoehring DanielDoehring deleted the LevelInfoTM branch October 9, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants