ASPECT
interface.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2015 - 2022 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_boundary_heat_flux_interface_h
23 #define _aspect_boundary_heat_flux_interface_h
24 
25 #include <aspect/plugins.h>
27 
28 namespace aspect
29 {
36  namespace BoundaryHeatFlux
37  {
38  using namespace dealii;
39 
45  template <int dim>
46  class Interface
47  {
48  public:
53  virtual ~Interface() = default;
54 
60  virtual void initialize ();
61 
73  virtual
74  void
75  update ();
76 
92  virtual
93  std::vector<Tensor<1,dim>>
94  heat_flux (const types::boundary_id boundary_indicator,
95  const MaterialModel::MaterialModelInputs<dim> &material_model_inputs,
96  const MaterialModel::MaterialModelOutputs<dim> &material_model_outputs,
97  const std::vector<Tensor<1,dim>> &normal_vectors) const = 0;
98 
105  static
106  void
107  declare_parameters (ParameterHandler &prm);
108 
115  virtual
116  void
117  parse_parameters (ParameterHandler &prm);
118  };
119 
120 
136  template <int dim>
137  void
138  register_boundary_heat_flux (const std::string &name,
139  const std::string &description,
140  void (*declare_parameters_function) (ParameterHandler &),
141  std::unique_ptr<Interface<dim>> (*factory_function) ());
142 
153  template <int dim>
154  std::unique_ptr<Interface<dim>>
155  create_boundary_heat_flux (ParameterHandler &prm);
156 
157 
164  template <int dim>
165  void
166  declare_parameters (ParameterHandler &prm);
167 
168 
178  template <int dim>
179  void
180  write_plugin_graph (std::ostream &output_stream);
181 
182 
190 #define ASPECT_REGISTER_BOUNDARY_HEAT_FLUX_MODEL(classname, name, description) \
191  template class classname<2>; \
192  template class classname<3>; \
193  namespace ASPECT_REGISTER_BOUNDARY_HEAT_FLUX_MODEL_ ## classname \
194  { \
195  aspect::internal::Plugins::RegisterHelper<aspect::BoundaryHeatFlux::Interface<2>,classname<2>> \
196  dummy_ ## classname ## _2d (&aspect::BoundaryHeatFlux::register_boundary_heat_flux<2>, \
197  name, description); \
198  aspect::internal::Plugins::RegisterHelper<aspect::BoundaryHeatFlux::Interface<3>,classname<3>> \
199  dummy_ ## classname ## _3d (&aspect::BoundaryHeatFlux::register_boundary_heat_flux<3>, \
200  name, description); \
201  }
202  }
203 }
204 
205 
206 #endif
std::unique_ptr< Interface< dim > > create_boundary_heat_flux(ParameterHandler &prm)
void write_plugin_graph(std::ostream &output_stream)
void declare_parameters(ParameterHandler &prm)
void register_boundary_heat_flux(const std::string &name, const std::string &description, void(*declare_parameters_function)(ParameterHandler &), std::unique_ptr< Interface< dim >>(*factory_function)())
Definition: compat.h:42