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_MANTLE_LAYER_MODELS_GRAINS_RANDOM_UNIFORM_DISTRIBUTION_H
21 #define WORLD_BUILDER_FEATURES_MANTLE_LAYER_MODELS_GRAINS_RANDOM_UNIFORM_DISTRIBUTION_H
22 
23 
26 
27 namespace WorldBuilder
28 {
29 
30  namespace Features
31  {
32  namespace MantleLayerModels
33  {
34  namespace Grains
35  {
43  {
44  public:
49 
53  ~RandomUniformDistribution() override final;
54 
59  static void declare_entries(Parameters &prm,
60  const std::string &parent_name = "");
61 
67  Parameters &prm, const std::string &parent_name,
68  const std::vector<std::string> &required_entries);
69 
74  static void
76  const std::string &parent_name = "");
77 
82  void parse_entries(Parameters &prm, const std::vector<Point<2>> &coordinates) override final;
83 
89  get_grains(const Point<3> &position,
90  const Objects::NaturalCoordinate &position_in_natural_coordinates,
91  const double depth,
92  const unsigned int composition_number,
94  const double feature_min_depth,
95  const double feature_max_depth) const override final;
96 
97  private:
98  // uniform grains submodule parameters
99  double min_depth;
101  double max_depth;
103  std::vector<unsigned int> grains;
104  std::vector<unsigned int> compositions;
105  std::string operation;
106  std::vector<double> grain_sizes;
107  std::vector<bool> normalize_grain_sizes;
108  };
109  } // namespace Grains
110  } // namespace MantleLayerModels
111  } // namespace Features
112 } // namespace WorldBuilder
113 
114 #endif
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)
static void declare_fixed_size_model_entries(Parameters &prm, const std::string &parent_name="")
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_entries(Parameters &prm, const std::string &parent_name="")