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

Reorganize the implementation of the mass conserving temperature prof… #588

Merged

Conversation

lhy11009
Copy link
Contributor

@lhy11009 lhy11009 commented Feb 14, 2024

I add a small new function "get_temperature_analytic" to extract the calculation of the temperature from the analytic solution in the slab mass-conserving temperature profile.

If the top heat content and the adjusted distance are computed elsewhere. Then only one more line is needed to compute the temperature:

temperature = get_temperature_analytic(top_heat_content, min_temperature, background_temperature, temperature_, effective_plate_age, adjusted_distance);

This would make further implementation of splining the temperature profile easier

While doing this, I migrate the plate model summation number as a separate constant variable in the file include/world_builder/features/subducting_plate_models/temperature/mass_conserving.h

const int plate_model_summation_number = 100;

@mibillen and @MFraters , could you give a review on this?

Copy link

codecov bot commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d465a69) 93.49% compared to head (556927e) 93.38%.
Report is 132 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #588      +/-   ##
==========================================
- Coverage   93.49%   93.38%   -0.12%     
==========================================
  Files          92       92              
  Lines        6346     6270      -76     
==========================================
- Hits         5933     5855      -78     
- Misses        413      415       +2     
Files Coverage Δ
...ucting_plate_models/temperature/mass_conserving.cc 98.05% <100.00%> (+0.57%) ⬆️

... and 10 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

@lhy11009 lhy11009 force-pushed the mass_conserving_reorganize branch from 057a94c to 964bdb0 Compare February 14, 2024 22:34
Copy link

github-actions bot commented Feb 14, 2024

Benchmark Main Feature Difference (99.9% CI)
Slab interpolation simple none 0.967 ± 0.003 (s=443) 0.969 ± 0.008 (s=490) +0.1% .. +0.3%
Slab interpolation curved simple none 0.970 ± 0.004 (s=469) 0.971 ± 0.005 (s=461) +0.0% .. +0.2%
Spherical slab interpolation simple none 1.068 ± 0.006 (s=435) 1.068 ± 0.006 (s=410) -0.1% .. +0.1%
Slab interpolation simple curved CMS 1.010 ± 0.004 (s=444) 1.010 ± 0.004 (s=449) -0.0% .. +0.2%
Spherical slab interpolation simple CMS 1.330 ± 0.007 (s=335) 1.330 ± 0.008 (s=344) -0.2% .. +0.1%
Spherical fault interpolation simple none 1.075 ± 0.007 (s=445) 1.075 ± 0.005 (s=395) -0.2% .. +0.1%
Cartesian min max surface 2.169 ± 0.020 (s=197) 2.175 ± 0.026 (s=220) -0.1% .. +0.6%
Spherical min max surface 6.908 ± 0.024 (s=69) 6.924 ± 0.032 (s=64) +0.0% .. +0.5%

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a simple shifting of existing code into a new function. None of the code being moved inside the new functions has changed. The new function name is chosen to highlight that the this function returns the temperature from the two analytic temperature equations.

Copy link
Contributor

@mibillen mibillen left a comment

Choose a reason for hiding this comment

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

This looks good to me @MFraters can you take a look.

@lhy11009 lhy11009 force-pushed the mass_conserving_reorganize branch from 964bdb0 to 556927e Compare February 15, 2024 05:33
Copy link
Member

@MFraters MFraters left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@MFraters MFraters merged commit f6a968d into GeodynamicWorldBuilder:main Feb 16, 2024
32 of 34 checks passed
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.

3 participants