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

Add tests and fix for spherical spreading centers #520

Conversation

danieldouglas92
Copy link
Contributor

@danieldouglas92 danieldouglas92 commented Nov 21, 2023

Addresses Issue #518

Copy link

github-actions bot commented Nov 21, 2023

Benchmark Main Feature Difference (99.9% CI)
Slab interpolation simple none 1.024 ± 0.004 (s=424) 1.022 ± 0.004 (s=458) -0.4% .. -0.2%
Slab interpolation curved simple none 1.029 ± 0.006 (s=430) 1.027 ± 0.006 (s=448) -0.4% .. -0.1%
Spherical slab interpolation simple none 1.265 ± 0.008 (s=346) 1.262 ± 0.005 (s=369) -0.4% .. -0.1%
Slab interpolation simple curved CMS 1.099 ± 0.008 (s=399) 1.097 ± 0.005 (s=423) -0.3% .. -0.1%
Spherical slab interpolation simple CMS 1.863 ± 0.006 (s=232) 1.859 ± 0.007 (s=254) -0.3% .. -0.1%
Spherical fault interpolation simple none 1.273 ± 0.006 (s=347) 1.270 ± 0.005 (s=363) -0.4% .. -0.1%
Cartesian min max surface 2.375 ± 0.016 (s=188) 2.377 ± 0.019 (s=193) -0.2% .. +0.3%
Spherical min max surface 7.372 ± 0.026 (s=62) 7.350 ± 0.014 (s=63) -0.5% .. -0.1%

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.

This looks good to me. Can you also add the fix for the mass conserving temperature model we discussed and update the test results?

const Point<3> point_1_cart = Utilities::spherical_to_cartesian_coordinates(point_1.get_array());
const Point<3> point_2_cart = Utilities::spherical_to_cartesian_coordinates(point_2.get_array());

return radius * std::acos(std::min(1.,std::max(0.,point_1_cart*point_2_cart/(radius*radius))));
Copy link
Member

Choose a reason for hiding this comment

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

This looks nice! It would also open up the possibility in the future to allow Cartesian points to be passed to the function directly. One of the unit tests fail with this change, but I checked it and it actually gave an incorrect solution before (distance (-90,0)->(90,180) = pi, not zero). So you can update this test result.

Copy link

codecov bot commented Jan 10, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (41ddcc5) 93.45% compared to head (774c845) 93.46%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #520   +/-   ##
=======================================
  Coverage   93.45%   93.46%           
=======================================
  Files          92       92           
  Lines        6279     6301   +22     
=======================================
+ Hits         5868     5889   +21     
- Misses        411      412    +1     
Files Coverage Δ
...urce/world_builder/coordinate_systems/spherical.cc 100.00% <100.00%> (ø)
...eanic_plate_models/temperature/half_space_model.cc 98.16% <96.87%> (+0.31%) ⬆️
...es/oceanic_plate_models/temperature/plate_model.cc 98.27% <97.05%> (-0.71%) ⬇️

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 41ddcc5...774c845. Read the comment docs.

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.

almost there, I think you forgot to add the .wb and .dat files for the test you made

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.

Great, thanks for your contribution!

@MFraters MFraters merged commit 84511b5 into GeodynamicWorldBuilder:main Jan 22, 2024
33 of 34 checks passed
danieldouglas92 added a commit to danieldouglas92/WorldBuilder that referenced this pull request Jan 22, 2024
danieldouglas92 added a commit to danieldouglas92/WorldBuilder that referenced this pull request Jan 22, 2024
danieldouglas92 added a commit to danieldouglas92/WorldBuilder that referenced this pull request Jan 23, 2024
MFraters added a commit that referenced this pull request Jan 23, 2024
danieldouglas92 added a commit to danieldouglas92/WorldBuilder that referenced this pull request Feb 15, 2024
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