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 variable surface min max area features #396

Conversation

MFraters
Copy link
Member

This pull request main objective is to resolve #366. It is now also added in a backward compatible way. That means that for example "min depth":0 and min depth":[[0]] are both valid and will give the same result.

The pull request currently only adds this functionality for continental plates, but adding it for oceanic plates and mantle layers should be easy.

The work on this pull request raised some issues along the way which had to be, or where a lot more convenient to resolve directly. This means this is a big pull request, which I am doubting about splitting up. For now I am keeping this together and I will reorganize the commits.

Here are some pictures of what is now possible with this input file:

{
"version":"0.5",
"coordinate system":{"model":"cartesian"},
"features":[
  {
    "model":"continental plate", "name":"Var thickness continent", "coordinates":[[0,1000e3],[1000e3,1000e3],[1000e3,0],[0,0]],
    "min depth":[[50e3,[[0,500e3]]],[200e3,[[1000e3,500e3]]]], "max depth":[[300e3],[200e3,[[0,500e3],[1000e3,500e3]]]],
    "temperature models":[{"model":"uniform", "min depth":0, "max depth":500e3, "temperature":150}],
    "composition models":[
      {"model":"uniform", "min depth":[[50e3,[[0,500e3]]],[200e3,[[1000e3,500e3]]]], "max depth":[[200e3],[100e3,[[0,500e3],[1000e3,500e3],[0,0]]]], "compositions":[0]},
      {"model":"uniform", "min depth":[[200e3],[100e3,[[0,500e3],[1000e3,500e3],[0,0]]]], "max depth":[[300e3],[200e3,[[0,500e3],[1000e3,500e3]]]], "compositions":[1]}
    ]
  }
]
}

variiable_thickness_continent_v2_back
variiable_thickness_continent_v2_front

@MFraters MFraters added the add/change user functionality Requests or proposes a new or improved user functionality label Mar 23, 2022
@codecov
Copy link

codecov bot commented Mar 23, 2022

Codecov Report

Merging #396 (b6f88d4) into main (8649fc7) will increase coverage by 0.38%.
The diff coverage is 99.75%.

❗ Current head b6f88d4 differs from pull request most recent head 55b35cb. Consider uploading reports for the commit 55b35cb to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #396      +/-   ##
==========================================
+ Coverage   99.00%   99.38%   +0.38%     
==========================================
  Files          79       82       +3     
  Lines        4711     5041     +330     
==========================================
+ Hits         4664     5010     +346     
+ Misses         47       31      -16     
Impacted Files Coverage Δ
source/types/plugin_system.cc 100.00% <ø> (ø)
...eanic_plate_models/temperature/half_space_model.cc 96.47% <96.61%> (+0.12%) ⬆️
app/main.cc 97.54% <100.00%> (+0.10%) ⬆️
source/features/continental_plate.cc 100.00% <100.00%> (ø)
...es/continental_plate_models/composition/uniform.cc 100.00% <100.00%> (ø)
...plate_models/grains/random_uniform_distribution.cc 100.00% <100.00%> (ø)
...eatures/continental_plate_models/grains/uniform.cc 100.00% <100.00%> (ø)
.../continental_plate_models/temperature/adiabatic.cc 100.00% <100.00%> (+5.71%) ⬆️
...res/continental_plate_models/temperature/linear.cc 100.00% <100.00%> (ø)
...es/continental_plate_models/temperature/uniform.cc 100.00% <100.00%> (ø)
... and 28 more

Continue to review full report at Codecov.

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

@github-actions
Copy link

github-actions bot commented Mar 23, 2022

Benchmark Main Feature Difference (99.9% CI)
Slab interpolation simple none 1.211 ± 0.002 (s=386) 1.216 ± 0.002 (s=358) +0.4% .. +0.4%
Slab interpolation curved simple none 1.316 ± 0.118 (s=339) 1.330 ± 0.115 (s=344) -1.2% .. +3.3%
Spherical slab interpolation simple none 1.575 ± 0.063 (s=267) 1.593 ± 0.065 (s=303) +0.1% .. +2.3%
Slab interpolation simple curved CMS 1.828 ± 0.067 (s=249) 1.838 ± 0.056 (s=245) -0.4% .. +1.6%
Spherical slab interpolation simple CMS 2.895 ± 0.061 (s=153) 2.901 ± 0.059 (s=160) -0.6% .. +1.0%
Spherical fault interpolation simple none 1.811 ± 0.041 (s=235) 1.816 ± 0.040 (s=264) -0.4% .. +0.9%

