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_prescribed_dilation_interface_h
23 #define _aspect_prescribed_dilation_interface_h
24 
25 #include <aspect/plugins.h>
27 #include <aspect/utilities.h>
29 
30 #include <deal.II/base/point.h>
32 
33 #include <boost/core/demangle.hpp>
34 #include <typeinfo>
35 
36 
37 namespace aspect
38 {
39  template <int dim> class SimulatorAccess;
46  namespace PrescribedDilation
47  {
48 
49  template <int dim>
51  {
52  public:
60  PrescribedDilationOutputs (const unsigned int n_points);
61 
66  PrescribedDilationOutputs (const PrescribedDilationOutputs &source) = default;
67 
72 
78 
83 
88  unsigned int n_evaluation_points() const;
89 
93  void reset();
94 
99  std::vector<double> dilation;
100  };
101 
102 
120  template <int dim>
122  {
123  public:
127  virtual void
129  PrescribedDilationOutputs<dim> &out) const = 0;
130  };
131 
132 
139  template <int dim>
140  class Manager : public Plugins::ManagerBase<Interface<dim>>, public SimulatorAccess<dim>
141  {
142  public:
147  static
148  void
150 
151 
157  void
158  parse_parameters (ParameterHandler &prm) override;
159 
160 
164  void
166  PrescribedDilationOutputs<dim> &out) const;
167 
168 
188  static
189  void
190  register_dilation_model (const std::string &name,
191  const std::string &description,
192  void (*declare_parameters_function) (ParameterHandler &),
193  std::unique_ptr<Interface<dim>> (*factory_function) ());
194 
195 
205  static
206  void
207  write_plugin_graph (std::ostream &output_stream);
208 
209 
213  DeclException1 (ExcDilationModelNameNotFound,
214  std::string,
215  << "Could not find entry <"
216  << arg1
217  << "> among the names of registered dilation model objects.");
218  };
219 
220 
227  template <int dim>
228  std::string
230 
231 
239 #define ASPECT_REGISTER_DILATION_MODEL(classname,name,description) \
240  template class classname<2>; \
241  template class classname<3>; \
242  namespace ASPECT_REGISTER_DILATION_MODEL_ ## classname \
243  { \
244  aspect::internal::Plugins::RegisterHelper<aspect::PrescribedDilation::Interface<2>,classname<2>> \
245  dummy_ ## classname ## _2d (&aspect::PrescribedDilation::Manager<2>::register_dilation_model, \
246  name, description); \
247  aspect::internal::Plugins::RegisterHelper<aspect::PrescribedDilation::Interface<3>,classname<3>> \
248  dummy_ ## classname ## _3d (&aspect::PrescribedDilation::Manager<3>::register_dilation_model, \
249  name, description); \
250  }
251  }
252 }
253 
254 
255 #endif
std::string get_valid_model_names_pattern()
void write_plugin_graph(std::ostream &output_stream)
PrescribedDilationOutputs(const unsigned int n_points)
PrescribedDilationOutputs & operator=(const PrescribedDilationOutputs &source)=delete
void declare_parameters(ParameterHandler &prm)
DeclException1(ProbabilityFunctionNegative, Point< dim >,<< "Your probability density function in the particle generator " "returned a negative probability density for the following position: "<< arg1<< ". Please check your function expression.")