Add indicator field - #886
Conversation
|
Currently, this is only added to the oceanic plate, so a lot of the tests will fail, because this field is required in the main function of gwb-grid. |
|
I also haven't modified the gwb-dat function yet. @MFraters, please let me know if this is the right way to move forward. I think in order to make this work, we essentially need to add this field and models to every feature. |
cde2f8a to
5db2e31
Compare
|
Following @MFraters's suggestion. I modelled this like the composition field to have a list of entry. In usage, they don't specify which component of velocity or which component of composition I am going to prescribe, but only indicate I am going to prescribe these fields in general. I would incorporate this additional information as inputs to ASPECT instead. I also decided to move the number of the entry later (i.e. 7 to 8), after Derek's PR with another new field is merged. This way, it would be easier to test the feature for now. |
alarshi
left a comment
There was a problem hiding this comment.
@lhy11009 : Thank you for the contribution! I just looked at your changes in the features folder and added my comments. I will take another look after I understand your goal more clearly. I have two comments that might help me in this process:
-
Have you tested your path with multiple indicator models? For example, if you include another indicator model in "second oceanic plate" that only defines indicator for velocity and have some overlap in the geometries of the two, are the indicators for temperature and velocity as what you would expect? I don't fully understand how the
operationworks in your case. -
Since your goal is to identify regions within your wb feature geometries that can then use some prescribed values from ASPECT, would it be possible to achieve this by assigning some nonphysical values at those locations (say, nan) and then checking for them in ASPECT ? I guess nan is not an option because that might trigger several assertions, but you get the idea. My comment is arising from not being able to fully understand how to use this property, so feel free to ignore it if it doesn't make sense.
tjhei
left a comment
There was a problem hiding this comment.
I am not sure I understand what this does and how this is different than a composition. Can you explain what you are trying to achieve?
| { | ||
| class ObjectFactory; | ||
|
|
||
| class Interface |
There was a problem hiding this comment.
Documents are before the "namespace" in this part. I think this seems to be the convention of WB file as in other places.
There was a problem hiding this comment.
Added comments before "Interaface"
This is to have a separate indicator field that can indicate, say, a region in ASPECT that I could prescribe the solution of temperature, velocity, and composition from the WorldBuilder. |
Here I made this new test with two plate overlapping. The first plate spans 0 - 500 km in x, while the second plate spans 300 - 1000 km in x. So the second plate should replace the first plate in the range of 300 - 500 km. And for the second plate I assigned indicator 2. And the results are listed:
|
5db2e31 to
97a0aba
Compare
|
@MFraters, can you take a look at this piece and some of the unresolved conversations before I duplicate it to other features? |
97a0aba to
a012b8c
Compare
|
As @MFraters recommended, I added "indicator properties" to the parameters and used names of "temperature", "velocity", and "composition" to represent entries in the wb file. @alarshi Feel free to take a second look. I really appreciate the time you guys spent. |
Coverage Report for CI Build 33357243627Coverage decreased (-0.07%) to 98.235%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
|
| template<> | ||
| std::vector<unsigned int> | ||
| Parameters::get_vector(const std::string &name, | ||
| const std::map<unsigned int, Parameters::indicator_property> &indicator_properties) |
There was a problem hiding this comment.
Related to the last question, this get_vector function is a little bit complex. I tried to model from the unmerged PR and get it to work. But I am not sure whether my implementation is good enough.
There was a problem hiding this comment.
I think we can come back to this after #926 is merged.
There was a problem hiding this comment.
Okay, regarding the progress of this PR, my plan is to leave this as it is now to merge this one, then get back to the new function after 934 is merged.
There was a problem hiding this comment.
I think @alarshi make a good point here:
Since your goal is to identify regions within your wb feature geometries that can then use some prescribed values from ASPECT, would it be possible to achieve this by assigning some nonphysical values at those locations (say, nan) and then checking for them in ASPECT ? I guess nan is not an option because that might trigger several assertions, but you get the idea. My comment is arising from not being able to fully understand how to use this property, so feel free to ignore it if it doesn't make sense.
You could also prescribe NaN in the world builder file (I think the json reader can convert that properly). Then ASPECT (or any other program would just need to check whether is is not a NaN. Would this also work for you, or would there be specific things you would not be able to do with that approach?
Other then that I have left a few comments on discussions in the pull request.
| template<> | ||
| std::vector<unsigned int> | ||
| Parameters::get_vector(const std::string &name, | ||
| const std::map<unsigned int, Parameters::indicator_property> &indicator_properties) |
|
@MFraters Related to your comments, I am not sure that setting values to If we are looking for an intermediate solution, I keep coming back to a slightly different question: could we assign a region to both composition If that is possible, we could use one compositional field to represent the region's actual composition and another as an indicator field. This would avoid having to encode the distinction through Do you think this would be possible within the current setup? |
2101698 to
1336391
Compare
998fd26 to
6dd0bfa
Compare
6dd0bfa to
2fe31d2
Compare









In the PR, I introduce a new field "indicator". In the example, an indicator field is derived from the depth of points in a feature of an oceanic plate.
@mibillen Here is how I am going to connect the prescribed solution to GWB.