Skip to content

Commit

Permalink
Rename uniform to uniform raw
Browse files Browse the repository at this point in the history
  • Loading branch information
MFraters committed Oct 18, 2024
1 parent 7f635d0 commit 6dfd43b
Show file tree
Hide file tree
Showing 14 changed files with 92 additions and 91 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"files.associations": {
"*.wb": "jsonc"
"*.wb": "jsonc",
"array": "cpp"
},
"json.validate.enable": true,
"json.schemas": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@
"temperature models":[{"model":"plate model", "max depth":95e3, "bottom temperature":1600, "spreading velocity":0.005, "ridge coordinates":[[[1,-1],[1,1]]]}],
"composition models":[{"model":"uniform", "compositions":[0], "max depth":10e3},
{"model":"uniform", "compositions":[1], "min depth":10e3, "max depth":95e3}],
"velocity models":[{"model":"uniform", "velocity":[1,0,0]}]},
"velocity models":[{"model":"uniform raw", "velocity":[1,0,0]}]},

{"model":"continental plate", "name":"continental plate", "coordinates":[[11.5,-1],[21,-1],[21,1],[11.5,1]],
"temperature models":[{"model":"linear", "max depth":95e3, "bottom temperature":1600}],
"composition models":[{"model":"uniform", "compositions":[2], "max depth":30e3},
{"model":"uniform", "compositions":[3], "min depth":30e3, "max depth":65e3}],
"velocity models":[{"model":"uniform", "velocity":[1,0,0]}]},
"velocity models":[{"model":"uniform raw", "velocity":[1,0,0]}]},

{"model":"mantle layer", "name":"upper mantle", "min depth":95e3, "max depth":660e3, "coordinates":[[-1,-1],[21,-1],[21,1],[-1,1]],
"temperature models":[{"model":"linear", "min depth":95e3, "max depth":660e3, "top temperature":1600, "bottom temperature":1820}],
"composition models":[{"model":"uniform", "compositions":[4]}],
"velocity models":[{"model":"uniform", "velocity":[1,0,0]}]},
"velocity models":[{"model":"uniform raw", "velocity":[1,0,0]}]},

{"model":"mantle layer", "name":"lower mantle", "min depth":660e3, "max depth":1160e3, "coordinates":[[-1,-1],[21,-1],[21,1],[-1,1]],
"temperature models":[{"model":"linear", "min depth":660e3, "max depth":1160e3, "top temperature":1820, "bottom temperature":2000}],
"composition models":[{"model":"uniform", "compositions":[5]}],
"velocity models":[{"model":"uniform", "velocity":[1,0,0]}]},
"velocity models":[{"model":"uniform raw", "velocity":[1,0,0]}]},

{"model":"subducting plate", "name":"Subducting plate", "coordinates":[[11.5,-1],[11.5,1]], "dip point":[20,0],
"segments":[{"length":200e3, "thickness":[95e3], "angle":[0,45]}, {"length":200e3, "thickness":[95e3], "angle":[45]},
{"length":200e3, "thickness":[95e3], "angle":[45,0]}, {"length":100e3, "thickness":[95e3], "angle":[0]}],
"temperature models":[{"model":"plate model", "density":3300, "plate velocity":0.01, "adiabatic heating":false}],
"composition models":[{"model":"uniform", "compositions":[0], "max distance slab top":10e3},
{"model":"uniform", "compositions":[1], "min distance slab top":10e3, "max distance slab top":95e3}],
"velocity models":[{"model":"uniform", "velocity":[1,0,0]}]}
"velocity models":[{"model":"uniform raw", "velocity":[1,0,0]}]}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef WORLD_BUILDER_FEATURES_CONTINENTAL_PLATE_MODELS_VELOCITY_UNIFORM_H
#define WORLD_BUILDER_FEATURES_CONTINENTAL_PLATE_MODELS_VELOCITY_UNIFORM_H
#ifndef WORLD_BUILDER_FEATURES_CONTINENTAL_PLATE_MODELS_VELOCITY_UNIFORM_RAW_H
#define WORLD_BUILDER_FEATURES_CONTINENTAL_PLATE_MODELS_VELOCITY_UNIFORM_RAW_H


