Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use '>>' instead of '> >' to close nested templates. #420

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ int main(int argc, char **argv)
std::ifstream data_stream(data_file);

// move the data into a vector of strings
std::vector<std::vector<std::string> > data;
std::vector<std::vector<std::string>> data;
std::string temp;

while (std::getline(data_stream, temp))
Expand Down
6 changes: 3 additions & 3 deletions include/world_builder/features/continental_plate.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,23 +123,23 @@ namespace WorldBuilder
* unique pointers are used.
* @see Features
*/
std::vector<std::unique_ptr<Features::ContinentalPlateModels::Temperature::Interface> > temperature_models;
std::vector<std::unique_ptr<Features::ContinentalPlateModels::Temperature::Interface>> temperature_models;

/**
* A vector containing all the pointers to the composition models. This vector is
* responsible for the features and has ownership over them. Therefore
* unique pointers are used.
* @see Features
*/
std::vector<std::unique_ptr<Features::ContinentalPlateModels::Composition::Interface> > composition_models;
std::vector<std::unique_ptr<Features::ContinentalPlateModels::Composition::Interface>> composition_models;

/**
* A vector containing all the pointers to the grains models. This vector is
* responsible for the features and has ownership over them. Therefore
* unique pointers are used.
* @see Features
*/
std::vector<std::unique_ptr<Features::ContinentalPlateModels::Grains::Interface> > grains_models;
std::vector<std::unique_ptr<Features::ContinentalPlateModels::Grains::Interface>> grains_models;


double min_depth;
Expand Down
16 changes: 8 additions & 8 deletions include/world_builder/features/fault.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,24 +130,24 @@ namespace WorldBuilder
std::vector<double> &output) const override final;

private:
std::vector<std::shared_ptr<Features::FaultModels::Temperature::Interface> > default_temperature_models;
std::vector<std::shared_ptr<Features::FaultModels::Temperature::Interface>> default_temperature_models;
std::vector<std::shared_ptr<Features::FaultModels::Composition::Interface> > default_composition_models;
std::vector<std::shared_ptr<Features::FaultModels::Grains::Interface> > default_grains_models;

std::vector<Objects::Segment<Features::FaultModels::Temperature::Interface,
Features::FaultModels::Composition::Interface,
Features::FaultModels::Grains::Interface> > default_segment_vector;
Features::FaultModels::Grains::Interface>> default_segment_vector;

std::vector< std::vector<Objects::Segment<Features::FaultModels::Temperature::Interface,
Features::FaultModels::Composition::Interface,
Features::FaultModels::Grains::Interface> > > sections_segment_vector;
Features::FaultModels::Grains::Interface>>> sections_segment_vector;

// This vector stores segments to this coordiante/section.
//First used (raw) pointers to the segment relevant to this coordinate/section,
// but I do not trust it won't fail when memory is moved. So storing the all the data now.
std::vector<std::vector<Objects::Segment<Features::FaultModels::Temperature::Interface,
Features::FaultModels::Composition::Interface,
Features::FaultModels::Grains::Interface> > > segment_vector;
Features::FaultModels::Grains::Interface>>> segment_vector;

// todo: the memory of this can be greatly improved by
// or using a plugin system for the submodules, or
Expand Down Expand Up @@ -190,10 +190,10 @@ namespace WorldBuilder
*/
WorldBuilder::Point<2> reference_point;

std::vector<std::vector<double> > fault_segment_lengths;
std::vector<std::vector<Point<2> > > fault_segment_thickness;
std::vector<std::vector<Point<2> > > fault_segment_top_truncation;
std::vector<std::vector<Point<2> > > fault_segment_angles;
std::vector<std::vector<double>> fault_segment_lengths;
std::vector<std::vector<Point<2>>> fault_segment_thickness;
std::vector<std::vector<Point<2>>> fault_segment_top_truncation;
std::vector<std::vector<Point<2>>> fault_segment_angles;
std::vector<double> total_fault_length;
double maximum_total_fault_length;
double maximum_fault_thickness;
Expand Down
2 changes: 1 addition & 1 deletion include/world_builder/features/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ namespace WorldBuilder
/**
* The coordinates at the surface of the feature
*/
std::vector<Point<2> > coordinates;
std::vector<Point<2>> coordinates;

