Skip to content

Commit

Permalink
Merge pull request #652 from tjhei/update-schema2
Browse files Browse the repository at this point in the history
Fix ValueAtPoints data type
  • Loading branch information
tjhei authored Feb 20, 2024
2 parents d9c2f64 + beaa8f3 commit 0b03a7e
Show file tree
Hide file tree
Showing 8 changed files with 6,925 additions and 996 deletions.
1,584 changes: 1,502 additions & 82 deletions doc/world_builder_declarations.schema.json

Large diffs are not rendered by default.

2,984 changes: 2,553 additions & 431 deletions doc/world_builder_declarations_closed.md

Large diffs are not rendered by default.

3,340 changes: 2,863 additions & 477 deletions doc/world_builder_declarations_open.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions include/world_builder/types/value_at_points.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace WorldBuilder
* A constructor
*/
ValueAtPoints(const double default_value,
size_t max_values_in_array,
uint64_t max_values_in_array,
std::vector<Point<2>> default_points_ = std::vector<Point<2>>());

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

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

protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "world_builder/types/value_at_points.h"
#include "world_builder/utilities.h"
#include "world_builder/world.h"
#include <cstdint>


namespace WorldBuilder
Expand Down Expand Up @@ -83,7 +84,7 @@ namespace WorldBuilder
"in degree Kelvin for this feature. If the model has an adiabatic gradient"
"this should be the mantle potential temperature, and T = Tad + Thalf. ");

prm.declare_entry("spreading velocity", Types::OneOf(Types::Double(0.01),Types::Array(Types::ValueAtPoints(0.01, std::numeric_limits<size_t>::max()))),
prm.declare_entry("spreading velocity", Types::OneOf(Types::Double(0.01),Types::Array(Types::ValueAtPoints(0.01, std::numeric_limits<uint64_t>::max()))),
"The spreading velocity of the plate in meter per year. "
"This is the velocity with which one side moves away from the ridge.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ namespace WorldBuilder
prm.declare_entry("bottom temperature", Types::Double(-1),
"The temperature in degree Kelvin which this feature should have");

prm.declare_entry("spreading velocity", Types::OneOf(Types::Double(0.01),Types::Array(Types::ValueAtPoints(0.01, std::numeric_limits<size_t>::max()))),
prm.declare_entry("spreading velocity", Types::OneOf(Types::Double(0.01),Types::Array(Types::ValueAtPoints(0.01, std::numeric_limits<uint64_t>::max()))),
"The spreading velocity of the plate in meter per year. "
"This is the velocity with which one side moves away from the ridge.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ namespace WorldBuilder
prm.declare_entry("density", Types::Double(3300),
"The reference density of the subducting plate in $kg/m^3$");

prm.declare_entry("plate velocity", Types::OneOf(Types::Double(0.01),Types::Array(Types::ValueAtPoints(0.01, std::numeric_limits<size_t>::max()))),
prm.declare_entry("plate velocity", Types::OneOf(Types::Double(0.01),Types::Array(Types::ValueAtPoints(0.01, std::numeric_limits<uint64_t>::max()))),
"The velocity with which the plate subducts in meters per year. Default is 5 cm/yr");

prm.declare_entry("coupling depth", Types::Double(100e3),
Expand Down
2 changes: 1 addition & 1 deletion source/world_builder/types/value_at_points.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace WorldBuilder
{

ValueAtPoints::ValueAtPoints(const double default_value_,
size_t max_values_in_array_,
uint64_t max_values_in_array_,
std::vector<Point<2>> default_points_)
:
default_value(default_value_),
Expand Down

0 comments on commit 0b03a7e

Please sign in to comment.