Skip to content

Commit

Permalink
rename features/utilities to features/featureutilites.
Browse files Browse the repository at this point in the history
  • Loading branch information
MFraters committed Feb 17, 2023
1 parent 5eec9eb commit 41d14a2
Show file tree
Hide file tree
Showing 71 changed files with 215 additions and 197 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -87,7 +88,7 @@ namespace WorldBuilder
Objects::Surface max_depth_surface;
std::vector<unsigned int> compositions;
std::vector<double> fractions;
Utilities::Operations operation;
Operations operation;

};
} // namespace Composition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand All @@ -31,6 +31,7 @@ namespace WorldBuilder

namespace Features
{
using namespace FeatureUtilities;
namespace ContinentalPlateModels
{
namespace Temperature
Expand Down Expand Up @@ -101,7 +102,7 @@ namespace WorldBuilder
*/
double specific_heat;

Utilities::Operations operation;
Operations operation;

};
} // namespace Temperature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand All @@ -31,6 +31,7 @@ namespace WorldBuilder

namespace Features
{
using namespace FeatureUtilities;
namespace ContinentalPlateModels
{
namespace Temperature
Expand Down Expand Up @@ -87,7 +88,7 @@ namespace WorldBuilder
Objects::Surface max_depth_surface;
double top_temperature;
double bottom_temperature;
Utilities::Operations operation;
Operations operation;

};
} // namespace Temperature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand All @@ -31,6 +31,7 @@ namespace WorldBuilder

namespace Features
{
using namespace FeatureUtilities;
namespace ContinentalPlateModels
{
namespace Temperature
Expand Down Expand Up @@ -86,7 +87,7 @@ namespace WorldBuilder
double max_depth;
Objects::Surface max_depth_surface;
double temperature;
Utilities::Operations operation;
Operations operation;

};
} // namespace Temperature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <map>
#include <vector>
Expand All @@ -40,7 +40,7 @@ namespace WorldBuilder
*/
namespace Features
{

using namespace FeatureUtilities;
namespace FaultModels
{
namespace Composition
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
#define _world_builder_features_fault_composition_smooth_h

#include <world_builder/features/fault_models/composition/interface.h>
#include <world_builder/features/utilities.h>
#include <world_builder/features/feature_utilities.h>
#include <world_builder/world.h>


namespace WorldBuilder
{
namespace Features
{
using namespace FeatureUtilities;
namespace FaultModels
{
namespace Composition
Expand Down Expand Up @@ -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
Expand All @@ -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<double> side_fraction;
std::vector<unsigned int> compositions;
Utilities::Operations operation;
Operations operation;

};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -84,7 +84,7 @@ namespace WorldBuilder
double max_depth;
std::vector<unsigned int> compositions;
std::vector<double> fractions;
Utilities::Operations operation;
Operations operation;

};
} // namespace Composition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <map>
#include <vector>
Expand All @@ -40,7 +40,7 @@ namespace WorldBuilder
*/
namespace Features
{

using namespace FeatureUtilities;
namespace FaultModels
{
namespace Grains
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace WorldBuilder

namespace Features
{
using namespace FeatureUtilities;
namespace FaultModels
{
namespace Grains
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -99,7 +99,7 @@ namespace WorldBuilder
*/
double specific_heat;

Utilities::Operations operation;
Operations operation;

};
} // namespace Temperature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <map>
#include <vector>
Expand All @@ -40,7 +40,7 @@ namespace WorldBuilder
*/
namespace Features
{

using namespace FeatureUtilities;
namespace FaultModels
{
namespace Temperature
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -84,7 +84,7 @@ namespace WorldBuilder
double max_depth;
double center_temperature;
double side_temperature;
Utilities::Operations operation;
Operations operation;

};
} // namespace Temperature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -76,15 +76,15 @@ 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 temperature submodule parameters
double min_depth;
double max_depth;
double temperature;
Utilities::Operations operation;
Operations operation;

};
} // namespace Temperature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <limits>

Expand All @@ -29,7 +29,7 @@ namespace WorldBuilder
{
namespace Features
{
namespace Utilities
namespace FeatureUtilities
{
enum class Operations
{
Expand All @@ -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:
Expand Down
Loading

0 comments on commit 41d14a2

Please sign in to comment.