Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ There have been contributions on the development from:
Chris Mills,
Arushi Saxena,
Wim Spakman,
Cedric Thieulot
Cedric Thieulot,
Yijun Wang,
and
Yijun Wang
Alan Yu
Comment on lines -16 to +19
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you created your branch from your other branch (the one used for #783) that is why this change shows up in this PR. Find me to talk about how to fix this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have closed that pull request (used for a tutorial).

16 changes: 15 additions & 1 deletion source/world_builder/features/continental_plate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ namespace WorldBuilder
grains.unroll_into(output,entry_in_output[i_property]);
break;
}
case 4:
case 4: // tag
{
output[entry_in_output[i_property]] = static_cast<double>(tag_index);
break;
Expand Down Expand Up @@ -295,6 +295,20 @@ namespace WorldBuilder
//std::cout << "vel=" << output[entry_in_output[i_property]] << ":" << output[entry_in_output[i_property]+1] << ":" << output[entry_in_output[i_property]+2] << std::endl;
break;
}
case 7: // elevation
Copy link
Contributor

Choose a reason for hiding this comment

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

this may be unrelated to your pull request, but why is elevation 7 and not 6? Why is 6 missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Case 6 is handled by @Djneu and is related to the density of the compositional field.

{
if(!std::isnan(output[entry_in_output[i_property]])){
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure this should not be:

Suggested change
if(!std::isnan(output[entry_in_output[i_property]])){
if(std::isnan(output[entry_in_output[i_property]])){

Do you want to check here if the output is not a number in order to then set it to some number?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was a mistake. This is addressed in Commit 0599baa. Thank you!

// for the first time, set the output to local min depth
output[entry_in_output[i_property]] = min_depth_local
} else {
// compare subsequent local min depths and set the output to the minimum
if (min_depth_local < output[entry_in_output[i_property]]) {
output[entry_in_output[i_property]] = min_depth_local
}
}
break;
}
break;
default:
{
WBAssertThrow(false,
Expand Down
17 changes: 17 additions & 0 deletions source/world_builder/world.cc
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ namespace WorldBuilder
n_output_entries += 3;
break;
}
case 7: // elevation
{
n_output_entries += 1;
break;
}
default:
WBAssertThrow(false,
"Internal error: Unimplemented property provided. " <<
Expand Down Expand Up @@ -385,6 +390,11 @@ namespace WorldBuilder
counter += 3;
break;
}
case 7: // elevation
{
counter += 1;
break;
}
default:
{
WBAssert(false,
Expand Down Expand Up @@ -471,6 +481,13 @@ namespace WorldBuilder
properties_local.emplace_back(properties[i_property]);
break;
}
case 7: // elevation
{
entry_in_output.emplace_back(output.size());
output.emplace_back(0);
properties_local.emplace_back(properties[i_property]);
break;
}
default:
WBAssertThrow(false,
"Internal error: Unimplemented property provided. " <<
Expand Down
Loading