-
Notifications
You must be signed in to change notification settings - Fork 33
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 max_model_depth variable to cartesian and spherical geometries #367
Add max_model_depth variable to cartesian and spherical geometries #367
Conversation
Codecov Report
@@ Coverage Diff @@
## main #367 +/- ##
=======================================
Coverage 98.88% 98.88%
=======================================
Files 77 77
Lines 4560 4578 +18
=======================================
+ Hits 4509 4527 +18
Misses 51 51
Continue to review full report at Codecov.
|
|
8e3a09d
to
418bc88
Compare
…th a get function and a radius input parameter for the spherical geometry model to define the max_model_depth.
4d91dd5
to
eec0273
Compare
size_t size = Pointer((base_path + "/oneOf").c_str()).Get(declarations)->Size(); | ||
#ifdef debug | ||
bool found = false; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has nothing to do with the patch itself, but just as a comment: I assume that you are putting the #ifdef
around this statement because you would otherwise get a warning about the found
variable only ever being written to, but never read, in release mode? If so, you can avoid the warning if you put
(void)found;
in front of the WBAssert
. This is interpreted as a "read" of the variable, but you are just discarding the value so read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, I will try that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on my laptop those if statement do not seem to matter, but probably for one of the tester configurations it does. I will look into it in a different pull request.
@@ -3823,9 +3823,12 @@ TEST_CASE("WorldBuilder Parameters") | |||
{ | |||
// First test a world builder file with a cross section defined | |||
std::string file = WorldBuilder::Data::WORLD_BUILDER_SOURCE_DIR + "/tests/data/type_data.json"; | |||
std::string file_name = WorldBuilder::Data::WORLD_BUILDER_SOURCE_DIR + "/tests/data/subducting_plate_different_angles_spherical.wb"; | |||
std::string file_name = WorldBuilder::Data::WORLD_BUILDER_SOURCE_DIR + "/tests/data/subducting_plate_different_angles_cartesian.wb"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't you abandoning the old test here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed the only thing happening with file_name
here is WorldBuilder::World world(file_name);
and then Parameters prm(world);
. Then the prm is actually initialized with a different file. These first two steps on this exact file are already being tested in line 7099-7100, so there is no reason to repeat that here. And there was no place in the unit tester which did this for the Cartesian case, so I think it is a nice expansion of the testing without losing anything.
I could have made a new test as well, but I guess I was a bit lazy ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review!
size_t size = Pointer((base_path + "/oneOf").c_str()).Get(declarations)->Size(); | ||
#ifdef debug | ||
bool found = false; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, I will try that!
@@ -3823,9 +3823,12 @@ TEST_CASE("WorldBuilder Parameters") | |||
{ | |||
// First test a world builder file with a cross section defined | |||
std::string file = WorldBuilder::Data::WORLD_BUILDER_SOURCE_DIR + "/tests/data/type_data.json"; | |||
std::string file_name = WorldBuilder::Data::WORLD_BUILDER_SOURCE_DIR + "/tests/data/subducting_plate_different_angles_spherical.wb"; | |||
std::string file_name = WorldBuilder::Data::WORLD_BUILDER_SOURCE_DIR + "/tests/data/subducting_plate_different_angles_cartesian.wb"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed the only thing happening with file_name
here is WorldBuilder::World world(file_name);
and then Parameters prm(world);
. Then the prm is actually initialized with a different file. These first two steps on this exact file are already being tested in line 7099-7100, so there is no reason to repeat that here. And there was no place in the unit tester which did this for the Cartesian case, so I think it is a nice expansion of the testing without losing anything.
I could have made a new test as well, but I guess I was a bit lazy ;)
@bangerth I think that all your comments have been addressed. I will wait with merging this for few hours in case you have more comments. |
I won't get to it before tomorrow afternoon, but feel free to go ahead. |
I am happy to wait if you want to have another look at it :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no further comments about the patch, so go ahead with merging! I guess the next step will be to propagate this information to the feature plugins?
Great, thanks! With this pull request the information should now be available anywhere in the world builder, so it will be both using it and making the changes to the interface which now have become possible. |
Sounds good. Feel free to tag me in any follow-up patches for which you are looking for input! |
This is a first step based on the discussion in both #331 and #345. This only add max_model_depth variable to cartesian and spherical geometries with a get function and a radius input parameter for the spherical geometry model to define the
max_model_depth
.Merging this will allow to start writing code which uses this internally and within ASPECT.