ASPECT
interface.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2024 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  {
50  template <int dim>
51  class Interface : public Plugins::InterfaceBase
52  {
53  public:
64  virtual
65  double value (const Point<dim-1> &surface_point) const = 0;
66 
70  virtual
71  double max_topography () const = 0;
72  };
73 
74 
75 
91  template <int dim>
92  void
93  register_initial_topography_model (const std::string &name,
94  const std::string &description,
95  void (*declare_parameters_function) (ParameterHandler &),
96  std::unique_ptr<Interface<dim>> (*factory_function) ());
97 
108  template <int dim>
109  std::unique_ptr<Interface<dim>>
110  create_initial_topography_model (ParameterHandler &prm);
111 
112 
119  template <int dim>
120  void
121  declare_parameters (ParameterHandler &prm);
122 
123 
133  template <int dim>
134  void
135  write_plugin_graph (std::ostream &output_stream);
136 
137 
145 #define ASPECT_REGISTER_INITIAL_TOPOGRAPHY_MODEL(classname,name,description) \
146  template class classname<2>; \
147  template class classname<3>; \
148  namespace ASPECT_REGISTER_INITIAL_TOPOGRAPHY_MODEL_ ## classname \
149  { \
150  aspect::internal::Plugins::RegisterHelper<aspect::InitialTopographyModel::Interface<2>,classname<2>> \
151  dummy_ ## classname ## _2d (&aspect::InitialTopographyModel::register_initial_topography_model<2>, \
152  name, description); \
153  aspect::internal::Plugins::RegisterHelper<aspect::InitialTopographyModel::Interface<3>,classname<3>> \
154  dummy_ ## classname ## _3d (&aspect::InitialTopographyModel::register_initial_topography_model<3>, \
155  name, description); \
156  }
157  }
158 }
159 
160 
161 #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)
virtual double max_topography() const =0
Definition: compat.h:59
virtual double value(const Point< dim-1 > &surface_point) const =0
void write_plugin_graph(std::ostream &output_stream)
static void declare_parameters(ParameterHandler &prm)