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

Create a function in Utilities.cc that calculates distance from Ridge + Spreading velocity #591

Conversation

danieldouglas92
Copy link
Contributor

Remove duplicate code in multiple places by creating a function in Utilities.cc that calculates the distance from a ridge and the spreading velocity. This is used by several different temperature plugins of various features. Currently, the spreading velocity is just a single, constant value, but this will be changed in a followup PR.

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. Could you just add some documentation to the function?

Copy link

codecov bot commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6f0e0a4) 93.40% compared to head (26092d1) 93.37%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #591      +/-   ##
==========================================
- Coverage   93.40%   93.37%   -0.03%     
==========================================
  Files          92       92              
  Lines        6349     6266      -83     
==========================================
- Hits         5930     5851      -79     
+ Misses        419      415       -4     
Files Coverage Δ
...eanic_plate_models/temperature/half_space_model.cc 98.18% <100.00%> (+0.01%) ⬆️
...es/oceanic_plate_models/temperature/plate_model.cc 98.38% <100.00%> (+0.11%) ⬆️
...ucting_plate_models/temperature/mass_conserving.cc 98.01% <100.00%> (+0.54%) ⬆️
source/world_builder/utilities.cc 97.19% <100.00%> (+0.39%) ⬆️

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 6f0e0a4...26092d1. Read the comment docs.

@danieldouglas92 danieldouglas92 force-pushed the create_function_for_ridge_distance branch from 87fcb12 to 6c49c53 Compare February 14, 2024 23:20
@danieldouglas92 danieldouglas92 force-pushed the create_function_for_ridge_distance branch from 550886a to 5feee18 Compare February 15, 2024 02:01
@MFraters MFraters added the ready to merge Pull request is ready to merge. May be waiting for tests to complete or other reviews. label Feb 15, 2024
@MFraters MFraters merged commit e376f22 into GeodynamicWorldBuilder:main Feb 15, 2024
33 of 34 checks passed
Copy link

Benchmark Main Feature Difference (99.9% CI)
Slab interpolation simple none 0.969 ± 0.004 (s=477) 0.968 ± 0.004 (s=455) -0.2% .. -0.0%
Slab interpolation curved simple none 0.976 ± 0.004 (s=471) 0.975 ± 0.004 (s=454) -0.2% .. -0.0%
Spherical slab interpolation simple none 1.071 ± 0.006 (s=398) 1.069 ± 0.006 (s=446) -0.3% .. -0.1%
Slab interpolation simple curved CMS 1.012 ± 0.004 (s=431) 1.011 ± 0.004 (s=461) -0.2% .. -0.1%
Spherical slab interpolation simple CMS 1.332 ± 0.007 (s=366) 1.331 ± 0.008 (s=312) -0.2% .. +0.0%
Spherical fault interpolation simple none 1.075 ± 0.006 (s=424) 1.072 ± 0.005 (s=417) -0.3% .. -0.1%
Cartesian min max surface 2.164 ± 0.026 (s=214) 2.168 ± 0.022 (s=204) -0.2% .. +0.6%
Spherical min max surface 6.922 ± 0.034 (s=70) 6.920 ± 0.037 (s=63) -0.3% .. +0.3%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull request is ready to merge. May be waiting for tests to complete or other reviews.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants