From 1cc36bc11cee73e2da6e723ad021a635e4bf92de Mon Sep 17 00:00:00 2001 From: Arushi Saxena Date: Fri, 16 Feb 2024 11:36:34 -0500 Subject: [PATCH 1/2] Modify assert when using gwb-dat. --- source/world_builder/world.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/world_builder/world.cc b/source/world_builder/world.cc index f6a4d703e..232427a6b 100644 --- a/source/world_builder/world.cc +++ b/source/world_builder/world.cc @@ -309,7 +309,8 @@ namespace WorldBuilder WBAssert(this->limit_debug_consistency_checks || this->parameters.coordinate_system->natural_coordinate_system() == cartesian || approx(depth, this->parameters.coordinate_system->max_model_depth()-sqrt(point_[0]*point_[0]+point_[1]*point_[1]+point_[2]*point_[2])), "Inconsistent input. Please check whether the radius in the sperhical coordinates is consistent with the radius of the planet as defined " - << "in the program that uses the Geodynamic World Builder. " + << "in the program that uses the Geodynamic World Builder. This is a debug check in GWB and can be disabled by setting " + << "limit_debug_consistency_checks to false. " << "Depth = " << depth << ", radius = " << this->parameters.coordinate_system->max_model_depth() << ", point = " << point_[0] << " " << point_[1] << " " << point_[2] << ", radius-point.norm() = " << this->parameters.coordinate_system->max_model_depth()-sqrt(point_[0]*point_[0]+point_[1]*point_[1]+point_[2]*point_[2])); @@ -458,7 +459,8 @@ namespace WorldBuilder WBAssert(!this->limit_debug_consistency_checks || this->parameters.coordinate_system->natural_coordinate_system() == cartesian || approx(depth, this->parameters.coordinate_system->max_model_depth()-sqrt(point_[0]*point_[0]+point_[1]*point_[1]+point_[2]*point_[2])), "Inconsistent input. Please check whether the radius in the sperhical coordinates is consistent with the radius of the planet as defined " - << "in the program that uses the Geodynamic World Builder. " + << "in the program that uses the Geodynamic World Builder. This is a debug check in GWB and can be disabled by setting " + << "limit_debug_consistency_checks to false. " << "Depth = " << depth << ", radius = " << this->parameters.coordinate_system->max_model_depth() << ", point = " << point_[0] << " " << point_[1] << " " << point_[2] << ", radius-point.norm() = " << this->parameters.coordinate_system->max_model_depth()-sqrt(point_[0]*point_[0]+point_[1]*point_[1]+point_[2]*point_[2])); From 251fd44ed0d6a9c1255ab9405467afc84637426e Mon Sep 17 00:00:00 2001 From: Arushi Saxena Date: Fri, 16 Feb 2024 11:55:35 -0500 Subject: [PATCH 2/2] Fix bugs. --- source/world_builder/world.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/world_builder/world.cc b/source/world_builder/world.cc index 232427a6b..8bd70f4c2 100644 --- a/source/world_builder/world.cc +++ b/source/world_builder/world.cc @@ -310,7 +310,7 @@ namespace WorldBuilder || approx(depth, this->parameters.coordinate_system->max_model_depth()-sqrt(point_[0]*point_[0]+point_[1]*point_[1]+point_[2]*point_[2])), "Inconsistent input. Please check whether the radius in the sperhical coordinates is consistent with the radius of the planet as defined " << "in the program that uses the Geodynamic World Builder. This is a debug check in GWB and can be disabled by setting " - << "limit_debug_consistency_checks to false. " + << "limit_debug_consistency_checks to true. " << "Depth = " << depth << ", radius = " << this->parameters.coordinate_system->max_model_depth() << ", point = " << point_[0] << " " << point_[1] << " " << point_[2] << ", radius-point.norm() = " << this->parameters.coordinate_system->max_model_depth()-sqrt(point_[0]*point_[0]+point_[1]*point_[1]+point_[2]*point_[2])); @@ -456,11 +456,11 @@ namespace WorldBuilder // We receive the cartesian points from the user. const Point<3> point(point_,cartesian); - WBAssert(!this->limit_debug_consistency_checks || this->parameters.coordinate_system->natural_coordinate_system() == cartesian + WBAssert(this->limit_debug_consistency_checks || this->parameters.coordinate_system->natural_coordinate_system() == cartesian || approx(depth, this->parameters.coordinate_system->max_model_depth()-sqrt(point_[0]*point_[0]+point_[1]*point_[1]+point_[2]*point_[2])), "Inconsistent input. Please check whether the radius in the sperhical coordinates is consistent with the radius of the planet as defined " << "in the program that uses the Geodynamic World Builder. This is a debug check in GWB and can be disabled by setting " - << "limit_debug_consistency_checks to false. " + << "limit_debug_consistency_checks to true. " << "Depth = " << depth << ", radius = " << this->parameters.coordinate_system->max_model_depth() << ", point = " << point_[0] << " " << point_[1] << " " << point_[2] << ", radius-point.norm() = " << this->parameters.coordinate_system->max_model_depth()-sqrt(point_[0]*point_[0]+point_[1]*point_[1]+point_[2]*point_[2]));