/**
* The x and y spline
Expand Down
6 changes: 3 additions & 3 deletions include/world_builder/features/mantle_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,23 +123,23 @@ namespace WorldBuilder
* unique pointers are used.
* @see Features
*/
std::vector<std::unique_ptr<Features::MantleLayerModels::Temperature::Interface> > temperature_models;
std::vector<std::unique_ptr<Features::MantleLayerModels::Temperature::Interface>> temperature_models;

/**
* A vector containing all the pointers to the composition models. This vector is
* responsible for the features and has ownership over them. Therefore
* unique pointers are used.
* @see Features
*/
std::vector<std::unique_ptr<Features::MantleLayerModels::Composition::Interface> > composition_models;
std::vector<std::unique_ptr<Features::MantleLayerModels::Composition::Interface>> composition_models;

/**
* A vector containing all the pointers to the grains models. This vector is
* responsible for the features and has ownership over them. Therefore
* unique pointers are used.
* @see Features
*/
std::vector<std::unique_ptr<Features::MantleLayerModels::Grains::Interface> > grains_models;
std::vector<std::unique_ptr<Features::MantleLayerModels::Grains::Interface>> grains_models;

double min_depth;
Objects::Surface min_depth_surface;
Expand Down
6 changes: 3 additions & 3 deletions include/world_builder/features/oceanic_plate.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,23 +123,23 @@ namespace WorldBuilder
* unique pointers are used.
* @see Features
*/
std::vector<std::unique_ptr<Features::OceanicPlateModels::Temperature::Interface> > temperature_models;
std::vector<std::unique_ptr<Features::OceanicPlateModels::Temperature::Interface>> temperature_models;

/**
* A vector containing all the pointers to the composition models. This vector is
* responsible for the features and has ownership over them. Therefore
* unique pointers are used.
* @see Features
*/
std::vector<std::unique_ptr<Features::OceanicPlateModels::Composition::Interface> > composition_models;
std::vector<std::unique_ptr<Features::OceanicPlateModels::Composition::Interface>> composition_models;

/**
* A vector containing all the pointers to the grains models. This vector is
* responsible for the features and has ownership over them. Therefore
* unique pointers are used.
* @see Features
*/
std::vector<std::unique_ptr<Features::OceanicPlateModels::Grains::Interface> > grains_models;
std::vector<std::unique_ptr<Features::OceanicPlateModels::Grains::Interface>> grains_models;

double min_depth;
Objects::Surface min_depth_surface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ namespace WorldBuilder
double top_temperature;
double bottom_temperature;
double spreading_velocity;
std::vector<std::vector<Point<2> > > mid_oceanic_ridges;
std::vector<std::vector<Point<2>>> mid_oceanic_ridges;
Utilities::Operations operation;

};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace WorldBuilder
double top_temperature;
double bottom_temperature;
double spreading_velocity;
std::vector<std::vector<Point<2> > > mid_oceanic_ridges;
std::vector<std::vector<Point<2>>> mid_oceanic_ridges;
Utilities::Operations operation;

};
Expand Down
16 changes: 8 additions & 8 deletions include/world_builder/features/subducting_plate.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,24 +130,24 @@ namespace WorldBuilder
std::vector<double> &output) const override final;

private:
std::vector<std::shared_ptr<Features::SubductingPlateModels::Temperature::Interface> > default_temperature_models;
std::vector<std::shared_ptr<Features::SubductingPlateModels::Temperature::Interface>> default_temperature_models;
std::vector<std::shared_ptr<Features::SubductingPlateModels::Composition::Interface> > default_composition_models;
std::vector<std::shared_ptr<Features::SubductingPlateModels::Grains::Interface> > default_grains_models;

std::vector<Objects::Segment<Features::SubductingPlateModels::Temperature::Interface,
Features::SubductingPlateModels::Composition::Interface,
Features::SubductingPlateModels::Grains::Interface> > default_segment_vector;
Features::SubductingPlateModels::Grains::Interface>> default_segment_vector;

std::vector< std::vector<Objects::Segment<Features::SubductingPlateModels::Temperature::Interface,
Features::SubductingPlateModels::Composition::Interface,
Features::SubductingPlateModels::Grains::Interface> > > sections_segment_vector;
Features::SubductingPlateModels::Grains::Interface>>> sections_segment_vector;

// This vector stores segments to this coordiante/section.
//First used (raw) pointers to the segment relevant to this coordinate/section,
// but I do not trust it won't fail when memory is moved. So storing the all the data now.
std::vector<std::vector<Objects::Segment<Features::SubductingPlateModels::Temperature::Interface,
Features::SubductingPlateModels::Composition::Interface,
Features::SubductingPlateModels::Grains::Interface> > > segment_vector;
Features::SubductingPlateModels::Grains::Interface>>> segment_vector;

