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

Print Analysis in Full Precision to File #2155

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

DanielDoehring
Copy link
Contributor

@DanielDoehring DanielDoehring commented Nov 12, 2024

As Float64 is the default type, we should IMO also use default Float64 precision when writing to file.
Ideally, this would also be fully type-generalized.

Copy link
Contributor

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 Nov 12, 2024

Codecov Report

Attention: Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 96.39%. Comparing base (9c69e10) to head (61af005).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/callbacks_step/analysis.jl 85.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2155   +/-   ##
=======================================
  Coverage   96.39%   96.39%           
=======================================
  Files         483      483           
  Lines       38333    38333           
=======================================
  Hits        36948    36948           
  Misses       1385     1385           
Flag Coverage Δ
unittests 96.39% <85.00%> (ø)

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.

@ranocha
Copy link
Member

ranocha commented Nov 14, 2024

When this PR is ready to be reviewed, please post an example output and request my review.

@DanielDoehring
Copy link
Contributor Author

So this is the output for this example:

https://github.com/trixi-framework/Trixi.jl/blob/main/examples/p4est_2d_dgsem/elixir_euler_NACA0012airfoil_mach085.jl

#timestep  time                   dt                      l2_rho                  l2_rho_v1               l2_rho_v2               l2_rho_e                linf_rho                linf_rho_v1             linf_rho_v2             linf_rho_e              CD_p                    CL_p                 
0  0.0  1.0  4.635877027111142e-19  9.594764314007183e-18  2.1395386617157513e-19  4.410582019008173e-16  8.673617379884035e-19  2.0816681711721685e-17  4.336808689942018e-19  8.881784197001252e-16  3.5344990823027445e-17  3.348863341582492e-16
2000  0.03417167487161614  1.6531800344891135e-5  9.239069860128937e-6  0.00010218505713782282  0.00015780594489402523  0.008386858030830217  0.0015342069137868238  0.05902551599364901  0.03596744637125509  1.188412268460238  0.059181395834243554  0.06685398281254544
4000  0.06820092242065948  1.298140433127391e-5  1.2475392023593072e-5  0.00010359577138024858  0.00017764533008070394  0.010643322215075933  0.0014858686637413089  0.05903246826381899  0.036234209612504  1.1175937394045472  0.053028518683718794  0.07704115781391377

admittedly not really nice.

@ranocha
Copy link
Member

ranocha commented Nov 20, 2024

The file should mainly be machine-readable. Would it make sense to reduce the amount of whitespace between the entries in the header?

@DanielDoehring
Copy link
Contributor Author

DanielDoehring commented Nov 21, 2024

I agree.

So with single whitespace this is

#timestep time dt l2_rho l2_rho_v1 l2_rho_v2 l2_rho_e linf_rho linf_rho_v1 linf_rho_v2 linf_rho_e CD_p CL_p 
0 0.0 1.0 4.635877027111142e-19 9.594764314007183e-18 2.1395386617157513e-19 4.410582019008173e-16 8.673617379884035e-19 2.0816681711721685e-17 4.336808689942018e-19 8.881784197001252e-16 3.5344990823027445e-17 3.348863341582492e-16
2000 0.03417167487161606 1.6531800344891064e-5 9.239069860128691e-6 0.00010218505713782645 0.00015780594489402477 0.008386858030830389 0.0015342069137867908 0.05902551599364911 0.03596744637125548 1.1884122684602763 0.059181395834245566 0.0668539828125497
4000 0.06820092242065921 1.2981404331273612e-5 1.2475392023592296e-5 0.0001035957713802507 0.00017764533008070532 0.010643322215075968 0.0014858686637413297 0.05903246826381898 0.036234209612504696 1.1175937394046325 0.053028518683719085 0.07704115781391595

which is ready for splitting at whitespaces.

@ranocha
Copy link
Member

ranocha commented Nov 27, 2024

Since you marked this as breaking, could you please add a NEWS.md entry?

@ranocha ranocha mentioned this pull request Nov 27, 2024
7 tasks
DanielDoehring and others added 2 commits November 28, 2024 10:51
NEWS.md Outdated Show resolved Hide resolved
NEWS.md Outdated Show resolved Hide resolved
NEWS.md Outdated Show resolved Hide resolved
sloede
sloede previously approved these changes Dec 1, 2024
Copy link
Member

@sloede sloede left a comment

Choose a reason for hiding this comment

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

LGTM - thanks!

@torrilhon
Copy link
Contributor

Please note #1880 ...

@ranocha ranocha marked this pull request as draft December 5, 2024 13:56
@ranocha
Copy link
Member

ranocha commented Dec 5, 2024

I converted this to draft so that nobody accidentally merges the breaking change

@sloede
Copy link
Member

sloede commented Dec 5, 2024

I converted this to draft so that nobody accidentally merges the breaking change

I think you mean "so that Michael won't accidentally merge the breaking change"

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.

6 participants