Skip to content

Commit

Permalink
Change the meaning of bool limit-debug-consistency-checks to be more …
Browse files Browse the repository at this point in the history
…intuative.
  • Loading branch information
MFraters committed Feb 14, 2024
1 parent 9e3c789 commit 5bd5ebb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/world_builder/world.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace WorldBuilder
* documented algorithm), we can test the results and they should be the same even for different
* compilers and machines.
*/
World(std::string filename, bool has_output_dir = false, const std::string &output_dir = "", unsigned long random_number_seed = 1, const bool limit_debug_consistency_checks = false);
World(std::string filename, bool has_output_dir = false, const std::string &output_dir = "", unsigned long random_number_seed = 1, const bool limit_debug_consistency_checks = true);

/**
* Destructor
Expand Down
6 changes: 3 additions & 3 deletions source/gwb-dat/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int main(int argc, char **argv)
unsigned int grain_compositions = 0;
size_t n_grains = 0;
bool convert_spherical = false;
bool limit_debug_consistency_checks = true;
bool limit_debug_consistency_checks = false;
bool output_json_files = false;

if (find_command_line_option(argv, argv+argc, "-h") || find_command_line_option(argv, argv+argc, "--help"))
Expand All @@ -86,7 +86,7 @@ int main(int argc, char **argv)
}

if (find_command_line_option(argv, argv+argc, "-ldcc") || find_command_line_option(argv, argv+argc, "--limit-debug-consistency-checks"))
limit_debug_consistency_checks = false;
limit_debug_consistency_checks = true;

if (find_command_line_option(argv, argv+argc, "--output-json-files"))
output_json_files = true;
Expand All @@ -106,7 +106,7 @@ int main(int argc, char **argv)
return 0;
}

if ((argc == 3 && (!limit_debug_consistency_checks || output_json_files)) || (argc == 3 && (!limit_debug_consistency_checks && output_json_files)) || argc > 5)
if ((argc == 3 && !(limit_debug_consistency_checks && output_json_files)) || (argc == 4 && !(!limit_debug_consistency_checks != !output_json_files)) || (argc == 5 && (!limit_debug_consistency_checks && !output_json_files)) || argc > 5)
{
std::cout << "Only exactly two command line arguments may be given, which should be the world builder file location and the data file location (in that order) "
<< "or exactly three command line arguments, which should be the world builder file location, the data file location and --limit-debug-consistency-checks or --output-json-files (in that order),"
Expand Down
2 changes: 1 addition & 1 deletion source/world_builder/world.cc
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ namespace WorldBuilder
// We receive the cartesian points from the user.
const Point<3> point(point_,cartesian);
(void) this->limit_debug_consistency_checks;
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. "
Expand Down
2 changes: 1 addition & 1 deletion tests/gwb-dat/testing_too_many_arguments/screen-output.log
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Only exactly two command line arguments may be given, which should be the world builder file location and the data file location (in that order) or exactly three command line arguments, which should be the world builder file location, the data file location and --limit-debug-consistency-checks (in that order). , argc = 5, limit_debug_consistency_checks = true
Only exactly two command line arguments may be given, which should be the world builder file location and the data file location (in that order) or exactly three command line arguments, which should be the world builder file location, the data file location and --limit-debug-consistency-checks or --output-json-files (in that order),or exactly four comman line arguments, which should be the world builder file location, the data file location and --limit-debug-consistency-checks and --output-json-files (in that order),, argc = 5, limit_debug_consistency_checks = false, output_json_files = false

0 comments on commit 5bd5ebb

Please sign in to comment.