ASPECT
interface.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 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_traction_interface_h
23 #define _aspect_boundary_traction_interface_h
24 
25 #include <aspect/plugins.h>
27 
28 #include <deal.II/base/point.h>
29 #include <deal.II/base/parameter_handler.h>
30 
31 namespace aspect
32 {
39  namespace BoundaryTraction
40  {
41  using namespace dealii;
42 
48  template <int dim>
49  class Interface
50  {
51  public:
56  virtual ~Interface() = default;
57 
63  virtual
64  void
65  initialize ();
66 
78  virtual
79  void
80  update ();
81 
89  virtual
90  Tensor<1,dim>
91  traction (const Point<dim> &position,
92  const Tensor<1,dim> &normal_vector) const;
93 
99  virtual
100  Tensor<1,dim>
101  boundary_traction (const types::boundary_id boundary_indicator,
102  const Point<dim> &position,
103  const Tensor<1,dim> &normal_vector) const;
104 
111  static
112  void
113  declare_parameters (ParameterHandler &prm);
114 
121  virtual
122  void
123  parse_parameters (ParameterHandler &prm);
124 
125  protected:
130  };
131 
132 
133 
134 
151  template <int dim>
152  void
153  register_boundary_traction (const std::string &name,
154  const std::string &description,
155  void (*declare_parameters_function) (ParameterHandler &),
156  Interface<dim> *(*factory_function) ());
157 
168  template <int dim>
170  create_boundary_traction (const std::string &name);
171 
177  template <int dim>
178  std::string
179  get_names ();
180 
187  template <int dim>
188  void
189  declare_parameters (ParameterHandler &prm);
190 
191 
201  template <int dim>
202  void
203  write_plugin_graph (std::ostream &output_stream);
204 
205 
206 
214 #define ASPECT_REGISTER_BOUNDARY_TRACTION_MODEL(classname,name,description) \
215  template class classname<2>; \
216  template class classname<3>; \
217  namespace ASPECT_REGISTER_BOUNDARY_TRACTION_MODEL_ ## classname \
218  { \
219  aspect::internal::Plugins::RegisterHelper<aspect::BoundaryTraction::Interface<2>,classname<2>> \
220  dummy_ ## classname ## _2d (&aspect::BoundaryTraction::register_boundary_traction<2>, \
221  name, description); \
222  aspect::internal::Plugins::RegisterHelper<aspect::BoundaryTraction::Interface<3>,classname<3>> \
223  dummy_ ## classname ## _3d (&aspect::BoundaryTraction::register_boundary_traction<3>, \
224  name, description); \
225  }
226  }
227 }
228 
229 
230 #endif
Interface< dim > * create_boundary_traction(const std::string &name)
void write_plugin_graph(std::ostream &output_stream)
void declare_parameters(ParameterHandler &prm)
StructuredDataLookup< dim > DEAL_II_DEPRECATED
const GeometryModel::Interface< dim > * geometry_model
Definition: interface.h:129
void register_boundary_traction(const std::string &name, const std::string &description, void(*declare_parameters_function)(ParameterHandler &), Interface< dim > *(*factory_function)())