ASPECT
interface.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2013 - 2023 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_adiabatic_conditions_interface_h
23 #define _aspect_adiabatic_conditions_interface_h
24 
25 #include <aspect/plugins.h>
28 #include <deal.II/base/parameter_handler.h>
29 #include <deal.II/distributed/tria.h>
30 
31 
32 namespace aspect
33 {
40  namespace AdiabaticConditions
41  {
42  using namespace dealii;
43 
54  template <int dim>
55  class Interface: public SimulatorAccess<dim>
56  {
57  public:
62  ~Interface() override;
63 
69  virtual
70  void
71  initialize ();
72 
80  virtual
81  bool
82  is_initialized () const = 0;
83 
89  virtual
90  void update ();
91 
95  virtual
96  double temperature (const Point<dim> &p) const = 0;
97 
101  virtual
102  double pressure (const Point<dim> &p) const = 0;
103 
107  virtual
108  double density (const Point<dim> &p) const = 0;
109 
114  virtual
115  double density_derivative (const Point<dim> &p) const = 0;
116 
129  virtual
130  void get_adiabatic_temperature_profile(std::vector<double> &values) const;
131 
139  virtual
140  void get_adiabatic_pressure_profile(std::vector<double> &values) const;
141 
149  virtual
150  void get_adiabatic_density_profile(std::vector<double> &values) const;
151 
159  virtual
160  void get_adiabatic_density_derivative_profile(std::vector<double> &values) const;
161 
168  static
169  void
170  declare_parameters (ParameterHandler &prm);
171 
178  virtual
179  void
180  parse_parameters (ParameterHandler &prm);
181 
182  };
183 
184 
200  template <int dim>
201  void
202  register_adiabatic_conditions (const std::string &name,
203  const std::string &description,
204  void (*declare_parameters_function) (ParameterHandler &),
205  std::unique_ptr<Interface<dim>> (*factory_function) ());
206 
217  template <int dim>
218  std::unique_ptr<Interface<dim>>
219  create_adiabatic_conditions (ParameterHandler &prm);
220 
221 
228  template <int dim>
229  void
230  declare_parameters (ParameterHandler &prm);
231 
232 
242  template <int dim>
243  void
244  write_plugin_graph (std::ostream &output_stream);
245 
246 
254 #define ASPECT_REGISTER_ADIABATIC_CONDITIONS_MODEL(classname, name, description) \
255  template class classname<2>; \
256  template class classname<3>; \
257  namespace ASPECT_REGISTER_ADIABATIC_CONDITIONS_MODEL_ ## classname \
258  { \
259  aspect::internal::Plugins::RegisterHelper<aspect::AdiabaticConditions::Interface<2>,classname<2>> \
260  dummy_ ## classname ## _2d (&aspect::AdiabaticConditions::register_adiabatic_conditions<2>, \
261  name, description); \
262  aspect::internal::Plugins::RegisterHelper<aspect::AdiabaticConditions::Interface<3>,classname<3>> \
263  dummy_ ## classname ## _3d (&aspect::AdiabaticConditions::register_adiabatic_conditions<3>, \
264  name, description); \
265  }
266  }
267 }
268 
269 
270 #endif
void write_plugin_graph(std::ostream &output_stream)
StructuredDataLookup< dim > DEAL_II_DEPRECATED
void register_adiabatic_conditions(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_adiabatic_conditions(ParameterHandler &prm)
void declare_parameters(ParameterHandler &prm)
Definition: compat.h:42