World Builder  1.1.0-pre
A geodynamic initial conditions generator
random_uniform_distribution.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2018-2024 by the authors of the World Builder code.
3 
4  This file is part of the World Builder.
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef WORLD_BUILDER_FEATURES_CONTINENTAL_PLATE_MODELS_GRAINS_RANDOM_UNIFORM_DISTRIBUTION_H
21 #define WORLD_BUILDER_FEATURES_CONTINENTAL_PLATE_MODELS_GRAINS_RANDOM_UNIFORM_DISTRIBUTION_H
22 
23 
26 
27 namespace WorldBuilder
28 {
29  class Parameters;
30 
31  namespace Features
32  {
33  namespace ContinentalPlateModels
34  {
35  namespace Grains
36  {
43  class RandomUniformDistribution final : public Interface
44  {
45  public:
50 
54  ~RandomUniformDistribution() override final;
55 
60  static void declare_entries(Parameters &prm,
61  const std::string &parent_name = "");
62 
68  Parameters &prm, const std::string &parent_name,
69  const std::vector<std::string> &required_entries);
70 
75  static void
77  const std::string &parent_name = "");
78 
83  void parse_entries(Parameters &prm, const std::vector<Point<2>> &coordinates) override final;
84 
90  get_grains(const Point<3> &position,
91  const Objects::NaturalCoordinate &position_in_natural_coordinates,
92  const double depth,
93  const unsigned int composition_number,
95  const double feature_min_depth,
96  const double feature_max_depth) const override final;
97 
98  private:
99  // uniform grains submodule parameters
100  double min_depth;
102  double max_depth;
104  std::vector<unsigned int> grains;
105  std::vector<unsigned int> compositions;
106  std::string operation;
107  std::vector<double> grain_sizes;
108  std::vector<bool> normalize_grain_sizes;
109  };
110  } // namespace Grains
111  } // namespace ContinentalPlateModels
112  } // namespace Features
113 } // namespace WorldBuilder
114 
115 #endif
static void declare_entries(Parameters &prm, const std::string &parent_name="")
void parse_entries(Parameters &prm, const std::vector< Point< 2 >> &coordinates) override final
static void declare_grain_size_model_entries(Parameters &prm, const std::string &parent_name, const std::vector< std::string > &required_entries)
WorldBuilder::grains get_grains(const Point< 3 > &position, const Objects::NaturalCoordinate &position_in_natural_coordinates, const double depth, const unsigned int composition_number, WorldBuilder::grains grains, const double feature_min_depth, const double feature_max_depth) const override final
static void declare_fixed_size_model_entries(Parameters &prm, const std::string &parent_name="")