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 #ifndef _aspect_particle_integrator_interface_h
22 #define _aspect_particle_integrator_interface_h
23 
25 #include <aspect/global.h>
26 
27 #include <deal.II/particles/particle.h>
28 #include <deal.II/particles/particle_handler.h>
29 #include <deal.II/base/parameter_handler.h>
30 
31 namespace aspect
32 {
33  namespace Particle
34  {
35  namespace Integrator
36  {
37  using namespace dealii;
38  using namespace ::Particles;
39 
46  template <int dim>
48  {
49  public:
69  virtual
70  void
71  local_integrate_step(const typename ParticleHandler<dim>::particle_iterator &begin_particle,
72  const typename ParticleHandler<dim>::particle_iterator &end_particle,
73  const std::vector<Tensor<1,dim>> &old_velocities,
74  const std::vector<Tensor<1,dim>> &velocities,
75  const double dt) = 0;
76 
87  virtual bool new_integration_step();
88 
101  virtual std::size_t get_data_size() const;
102 
112  virtual std::array<bool, 3> required_solution_vectors() const = 0;
113 
126  virtual
127  const void *
128  read_data(const typename ParticleHandler<dim>::particle_iterator &particle,
129  const void *data);
130 
143  virtual
144  void *
145  write_data(const typename ParticleHandler<dim>::particle_iterator &particle,
146  void *data) const;
147  };
148 
149 
154  std::string
156 
157 
173  template <int dim>
174  void
175  register_particle_integrator (const std::string &name,
176  const std::string &description,
177  void (*declare_parameters_function) (ParameterHandler &),
178  std::unique_ptr<Interface<dim>> (*factory_function) ());
179 
190  template <int dim>
191  std::unique_ptr<Interface<dim>>
192  create_particle_integrator (ParameterHandler &prm);
193 
194 
200  template <int dim>
201  void
202  declare_parameters (ParameterHandler &prm);
203 
204 
214  template <int dim>
215  void
216  write_plugin_graph (std::ostream &output_stream);
217 
225 #define ASPECT_REGISTER_PARTICLE_INTEGRATOR(classname, name, description) \
226  template class classname<2>; \
227  template class classname<3>; \
228  namespace ASPECT_REGISTER_PARTICLE_INTEGRATOR_ ## classname \
229  { \
230  aspect::internal::Plugins::RegisterHelper<aspect::Particle::Integrator::Interface<2>,classname<2>> \
231  dummy_ ## classname ## _2d (&aspect::Particle::Integrator::register_particle_integrator<2>, \
232  name, description); \
233  aspect::internal::Plugins::RegisterHelper<aspect::Particle::Integrator::Interface<3>,classname<3>> \
234  dummy_ ## classname ## _3d (&aspect::Particle::Integrator::register_particle_integrator<3>, \
235  name, description); \
236  }
237  }
238  }
239 }
240 
241 
242 #endif
void register_particle_integrator(const std::string &name, const std::string &description, void(*declare_parameters_function)(ParameterHandler &), std::unique_ptr< Interface< dim >>(*factory_function)())
std::unique_ptr< Interface< dim > > create_particle_integrator(ParameterHandler &prm)
std::string integrator_object_names()
void write_plugin_graph(std::ostream &output_stream)
void declare_parameters(ParameterHandler &prm)
Definition: compat.h:59
Definition: compat.h:42