Skip to content

Commit

Permalink
Add variable spreading for ridges
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldouglas92 committed Feb 16, 2024
1 parent 684b28a commit 6c00e94
Show file tree
Hide file tree
Showing 42 changed files with 409 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ namespace WorldBuilder
const double feature_min_depth,
const double feature_max_depth) const override final;


private:
// plate model temperature submodule parameters
double min_depth;
Expand All @@ -90,8 +89,9 @@ namespace WorldBuilder
Objects::Surface max_depth_surface;
double top_temperature;
double bottom_temperature;
double spreading_velocity;
std::pair<std::vector<double>,std::vector<double>> spreading_velocities;
std::vector<std::vector<Point<2> > > mid_oceanic_ridges;
std::vector<std::vector<double>> spreading_velocities_at_each_ridge_point;
Operations operation;

};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ namespace WorldBuilder
Objects::Surface max_depth_surface;
double top_temperature;
double bottom_temperature;
double spreading_velocity;
std::pair<std::vector<double>,std::vector<double>> spreading_velocities;
std::vector<std::vector<Point<2> > > mid_oceanic_ridges;
std::vector<std::vector<double>> spreading_velocities_at_each_ridge_point;
Operations operation;

};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ namespace WorldBuilder
const double min_temperature,
const double background_temperature,
const double temperature_,
const double plate_velocity,
const double effective_plate_age,
const double adjusted_distance) const;

Expand All @@ -109,7 +110,8 @@ namespace WorldBuilder
double min_depth;
double max_depth;
double density;
double plate_velocity;
std::pair<std::vector<double>,std::vector<double>> plate_velocities;
std::vector<std::vector<double>> plate_velocities_at_each_ridge_point;
double mantle_coupling_depth;
double forearc_cooling_factor;
double thermal_conductivity;
Expand Down
8 changes: 7 additions & 1 deletion include/world_builder/parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ namespace WorldBuilder
const std::vector<Point<2> > &addition_points = {});

/**
* A specialized version of get which can return vectors/arrays.
* A specialized version of get which can return a values at times type.
* \param name The name of the entry to retrieved
*/
std::pair<std::vector<double>,std::vector<double>> get_value_at_array(const std::string &name);

/**
* A specialized verions of get which can return vectors/arrays.
* This version is designed for the plugin system.
* \param name The name of the entry to retrieved
*/
Expand Down
2 changes: 2 additions & 0 deletions include/world_builder/types/value_at_points.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ namespace WorldBuilder
* A constructor
*/
ValueAtPoints(const double default_value,
size_t max_values_in_array,
std::vector<Point<2>> default_points_ = std::vector<Point<2>>());

/**
Expand All @@ -61,6 +62,7 @@ namespace WorldBuilder
const std::string &documentation) const override final;

double default_value;
double max_values_in_array;
std::vector<Point<2> > default_points;

protected:
Expand Down
3 changes: 2 additions & 1 deletion include/world_builder/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,10 @@ namespace WorldBuilder
*/
std::pair<double, double>
calculate_ridge_distance_and_spreading(std::vector<std::vector<Point<2>>> mid_oceanic_ridges,
const double spreading_velocity,
std::vector<std::vector<double>> mid_oceanic_spreading_velocities,
const std::unique_ptr<WorldBuilder::CoordinateSystems::Interface> &coordinate_system,
const Objects::NaturalCoordinate &position_in_natural_coordinates_at_min_depth);

} // namespace Utilities
} // namespace WorldBuilder

Expand Down
4 changes: 2 additions & 2 deletions source/world_builder/features/continental_plate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ namespace WorldBuilder
{
prm.declare_entry("", Types::Object(required_entries), "Continental plate object. Requires properties `model` and `coordinates`.");

prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0.))),
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0., 2.))),
"The depth from which this feature is present");
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max()))),
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max(), 2.))),
"The depth to which this feature is present");
prm.declare_entry("temperature models",
Types::PluginSystem("", Features::ContinentalPlateModels::Temperature::Interface::declare_entries, {"model"}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ namespace WorldBuilder
"Uniform compositional model. Sets constant compositional field.");

// Declare entries of this plugin
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0.))),
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0., 2.))),
"The depth in meters from which the composition of this feature is present.");

prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max()))),
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max(), 2.))),
"The depth in meters to which the composition of this feature is present.");

prm.declare_entry("compositions", Types::Array(Types::UnsignedInt(),0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ namespace WorldBuilder
"to a single value or to a random distribution.");

// Declare entries of this plugin
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0.))),
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0., 2.))),
"The depth in meters from which the composition of this feature is present.");
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max()))),
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max(), 2.))),
"The depth in meters to which the composition of this feature is present.");

prm.declare_entry("compositions", Types::Array(Types::UnsignedInt(),0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ namespace WorldBuilder
"Uniform grains model. All grains start exactly the same.");

// Declare entries of this plugin
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0.))),
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0., 2.))),
"The depth in meters from which the composition of this feature is present.");

prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max()))),
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max(), 2.))),
"The depth in meters to which the composition of this feature is present.");

