ASPECT
interface.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2013 - 2019 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 
53  template <int dim>
54  class Interface: public SimulatorAccess<dim>
55  {
56  public:
61  ~Interface() override;
62 
68  virtual
69  void
70  initialize ();
71 
79  virtual
80  bool
81  is_initialized () const = 0;
82 
88  virtual
89  void update ();
90 
94  virtual
95  double temperature (const Point<dim> &p) const = 0;
96 
100  virtual
101  double pressure (const Point<dim> &p) const = 0;
102 
106  virtual
107  double density (const Point<dim> &p) const = 0;
108 
113  virtual
114  double density_derivative (const Point<dim> &p) const = 0;
115 
124  virtual
125  void get_adiabatic_temperature_profile(std::vector<double> &values) const;
126 
130  virtual
131  void get_adiabatic_pressure_profile(std::vector<double> &values) const;
132 
136  virtual
137  void get_adiabatic_density_profile(std::vector<double> &values) const;
138 
142  virtual
143  void get_adiabatic_density_derivative_profile(std::vector<double> &values) const;
144 
145 
152  static
153  void
154  declare_parameters (ParameterHandler &prm);
155 
162  virtual
163  void
164  parse_parameters (ParameterHandler &prm);
165 
166  };
167 
168 
184  template <int dim>
185  void
186  register_adiabatic_conditions (const std::string &name,
187  const std::string &description,
188  void (*declare_parameters_function) (ParameterHandler &),
189  Interface<dim> *(*factory_function) ());
190 
201  template <int dim>
202  Interface<dim> *
203  create_adiabatic_conditions (ParameterHandler &prm);
204 
205 
212  template <int dim>
213  void
214  declare_parameters (ParameterHandler &prm);
215 
216 
226  template <int dim>
227  void
228  write_plugin_graph (std::ostream &output_stream);
229 
230 
238 #define ASPECT_REGISTER_ADIABATIC_CONDITIONS_MODEL(classname, name, description) \
239  template class classname<2>; \
240  template class classname<3>; \
241  namespace ASPECT_REGISTER_ADIABATIC_CONDITIONS_MODEL_ ## classname \
242  { \
243  aspect::internal::Plugins::RegisterHelper<aspect::AdiabaticConditions::Interface<2>,classname<2>> \
244  dummy_ ## classname ## _2d (&aspect::AdiabaticConditions::register_adiabatic_conditions<2>, \
245  name, description); \
246  aspect::internal::Plugins::RegisterHelper<aspect::AdiabaticConditions::Interface<3>,classname<3>> \
247  dummy_ ## classname ## _3d (&aspect::AdiabaticConditions::register_adiabatic_conditions<3>, \
248  name, description); \
249  }
250  }
251 }
252 
253 
254 #endif
void write_plugin_graph(std::ostream &output_stream)
Interface< dim > * create_adiabatic_conditions(ParameterHandler &prm)
void declare_parameters(ParameterHandler &prm)
void register_adiabatic_conditions(const std::string &name, const std::string &description, void(*declare_parameters_function)(ParameterHandler &), Interface< dim > *(*factory_function)())