// todo: the memory of this can be greatly improved by
// or using a plugin system for the submodules, or
Expand Down Expand Up @@ -190,10 +190,10 @@ namespace WorldBuilder
*/
Point<2> reference_point;

std::vector<std::vector<double> > slab_segment_lengths;
std::vector<std::vector<Point<2> > > slab_segment_thickness;
std::vector<std::vector<Point<2> > > slab_segment_top_truncation;
std::vector<std::vector<Point<2> > > slab_segment_angles;
std::vector<std::vector<double>> slab_segment_lengths;
std::vector<std::vector<Point<2>>> slab_segment_thickness;
std::vector<std::vector<Point<2>>> slab_segment_top_truncation;
std::vector<std::vector<Point<2>>> slab_segment_angles;
std::vector<double> total_slab_length;
double maximum_total_slab_length;
double maximum_slab_thickness;
Expand Down
2 changes: 1 addition & 1 deletion include/world_builder/grains.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace WorldBuilder

// the rotation matrices of the latices of the grains.
// todo: convention.
std::vector<std::array<std::array<double,3>,3> > rotation_matrices;
std::vector<std::array<std::array<double,3>,3>> rotation_matrices;

friend std::ostream &operator<<(std::ostream &os, const grains &grains)
{
Expand Down
2 changes: 1 addition & 1 deletion include/world_builder/objects/surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ namespace WorldBuilder
/**
* Stores the triangles as a list of three points.
*/
std::vector<std::array<std::array<double,3>,3> > triangles;
std::vector<std::array<std::array<double,3>,3>> triangles;

private:
/**
Expand Down
12 changes: 6 additions & 6 deletions include/world_builder/parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ namespace WorldBuilder
*/
std::pair<std::vector<double>,std::vector<double>>
get(const std::string &name,
const std::vector<Point<2> > &addition_points = {});
const std::vector<Point<2>> &addition_points = {});

/**
* A specialized verions of get which can retun vecors/arrays.
* This version is designed for the plugin system.
* \param name The name of the entry to retrieved
*/
template<class T, class A, class B, class C>
std::vector<T> get_vector(const std::string &name, std::vector<std::shared_ptr<A> > &, std::vector<std::shared_ptr<B> > &, std::vector<std::shared_ptr<C> > &);
std::vector<T> get_vector(const std::string &name, std::vector<std::shared_ptr<A>> &, std::vector<std::shared_ptr<B>> &, std::vector<std::shared_ptr<C>> &);

/**
* A specialized verions of get which can retun unique pointers.
Expand All @@ -146,7 +146,7 @@ namespace WorldBuilder
*/
template<class T>
bool
get_unique_pointers(const std::string &name, std::vector<std::unique_ptr<T> > &vector);
get_unique_pointers(const std::string &name, std::vector<std::unique_ptr<T>> &vector);

/**
* A specialized verions of get which can retun shared pointers as an argument
Expand All @@ -157,7 +157,7 @@ namespace WorldBuilder
*/
template<class T>
bool
get_shared_pointers(const std::string &name, std::vector<std::shared_ptr<T> > & /*vector*/);
get_shared_pointers(const std::string &name, std::vector<std::shared_ptr<T>> & /*vector*/);

/**
* Checks for the existance of an entry in the parameter file.
Expand Down Expand Up @@ -214,7 +214,7 @@ namespace WorldBuilder
const std::string &parent_name,
const std::map<std::string, void ( *)(Parameters &,const std::string &)> &declare_map,
const std::vector<std::string> &required_entries = {},
const std::vector<std::tuple<std::string,const WorldBuilder::Types::Interface &, std::string> > &extra_declarations = {});
const std::vector<std::tuple<std::string,const WorldBuilder::Types::Interface &, std::string>> &extra_declarations = {});


/**
Expand Down Expand Up @@ -247,7 +247,7 @@ namespace WorldBuilder
* unique pointers are used.
* @see Features
*/
std::vector<std::unique_ptr<WorldBuilder::Features::Interface> > features;
std::vector<std::unique_ptr<WorldBuilder::Features::Interface>> features;