prm.declare_entry("compositions", Types::Array(Types::UnsignedInt(),0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ namespace WorldBuilder
"Adiabatic temperature model. Uses global values by default.");

// Declare entries of this plugin
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0.))),
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0., 2.))),
"The depth in meters from which the composition of this feature is present.");

prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max()))),
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max(), 2.))),
"The depth in meters to which the composition of this feature is present.");

prm.declare_entry("potential mantle temperature", Types::Double(-1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ namespace WorldBuilder
"Linear temperature model. Can be set to use an adiabatic temperature at the boundaries.");

// Declare entries of this plugin
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0.))),
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0., 2.))),
"The depth in meters from which the composition of this feature is present.");

prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max()))),
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max(), 2.))),
"The depth in meters to which the composition of this feature is present.");

prm.declare_entry("top temperature", Types::Double(293.15),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ namespace WorldBuilder
"Uniform temperature model. Set the temperature to a constan value.");

// Declare entries of this plugin
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0.))),
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0., 2.))),
"The depth in meters from which the composition of this feature is present.");

prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max()))),
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max(), 2.))),
"The depth in meters to which the composition of this feature is present.");

prm.declare_entry("temperature", Types::Double(293.15),
Expand Down
4 changes: 2 additions & 2 deletions source/world_builder/features/mantle_layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ namespace WorldBuilder
{
prm.declare_entry("", Types::Object(required_entries), "Mantle layer object. Requires properties `model` and `coordinates`.");

prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0.))),
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0., 2.))),
"The depth from which this feature is present");
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max()))),
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max(), 2.))),
"The depth to which this feature is present");
prm.declare_entry("temperature models",
Types::PluginSystem("", Features::MantleLayerModels::Temperature::Interface::declare_entries, {"model"}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ namespace WorldBuilder
"Uniform compositional model. Sets constant compositional field.");

// Declare entries of this plugin
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0.))),
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0., 2.))),
"The depth in meters from which the composition of this feature is present.");
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max()))),
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max(), 2.))),
"The depth in meters to which the composition of this feature is present.");
prm.declare_entry("compositions", Types::Array(Types::UnsignedInt(),0),
"A list with the labels of the composition which are present there.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ namespace WorldBuilder
"to a single value or to a random distribution.");

// Declare entries of this plugin
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0.))),
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0., 2.))),
"The depth in meters from which the composition of this feature is present.");
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max()))),
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max(), 2.))),
"The depth in meters to which the composition of this feature is present.");

prm.declare_entry("compositions", Types::Array(Types::UnsignedInt(),0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ namespace WorldBuilder
"Uniform grains model. All grains start exactly the same.");

// Declare entries of this plugin
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0.))),
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0., 2.))),
"The depth in meters from which the composition of this feature is present.");
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max()))),
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max(), 2.))),
"The depth in meters to which the composition of this feature is present.");

prm.declare_entry("compositions", Types::Array(Types::UnsignedInt(),0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ namespace WorldBuilder
"Adiabatic temperature model. Uses global values by default.");

// Declare entries of this plugin
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0.))),
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0., 2.))),
"The depth in meters from which the temperature of this feature is present.");

prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max()))),
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max(), 2.))),
"The depth in meters to which the temperature of this feature is present.");

prm.declare_entry("potential mantle temperature", Types::Double(-1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ namespace WorldBuilder
"Linear temperature model. Can be set to use an adiabatic temperature at the boundaries.");

// Declare entries of this plugin
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0.))),
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0., 2.))),
"The depth in meters from which the temperature of this feature is present.");

prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max()))),
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max(), 2.))),
"The depth in meters to which the temperature of this feature is present.");

prm.declare_entry("top temperature", Types::Double(293.15),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ namespace WorldBuilder
"Uniform temperature model. Set the temperature to a constan value.");

// Declare entries of this plugin
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0.))),
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0., 2.))),
"The depth in meters from which the temperature of this feature is present.");

prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max()))),
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max(), 2.))),
"The depth in meters to which the temperature of this feature is present.");

prm.declare_entry("temperature", Types::Double(293.15),
Expand Down
4 changes: 2 additions & 2 deletions source/world_builder/features/oceanic_plate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ namespace WorldBuilder
{
prm.declare_entry("", Types::Object(required_entries), "Oceanic plate object. Requires properties `model` and `coordinates`.");

prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0.))),
prm.declare_entry("min depth", Types::OneOf(Types::Double(0),Types::Array(Types::ValueAtPoints(0., 2.))),
"The depth from which this feature is present");
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max()))),
prm.declare_entry("max depth", Types::OneOf(Types::Double(std::numeric_limits<double>::max()),Types::Array(Types::ValueAtPoints(std::numeric_limits<double>::max(), 2.))),
"The depth to which this feature is present");
prm.declare_entry("temperature models",
Types::PluginSystem("", Features::OceanicPlateModels::Temperature::Interface::declare_entries, {"model"}),
Expand Down
Loading

0 comments on commit 6c00e94

Please sign in to comment.