From 41d14a2f472d9e7ba1d610e53687d5d7d1e092bd Mon Sep 17 00:00:00 2001 From: MFraters Date: Thu, 16 Feb 2023 23:28:49 -0800 Subject: [PATCH] rename features/utilities to features/featureutilites. --- .../composition/uniform.h | 5 +++-- .../temperature/adiabatic.h | 5 +++-- .../temperature/linear.h | 5 +++-- .../temperature/uniform.h | 5 +++-- .../fault_models/composition/interface.h | 6 +++--- .../features/fault_models/composition/smooth.h | 7 ++++--- .../features/fault_models/composition/uniform.h | 4 ++-- .../features/fault_models/grains/interface.h | 6 +++--- .../grains/random_uniform_distribution.h | 3 ++- .../features/fault_models/grains/uniform.h | 2 +- .../fault_models/temperature/adiabatic.h | 6 +++--- .../fault_models/temperature/interface.h | 6 +++--- .../features/fault_models/temperature/linear.h | 4 ++-- .../features/fault_models/temperature/uniform.h | 6 +++--- .../{utilities.h => feature_utilities.h} | 16 ++++++++-------- .../mantle_layer_models/composition/uniform.h | 6 +++--- .../mantle_layer_models/temperature/adiabatic.h | 5 +++-- .../mantle_layer_models/temperature/linear.h | 6 +++--- .../mantle_layer_models/temperature/uniform.h | 6 +++--- .../oceanic_plate_models/composition/uniform.h | 6 +++--- .../oceanic_plate_models/temperature/adiabatic.h | 6 +++--- .../temperature/half_space_model.h | 5 +++-- .../oceanic_plate_models/temperature/linear.h | 6 +++--- .../temperature/plate_model.h | 5 +++-- .../temperature/plate_model_constant_age.h | 5 +++-- .../oceanic_plate_models/temperature/uniform.h | 6 +++--- .../world_builder/features/subducting_plate.h | 1 + .../composition/interface.h | 5 +++-- .../composition/uniform.h | 4 ++-- .../subducting_plate_models/grains/interface.h | 6 +++--- .../grains/random_uniform_distribution.h | 2 +- .../subducting_plate_models/grains/uniform.h | 2 +- .../temperature/adiabatic.h | 6 +++--- .../temperature/interface.h | 5 +++-- .../subducting_plate_models/temperature/linear.h | 6 +++--- .../temperature/mass_conserving.h | 6 +++--- .../temperature/plate_model.h | 6 +++--- .../temperature/uniform.h | 6 +++--- .../composition/uniform.cc | 7 ++++--- .../temperature/adiabatic.cc | 7 ++++--- .../temperature/linear.cc | 7 ++++--- .../temperature/uniform.cc | 6 +++--- source/world_builder/features/fault.cc | 4 ++-- .../features/fault_models/composition/smooth.cc | 10 +++++----- .../features/fault_models/composition/uniform.cc | 9 +++++---- .../grains/random_uniform_distribution.cc | 2 +- .../features/fault_models/grains/uniform.cc | 2 +- .../fault_models/temperature/adiabatic.cc | 8 ++++---- .../features/fault_models/temperature/linear.cc | 8 ++++---- .../features/fault_models/temperature/uniform.cc | 8 ++++---- .../{utilities.cc => feature_utilities.cc} | 4 ++-- .../mantle_layer_models/composition/uniform.cc | 6 +++--- .../mantle_layer_models/temperature/adiabatic.cc | 7 ++++--- .../mantle_layer_models/temperature/linear.cc | 6 +++--- .../mantle_layer_models/temperature/uniform.cc | 6 +++--- .../oceanic_plate_models/composition/uniform.cc | 6 +++--- .../temperature/adiabatic.cc | 6 +++--- .../temperature/half_space_model.cc | 6 +++--- .../oceanic_plate_models/temperature/linear.cc | 6 +++--- .../temperature/plate_model.cc | 6 +++--- .../temperature/plate_model_constant_age.cc | 6 +++--- .../oceanic_plate_models/temperature/uniform.cc | 6 +++--- .../world_builder/features/subducting_plate.cc | 2 +- .../composition/uniform.cc | 14 +++++++------- .../grains/random_uniform_distribution.cc | 2 +- .../subducting_plate_models/grains/uniform.cc | 2 +- .../temperature/adiabatic.cc | 8 ++++---- .../temperature/linear.cc | 8 ++++---- .../temperature/mass_conserving.cc | 8 ++++---- .../temperature/plate_model.cc | 8 ++++---- .../temperature/uniform.cc | 8 ++++---- 71 files changed, 215 insertions(+), 197 deletions(-) rename include/world_builder/features/{utilities.h => feature_utilities.h} (85%) rename source/world_builder/features/{utilities.cc => feature_utilities.cc} (94%) diff --git a/include/world_builder/features/continental_plate_models/composition/uniform.h b/include/world_builder/features/continental_plate_models/composition/uniform.h index 500a48c6f..574178da9 100644 --- a/include/world_builder/features/continental_plate_models/composition/uniform.h +++ b/include/world_builder/features/continental_plate_models/composition/uniform.h @@ -23,13 +23,14 @@ #include "world_builder/features/continental_plate_models/composition/interface.h" #include "world_builder/objects/surface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" namespace WorldBuilder { namespace Features { + using namespace FeatureUtilities; namespace ContinentalPlateModels { namespace Composition @@ -87,7 +88,7 @@ namespace WorldBuilder Objects::Surface max_depth_surface; std::vector compositions; std::vector fractions; - Utilities::Operations operation; + Operations operation; }; } // namespace Composition diff --git a/include/world_builder/features/continental_plate_models/temperature/adiabatic.h b/include/world_builder/features/continental_plate_models/temperature/adiabatic.h index f66e566e6..537f3bf61 100644 --- a/include/world_builder/features/continental_plate_models/temperature/adiabatic.h +++ b/include/world_builder/features/continental_plate_models/temperature/adiabatic.h @@ -22,7 +22,7 @@ #include "world_builder/features/continental_plate_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include "world_builder/objects/surface.h" @@ -31,6 +31,7 @@ namespace WorldBuilder namespace Features { + using namespace FeatureUtilities; namespace ContinentalPlateModels { namespace Temperature @@ -101,7 +102,7 @@ namespace WorldBuilder */ double specific_heat; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/continental_plate_models/temperature/linear.h b/include/world_builder/features/continental_plate_models/temperature/linear.h index bb5d3cbe3..3b648c90c 100644 --- a/include/world_builder/features/continental_plate_models/temperature/linear.h +++ b/include/world_builder/features/continental_plate_models/temperature/linear.h @@ -22,7 +22,7 @@ #include "world_builder/features/continental_plate_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include "world_builder/objects/surface.h" @@ -31,6 +31,7 @@ namespace WorldBuilder namespace Features { + using namespace FeatureUtilities; namespace ContinentalPlateModels { namespace Temperature @@ -87,7 +88,7 @@ namespace WorldBuilder Objects::Surface max_depth_surface; double top_temperature; double bottom_temperature; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/continental_plate_models/temperature/uniform.h b/include/world_builder/features/continental_plate_models/temperature/uniform.h index 408e897da..559eb9439 100644 --- a/include/world_builder/features/continental_plate_models/temperature/uniform.h +++ b/include/world_builder/features/continental_plate_models/temperature/uniform.h @@ -22,7 +22,7 @@ #include "world_builder/features/continental_plate_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include "world_builder/objects/surface.h" @@ -31,6 +31,7 @@ namespace WorldBuilder namespace Features { + using namespace FeatureUtilities; namespace ContinentalPlateModels { namespace Temperature @@ -86,7 +87,7 @@ namespace WorldBuilder double max_depth; Objects::Surface max_depth_surface; double temperature; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/fault_models/composition/interface.h b/include/world_builder/features/fault_models/composition/interface.h index b4b62a6b5..46bbfbee0 100644 --- a/include/world_builder/features/fault_models/composition/interface.h +++ b/include/world_builder/features/fault_models/composition/interface.h @@ -23,7 +23,7 @@ #include "world_builder/grains.h" #include "world_builder/parameters.h" #include "world_builder/utilities.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include #include @@ -40,7 +40,7 @@ namespace WorldBuilder */ namespace Features { - + using namespace FeatureUtilities; namespace FaultModels { namespace Composition @@ -87,7 +87,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const = 0; + const AdditionalParameters &additional_paramters) const = 0; /** * A function to register a new type. This is part of the automatic * registration of the object factory. diff --git a/include/world_builder/features/fault_models/composition/smooth.h b/include/world_builder/features/fault_models/composition/smooth.h index a249af95b..e91b930f6 100644 --- a/include/world_builder/features/fault_models/composition/smooth.h +++ b/include/world_builder/features/fault_models/composition/smooth.h @@ -21,7 +21,7 @@ #define _world_builder_features_fault_composition_smooth_h #include -#include +#include #include @@ -29,6 +29,7 @@ namespace WorldBuilder { namespace Features { + using namespace FeatureUtilities; namespace FaultModels { namespace Composition @@ -75,7 +76,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const override final; + const AdditionalParameters &additional_paramters) const override final; private: // linear temperature submodule parameters @@ -85,7 +86,7 @@ namespace WorldBuilder // currenly not using the side composition, but maybe usefu if you want another composition towards the end std::vector side_fraction; std::vector compositions; - Utilities::Operations operation; + Operations operation; }; } diff --git a/include/world_builder/features/fault_models/composition/uniform.h b/include/world_builder/features/fault_models/composition/uniform.h index 93ed5b921..9b194c113 100644 --- a/include/world_builder/features/fault_models/composition/uniform.h +++ b/include/world_builder/features/fault_models/composition/uniform.h @@ -75,7 +75,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const override final; + const AdditionalParameters &additional_paramters) const override final; private: @@ -84,7 +84,7 @@ namespace WorldBuilder double max_depth; std::vector compositions; std::vector fractions; - Utilities::Operations operation; + Operations operation; }; } // namespace Composition diff --git a/include/world_builder/features/fault_models/grains/interface.h b/include/world_builder/features/fault_models/grains/interface.h index a966632cf..a65a7d6fd 100644 --- a/include/world_builder/features/fault_models/grains/interface.h +++ b/include/world_builder/features/fault_models/grains/interface.h @@ -23,7 +23,7 @@ #include "world_builder/grains.h" #include "world_builder/parameters.h" #include "world_builder/utilities.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include #include @@ -40,7 +40,7 @@ namespace WorldBuilder */ namespace Features { - + using namespace FeatureUtilities; namespace FaultModels { namespace Grains @@ -88,7 +88,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const = 0; + const AdditionalParameters &additional_paramters) const = 0; /** * A function to register a new type. This is part of the automatic * registration of the object factory. diff --git a/include/world_builder/features/fault_models/grains/random_uniform_distribution.h b/include/world_builder/features/fault_models/grains/random_uniform_distribution.h index 0a60e7a96..671826db8 100644 --- a/include/world_builder/features/fault_models/grains/random_uniform_distribution.h +++ b/include/world_builder/features/fault_models/grains/random_uniform_distribution.h @@ -28,6 +28,7 @@ namespace WorldBuilder namespace Features { + using namespace FeatureUtilities; namespace FaultModels { namespace Grains @@ -92,7 +93,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const override final; + const AdditionalParameters &additional_paramters) const override final; private: // uniform grains submodule parameters diff --git a/include/world_builder/features/fault_models/grains/uniform.h b/include/world_builder/features/fault_models/grains/uniform.h index 1c95723f3..c4d5a10c3 100644 --- a/include/world_builder/features/fault_models/grains/uniform.h +++ b/include/world_builder/features/fault_models/grains/uniform.h @@ -92,7 +92,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const override final; + const AdditionalParameters &additional_paramters) const override final; private: // uniform grains submodule parameters diff --git a/include/world_builder/features/fault_models/temperature/adiabatic.h b/include/world_builder/features/fault_models/temperature/adiabatic.h index 8ec78f5c2..2d74789e7 100644 --- a/include/world_builder/features/fault_models/temperature/adiabatic.h +++ b/include/world_builder/features/fault_models/temperature/adiabatic.h @@ -22,7 +22,7 @@ #include "world_builder/features/fault_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" namespace WorldBuilder @@ -76,7 +76,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const override final; + const AdditionalParameters &additional_paramters) const override final; private: @@ -99,7 +99,7 @@ namespace WorldBuilder */ double specific_heat; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/fault_models/temperature/interface.h b/include/world_builder/features/fault_models/temperature/interface.h index 3ad55ebca..270579bd5 100644 --- a/include/world_builder/features/fault_models/temperature/interface.h +++ b/include/world_builder/features/fault_models/temperature/interface.h @@ -23,7 +23,7 @@ #include "world_builder/grains.h" #include "world_builder/parameters.h" #include "world_builder/utilities.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include #include @@ -40,7 +40,7 @@ namespace WorldBuilder */ namespace Features { - + using namespace FeatureUtilities; namespace FaultModels { namespace Temperature @@ -87,7 +87,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const = 0; + const AdditionalParameters &additional_paramters) const = 0; /** * A function to register a new type. This is part of the automatic * registration of the object factory. diff --git a/include/world_builder/features/fault_models/temperature/linear.h b/include/world_builder/features/fault_models/temperature/linear.h index 8474f1b25..0d9f144f3 100644 --- a/include/world_builder/features/fault_models/temperature/linear.h +++ b/include/world_builder/features/fault_models/temperature/linear.h @@ -75,7 +75,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const override final; + const AdditionalParameters &additional_paramters) const override final; private: @@ -84,7 +84,7 @@ namespace WorldBuilder double max_depth; double center_temperature; double side_temperature; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/fault_models/temperature/uniform.h b/include/world_builder/features/fault_models/temperature/uniform.h index 306ba5bb3..301016931 100644 --- a/include/world_builder/features/fault_models/temperature/uniform.h +++ b/include/world_builder/features/fault_models/temperature/uniform.h @@ -22,7 +22,7 @@ #include "world_builder/features/fault_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" namespace WorldBuilder @@ -76,7 +76,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const override final; + const AdditionalParameters &additional_paramters) const override final; private: @@ -84,7 +84,7 @@ namespace WorldBuilder double min_depth; double max_depth; double temperature; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/utilities.h b/include/world_builder/features/feature_utilities.h similarity index 85% rename from include/world_builder/features/utilities.h rename to include/world_builder/features/feature_utilities.h index 14a9403aa..718a1a9df 100644 --- a/include/world_builder/features/utilities.h +++ b/include/world_builder/features/feature_utilities.h @@ -18,8 +18,8 @@ */ -#ifndef WORLD_BUILDER_FEATURES_UTILITIES_H -#define WORLD_BUILDER_FEATURES_UTILITIES_H +#ifndef WORLD_BUILDER_FEATURES_FEATURE_UTILITIES_H +#define WORLD_BUILDER_FEATURES_FEATURE_UTILITIES_H #include @@ -29,7 +29,7 @@ namespace WorldBuilder { namespace Features { - namespace Utilities + namespace FeatureUtilities { enum class Operations { @@ -47,22 +47,22 @@ namespace WorldBuilder * Applies different opertions such as replace, add and subtract to the original values */ inline double - apply_operation(const Utilities::Operations operation, + apply_operation(const Operations operation, const double old_value, const double new_value) { switch (operation) { - case Utilities::Operations::REPLACE: - case Utilities::Operations::REPLACE_DEFINED_ONLY: + case Operations::REPLACE: + case Operations::REPLACE_DEFINED_ONLY: return new_value; break; - case Utilities::Operations::ADD: + case Operations::ADD: return old_value + new_value; break; - case Utilities::Operations::SUBTRACT: + case Operations::SUBTRACT: return old_value - new_value; default: diff --git a/include/world_builder/features/mantle_layer_models/composition/uniform.h b/include/world_builder/features/mantle_layer_models/composition/uniform.h index c09a956b4..5edfb5522 100644 --- a/include/world_builder/features/mantle_layer_models/composition/uniform.h +++ b/include/world_builder/features/mantle_layer_models/composition/uniform.h @@ -23,14 +23,14 @@ #include "world_builder/features/mantle_layer_models/composition/interface.h" #include "world_builder/objects/surface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" namespace WorldBuilder { - namespace Features { + using namespace FeatureUtilities; namespace MantleLayerModels { namespace Composition @@ -87,7 +87,7 @@ namespace WorldBuilder Objects::Surface max_depth_surface; std::vector compositions; std::vector fractions; - Utilities::Operations operation; + Operations operation; }; } // namespace Composition diff --git a/include/world_builder/features/mantle_layer_models/temperature/adiabatic.h b/include/world_builder/features/mantle_layer_models/temperature/adiabatic.h index 647600872..83ad63ac5 100644 --- a/include/world_builder/features/mantle_layer_models/temperature/adiabatic.h +++ b/include/world_builder/features/mantle_layer_models/temperature/adiabatic.h @@ -22,7 +22,7 @@ #include "world_builder/features/mantle_layer_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include "world_builder/objects/surface.h" @@ -31,6 +31,7 @@ namespace WorldBuilder namespace Features { + using namespace FeatureUtilities; namespace MantleLayerModels { namespace Temperature @@ -101,7 +102,7 @@ namespace WorldBuilder */ double specific_heat; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/mantle_layer_models/temperature/linear.h b/include/world_builder/features/mantle_layer_models/temperature/linear.h index 5852bc469..27395cbf1 100644 --- a/include/world_builder/features/mantle_layer_models/temperature/linear.h +++ b/include/world_builder/features/mantle_layer_models/temperature/linear.h @@ -22,15 +22,15 @@ #include "world_builder/features/mantle_layer_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include "world_builder/objects/surface.h" namespace WorldBuilder { - namespace Features { + using namespace FeatureUtilities; namespace MantleLayerModels { namespace Temperature @@ -87,7 +87,7 @@ namespace WorldBuilder Objects::Surface max_depth_surface; double top_temperature; double bottom_temperature; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/mantle_layer_models/temperature/uniform.h b/include/world_builder/features/mantle_layer_models/temperature/uniform.h index ec8f645a4..4711ba836 100644 --- a/include/world_builder/features/mantle_layer_models/temperature/uniform.h +++ b/include/world_builder/features/mantle_layer_models/temperature/uniform.h @@ -22,15 +22,15 @@ #include "world_builder/features/mantle_layer_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include "world_builder/objects/surface.h" namespace WorldBuilder { - namespace Features { + using namespace FeatureUtilities; namespace MantleLayerModels { namespace Temperature @@ -86,7 +86,7 @@ namespace WorldBuilder double max_depth; Objects::Surface max_depth_surface; double temperature; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/oceanic_plate_models/composition/uniform.h b/include/world_builder/features/oceanic_plate_models/composition/uniform.h index 1932c7090..d497bfc29 100644 --- a/include/world_builder/features/oceanic_plate_models/composition/uniform.h +++ b/include/world_builder/features/oceanic_plate_models/composition/uniform.h @@ -23,14 +23,14 @@ #include "world_builder/features/oceanic_plate_models/composition/interface.h" #include "world_builder/objects/surface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" namespace WorldBuilder { - namespace Features { + using namespace FeatureUtilities; namespace OceanicPlateModels { namespace Composition @@ -87,7 +87,7 @@ namespace WorldBuilder Objects::Surface max_depth_surface; std::vector compositions; std::vector fractions; - Utilities::Operations operation; + Operations operation; }; } // namespace Composition diff --git a/include/world_builder/features/oceanic_plate_models/temperature/adiabatic.h b/include/world_builder/features/oceanic_plate_models/temperature/adiabatic.h index ed68e7c4c..4b18c1800 100644 --- a/include/world_builder/features/oceanic_plate_models/temperature/adiabatic.h +++ b/include/world_builder/features/oceanic_plate_models/temperature/adiabatic.h @@ -22,15 +22,15 @@ #include "world_builder/features/oceanic_plate_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include "world_builder/objects/surface.h" namespace WorldBuilder { - namespace Features { + using namespace FeatureUtilities; namespace OceanicPlateModels { namespace Temperature @@ -101,7 +101,7 @@ namespace WorldBuilder */ double specific_heat; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/oceanic_plate_models/temperature/half_space_model.h b/include/world_builder/features/oceanic_plate_models/temperature/half_space_model.h index f82b83e33..723653d68 100644 --- a/include/world_builder/features/oceanic_plate_models/temperature/half_space_model.h +++ b/include/world_builder/features/oceanic_plate_models/temperature/half_space_model.h @@ -22,7 +22,7 @@ #include "world_builder/features/oceanic_plate_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include "world_builder/objects/surface.h" @@ -33,6 +33,7 @@ namespace WorldBuilder namespace Features { + using namespace FeatureUtilities; namespace OceanicPlateModels { namespace Temperature @@ -91,7 +92,7 @@ namespace WorldBuilder double bottom_temperature; double spreading_velocity; std::vector > > mid_oceanic_ridges; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/oceanic_plate_models/temperature/linear.h b/include/world_builder/features/oceanic_plate_models/temperature/linear.h index a97ef129f..847de93dd 100644 --- a/include/world_builder/features/oceanic_plate_models/temperature/linear.h +++ b/include/world_builder/features/oceanic_plate_models/temperature/linear.h @@ -22,15 +22,15 @@ #include "world_builder/features/oceanic_plate_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include "world_builder/objects/surface.h" namespace WorldBuilder { - namespace Features { + using namespace FeatureUtilities; namespace OceanicPlateModels { namespace Temperature @@ -87,7 +87,7 @@ namespace WorldBuilder Objects::Surface max_depth_surface; double top_temperature; double bottom_temperature; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/oceanic_plate_models/temperature/plate_model.h b/include/world_builder/features/oceanic_plate_models/temperature/plate_model.h index 262949eab..233a1b846 100644 --- a/include/world_builder/features/oceanic_plate_models/temperature/plate_model.h +++ b/include/world_builder/features/oceanic_plate_models/temperature/plate_model.h @@ -22,7 +22,7 @@ #include "world_builder/features/oceanic_plate_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include "world_builder/objects/surface.h" @@ -33,6 +33,7 @@ namespace WorldBuilder namespace Features { + using namespace FeatureUtilities; namespace OceanicPlateModels { namespace Temperature @@ -94,7 +95,7 @@ namespace WorldBuilder double bottom_temperature; double spreading_velocity; std::vector > > mid_oceanic_ridges; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/oceanic_plate_models/temperature/plate_model_constant_age.h b/include/world_builder/features/oceanic_plate_models/temperature/plate_model_constant_age.h index 5e9e9c3e1..feab4e1a7 100644 --- a/include/world_builder/features/oceanic_plate_models/temperature/plate_model_constant_age.h +++ b/include/world_builder/features/oceanic_plate_models/temperature/plate_model_constant_age.h @@ -22,7 +22,7 @@ #include "world_builder/features/oceanic_plate_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include "world_builder/objects/surface.h" @@ -33,6 +33,7 @@ namespace WorldBuilder namespace Features { + using namespace FeatureUtilities; namespace OceanicPlateModels { namespace Temperature @@ -93,7 +94,7 @@ namespace WorldBuilder double top_temperature; double bottom_temperature; double plate_age; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/oceanic_plate_models/temperature/uniform.h b/include/world_builder/features/oceanic_plate_models/temperature/uniform.h index e4f4c95e2..68cdf734b 100644 --- a/include/world_builder/features/oceanic_plate_models/temperature/uniform.h +++ b/include/world_builder/features/oceanic_plate_models/temperature/uniform.h @@ -22,15 +22,15 @@ #include "world_builder/features/oceanic_plate_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include "world_builder/objects/surface.h" namespace WorldBuilder { - namespace Features { + using namespace FeatureUtilities; namespace OceanicPlateModels { namespace Temperature @@ -86,7 +86,7 @@ namespace WorldBuilder double max_depth; Objects::Surface max_depth_surface; double temperature; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/subducting_plate.h b/include/world_builder/features/subducting_plate.h index 2e7b02460..422aba1d7 100644 --- a/include/world_builder/features/subducting_plate.h +++ b/include/world_builder/features/subducting_plate.h @@ -36,6 +36,7 @@ namespace WorldBuilder namespace Features { + using namespace FeatureUtilities; namespace SubductingPlateModels { namespace Composition diff --git a/include/world_builder/features/subducting_plate_models/composition/interface.h b/include/world_builder/features/subducting_plate_models/composition/interface.h index b28bdeba2..52298aeb3 100644 --- a/include/world_builder/features/subducting_plate_models/composition/interface.h +++ b/include/world_builder/features/subducting_plate_models/composition/interface.h @@ -23,7 +23,7 @@ #include "world_builder/grains.h" #include "world_builder/parameters.h" #include "world_builder/utilities.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include #include @@ -40,6 +40,7 @@ namespace WorldBuilder */ namespace Features { + using namespace FeatureUtilities; namespace SubductingPlateModels { @@ -87,7 +88,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const = 0; + const AdditionalParameters &additional_paramters) const = 0; /** * A function to register a new type. This is part of the automatic * registration of the object factory. diff --git a/include/world_builder/features/subducting_plate_models/composition/uniform.h b/include/world_builder/features/subducting_plate_models/composition/uniform.h index a05a447a9..1efbb9110 100644 --- a/include/world_builder/features/subducting_plate_models/composition/uniform.h +++ b/include/world_builder/features/subducting_plate_models/composition/uniform.h @@ -75,7 +75,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const override final; + const AdditionalParameters &additional_paramters) const override final; private: @@ -84,7 +84,7 @@ namespace WorldBuilder double max_depth; std::vector compositions; std::vector fractions; - Utilities::Operations operation; + Operations operation; }; } // namespace Composition diff --git a/include/world_builder/features/subducting_plate_models/grains/interface.h b/include/world_builder/features/subducting_plate_models/grains/interface.h index ecb33b06c..76c348a1f 100644 --- a/include/world_builder/features/subducting_plate_models/grains/interface.h +++ b/include/world_builder/features/subducting_plate_models/grains/interface.h @@ -23,7 +23,7 @@ #include "world_builder/grains.h" #include "world_builder/parameters.h" #include "world_builder/utilities.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include #include @@ -40,7 +40,7 @@ namespace WorldBuilder */ namespace Features { - + using namespace FeatureUtilities; namespace SubductingPlateModels { namespace Grains @@ -88,7 +88,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const = 0; + const AdditionalParameters &additional_paramters) const = 0; /** * A function to register a new type. This is part of the automatic * registration of the object factory. diff --git a/include/world_builder/features/subducting_plate_models/grains/random_uniform_distribution.h b/include/world_builder/features/subducting_plate_models/grains/random_uniform_distribution.h index 9ed40cccd..bdbae95bc 100644 --- a/include/world_builder/features/subducting_plate_models/grains/random_uniform_distribution.h +++ b/include/world_builder/features/subducting_plate_models/grains/random_uniform_distribution.h @@ -92,7 +92,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const override final; + const AdditionalParameters &additional_paramters) const override final; private: // uniform grains submodule parameters diff --git a/include/world_builder/features/subducting_plate_models/grains/uniform.h b/include/world_builder/features/subducting_plate_models/grains/uniform.h index 3e6200004..33c808342 100644 --- a/include/world_builder/features/subducting_plate_models/grains/uniform.h +++ b/include/world_builder/features/subducting_plate_models/grains/uniform.h @@ -92,7 +92,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const override final; + const AdditionalParameters &additional_paramters) const override final; private: // uniform grains submodule parameters diff --git a/include/world_builder/features/subducting_plate_models/temperature/adiabatic.h b/include/world_builder/features/subducting_plate_models/temperature/adiabatic.h index d3d03cf57..1851288f9 100644 --- a/include/world_builder/features/subducting_plate_models/temperature/adiabatic.h +++ b/include/world_builder/features/subducting_plate_models/temperature/adiabatic.h @@ -22,7 +22,7 @@ #include "world_builder/features/subducting_plate_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" namespace WorldBuilder @@ -76,7 +76,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const override final; + const AdditionalParameters &additional_paramters) const override final; private: @@ -99,7 +99,7 @@ namespace WorldBuilder */ double specific_heat; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/subducting_plate_models/temperature/interface.h b/include/world_builder/features/subducting_plate_models/temperature/interface.h index 442ec99a5..c63e8508d 100644 --- a/include/world_builder/features/subducting_plate_models/temperature/interface.h +++ b/include/world_builder/features/subducting_plate_models/temperature/interface.h @@ -23,7 +23,7 @@ #include "world_builder/grains.h" #include "world_builder/parameters.h" #include "world_builder/utilities.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include #include @@ -40,6 +40,7 @@ namespace WorldBuilder */ namespace Features { + using namespace FeatureUtilities; namespace SubductingPlateModels { @@ -87,7 +88,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const = 0; + const AdditionalParameters &additional_paramters) const = 0; /** * A function to register a new type. This is part of the automatic * registration of the object factory. diff --git a/include/world_builder/features/subducting_plate_models/temperature/linear.h b/include/world_builder/features/subducting_plate_models/temperature/linear.h index b667973d9..3932b5e5f 100644 --- a/include/world_builder/features/subducting_plate_models/temperature/linear.h +++ b/include/world_builder/features/subducting_plate_models/temperature/linear.h @@ -22,7 +22,7 @@ #include "world_builder/features/subducting_plate_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" namespace WorldBuilder @@ -76,7 +76,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const override final; + const AdditionalParameters &additional_paramters) const override final; private: @@ -85,7 +85,7 @@ namespace WorldBuilder double max_depth; double top_temperature; double bottom_temperature; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/subducting_plate_models/temperature/mass_conserving.h b/include/world_builder/features/subducting_plate_models/temperature/mass_conserving.h index 2c7cdfedc..efdb7edf2 100644 --- a/include/world_builder/features/subducting_plate_models/temperature/mass_conserving.h +++ b/include/world_builder/features/subducting_plate_models/temperature/mass_conserving.h @@ -22,7 +22,7 @@ #include "world_builder/features/subducting_plate_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" namespace WorldBuilder @@ -89,7 +89,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const override final; + const AdditionalParameters &additional_paramters) const override final; private: @@ -109,7 +109,7 @@ namespace WorldBuilder double taper_distance; bool adiabatic_heating; std::vector>> mid_oceanic_ridges; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/subducting_plate_models/temperature/plate_model.h b/include/world_builder/features/subducting_plate_models/temperature/plate_model.h index f6bc31471..4ed9160ae 100644 --- a/include/world_builder/features/subducting_plate_models/temperature/plate_model.h +++ b/include/world_builder/features/subducting_plate_models/temperature/plate_model.h @@ -22,7 +22,7 @@ #include "world_builder/features/subducting_plate_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" namespace WorldBuilder @@ -76,7 +76,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const override final; + const AdditionalParameters &additional_paramters) const override final; private: @@ -91,7 +91,7 @@ namespace WorldBuilder double potential_mantle_temperature; double surface_temperature; bool adiabatic_heating; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/include/world_builder/features/subducting_plate_models/temperature/uniform.h b/include/world_builder/features/subducting_plate_models/temperature/uniform.h index 81c25873d..460345856 100644 --- a/include/world_builder/features/subducting_plate_models/temperature/uniform.h +++ b/include/world_builder/features/subducting_plate_models/temperature/uniform.h @@ -22,7 +22,7 @@ #include "world_builder/features/subducting_plate_models/temperature/interface.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" namespace WorldBuilder @@ -76,7 +76,7 @@ namespace WorldBuilder const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const override final; + const AdditionalParameters &additional_paramters) const override final; private: @@ -84,7 +84,7 @@ namespace WorldBuilder double min_depth; double max_depth; double temperature; - Utilities::Operations operation; + Operations operation; }; } // namespace Temperature diff --git a/source/world_builder/features/continental_plate_models/composition/uniform.cc b/source/world_builder/features/continental_plate_models/composition/uniform.cc index 58633f98c..82713ec2e 100644 --- a/source/world_builder/features/continental_plate_models/composition/uniform.cc +++ b/source/world_builder/features/continental_plate_models/composition/uniform.cc @@ -39,6 +39,7 @@ namespace WorldBuilder namespace Features { + using namespace FeatureUtilities; namespace ContinentalPlateModels { namespace Composition @@ -93,7 +94,7 @@ namespace WorldBuilder compositions = prm.get_vector("compositions"); fractions = prm.get_vector("fractions"); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); WBAssertThrow(compositions.size() == fractions.size(), "There are not the same amount of compositions and fractions."); @@ -120,11 +121,11 @@ namespace WorldBuilder { if (compositions[i] == composition_number) { - return Utilities::apply_operation(operation,composition_,fractions[i]); + return apply_operation(operation,composition_,fractions[i]); } } - if (operation == Utilities::Operations::REPLACE) + if (operation == Operations::REPLACE) return 0.0; } } diff --git a/source/world_builder/features/continental_plate_models/temperature/adiabatic.cc b/source/world_builder/features/continental_plate_models/temperature/adiabatic.cc index 8bd93aed7..db97ae853 100644 --- a/source/world_builder/features/continental_plate_models/temperature/adiabatic.cc +++ b/source/world_builder/features/continental_plate_models/temperature/adiabatic.cc @@ -37,6 +37,7 @@ namespace WorldBuilder namespace Features { + using namespace FeatureUtilities; namespace ContinentalPlateModels { namespace Temperature @@ -48,7 +49,7 @@ namespace WorldBuilder potential_mantle_temperature(NaN::DSNAN), thermal_expansion_coefficient(NaN::DSNAN), specific_heat(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "adiabatic"; @@ -93,7 +94,7 @@ namespace WorldBuilder min_depth = min_depth_surface.minimum; max_depth_surface = Objects::Surface(prm.get("max depth",coordinates)); max_depth = max_depth_surface.maximum; - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); potential_mantle_temperature = prm.get("potential mantle temperature"); if (potential_mantle_temperature < 0) @@ -159,7 +160,7 @@ namespace WorldBuilder WBAssert(std::isfinite(adabatic_temperature), "adabatic_temperature is not a finite: " << adabatic_temperature << '.'); - return Utilities::apply_operation(operation,temperature_,adabatic_temperature); + return apply_operation(operation,temperature_,adabatic_temperature); } } return temperature_; 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 1280a5247..5b3973019 100644 --- a/source/world_builder/features/continental_plate_models/temperature/linear.cc +++ b/source/world_builder/features/continental_plate_models/temperature/linear.cc @@ -37,6 +37,7 @@ namespace WorldBuilder namespace Features { + using namespace FeatureUtilities; namespace ContinentalPlateModels { namespace Temperature @@ -47,7 +48,7 @@ namespace WorldBuilder max_depth(NaN::DSNAN), top_temperature(NaN::DSNAN), bottom_temperature(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "linear"; @@ -89,7 +90,7 @@ namespace WorldBuilder max_depth_surface = Objects::Surface(prm.get("max depth",coordinates)); max_depth = max_depth_surface.maximum; WBAssert(max_depth >= min_depth, "max depth needs to be larger or equal to min depth."); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); top_temperature = prm.get("top temperature"); bottom_temperature = prm.get("bottom temperature"); } @@ -133,7 +134,7 @@ namespace WorldBuilder (depth - min_depth_local) * ((bottom_temperature_local - top_temperature_local) / (max_depth_local_local - min_depth_local_local)); - return Utilities::apply_operation(operation,temperature_,new_temperature); + return apply_operation(operation,temperature_,new_temperature); } } diff --git a/source/world_builder/features/continental_plate_models/temperature/uniform.cc b/source/world_builder/features/continental_plate_models/temperature/uniform.cc index fbadb2b06..cd65ac46f 100644 --- a/source/world_builder/features/continental_plate_models/temperature/uniform.cc +++ b/source/world_builder/features/continental_plate_models/temperature/uniform.cc @@ -46,7 +46,7 @@ namespace WorldBuilder min_depth(NaN::DSNAN), max_depth(NaN::DSNAN), temperature(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "uniform"; @@ -83,7 +83,7 @@ namespace WorldBuilder min_depth = min_depth_surface.minimum; max_depth_surface = Objects::Surface(prm.get("max depth",coordinates)); max_depth = max_depth_surface.maximum; - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); temperature = prm.get("temperature"); } @@ -103,7 +103,7 @@ namespace WorldBuilder { if (depth <= max_depth && depth >= min_depth) { - return Utilities::apply_operation(operation,temperature_,temperature); + return apply_operation(operation,temperature_,temperature); } } return temperature_; diff --git a/source/world_builder/features/fault.cc b/source/world_builder/features/fault.cc index c122b454b..02f224b72 100644 --- a/source/world_builder/features/fault.cc +++ b/source/world_builder/features/fault.cc @@ -26,7 +26,7 @@ #include "world_builder/types/object.h" #include "world_builder/types/point.h" #include "world_builder/types/unsigned_int.h" -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" #include "world_builder/world.h" #include @@ -497,7 +497,7 @@ namespace WorldBuilder const double max_fault_length = total_fault_length[current_section] + section_fraction * (total_fault_length[next_section] - total_fault_length[current_section]); - const Features::Utilities::AdditionalParameters additional_parameters = {max_fault_length,thickness_local}; + const AdditionalParameters additional_parameters = {max_fault_length,thickness_local}; // Because both sides return positve values, we have to // devide the thickness_local by two diff --git a/source/world_builder/features/fault_models/composition/smooth.cc b/source/world_builder/features/fault_models/composition/smooth.cc index e0f78aea7..ef77b7520 100644 --- a/source/world_builder/features/fault_models/composition/smooth.cc +++ b/source/world_builder/features/fault_models/composition/smooth.cc @@ -45,7 +45,7 @@ namespace WorldBuilder : min_distance(NaN::DSNAN), side_distance(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "smooth"; @@ -82,7 +82,7 @@ namespace WorldBuilder min_distance = prm.get("min distance fault center"); side_distance = prm.get("side distance fault center"); WBAssert(side_distance >= min_distance, "distance at the side needs to be larger or equal than the min distance."); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); center_fraction = prm.get_vector("center fractions"); side_fraction = prm.get_vector("side fractions"); compositions = prm.get_vector("compositions"); @@ -97,7 +97,7 @@ namespace WorldBuilder const double , const double , const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &) const + const AdditionalParameters &) const { double composition = composition_; @@ -111,11 +111,11 @@ namespace WorldBuilder composition = (center_fraction[i] - side_fraction[i]) * ( 1 - std::tanh(10 * (distance_from_planes.distance_from_plane - side_distance/2)/side_distance ) )/2 ; - return Utilities::apply_operation(operation,composition_,composition); + return apply_operation(operation,composition_,composition); } } - if (operation == Utilities::Operations::REPLACE) + if (operation == Operations::REPLACE) return 0.0; return composition; diff --git a/source/world_builder/features/fault_models/composition/uniform.cc b/source/world_builder/features/fault_models/composition/uniform.cc index 4359e54ab..fe5b4ed8c 100644 --- a/source/world_builder/features/fault_models/composition/uniform.cc +++ b/source/world_builder/features/fault_models/composition/uniform.cc @@ -35,6 +35,7 @@ namespace WorldBuilder namespace Features { + using namespace FeatureUtilities; namespace FaultModels { namespace Composition @@ -82,7 +83,7 @@ namespace WorldBuilder max_depth = prm.get("max distance fault center"); compositions = prm.get_vector("compositions"); fractions = prm.get_vector("fractions"); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); WBAssertThrow(compositions.size() == fractions.size(), "There are not the same amount of compositions and fractions."); @@ -97,7 +98,7 @@ namespace WorldBuilder const double /*feature_min_depth*/, const double /*feature_max_depth*/, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_plane, - const Utilities::AdditionalParameters & /*additional_paramters*/) const + const AdditionalParameters & /*additional_paramters*/) const { double composition = composition_; if (std::fabs(distance_from_plane.distance_from_plane) <= max_depth && std::fabs(distance_from_plane.distance_from_plane) >= min_depth) @@ -106,11 +107,11 @@ namespace WorldBuilder { if (compositions[i] == composition_number) { - return Utilities::apply_operation(operation,composition_,fractions[i]); + return apply_operation(operation,composition_,fractions[i]); } } - if (operation == Utilities::Operations::REPLACE) + if (operation == Operations::REPLACE) return 0.0; } return composition; diff --git a/source/world_builder/features/fault_models/grains/random_uniform_distribution.cc b/source/world_builder/features/fault_models/grains/random_uniform_distribution.cc index d229d6f06..27a58bcc3 100644 --- a/source/world_builder/features/fault_models/grains/random_uniform_distribution.cc +++ b/source/world_builder/features/fault_models/grains/random_uniform_distribution.cc @@ -117,7 +117,7 @@ namespace WorldBuilder const double /*feature_min_depth*/, const double /*feature_max_depth*/, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters & /*additional_paramters*/) const + const AdditionalParameters & /*additional_paramters*/) const { WorldBuilder::grains grains_local = grains_; if (std::fabs(distance_from_planes.distance_from_plane) <= max_depth && std::fabs(distance_from_planes.distance_from_plane) >= min_depth) diff --git a/source/world_builder/features/fault_models/grains/uniform.cc b/source/world_builder/features/fault_models/grains/uniform.cc index aa190eb25..a30450de8 100644 --- a/source/world_builder/features/fault_models/grains/uniform.cc +++ b/source/world_builder/features/fault_models/grains/uniform.cc @@ -140,7 +140,7 @@ namespace WorldBuilder const double /*feature_min_depth*/, const double /*feature_max_depth*/, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters & /*additional_paramters*/) const + const AdditionalParameters & /*additional_paramters*/) const { WorldBuilder::grains grains_local = grains_; if (std::fabs(distance_from_planes.distance_from_plane) <= max_depth && std::fabs(distance_from_planes.distance_from_plane) >= min_depth) diff --git a/source/world_builder/features/fault_models/temperature/adiabatic.cc b/source/world_builder/features/fault_models/temperature/adiabatic.cc index aaf45722c..402bd5611 100644 --- a/source/world_builder/features/fault_models/temperature/adiabatic.cc +++ b/source/world_builder/features/fault_models/temperature/adiabatic.cc @@ -44,7 +44,7 @@ namespace WorldBuilder potential_mantle_temperature(NaN::DSNAN), thermal_expansion_coefficient(NaN::DSNAN), specific_heat(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "adiabatic"; @@ -87,7 +87,7 @@ namespace WorldBuilder min_depth = prm.get("min distance fault center"); max_depth = prm.get("max distance fault center"); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); potential_mantle_temperature = prm.get("potential mantle temperature"); if (potential_mantle_temperature < 0) @@ -129,7 +129,7 @@ namespace WorldBuilder const double /*feature_min_depth*/, const double /*feature_max_depth*/, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes & /*distance_from_planes*/, - const Utilities::AdditionalParameters & /*additional_paramters*/) const + const AdditionalParameters & /*additional_paramters*/) const { if (depth <= max_depth && depth >= min_depth) @@ -150,7 +150,7 @@ namespace WorldBuilder WBAssert(std::isfinite(adabatic_temperature), "adabatic_temperature is not a finite: " << adabatic_temperature << '.'); - return Utilities::apply_operation(operation,temperature_,adabatic_temperature); + return apply_operation(operation,temperature_,adabatic_temperature); } return temperature_; diff --git a/source/world_builder/features/fault_models/temperature/linear.cc b/source/world_builder/features/fault_models/temperature/linear.cc index 41441d3b6..8305ef138 100644 --- a/source/world_builder/features/fault_models/temperature/linear.cc +++ b/source/world_builder/features/fault_models/temperature/linear.cc @@ -43,7 +43,7 @@ namespace WorldBuilder max_depth(NaN::DSNAN), center_temperature(NaN::DSNAN), side_temperature(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "linear"; @@ -83,7 +83,7 @@ namespace WorldBuilder min_depth = prm.get("min distance fault center"); max_depth = prm.get("max distance fault center"); WBAssert(max_depth >= min_depth, "max depth needs to be larger or equal to min depth."); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); center_temperature = prm.get("center temperature"); side_temperature = prm.get("side temperature"); } @@ -97,7 +97,7 @@ namespace WorldBuilder const double /*feature_min_depth*/, const double /*feature_max_depth*/, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters & /*additional_paramters*/) const + const AdditionalParameters & /*additional_paramters*/) const { if (std::fabs(distance_from_planes.distance_from_plane) <= max_depth && std::fabs(distance_from_planes.distance_from_plane) >= min_depth) @@ -125,7 +125,7 @@ namespace WorldBuilder (std::fabs(distance_from_planes.distance_from_plane) - min_depth_local) * ((side_temperature_local - center_temperature_local) / (max_depth_local - min_depth_local)); - return Utilities::apply_operation(operation,temperature_,new_temperature); + return apply_operation(operation,temperature_,new_temperature); } diff --git a/source/world_builder/features/fault_models/temperature/uniform.cc b/source/world_builder/features/fault_models/temperature/uniform.cc index 9d26c180a..48f86fc52 100644 --- a/source/world_builder/features/fault_models/temperature/uniform.cc +++ b/source/world_builder/features/fault_models/temperature/uniform.cc @@ -42,7 +42,7 @@ namespace WorldBuilder min_depth(NaN::DSNAN), max_depth(NaN::DSNAN), temperature(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "uniform"; @@ -76,7 +76,7 @@ namespace WorldBuilder { min_depth = prm.get("min distance fault center"); max_depth = prm.get("max distance fault center"); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); temperature = prm.get("temperature"); } @@ -89,12 +89,12 @@ namespace WorldBuilder const double /*feature_min_depth*/, const double /*feature_max_depth*/, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_plane, - const Utilities::AdditionalParameters & /*additional_paramters*/) const + const AdditionalParameters & /*additional_paramters*/) const { if (std::fabs(distance_from_plane.distance_from_plane) <= max_depth && std::fabs(distance_from_plane.distance_from_plane) >= min_depth) { - return Utilities::apply_operation(operation,temperature_,temperature); + return apply_operation(operation,temperature_,temperature); } return temperature_; } diff --git a/source/world_builder/features/utilities.cc b/source/world_builder/features/feature_utilities.cc similarity index 94% rename from source/world_builder/features/utilities.cc rename to source/world_builder/features/feature_utilities.cc index 0f5eb2d26..204ec8d75 100644 --- a/source/world_builder/features/utilities.cc +++ b/source/world_builder/features/feature_utilities.cc @@ -17,14 +17,14 @@ along with this program. If not, see . */ -#include "world_builder/features/utilities.h" +#include "world_builder/features/feature_utilities.h" namespace WorldBuilder { namespace Features { - namespace Utilities + namespace FeatureUtilities { Operations string_operations_to_enum(const std::string &operation) diff --git a/source/world_builder/features/mantle_layer_models/composition/uniform.cc b/source/world_builder/features/mantle_layer_models/composition/uniform.cc index dd59c0113..b5a86fd60 100644 --- a/source/world_builder/features/mantle_layer_models/composition/uniform.cc +++ b/source/world_builder/features/mantle_layer_models/composition/uniform.cc @@ -86,7 +86,7 @@ namespace WorldBuilder max_depth = max_depth_surface.maximum; compositions = prm.get_vector("compositions"); fractions = prm.get_vector("fractions"); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); WBAssertThrow(compositions.size() == fractions.size(), "There are not the same amount of compositions and fractions."); @@ -113,11 +113,11 @@ namespace WorldBuilder { if (compositions[i] == composition_number) { - return Utilities::apply_operation(operation,composition_,fractions[i]); + return apply_operation(operation,composition_,fractions[i]); } } - if (operation == Utilities::Operations::REPLACE) + if (operation == Operations::REPLACE) return 0.0; } } diff --git a/source/world_builder/features/mantle_layer_models/temperature/adiabatic.cc b/source/world_builder/features/mantle_layer_models/temperature/adiabatic.cc index 062cbd4c2..026bda854 100644 --- a/source/world_builder/features/mantle_layer_models/temperature/adiabatic.cc +++ b/source/world_builder/features/mantle_layer_models/temperature/adiabatic.cc @@ -36,6 +36,7 @@ namespace WorldBuilder namespace Features { + using namespace FeatureUtilities; namespace MantleLayerModels { namespace Temperature @@ -47,7 +48,7 @@ namespace WorldBuilder potential_mantle_temperature(NaN::DSNAN), thermal_expansion_coefficient(NaN::DSNAN), specific_heat(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "adiabatic"; @@ -91,7 +92,7 @@ namespace WorldBuilder min_depth = min_depth_surface.minimum; max_depth_surface = Objects::Surface(prm.get("max depth",coordinates)); max_depth = max_depth_surface.maximum; - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); potential_mantle_temperature = prm.get("potential mantle temperature"); if (potential_mantle_temperature < 0) @@ -157,7 +158,7 @@ namespace WorldBuilder WBAssert(std::isfinite(adabatic_temperature), "adabatic_temperature is not a finite: " << adabatic_temperature << '.'); - return Utilities::apply_operation(operation,temperature_,adabatic_temperature); + return apply_operation(operation,temperature_,adabatic_temperature); } } 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 9dfeb21c1..db3ad32c6 100644 --- a/source/world_builder/features/mantle_layer_models/temperature/linear.cc +++ b/source/world_builder/features/mantle_layer_models/temperature/linear.cc @@ -46,7 +46,7 @@ namespace WorldBuilder max_depth(NaN::DSNAN), top_temperature(NaN::DSNAN), bottom_temperature(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "linear"; @@ -87,7 +87,7 @@ namespace WorldBuilder max_depth_surface = Objects::Surface(prm.get("max depth",coordinates)); max_depth = max_depth_surface.maximum; WBAssert(max_depth >= min_depth, "max depth needs to be larger or equal to min depth."); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); top_temperature = prm.get("top temperature"); bottom_temperature = prm.get("bottom temperature"); } @@ -132,7 +132,7 @@ namespace WorldBuilder (depth - min_depth_local_local) * ((bottom_temperature_local - top_temperature_local) / (max_depth_local_local - min_depth_local_local)); - return Utilities::apply_operation(operation,temperature_,new_temperature); + return apply_operation(operation,temperature_,new_temperature); } } diff --git a/source/world_builder/features/mantle_layer_models/temperature/uniform.cc b/source/world_builder/features/mantle_layer_models/temperature/uniform.cc index 5e51717a6..2e47d23d3 100644 --- a/source/world_builder/features/mantle_layer_models/temperature/uniform.cc +++ b/source/world_builder/features/mantle_layer_models/temperature/uniform.cc @@ -45,7 +45,7 @@ namespace WorldBuilder min_depth(NaN::DSNAN), max_depth(NaN::DSNAN), temperature(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "uniform"; @@ -82,7 +82,7 @@ namespace WorldBuilder min_depth = min_depth_surface.minimum; max_depth_surface = Objects::Surface(prm.get("max depth",coordinates)); max_depth = max_depth_surface.maximum; - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); temperature = prm.get("temperature"); } @@ -103,7 +103,7 @@ namespace WorldBuilder const double max_depth_local = max_depth_surface.constant_value ? max_depth : max_depth_surface.local_value(position_in_natural_coordinates.get_surface_point()).interpolated_value; if (depth <= max_depth_local && depth >= min_depth_local) { - return Utilities::apply_operation(operation,temperature_,temperature); + return apply_operation(operation,temperature_,temperature); } } diff --git a/source/world_builder/features/oceanic_plate_models/composition/uniform.cc b/source/world_builder/features/oceanic_plate_models/composition/uniform.cc index 6cdc87a0d..70863ba6e 100644 --- a/source/world_builder/features/oceanic_plate_models/composition/uniform.cc +++ b/source/world_builder/features/oceanic_plate_models/composition/uniform.cc @@ -87,7 +87,7 @@ namespace WorldBuilder max_depth = max_depth_surface.maximum; compositions = prm.get_vector("compositions"); fractions = prm.get_vector("fractions"); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); WBAssertThrow(compositions.size() == fractions.size(), "There are not the same amount of compositions and fractions."); @@ -114,11 +114,11 @@ namespace WorldBuilder { if (compositions[i] == composition_number) { - return Utilities::apply_operation(operation,composition_,fractions[i]); + return apply_operation(operation,composition_,fractions[i]); } } - if (operation == Utilities::Operations::REPLACE) + if (operation == Operations::REPLACE) return 0.0; } } diff --git a/source/world_builder/features/oceanic_plate_models/temperature/adiabatic.cc b/source/world_builder/features/oceanic_plate_models/temperature/adiabatic.cc index 90ae0f81d..2606d219a 100644 --- a/source/world_builder/features/oceanic_plate_models/temperature/adiabatic.cc +++ b/source/world_builder/features/oceanic_plate_models/temperature/adiabatic.cc @@ -48,7 +48,7 @@ namespace WorldBuilder potential_mantle_temperature(NaN::DSNAN), thermal_expansion_coefficient(NaN::DSNAN), specific_heat(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "adiabatic"; @@ -93,7 +93,7 @@ namespace WorldBuilder min_depth = min_depth_surface.minimum; max_depth_surface = Objects::Surface(prm.get("max depth",coordinates)); max_depth = max_depth_surface.maximum; - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); potential_mantle_temperature = prm.get("potential mantle temperature"); if (potential_mantle_temperature < 0) @@ -159,7 +159,7 @@ namespace WorldBuilder WBAssert(std::isfinite(adabatic_temperature), "adabatic_temperature is not a finite: " << adabatic_temperature << '.'); - return Utilities::apply_operation(operation,temperature_,adabatic_temperature); + return apply_operation(operation,temperature_,adabatic_temperature); } } diff --git a/source/world_builder/features/oceanic_plate_models/temperature/half_space_model.cc b/source/world_builder/features/oceanic_plate_models/temperature/half_space_model.cc index 6f3b178e6..033b8946c 100644 --- a/source/world_builder/features/oceanic_plate_models/temperature/half_space_model.cc +++ b/source/world_builder/features/oceanic_plate_models/temperature/half_space_model.cc @@ -49,7 +49,7 @@ namespace WorldBuilder top_temperature(NaN::DSNAN), bottom_temperature(NaN::DSNAN), spreading_velocity(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "half space model"; @@ -102,7 +102,7 @@ namespace WorldBuilder min_depth = min_depth_surface.minimum; max_depth_surface = Objects::Surface(prm.get("max depth",coordinates)); max_depth = max_depth_surface.maximum; - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); top_temperature = prm.get("top temperature"); bottom_temperature = prm.get("bottom temperature"); spreading_velocity = prm.get("spreading velocity")/31557600; // m/seconds @@ -244,7 +244,7 @@ namespace WorldBuilder << ", age = " << age << '.'); - return Utilities::apply_operation(operation,temperature_,temperature); + return apply_operation(operation,temperature_,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 e3d27257f..61901a836 100644 --- a/source/world_builder/features/oceanic_plate_models/temperature/linear.cc +++ b/source/world_builder/features/oceanic_plate_models/temperature/linear.cc @@ -47,7 +47,7 @@ namespace WorldBuilder max_depth(NaN::DSNAN), top_temperature(NaN::DSNAN), bottom_temperature(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "linear"; @@ -88,7 +88,7 @@ namespace WorldBuilder max_depth_surface = Objects::Surface(prm.get("max depth",coordinates)); max_depth = max_depth_surface.maximum; WBAssert(max_depth >= min_depth, "max depth needs to be larger or equal to min depth."); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); top_temperature = prm.get("top temperature"); bottom_temperature = prm.get("bottom temperature"); } @@ -132,7 +132,7 @@ namespace WorldBuilder (depth - min_depth_local_local) * ((bottom_temperature_local - top_temperature_local) / (max_depth_local_local - min_depth_local_local)); - return Utilities::apply_operation(operation,temperature_,new_temperature); + return apply_operation(operation,temperature_,new_temperature); } } diff --git a/source/world_builder/features/oceanic_plate_models/temperature/plate_model.cc b/source/world_builder/features/oceanic_plate_models/temperature/plate_model.cc index f66b9aba4..673f33137 100644 --- a/source/world_builder/features/oceanic_plate_models/temperature/plate_model.cc +++ b/source/world_builder/features/oceanic_plate_models/temperature/plate_model.cc @@ -49,7 +49,7 @@ namespace WorldBuilder top_temperature(NaN::DSNAN), bottom_temperature(NaN::DSNAN), spreading_velocity(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "plate model"; @@ -99,7 +99,7 @@ namespace WorldBuilder min_depth = min_depth_surface.minimum; max_depth_surface = Objects::Surface(prm.get("max depth",coordinates)); max_depth = max_depth_surface.maximum; - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); top_temperature = prm.get("top temperature"); bottom_temperature = prm.get("bottom temperature"); spreading_velocity = prm.get("spreading velocity")/31557600; @@ -251,7 +251,7 @@ namespace WorldBuilder << ", age = " << age << '.'); - return Utilities::apply_operation(operation,temperature_,temperature); + return apply_operation(operation,temperature_,temperature); } } diff --git a/source/world_builder/features/oceanic_plate_models/temperature/plate_model_constant_age.cc b/source/world_builder/features/oceanic_plate_models/temperature/plate_model_constant_age.cc index 95a61ff00..a3ef069c6 100644 --- a/source/world_builder/features/oceanic_plate_models/temperature/plate_model_constant_age.cc +++ b/source/world_builder/features/oceanic_plate_models/temperature/plate_model_constant_age.cc @@ -48,7 +48,7 @@ namespace WorldBuilder max_depth(NaN::DSNAN), top_temperature(NaN::DSNAN), bottom_temperature(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "plate model constant age"; @@ -91,7 +91,7 @@ namespace WorldBuilder min_depth = min_depth_surface.minimum; max_depth_surface = Objects::Surface(prm.get("max depth",coordinates)); max_depth = max_depth_surface.maximum; - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); top_temperature = prm.get("top temperature"); bottom_temperature = prm.get("bottom temperature"); plate_age = prm.get("plate age")*31557600; @@ -149,7 +149,7 @@ namespace WorldBuilder << ", age = " << plate_age << '.'); - return Utilities::apply_operation(operation,temperature_,temperature); + return apply_operation(operation,temperature_,temperature); } } diff --git a/source/world_builder/features/oceanic_plate_models/temperature/uniform.cc b/source/world_builder/features/oceanic_plate_models/temperature/uniform.cc index 837af24df..834413b26 100644 --- a/source/world_builder/features/oceanic_plate_models/temperature/uniform.cc +++ b/source/world_builder/features/oceanic_plate_models/temperature/uniform.cc @@ -46,7 +46,7 @@ namespace WorldBuilder min_depth(NaN::DSNAN), max_depth(NaN::DSNAN), temperature(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "uniform"; @@ -83,7 +83,7 @@ namespace WorldBuilder min_depth = min_depth_surface.minimum; max_depth_surface = Objects::Surface(prm.get("max depth",coordinates)); max_depth = max_depth_surface.maximum; - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); temperature = prm.get("temperature"); } @@ -104,7 +104,7 @@ namespace WorldBuilder const double max_depth_local = max_depth_surface.constant_value ? max_depth : max_depth_surface.local_value(position_in_natural_coordinates.get_surface_point()).interpolated_value; if (depth <= max_depth_local && depth >= min_depth_local) { - return Utilities::apply_operation(operation,temperature_,temperature); + return apply_operation(operation,temperature_,temperature); } } diff --git a/source/world_builder/features/subducting_plate.cc b/source/world_builder/features/subducting_plate.cc index b60aeeb5a..94e55184a 100644 --- a/source/world_builder/features/subducting_plate.cc +++ b/source/world_builder/features/subducting_plate.cc @@ -513,7 +513,7 @@ namespace WorldBuilder distance_along_plane <= max_slab_length) { // Inside the slab! - const Features::Utilities::AdditionalParameters additional_parameters = {max_slab_length,thickness_local}; + const Features::AdditionalParameters additional_parameters = {max_slab_length,thickness_local}; for (unsigned int i_property = 0; i_property < properties.size(); ++i_property) { switch (properties[i_property][0]) diff --git a/source/world_builder/features/subducting_plate_models/composition/uniform.cc b/source/world_builder/features/subducting_plate_models/composition/uniform.cc index 460724bb4..a6c5b01ed 100644 --- a/source/world_builder/features/subducting_plate_models/composition/uniform.cc +++ b/source/world_builder/features/subducting_plate_models/composition/uniform.cc @@ -68,10 +68,10 @@ namespace WorldBuilder "A list with the labels of the composition which are present there."); prm.declare_entry("fractions", Types::Array(Types::Double(1.0),1), "TA list of compositional fractions corresponding to the compositions list."); - prm.declare_entry("operation", Types::String("replace", std::vector {"replace", "only replace defined"}), + prm.declare_entry("operation", Types::String("replace", std::vector {"replace", "only replace defined", "add", "subtract"}), "Whether the value should replace any value previously defined at this location (replace) or " - "add the value to the previously define value (add, not implemented). Replacing implies that all values not " - "explicitly defined are set to zero."); + "add the value to the previously define value. Replacing implies that all compositions not " + "explicitly defined are set to zero. To only replace the defined compositions use the replace only defined option."); } @@ -82,7 +82,7 @@ namespace WorldBuilder max_depth = prm.get("max distance slab top"); compositions = prm.get_vector("compositions"); fractions = prm.get_vector("fractions"); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); WBAssertThrow(compositions.size() == fractions.size(), "There are not the same amount of compositions and fractions."); @@ -97,7 +97,7 @@ namespace WorldBuilder const double /*feature_min_depth*/, const double /*feature_max_depth*/, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_plane, - const Utilities::AdditionalParameters & /*additional_paramters*/) const + const AdditionalParameters & /*additional_paramters*/) const { double composition = composition_; if (distance_from_plane.distance_from_plane <= max_depth && distance_from_plane.distance_from_plane >= min_depth) @@ -106,11 +106,11 @@ namespace WorldBuilder { if (compositions[i] == composition_number) { - return Utilities::apply_operation(operation,composition_,fractions[i]); + return apply_operation(operation,composition_,fractions[i]); } } - if (operation == Utilities::Operations::REPLACE) + if (operation == Operations::REPLACE) return 0.0; } return composition; diff --git a/source/world_builder/features/subducting_plate_models/grains/random_uniform_distribution.cc b/source/world_builder/features/subducting_plate_models/grains/random_uniform_distribution.cc index f0256486a..9bcebde73 100644 --- a/source/world_builder/features/subducting_plate_models/grains/random_uniform_distribution.cc +++ b/source/world_builder/features/subducting_plate_models/grains/random_uniform_distribution.cc @@ -117,7 +117,7 @@ namespace WorldBuilder const double /*feature_min_depth*/, const double /*feature_max_depth*/, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters & /*additional_paramters*/) const + const AdditionalParameters & /*additional_paramters*/) const { WorldBuilder::grains grains_local = grains_; if (distance_from_planes.distance_from_plane <= max_depth && distance_from_planes.distance_from_plane >= min_depth) diff --git a/source/world_builder/features/subducting_plate_models/grains/uniform.cc b/source/world_builder/features/subducting_plate_models/grains/uniform.cc index 0d0aec603..52636cdb4 100644 --- a/source/world_builder/features/subducting_plate_models/grains/uniform.cc +++ b/source/world_builder/features/subducting_plate_models/grains/uniform.cc @@ -140,7 +140,7 @@ namespace WorldBuilder const double /*feature_min_depth*/, const double /*feature_max_depth*/, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters & /*additional_paramters*/) const + const AdditionalParameters & /*additional_paramters*/) const { WorldBuilder::grains grains_local = grains_; if (distance_from_planes.distance_from_plane <= max_depth && distance_from_planes.distance_from_plane >= min_depth) diff --git a/source/world_builder/features/subducting_plate_models/temperature/adiabatic.cc b/source/world_builder/features/subducting_plate_models/temperature/adiabatic.cc index 306e12075..0f396fc34 100644 --- a/source/world_builder/features/subducting_plate_models/temperature/adiabatic.cc +++ b/source/world_builder/features/subducting_plate_models/temperature/adiabatic.cc @@ -44,7 +44,7 @@ namespace WorldBuilder potential_mantle_temperature(NaN::DSNAN), thermal_expansion_coefficient(NaN::DSNAN), specific_heat(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "adiabatic"; @@ -87,7 +87,7 @@ namespace WorldBuilder min_depth = prm.get("min distance slab top"); max_depth = prm.get("max distance slab top"); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); potential_mantle_temperature = prm.get("potential mantle temperature"); if (potential_mantle_temperature < 0) @@ -129,7 +129,7 @@ namespace WorldBuilder const double /*feature_min_depth*/, const double /*feature_max_depth*/, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters & /*additional_paramters*/) const + const AdditionalParameters & /*additional_paramters*/) const { const double distance_from_plane = distance_from_planes.distance_from_plane; @@ -151,7 +151,7 @@ namespace WorldBuilder WBAssert(std::isfinite(adabatic_temperature), "adabatic_temperature is not a finite: " << adabatic_temperature << '.'); - return Utilities::apply_operation(operation,temperature_,adabatic_temperature); + return apply_operation(operation,temperature_,adabatic_temperature); } diff --git a/source/world_builder/features/subducting_plate_models/temperature/linear.cc b/source/world_builder/features/subducting_plate_models/temperature/linear.cc index aeb47bc84..288c92185 100644 --- a/source/world_builder/features/subducting_plate_models/temperature/linear.cc +++ b/source/world_builder/features/subducting_plate_models/temperature/linear.cc @@ -43,7 +43,7 @@ namespace WorldBuilder max_depth(NaN::DSNAN), top_temperature(NaN::DSNAN), bottom_temperature(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "linear"; @@ -82,7 +82,7 @@ namespace WorldBuilder min_depth = prm.get("min distance slab top"); max_depth = prm.get("max distance slab top"); WBAssert(max_depth >= min_depth, "max depth needs to be larger or equal to min depth."); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); top_temperature = prm.get("top temperature"); bottom_temperature = prm.get("bottom temperature"); } @@ -96,7 +96,7 @@ namespace WorldBuilder const double /*feature_min_depth*/, const double /*feature_max_depth*/, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_plane, - const Utilities::AdditionalParameters & /*additional_paramters*/) const + const AdditionalParameters & /*additional_paramters*/) const { if (distance_from_plane.distance_from_plane <= max_depth && distance_from_plane.distance_from_plane >= min_depth) { @@ -123,7 +123,7 @@ namespace WorldBuilder const double new_temperature = top_temperature_local + (distance_from_plane.distance_from_plane - min_depth_local) * ((bottom_temperature_local - top_temperature_local) / (max_depth_local - min_depth_local)); - return Utilities::apply_operation(operation,temperature_,new_temperature); + return apply_operation(operation,temperature_,new_temperature); } diff --git a/source/world_builder/features/subducting_plate_models/temperature/mass_conserving.cc b/source/world_builder/features/subducting_plate_models/temperature/mass_conserving.cc index 79215b287..81113ebe8 100644 --- a/source/world_builder/features/subducting_plate_models/temperature/mass_conserving.cc +++ b/source/world_builder/features/subducting_plate_models/temperature/mass_conserving.cc @@ -59,7 +59,7 @@ namespace WorldBuilder surface_temperature(NaN::DSNAN), taper_distance(NaN::DSNAN), adiabatic_heating(true), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "mass conserving"; @@ -160,7 +160,7 @@ namespace WorldBuilder min_depth = prm.get("min distance slab top"); max_depth = prm.get("max distance slab top"); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); density = prm.get("density"); thermal_conductivity = prm.get("thermal conductivity"); @@ -210,7 +210,7 @@ namespace WorldBuilder const double /*feature_min_depth*/, const double /*feature_max_depth*/, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_parameters) const + const AdditionalParameters &additional_parameters) const { const double distance_from_plane = distance_from_planes.distance_from_plane; @@ -445,7 +445,7 @@ namespace WorldBuilder WBAssert(!std::isnan(temperature), "Internal error: temperature is not a number: " << temperature << '.'); WBAssert(std::isfinite(temperature), "Internal error: temperature is not finite: " << temperature << '.'); - return Utilities::apply_operation(operation, temperature_, temperature); + return apply_operation(operation, temperature_, temperature); } return temperature_; 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 eabfb2749..9c29cb7c1 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 @@ -48,7 +48,7 @@ namespace WorldBuilder potential_mantle_temperature(NaN::DSNAN), surface_temperature(NaN::DSNAN), adiabatic_heating(true), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "plate model"; @@ -101,7 +101,7 @@ namespace WorldBuilder min_depth = prm.get("min distance slab top"); max_depth = prm.get("max distance slab top"); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); density = prm.get("density"); plate_velocity = prm.get("plate velocity"); @@ -135,7 +135,7 @@ namespace WorldBuilder const double /*feature_min_depth*/, const double /*feature_max_depth*/, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, - const Utilities::AdditionalParameters &additional_paramters) const + const AdditionalParameters &additional_paramters) const { const double thickness_local = std::min(additional_paramters.local_thickness, max_depth); const double distance_from_plane = distance_from_planes.distance_from_plane; @@ -200,7 +200,7 @@ namespace WorldBuilder WBAssert(std::isfinite(temperature), "Internal error: temperature is not finite: " << temperature << '.'); - return Utilities::apply_operation(operation,temperature_,temperature); + return apply_operation(operation,temperature_,temperature); } return temperature_; diff --git a/source/world_builder/features/subducting_plate_models/temperature/uniform.cc b/source/world_builder/features/subducting_plate_models/temperature/uniform.cc index 86dc4157a..05d39fc6e 100644 --- a/source/world_builder/features/subducting_plate_models/temperature/uniform.cc +++ b/source/world_builder/features/subducting_plate_models/temperature/uniform.cc @@ -42,7 +42,7 @@ namespace WorldBuilder min_depth(NaN::DSNAN), max_depth(NaN::DSNAN), temperature(NaN::DSNAN), - operation(Utilities::Operations::REPLACE) + operation(Operations::REPLACE) { this->world = world_; this->name = "uniform"; @@ -77,7 +77,7 @@ namespace WorldBuilder min_depth = prm.get("min distance slab top"); max_depth = prm.get("max distance slab top"); - operation = Utilities::string_operations_to_enum(prm.get("operation")); + operation = string_operations_to_enum(prm.get("operation")); temperature = prm.get("temperature"); } @@ -90,12 +90,12 @@ namespace WorldBuilder const double /*feature_min_depth*/, const double /*feature_max_depth*/, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_plane, - const Utilities::AdditionalParameters & /*additional_paramters*/) const + const AdditionalParameters & /*additional_paramters*/) const { if (distance_from_plane.distance_from_plane <= max_depth && distance_from_plane.distance_from_plane >= min_depth) { - return Utilities::apply_operation(operation,temperature_,temperature); + return apply_operation(operation,temperature_,temperature); } return temperature_;