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  {
44  using namespace dealii;
45 
52  template <int dim>
53  class Interface : public Plugins::InterfaceBase
54  {
55  public:
66  virtual
67  double value (const Point<dim-1> &surface_point) const = 0;
68 
72  virtual
73  double max_topography () const = 0;
74  };
75 
76 
77 
93  template <int dim>
94  void
95  register_initial_topography_model (const std::string &name,
96  const std::string &description,
97  void (*declare_parameters_function) (ParameterHandler &),
98  std::unique_ptr<Interface<dim>> (*factory_function) ());
99 
110  template <int dim>
111  std::unique_ptr<Interface<dim>>
112  create_initial_topography_model (ParameterHandler &prm);
113 
114 
121  template <int dim>
122  void
123  declare_parameters (ParameterHandler &prm);
124 
125 
135  template <int dim>
136  void
137  write_plugin_graph (std::ostream &output_stream);
138 
139 
147 #define ASPECT_REGISTER_INITIAL_TOPOGRAPHY_MODEL(classname,name,description) \
148  template class classname<2>; \
149  template class classname<3>; \
150  namespace ASPECT_REGISTER_INITIAL_TOPOGRAPHY_MODEL_ ## classname \
151  { \
152  aspect::internal::Plugins::RegisterHelper<aspect::InitialTopographyModel::Interface<2>,classname<2>> \
153  dummy_ ## classname ## _2d (&aspect::InitialTopographyModel::register_initial_topography_model<2>, \
154  name, description); \
155  aspect::internal::Plugins::RegisterHelper<aspect::InitialTopographyModel::Interface<3>,classname<3>> \
156  dummy_ ## classname ## _3d (&aspect::InitialTopographyModel::register_initial_topography_model<3>, \
157  name, description); \
158  }
159  }
160 }
161 
162 
163 #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)
Definition: compat.h:59
void declare_parameters(ParameterHandler &prm)
void write_plugin_graph(std::ostream &output_stream)
Definition: compat.h:42