Skip to content
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

Modify assert when using gwb-dat. #625

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Changes from all 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
8 changes: 5 additions & 3 deletions source/world_builder/world.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 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]));
Expand Down Expand Up @@ -455,10 +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. "
<< "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 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]));
Expand Down
Loading