diff --git a/AUTHORS b/AUTHORS index b04a72331..3b289c057 100644 --- a/AUTHORS +++ b/AUTHORS @@ -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 diff --git a/source/world_builder/features/continental_plate.cc b/source/world_builder/features/continental_plate.cc index 38d2e2b51..84a3d86a9 100644 --- a/source/world_builder/features/continental_plate.cc +++ b/source/world_builder/features/continental_plate.cc @@ -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(tag_index); break; @@ -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 + { + if(std::isnan(output[entry_in_output[i_property]])){ + // 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, diff --git a/source/world_builder/world.cc b/source/world_builder/world.cc index 5bfd422f4..a2c6e639d 100644 --- a/source/world_builder/world.cc +++ b/source/world_builder/world.cc @@ -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. " << @@ -385,6 +390,11 @@ namespace WorldBuilder counter += 3; break; } + case 7: // elevation + { + counter += 1; + break; + } default: { WBAssert(false, @@ -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. " <<