ASPECT
interface.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2022 by the authors of the ASPECT code.
3 
4  This file is part of ASPECT.
5 
6  ASPECT is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2, or (at your option)
9  any later version.
10 
11  ASPECT 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 General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with ASPECT; see the file LICENSE. If not see
18  <http://www.gnu.org/licenses/>.
19 */
20 
21 
22 #ifndef _aspect_geometry_model_initial_topography_model_interface_h
23 #define _aspect_geometry_model_initial_topography_model_interface_h
24 
25 #include <aspect/plugins.h>
26 #include <deal.II/base/parameter_handler.h>
27 #include <deal.II/base/point.h>
28 
29 #include <set>
30 
31 
32 namespace aspect
33 {
42  namespace InitialTopographyModel
43  {
44  using namespace dealii;
45 
52  template <int dim>
53  class Interface
54  {
55  public:
60  virtual ~Interface() = default;
61 
67  virtual void initialize ();
68 
72  virtual
73  double value (const Point<dim-1> &p) const = 0;
74 
78  virtual
79  double max_topography () const = 0;
80 
87  static
88  void
89  declare_parameters (ParameterHandler &prm);
90 
97  virtual
98  void
99  parse_parameters (ParameterHandler &prm);
100 
101  };
102 
103 
104 
120  template <int dim>
121  void
122  register_initial_topography_model (const std::string &name,
123  const std::string &description,
124  void (*declare_parameters_function) (ParameterHandler &),
125  std::unique_ptr<Interface<dim>> (*factory_function) ());
126 
137  template <int dim>
138  std::unique_ptr<Interface<dim>>
139  create_initial_topography_model (ParameterHandler &prm);
140 
141 
148  template <int dim>
149  void
150  declare_parameters (ParameterHandler &prm);
151 
152 
162  template <int dim>
163  void
164  write_plugin_graph (std::ostream &output_stream);
165 
166 
174 #define ASPECT_REGISTER_INITIAL_TOPOGRAPHY_MODEL(classname,name,description) \
175  template class classname<2>; \
176  template class classname<3>; \
177  namespace ASPECT_REGISTER_INITIAL_TOPOGRAPHY_MODEL_ ## classname \
178  { \
179  aspect::internal::Plugins::RegisterHelper<aspect::InitialTopographyModel::Interface<2>,classname<2>> \
180  dummy_ ## classname ## _2d (&aspect::InitialTopographyModel::register_initial_topography_model<2>, \
181  name, description); \
182  aspect::internal::Plugins::RegisterHelper<aspect::InitialTopographyModel::Interface<3>,classname<3>> \
183  dummy_ ## classname ## _3d (&aspect::InitialTopographyModel::register_initial_topography_model<3>, \
184  name, description); \
185  }
186  }
187 }
188 
189 
190 #endif
void register_initial_topography_model(const std::string &name, const std::string &description, void(*declare_parameters_function)(ParameterHandler &), std::unique_ptr< Interface< dim >>(*factory_function)())
std::unique_ptr< Interface< dim > > create_initial_topography_model(ParameterHandler &prm)
void declare_parameters(ParameterHandler &prm)
void write_plugin_graph(std::ostream &output_stream)