ASPECT
interface.h
Go to the documentation of this file.
1 // ------------------------------------------------------
2 //
3 // SPDX-License-Identifier: GPL-2.0-or-later
4 //
5 // SPDX-FileCopyrightText: Copyright (C) 2011-2026 by the ASPECT authors.
6 //
7 // This file is part of ASPECT.
8 //
9 // Detailed license information governing the source code and
10 // contributions can be found in the folder LICENSES and in
11 // LICENSE and CONTRIBUTING.md at the top level directory.
12 //
13 // ------------------------------------------------------
14 
15 
16 #ifndef _aspect_prescribed_dilation_interface_h
17 #define _aspect_prescribed_dilation_interface_h
18 
19 #include <aspect/plugins.h>
21 #include <aspect/utilities.h>
23 
24 #include <deal.II/base/point.h>
26 
27 #include <boost/core/demangle.hpp>
28 #include <typeinfo>
29 
30 
31 namespace aspect
32 {
33  template <int dim> class SimulatorAccess;
40  namespace PrescribedDilation
41  {
42 
43  template <int dim>
45  {
46  public:
54  PrescribedDilationOutputs (const unsigned int n_points);
55 
60  PrescribedDilationOutputs (const PrescribedDilationOutputs &source) = default;
61 
66 
72 
77 
82  unsigned int n_evaluation_points() const;
83 
87  void reset();
88 
93  std::vector<double> dilation;
94  };
95 
96 
114  template <int dim>
116  {
117  public:
121  virtual void
123  PrescribedDilationOutputs<dim> &out) const = 0;
124  };
125 
126 
133  template <int dim>
134  class Manager : public Plugins::ManagerBase<Interface<dim>>, public SimulatorAccess<dim>
135  {
136  public:
141  static
142  void
144 
145 
151  void
152  parse_parameters (ParameterHandler &prm) override;
153 
154 
158  void
160  PrescribedDilationOutputs<dim> &out) const;
161 
162 
182  static
183  void
184  register_dilation_model (const std::string &name,
185  const std::string &description,
186  void (*declare_parameters_function) (ParameterHandler &),
187  std::unique_ptr<Interface<dim>> (*factory_function) ());
188 
189 
199  static
200  void
201  write_plugin_graph (std::ostream &output_stream);
202 
203 
207  DeclException1 (ExcDilationModelNameNotFound,
208  std::string,
209  << "Could not find entry <"
210  << arg1
211  << "> among the names of registered dilation model objects.");
212  };
213 
214 
221  template <int dim>
222  std::string
224 
225 
233 #define ASPECT_REGISTER_DILATION_MODEL(classname,name,description) \
234  template class classname<2>; \
235  template class classname<3>; \
236  namespace ASPECT_REGISTER_DILATION_MODEL_ ## classname \
237  { \
238  aspect::internal::Plugins::RegisterHelper<aspect::PrescribedDilation::Interface<2>,classname<2>> \
239  dummy_ ## classname ## _2d (&aspect::PrescribedDilation::Manager<2>::register_dilation_model, \
240  name, description); \
241  aspect::internal::Plugins::RegisterHelper<aspect::PrescribedDilation::Interface<3>,classname<3>> \
242  dummy_ ## classname ## _3d (&aspect::PrescribedDilation::Manager<3>::register_dilation_model, \
243  name, description); \
244  }
245  }
246 }
247 
248 
249 #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.")