/**
* A pointers to the corodinate system. This variable is responsible for
Expand Down
12 changes: 6 additions & 6 deletions include/world_builder/types/segment.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ namespace WorldBuilder
const WorldBuilder::Point<2> &default_thickness,
const WorldBuilder::Point<2> &default_top_truncation,
const WorldBuilder::Point<2> &default_angle,
std::vector<std::shared_ptr<A> > temperature_systems,
std::vector<std::shared_ptr<B> > composition_systems,
std::vector<std::shared_ptr<C> > grains_systems);
std::vector<std::shared_ptr<A>> temperature_systems,
std::vector<std::shared_ptr<B>> composition_systems,
std::vector<std::shared_ptr<C>> grains_systems);

/**
* Copy constructor
Expand All @@ -141,9 +141,9 @@ namespace WorldBuilder
WorldBuilder::Point<2> value_thickness;
WorldBuilder::Point<2> value_top_truncation;
WorldBuilder::Point<2> value_angle;
std::vector<std::shared_ptr<A> > temperature_systems;
std::vector<std::shared_ptr<B> > composition_systems;
std::vector<std::shared_ptr<C> > grains_systems;
std::vector<std::shared_ptr<A>> temperature_systems;
std::vector<std::shared_ptr<B>> composition_systems;
std::vector<std::shared_ptr<C>> grains_systems;

protected:
Segment *clone_impl() const override final
Expand Down
2 changes: 1 addition & 1 deletion include/world_builder/types/value_at_points.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace WorldBuilder
const std::string &documentation) const override final;

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

protected:
ValueAtPoints *clone_impl() const override final
Expand Down
12 changes: 6 additions & 6 deletions include/world_builder/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ namespace WorldBuilder
* polygon_contains_point_implementation to do the real work.
*/
bool
polygon_contains_point(const std::vector<Point<2> > &point_list,
polygon_contains_point(const std::vector<Point<2>> &point_list,
const Point<2> &point);

/**
* Given a 2d point and a list of points which form a polygon, computes if the point
* falls within the polygon.
*/
bool
polygon_contains_point_implementation(const std::vector<Point<2> > &point_list,
polygon_contains_point_implementation(const std::vector<Point<2>> &point_list,
const Point<2> &point);

/**
Expand All @@ -78,7 +78,7 @@ namespace WorldBuilder
* the polygon and positive for points inside the polygon.
*/
double
signed_distance_to_polygon(const std::vector<Point<2> > &point_list_,
signed_distance_to_polygon(const std::vector<Point<2>> &point_list_,
const Point<2> &point_);


Expand Down Expand Up @@ -391,9 +391,9 @@ namespace WorldBuilder
PointDistanceFromCurvedPlanes distance_point_from_curved_planes(const Point<3> &check_point,
const Objects::NaturalCoordinate &check_point_natural,
const Point<2> &reference_point,
const std::vector<Point<2> > &point_list,
const std::vector<std::vector<double> > &plane_segment_lengths,
const std::vector<std::vector<Point<2> > > &plane_segment_angles,
const std::vector<Point<2>> &point_list,
const std::vector<std::vector<double>> &plane_segment_lengths,
const std::vector<std::vector<Point<2>>> &plane_segment_angles,
const double start_radius,
const std::unique_ptr<CoordinateSystems::Interface> &coordinate_system,
const bool only_positive,
Expand Down
2 changes: 1 addition & 1 deletion include/world_builder/world.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ namespace WorldBuilder
/**
* Todo
*/
std::vector<Point<2> > cross_section;
std::vector<Point<2>> cross_section;

/**
* Todo
Expand Down
4 changes: 2 additions & 2 deletions source/features/continental_plate_models/grains/uniform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ namespace WorldBuilder

if (set_euler_angles)
{
std::vector<std::array<double,3> > euler_angles_vector = prm.get_vector<std::array<double,3> >("Euler angles z-x-z");
std::vector<std::array<double,3>> euler_angles_vector = prm.get_vector<std::array<double,3>>("Euler angles z-x-z");
rotation_matrices.resize(euler_angles_vector.size());
for (size_t i = 0; i<euler_angles_vector.size(); ++i)
{
Expand All @@ -122,7 +122,7 @@ namespace WorldBuilder
}
else
{
rotation_matrices = prm.get_vector<std::array<std::array<double,3>,3> >("rotation matrices");
rotation_matrices = prm.get_vector<std::array<std::array<double,3>,3>>("rotation matrices");
}

operation = prm.get<std::string>("orientation operation");
Expand Down
Loading