From 6bd7deaed110f3d3649b911bf2cff04dcedbd2a9 Mon Sep 17 00:00:00 2001 From: MFraters Date: Fri, 26 Apr 2024 22:59:36 -0400 Subject: [PATCH 1/6] Fix crash if the minimum and maximum depth are the same. --- .../features/continental_plate_models/temperature/linear.cc | 6 +++--- .../features/mantle_layer_models/temperature/linear.cc | 6 +++--- .../features/oceanic_plate_models/temperature/linear.cc | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/world_builder/features/continental_plate_models/temperature/linear.cc b/source/world_builder/features/continental_plate_models/temperature/linear.cc index 8fead61f0..03d173390 100644 --- a/source/world_builder/features/continental_plate_models/temperature/linear.cc +++ b/source/world_builder/features/continental_plate_models/temperature/linear.cc @@ -128,9 +128,9 @@ namespace WorldBuilder this->world->specific_heat) * max_depth_local_local); } - const double new_temperature = top_temperature_local + - (depth - min_depth_local) * - ((bottom_temperature_local - top_temperature_local) / (max_depth_local_local - min_depth_local_local)); + const double new_temperature = top_temperature_local + (max_depth_local_local - min_depth_local_local < 10.0*std::numeric_limits::epsilon() ? 0.0 : + (depth - min_depth_local) * + ((bottom_temperature_local - top_temperature_local) / (max_depth_local_local - min_depth_local_local))); WBAssert(!std::isnan(new_temperature), "Temperature is not a number: " << new_temperature << ", based on a temperature model with the name " << this->name); diff --git a/source/world_builder/features/mantle_layer_models/temperature/linear.cc b/source/world_builder/features/mantle_layer_models/temperature/linear.cc index c7307d528..b8e64d70e 100644 --- a/source/world_builder/features/mantle_layer_models/temperature/linear.cc +++ b/source/world_builder/features/mantle_layer_models/temperature/linear.cc @@ -127,9 +127,9 @@ namespace WorldBuilder } - const double new_temperature = top_temperature_local + - (depth - min_depth_local_local) * - ((bottom_temperature_local - top_temperature_local) / (max_depth_local_local - min_depth_local_local)); + const double new_temperature = top_temperature_local + (max_depth_local_local - min_depth_local_local < 10.0*std::numeric_limits::epsilon() ? 0.0 : + (depth - min_depth_local_local) * + ((bottom_temperature_local - top_temperature_local) / (max_depth_local_local - min_depth_local_local))); return apply_operation(operation,temperature_,new_temperature); } diff --git a/source/world_builder/features/oceanic_plate_models/temperature/linear.cc b/source/world_builder/features/oceanic_plate_models/temperature/linear.cc index c5a0e6602..c76478656 100644 --- a/source/world_builder/features/oceanic_plate_models/temperature/linear.cc +++ b/source/world_builder/features/oceanic_plate_models/temperature/linear.cc @@ -125,9 +125,9 @@ namespace WorldBuilder this->world->specific_heat) * max_depth_local_local); } - const double new_temperature = top_temperature_local + - (depth - min_depth_local_local) * - ((bottom_temperature_local - top_temperature_local) / (max_depth_local_local - min_depth_local_local)); + const double new_temperature = top_temperature_local + (max_depth_local_local - min_depth_local_local < 10.0*std::numeric_limits::epsilon() ? 0.0 : + (depth - min_depth_local_local) * + ((bottom_temperature_local - top_temperature_local) / (max_depth_local_local - min_depth_local_local))); return apply_operation(operation,temperature_,new_temperature); } From e0b6e7d8e81a110ba897d46fb715843f2fd63403 Mon Sep 17 00:00:00 2001 From: MFraters Date: Fri, 26 Apr 2024 23:22:46 -0400 Subject: [PATCH 2/6] update xcode app to 15.0.1 --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a1cbf17b8..91d76f484 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -92,7 +92,7 @@ jobs: echo "3" ls /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/libexec echo "4" - sudo xcode-select --switch /Applications/Xcode_13.2.1.app + sudo xcode-select --switch /Applications/Xcode_15.0.1.app fi shell: bash @@ -230,7 +230,7 @@ jobs: elif [ "$RUNNER_OS" == "macOS" ]; then sudo brew install open-mpi || true echo "4" - sudo xcode-select --switch /Applications/Xcode_13.2.1.app + sudo xcode-select --switch /Applications/Xcode_15.0.1.app else echo "$RUNNER_OS not supported" exit 1 From e6ad8317e6a64d15cd576e65cbac6eae81adcd59 Mon Sep 17 00:00:00 2001 From: MFraters Date: Fri, 26 Apr 2024 23:24:35 -0400 Subject: [PATCH 3/6] fix typos --- doc/sphinx/user_manual/basic_starter_tutorial/17_plume.md | 2 +- source/world_builder/features/subducting_plate.cc | 2 +- .../features/subducting_plate_models/temperature/plate_model.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/sphinx/user_manual/basic_starter_tutorial/17_plume.md b/doc/sphinx/user_manual/basic_starter_tutorial/17_plume.md index fd2220eab..bb27725cf 100644 --- a/doc/sphinx/user_manual/basic_starter_tutorial/17_plume.md +++ b/doc/sphinx/user_manual/basic_starter_tutorial/17_plume.md @@ -2,7 +2,7 @@ Adding a mantle plume =============================== -The last feature we will be adding in this tutorial is the `plume`. The plume is defined by a set of coordinates which represent where the plume is at different depths. The depth are set through the `cross section depths` parameter, hich requires as many depths as there are coordinates. Each cross-section is an ellipse, for which the parameters can be set individually. Please see [the plume feature description](part:user_manual:chap:parameter_documentation:sec:features:subsec:plume) for more information on what each of the parameters do. In this case we will increase the eccentricity of the plume at the top. +The last feature we will be adding in this tutorial is the `plume`. The plume is defined by a set of coordinates which represent where the plume is at different depths. The depth are set through the `cross section depths` parameter, which requires as many depths as there are coordinates. Each cross-section is an ellipse, for which the parameters can be set individually. Please see [the plume feature description](part:user_manual:chap:parameter_documentation:sec:features:subsec:plume) for more information on what each of the parameters do. In this case we will increase the eccentricity of the plume at the top. With the definition of the area the feature plume contains completed, we can now add a temperature and compositional structure. A gaussian is a good first order approximation of the temperature, so we will add that as the temperature model. This temperature model allows you to set change the gaussian distribution parameters for each depth segment. Note that in this case we are not replacing the temperature, but adding to the temperature which was already there. diff --git a/source/world_builder/features/subducting_plate.cc b/source/world_builder/features/subducting_plate.cc index 025e7ac48..679f912cc 100644 --- a/source/world_builder/features/subducting_plate.cc +++ b/source/world_builder/features/subducting_plate.cc @@ -685,7 +685,7 @@ namespace WorldBuilder grains.sizes[i] = grains_current_section.sizes[i] + section_fraction * (grains_next_section.sizes[i] - grains_current_section.sizes[i]); } - // average two rotations matrices throu quaternions. + // average two rotations matrices through quaternions. for (size_t i = 0; i < grains_current_section.rotation_matrices.size(); i++) { const glm::quaternion::quat quat_current = glm::quaternion::quat_cast(grains_current_section.rotation_matrices[i]); diff --git a/source/world_builder/features/subducting_plate_models/temperature/plate_model.cc b/source/world_builder/features/subducting_plate_models/temperature/plate_model.cc index 368adcdc0..2b3a942cf 100644 --- a/source/world_builder/features/subducting_plate_models/temperature/plate_model.cc +++ b/source/world_builder/features/subducting_plate_models/temperature/plate_model.cc @@ -170,7 +170,7 @@ namespace WorldBuilder distance_along_plane/thickness_local); // the paper uses `(x_scaled * sin(average_angle) - z_scaled * cos(average_angle))` to compute the - // depth (execpt that you do not use average angles since they only have on angle). On recomputing + // depth (except that you do not use average angles since they only have on angle). On recomputing // their result it seems to me (Menno) that it should have been `(1-z_scaled)` instead of `z_scaled`. // To avoid this whole problem we just use the depth directly since we have that. // todo: get the local thickniss out of H, that prevents an other division. From 0fe8731446359d09bdea492257ebc40ecb755993 Mon Sep 17 00:00:00 2001 From: MFraters Date: Fri, 26 Apr 2024 23:41:30 -0400 Subject: [PATCH 4/6] update sprintf to snprintf --- include/doctest/doctest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/doctest/doctest.h b/include/doctest/doctest.h index f9185343f..db9417efa 100644 --- a/include/doctest/doctest.h +++ b/include/doctest/doctest.h @@ -4151,7 +4151,7 @@ namespace doctest #define DOCTEST_TO_STRING_OVERLOAD(type, fmt) \ String toString(type in) { \ char buf[64]; \ - std::sprintf(buf, fmt, in); \ + std::snprintf(buf, sizeof( buf ), fmt, in); \ return buf; \ } From b31b4f99d08be976dd96680b75d57f8f41fac959 Mon Sep 17 00:00:00 2001 From: MFraters Date: Fri, 26 Apr 2024 23:53:21 -0400 Subject: [PATCH 5/6] set macos to 12 instead of latest. --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 91d76f484..9636ec6c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -65,7 +65,7 @@ jobs: strategy: fail-fast: false matrix: - os: ['ubuntu-latest','macos-latest','macos-11'] + os: ['ubuntu-latest','macos-12','macos-11'] build_type: ['Release', 'Debug'] runs-on: ${{ matrix.os }} @@ -92,7 +92,7 @@ jobs: echo "3" ls /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/libexec echo "4" - sudo xcode-select --switch /Applications/Xcode_15.0.1.app + sudo xcode-select --switch /Applications/Xcode_13.2.1.app fi shell: bash @@ -214,7 +214,7 @@ jobs: strategy: fail-fast: false matrix: - os: ['ubuntu-latest','macos-latest'] + os: ['ubuntu-latest','macos-12'] build_type: ['Release'] runs-on: ${{ matrix.os }} @@ -230,7 +230,7 @@ jobs: elif [ "$RUNNER_OS" == "macOS" ]; then sudo brew install open-mpi || true echo "4" - sudo xcode-select --switch /Applications/Xcode_15.0.1.app + sudo xcode-select --switch /Applications/Xcode_13.2.1.app else echo "$RUNNER_OS not supported" exit 1 From 4d30f92e2fbff7ebc76467162dd2e31d97043da3 Mon Sep 17 00:00:00 2001 From: MFraters Date: Wed, 1 May 2024 18:46:25 -0800 Subject: [PATCH 6/6] fix manual toctree entry. --- cookbooks/index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/cookbooks/index.md b/cookbooks/index.md index 598348bb3..18514230c 100644 --- a/cookbooks/index.md +++ b/cookbooks/index.md @@ -12,5 +12,4 @@ This section contains self-contained cookbooks on how to design different geodyn 3d_cartesian_transform_fault/doc/README simple_subduction_2d_cartesian/doc/README simple_subduction_2d_chunk/doc/README - ```