@MFraters
Copy link
Member Author

Spherical now also seems to work, here is an example figure of what that looks like:

variable_thickness_continent_spherical

(basically the same input file, but with spherical coordinates:

{
"version":"0.5",
"coordinate system":{"model":"spherical", "depth method":"begin at end segment"},
"features":[
  {
    "model":"continental plate", "name":"Var thickness continent", "coordinates":[[0,10],[10,10],[10,0],[0,0]],
    "min depth":[[50e3,[[0,5]]],[200e3,[[10,5]]]], "max depth":[[300e3],[200e3,[[0,5],[10,5]]]],
    "temperature models":[
      {"model":"uniform", "min depth":[[50e3,[[0,5]]],[200e3,[[10,5]]]], "max depth":[[200e3],[100e3,[[0,5],[10,5],[0,0]]]], "temperature":150},
      {"model":"uniform", "min depth":[[200e3],[100e3,[[0,5],[10,5],[0,0]]]], "max depth":[[300e3],[200e3,[[0,5],[10,5]]]], "temperature":200}
    ],
    "composition models":[
      {"model":"uniform", "min depth":[[50e3,[[0,5]]],[200e3,[[10,5]]]], "max depth":[[200e3],[100e3,[[0,5],[10,5],[0,0]]]], "compositions":[0]},
      {"model":"uniform", "min depth":[[200e3],[100e3,[[0,5],[10,5],[0,0]]]], "max depth":[[300e3],[200e3,[[0,5],[10,5]]]], "compositions":[1]}
    ],
  }
]
}

@MFraters
Copy link
Member Author

In terms of functionality and basic testing, this pull request is mostly done. Benchmarks also show that also shows that there is no significant performance loss if this feature is not used, which is great.

I have a few more corner case tests and a benchmark in mind and will need to improve the coverage. Will also need to properly document all the new and changed functions. After that the code and commits will be cleaned and refactored. Documentation into the user manual will be part of #379.

@MFraters MFraters force-pushed the add_variable_surface_min_max_area_features branch 2 times, most recently from 78aabf6 to 7384851 Compare March 24, 2022 20:54
@MFraters MFraters force-pushed the add_variable_surface_min_max_area_features branch from 7384851 to cb0bef0 Compare March 24, 2022 20:57
@MFraters MFraters changed the title [WIP] Add variable surface min max area features Add variable surface min max area features Mar 24, 2022
@MFraters MFraters force-pushed the add_variable_surface_min_max_area_features branch 2 times, most recently from 9758d57 to 2c04dbd Compare March 24, 2022 21:08
@MFraters
Copy link
Member Author

This was a large amount of work, but I am happy with how this pull request turned out. The thing left is to add the same feature to the oceanic plate and mantle layer and add similar tests. I expect this pull request to be merged within the next few days if there are no further issues or comments.

Additional benchmarks can only be added in a follow up pull request because main doesn't have the features yet.

@MFraters MFraters force-pushed the add_variable_surface_min_max_area_features branch from 2c04dbd to acab243 Compare March 25, 2022 22:45
@MFraters MFraters force-pushed the add_variable_surface_min_max_area_features branch from acab243 to 6594160 Compare March 26, 2022 00:30
@MFraters MFraters merged commit 6d4a223 into GeodynamicWorldBuilder:main Mar 26, 2022
MFraters added a commit to MFraters/WorldBuilder-1 that referenced this pull request Mar 26, 2022
 (add_variable_surface_min_max_area_features).
MFraters added a commit that referenced this pull request Mar 26, 2022
…e_surface_min_max_area_features

Add changelog entries for the changes made in #396: add_variable_surface_min_max_area_features
lhy11009 pushed a commit to lhy11009/WorldBuilder that referenced this pull request Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add/change user functionality Requests or proposes a new or improved user functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make min and max depth variable on postion in plate.
1 participant