#include "world_builder/features/continental_plate_models/velocity/interface.h"
Expand All @@ -42,18 +42,18 @@ namespace WorldBuilder
* the returned velocity or composition of the velocity and composition
* functions of this class will be.
*/
class Uniform final: public Interface
class UniformRaw final: public Interface
{
public:
/**
* constructor
*/
Uniform(WorldBuilder::World *world);
UniformRaw(WorldBuilder::World *world);

/**
* Destructor
*/
~Uniform() override final;
~UniformRaw() override final;

/**
* declare and read in the world builder file into the parameters class
Expand Down Expand Up @@ -81,7 +81,7 @@ namespace WorldBuilder


private:
// uniform velocity submodule parameters
// uniform raw velocity submodule parameters
double min_depth;
Objects::Surface min_depth_surface;
double max_depth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef WORLD_BUILDER_FEATURES_FAULT_MODELS_VELOCITY_UNIFORM_H
#define WORLD_BUILDER_FEATURES_FAULT_MODELS_VELOCITY_UNIFORM_H
#ifndef WORLD_BUILDER_FEATURES_FAULT_MODELS_VELOCITY_UNIFORM_RAW_H
#define WORLD_BUILDER_FEATURES_FAULT_MODELS_VELOCITY_UNIFORM_RAW_H


#include "world_builder/features/fault_models/velocity/interface.h"
Expand All @@ -40,18 +40,18 @@ namespace WorldBuilder
* the returned velocity or composition of the velocity and composition
* functions of this class will be.
*/
class Uniform final: public Interface
class UniformRaw final: public Interface
{
public:
/**
* constructor
*/
Uniform(WorldBuilder::World *world);
UniformRaw(WorldBuilder::World *world);

/**
* Destructor
*/
~Uniform() override final;
~UniformRaw() override final;

/**
* declare and read in the world builder file into the parameters class
Expand Down Expand Up @@ -80,7 +80,7 @@ namespace WorldBuilder


private:
// uniform velocity submodule parameters
// uniform raw velocity submodule parameters
double min_depth;
double max_depth;
std::array<double,3> velocity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef WORLD_BUILDER_FEATURES_MANTLE_LAYER_MODELS_VELOCITY_UNIFORM_H
#define WORLD_BUILDER_FEATURES_MANTLE_LAYER_MODELS_VELOCITY_UNIFORM_H
#ifndef WORLD_BUILDER_FEATURES_MANTLE_LAYER_MODELS_VELOCITY_UNIFORM_RAW_H
#define WORLD_BUILDER_FEATURES_MANTLE_LAYER_MODELS_VELOCITY_UNIFORM_RAW_H


#include "world_builder/features/mantle_layer_models/velocity/interface.h"
Expand All @@ -41,18 +41,18 @@ namespace WorldBuilder
* the returned velocity or composition of the velocity and composition
* functions of this class will be.
*/
class Uniform final: public Interface
class UniformRaw final: public Interface
{
public:
/**
* constructor
*/
Uniform(WorldBuilder::World *world);
UniformRaw(WorldBuilder::World *world);

/**
* Destructor
*/
~Uniform() override final;
~UniformRaw() override final;

/**
* declare and read in the world builder file into the parameters class
Expand Down Expand Up @@ -80,7 +80,7 @@ namespace WorldBuilder


private:
// uniform velocity submodule parameters
// uniform raw velocity submodule parameters
double min_depth;
Objects::Surface min_depth_surface;
double max_depth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef WORLD_BUILDER_FEATURES_OCEANIC_PLATE_MODELS_VELOCITY_UNIFORM_H
#define WORLD_BUILDER_FEATURES_OCEANIC_PLATE_MODELS_VELOCITY_UNIFORM_H
#ifndef WORLD_BUILDER_FEATURES_OCEANIC_PLATE_MODELS_VELOCITY_UNIFORM_RAW_H
#define WORLD_BUILDER_FEATURES_OCEANIC_PLATE_MODELS_VELOCITY_UNIFORM_RAW_H


#include "world_builder/features/oceanic_plate_models/velocity/interface.h"
Expand All @@ -41,18 +41,18 @@ namespace WorldBuilder
* the returned velocity or composition of the velocity and composition
* functions of this class will be.
*/
class Uniform final: public Interface
class UniformRaw final: public Interface
{
public:
/**
* constructor
*/
Uniform(WorldBuilder::World *world);
UniformRaw(WorldBuilder::World *world);

/**
* Destructor
*/
~Uniform() override final;
~UniformRaw() override final;

/**
* declare and read in the world builder file into the parameters class
Expand Down Expand Up @@ -80,7 +80,7 @@ namespace WorldBuilder


private:
// uniform velocity submodule parameters
// uniform raw velocity submodule parameters
double min_depth;
Objects::Surface min_depth_surface;
double max_depth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef WORLD_BUILDER_FEATURES_PLUME_MODELS_VELOCITY_UNIFORM_H
#define WORLD_BUILDER_FEATURES_PLUME_MODELS_VELOCITY_UNIFORM_H
#ifndef WORLD_BUILDER_FEATURES_PLUME_MODELS_VELOCITY_UNIFORM_RAW_H
#define WORLD_BUILDER_FEATURES_PLUME_MODELS_VELOCITY_UNIFORM_RAW_H


#include "world_builder/features/plume_models/velocity/interface.h"
Expand All @@ -41,20 +41,20 @@ namespace WorldBuilder
* for velocity and composition. These submodules determine what
* the returned velocity or composition of the velocity and composition
* functions of this class will be.
* In this class, the velocity within the plume is uniform.
* In this class, the velocity within the plume is uniformraw.
*/
class Uniform final: public Interface
class UniformRaw final: public Interface
{
public:
/**
* constructor
*/
Uniform(WorldBuilder::World *world);
UniformRaw(WorldBuilder::World *world);

/**
* Destructor
*/
~Uniform() override final;
~UniformRaw() override final;

/**
* declare and read in the world builder file into the parameters class
Expand Down Expand Up @@ -83,7 +83,7 @@ namespace WorldBuilder


private:
// uniform velocity submodule parameters
// uniform raw velocity submodule parameters
double min_depth;
double max_depth;
std::array<double,3> velocity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef WORLD_BUILDER_FEATURES_SUBDUCTING_PLATE_MODELS_VELOCITY_UNIFORM_H
#define WORLD_BUILDER_FEATURES_SUBDUCTING_PLATE_MODELS_VELOCITY_UNIFORM_H
#ifndef WORLD_BUILDER_FEATURES_SUBDUCTING_PLATE_MODELS_VELOCITY_UNIFORM_RAW_H
#define WORLD_BUILDER_FEATURES_SUBDUCTING_PLATE_MODELS_VELOCITY_UNIFORM_RAW_H


#include "world_builder/features/subducting_plate_models/velocity/interface.h"
Expand All @@ -40,18 +40,18 @@ namespace WorldBuilder
* the returned velocity or composition of the velocity and composition
* functions of this class will be.
*/
class Uniform final: public Interface
class UniformRaw final: public Interface
{
public:
/**
* constructor
*/
Uniform(WorldBuilder::World *world);
UniformRaw(WorldBuilder::World *world);

/**
* Destructor
*/
~Uniform() override final;
~UniformRaw() override final;

/**
* declare and read in the world builder file into the parameters class
Expand Down Expand Up @@ -80,7 +80,7 @@ namespace WorldBuilder


private:
// uniform velocity submodule parameters
// uniform raw velocity submodule parameters
double min_depth;
double max_depth;
std::array<double,3> velocity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#include "world_builder/features/continental_plate_models/velocity/uniform.h"
#include "world_builder/features/continental_plate_models/velocity/uniform_raw.h"


#include "world_builder/nan.h"
Expand All @@ -39,22 +39,22 @@ namespace WorldBuilder
{
namespace Velocity
{
Uniform::Uniform(WorldBuilder::World *world_)
UniformRaw::UniformRaw(WorldBuilder::World *world_)
:
min_depth(NaN::DSNAN),
max_depth(NaN::DSNAN),
velocity({{NaN::DSNAN,NaN::DSNAN,NaN::DSNAN}}),
operation(Operations::REPLACE)
{
this->world = world_;
this->name = "uniform";
this->name = "uniform raw";
}

Uniform::~Uniform()
UniformRaw::~UniformRaw()
= default;

void
Uniform::declare_entries(Parameters &prm, const std::string & /*unused*/)
UniformRaw::declare_entries(Parameters &prm, const std::string & /*unused*/)
{
// Document plugin and require entries if needed.
// Add `velocity` to the required parameters.
Expand All @@ -74,7 +74,7 @@ namespace WorldBuilder
}

void
Uniform::parse_entries(Parameters &prm, const std::vector<Point<2>> &coordinates)
UniformRaw::parse_entries(Parameters &prm, const std::vector<Point<2>> &coordinates)
{

min_depth_surface = Objects::Surface(prm.get("min depth",coordinates));
Expand All @@ -90,7 +90,7 @@ namespace WorldBuilder


std::array<double,3>
Uniform::get_velocity(const Point<3> & /*position_in_cartesian_coordinates*/,
UniformRaw::get_velocity(const Point<3> & /*position_in_cartesian_coordinates*/,
const Objects::NaturalCoordinate &position_in_natural_coordinates,
const double depth,
const double /*gravity*/,
Expand All @@ -116,7 +116,7 @@ namespace WorldBuilder
return velocity_;
}

WB_REGISTER_FEATURE_CONTINENTAL_PLATE_VELOCITY_MODEL(Uniform, uniform)
WB_REGISTER_FEATURE_CONTINENTAL_PLATE_VELOCITY_MODEL(UniformRaw, uniform raw)
} // namespace Velocity
} // namespace ContinentalPlateModels
} // namespace Features
Expand Down
Loading

0 comments on commit 6dfd43b

Please sign in to comment.