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_heating_model_interface_h
17 #define _aspect_heating_model_interface_h
18 
19 #include <aspect/plugins.h>
22 #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 HeatingModel
41  {
49  {
60  HeatingModelOutputs (const unsigned int n_points,
61  const unsigned int n_comp);
62 
70  std::vector<double> heating_source_terms;
71 
91  std::vector<double> rates_of_temperature_change;
92 
97  std::vector<double> lhs_latent_heat_terms;
98 
104  void
105  reset ();
106  };
107 
113  template <int dim>
115  {
116  public:
129  virtual
130  void
131  evaluate (const MaterialModel::MaterialModelInputs<dim> &material_model_inputs,
132  const MaterialModel::MaterialModelOutputs<dim> &material_model_outputs,
133  HeatingModel::HeatingModelOutputs &heating_model_outputs) const = 0;
134 
141  virtual
142  void
143  create_additional_material_model_outputs(MaterialModel::MaterialModelOutputs<dim> &outputs) const;
144 
151  virtual
152  void
153  create_additional_material_model_inputs(MaterialModel::MaterialModelInputs<dim> &inputs) const;
154 
159  virtual
161  get_required_properties() const;
162  };
163 
164 
171  template <int dim>
172  class Manager : public Plugins::ManagerBase<Interface<dim>>, public SimulatorAccess<dim>
173  {
174  public:
179  bool
180  adiabatic_heating_enabled() const;
181 
186  bool
187  shear_heating_enabled() const;
188 
193  static
194  void
196 
197 
203  void
204  parse_parameters (ParameterHandler &prm) override;
205 
211  void
212  evaluate (const MaterialModel::MaterialModelInputs<dim> &material_model_inputs,
213  const MaterialModel::MaterialModelOutputs<dim> &material_model_outputs,
214  HeatingModel::HeatingModelOutputs &heating_model_outputs) const;
215 
221  virtual
222  void
223  create_additional_material_model_inputs_and_outputs(MaterialModel::MaterialModelInputs<dim> &material_model_inputs,
224  MaterialModel::MaterialModelOutputs<dim> &material_model_outputs) const;
225 
226 
246  static
247  void
248  register_heating_model (const std::string &name,
249  const std::string &description,
250  void (*declare_parameters_function) (ParameterHandler &),
251  std::unique_ptr<Interface<dim>> (*factory_function) ());
252 
253 
262  const std::vector<std::string> &
263  get_active_heating_model_names () const;
264 
273  const std::list<std::unique_ptr<Interface<dim>>> &
274  get_active_heating_models () const;
275 
290  template <typename HeatingModelType,
291  typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,HeatingModelType>::value>>
293  bool
294  has_matching_heating_model () const;
295 
312  template <typename HeatingModelType,
313  typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,HeatingModelType>::value>>
315  const HeatingModelType &
316  get_matching_heating_model () const;
317 
318 
328  static
329  void
330  write_plugin_graph (std::ostream &output_stream);
331 
335  DeclException1 (ExcHeatingModelNameNotFound,
336  std::string,
337  << "Could not find entry <"
338  << arg1
339  << "> among the names of registered heating model objects.");
340  };
341 
342 
343 
344  template <int dim>
345  template <typename HeatingModelType, typename>
346  inline
347  bool
349  {
350  return this->template has_matching_active_plugin<HeatingModelType>();
351  }
352 
353 
354  template <int dim>
355  template <typename HeatingModelType, typename>
356  inline
357  const HeatingModelType &
359  {
360  return this->template get_matching_active_plugin<HeatingModelType>();
361  }
362 
363 
370  template <int dim>
371  std::string
373 
374 
382 #define ASPECT_REGISTER_HEATING_MODEL(classname,name,description) \
383  template class classname<2>; \
384  template class classname<3>; \
385  namespace ASPECT_REGISTER_HEATING_MODEL_ ## classname \
386  { \
387  aspect::internal::Plugins::RegisterHelper<aspect::HeatingModel::Interface<2>,classname<2>> \
388  dummy_ ## classname ## _2d (&aspect::HeatingModel::Manager<2>::register_heating_model, \
389  name, description); \
390  aspect::internal::Plugins::RegisterHelper<aspect::HeatingModel::Interface<3>,classname<3>> \
391  dummy_ ## classname ## _3d (&aspect::HeatingModel::Manager<3>::register_heating_model, \
392  name, description); \
393  }
394  }
395 }
396 
397 
398 #endif
std::vector< double > heating_source_terms
Definition: interface.h:70
std::vector< double > rates_of_temperature_change
Definition: interface.h:91
DEAL_II_DEPRECATED bool has_matching_heating_model() const
DEAL_II_DEPRECATED const HeatingModelType & get_matching_heating_model() const
void write_plugin_graph(std::ostream &output_stream)
std::string get_valid_model_names_pattern()
HeatingModelOutputs(const unsigned int n_points, const unsigned int n_comp)
std::vector< double > lhs_latent_heat_terms
Definition: interface.h:97
void declare_parameters(ParameterHandler &prm)
#define DEAL_II_DEPRECATED
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.")