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 
23 #ifndef _aspect_prescribed_stokes_solution_interface_h
24 #define _aspect_prescribed_stokes_solution_interface_h
25 
26 #include <aspect/plugins.h>
27 
28 #include <deal.II/base/point.h>
29 #include <deal.II/base/parameter_handler.h>
30 
31 #include <deal.II/base/function.h>
32 
33 namespace aspect
34 {
41  namespace PrescribedStokesSolution
42  {
43  using namespace dealii;
44 
55  template <int dim>
57  {
58  public:
65  virtual
66  void stokes_solution (const Point<dim> &p, Vector<double> &value) const = 0;
67  };
68 
69 
70 
71 
88  template <int dim>
89  void
90  register_prescribed_stokes_solution_model (const std::string &name,
91  const std::string &description,
92  void (*declare_parameters_function) (ParameterHandler &),
93  std::unique_ptr<Interface<dim>> (*factory_function) ());
94 
105  template <int dim>
106  std::unique_ptr<Interface<dim>>
107  create_prescribed_stokes_solution (ParameterHandler &prm);
108 
109 
116  template <int dim>
117  void
118  declare_parameters (ParameterHandler &prm);
119 
120 
130  template <int dim>
131  void
132  write_plugin_graph (std::ostream &output_stream);
133 
134 
135 
143 #define ASPECT_REGISTER_PRESCRIBED_STOKES_SOLUTION(classname,name,description) \
144  template class classname<2>; \
145  template class classname<3>; \
146  namespace ASPECT_REGISTER_PRESCRIBED_STOKES_SOLUTION_ ## classname \
147  { \
148  aspect::internal::Plugins::RegisterHelper<aspect::PrescribedStokesSolution::Interface<2>,classname<2>> \
149  dummy_ ## classname ## _2d (&aspect::PrescribedStokesSolution::register_prescribed_stokes_solution_model<2>, \
150  name, description); \
151  aspect::internal::Plugins::RegisterHelper<aspect::PrescribedStokesSolution::Interface<3>,classname<3>> \
152  dummy_ ## classname ## _3d (&aspect::PrescribedStokesSolution::register_prescribed_stokes_solution_model<3>, \
153  name, description); \
154  }
155  }
156 }
157 
158 
159 #endif
void register_prescribed_stokes_solution_model(const std::string &name, const std::string &description, void(*declare_parameters_function)(ParameterHandler &), std::unique_ptr< Interface< dim >>(*factory_function)())
Definition: compat.h:59
void declare_parameters(ParameterHandler &prm)
std::unique_ptr< Interface< dim > > create_prescribed_stokes_solution(ParameterHandler &prm)
void write_plugin_graph(std::ostream &output_stream)
Definition: compat.h:42