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) 2015-2025 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 #ifndef _aspect_particle_integrator_interface_h
16 #define _aspect_particle_integrator_interface_h
17 
19 #include <aspect/global.h>
20 
24 
25 namespace aspect
26 {
27  namespace Particle
28  {
29  namespace Integrator
30  {
31  using namespace ::Particles;
32 
39  template <int dim>
41  {
42  public:
62  virtual
63  void
65  const typename ParticleHandler<dim>::particle_iterator &end_particle,
66  const std::vector<Tensor<1,dim>> &old_velocities,
67  const std::vector<Tensor<1,dim>> &velocities,
68  const double dt) = 0;
69 
80  virtual bool new_integration_step();
81 
94  virtual std::size_t get_data_size() const;
95 
105  virtual std::array<bool, 3> required_solution_vectors() const = 0;
106 
119  virtual
120  const void *
121  read_data(const typename ParticleHandler<dim>::particle_iterator &particle,
122  const void *data);
123 
136  virtual
137  void *
138  write_data(const typename ParticleHandler<dim>::particle_iterator &particle,
139  void *data) const;
140  };
141 
142 
147  std::string
149 
150 
166  template <int dim>
167  void
168  register_particle_integrator (const std::string &name,
169  const std::string &description,
170  void (*declare_parameters_function) (ParameterHandler &),
171  std::unique_ptr<Interface<dim>> (*factory_function) ());
172 
183  template <int dim>
184  std::unique_ptr<Interface<dim>>
186 
187 
193  template <int dim>
194  void
196 
197 
207  template <int dim>
208  void
209  write_plugin_graph (std::ostream &output_stream);
210 
218 #define ASPECT_REGISTER_PARTICLE_INTEGRATOR(classname, name, description) \
219  template class classname<2>; \
220  template class classname<3>; \
221  namespace ASPECT_REGISTER_PARTICLE_INTEGRATOR_ ## classname \
222  { \
223  aspect::internal::Plugins::RegisterHelper<aspect::Particle::Integrator::Interface<2>,classname<2>> \
224  dummy_ ## classname ## _2d (&aspect::Particle::Integrator::register_particle_integrator<2>, \
225  name, description); \
226  aspect::internal::Plugins::RegisterHelper<aspect::Particle::Integrator::Interface<3>,classname<3>> \
227  dummy_ ## classname ## _3d (&aspect::Particle::Integrator::register_particle_integrator<3>, \
228  name, description); \
229  }
230  }
231  }
232 }
233 
234 
235 #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::vector< index_type > data
std::unique_ptr< Interface< dim > > create_particle_integrator(ParameterHandler &prm)
virtual void local_integrate_step(const typename ParticleHandler< dim >::particle_iterator &begin_particle, const typename ParticleHandler< dim >::particle_iterator &end_particle, const std::vector< Tensor< 1, dim >> &old_velocities, const std::vector< Tensor< 1, dim >> &velocities, const double dt)=0
std::string integrator_object_names()
void write_plugin_graph(std::ostream &output_stream)
virtual void * write_data(const typename ParticleHandler< dim >::particle_iterator &particle, void *data) const
ParticleIterator< dim, spacedim > particle_iterator
virtual std::size_t get_data_size() const
virtual const void * read_data(const typename ParticleHandler< dim >::particle_iterator &particle, const void *data)
static void declare_parameters(ParameterHandler &prm)
virtual std::array< bool, 3 > required_solution_vectors() const =0