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-2026 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_interpolator_interface_h
16 #define _aspect_particle_interpolator_interface_h
17 
19 #include <aspect/global.h>
20 
23 #include <deal.II/base/point.h>
27 
28 namespace aspect
29 {
30  namespace Particle
31  {
32  namespace Interpolator
33  {
34  using namespace ::Particles;
35 
42  template <int dim>
44  {
45  public:
71  virtual
72  std::vector<std::vector<double>>
73  properties_at_points(const ParticleHandler<dim> &particle_handler,
74  const std::vector<Point<dim>> &positions,
75  const ComponentMask &selected_properties,
77  };
78 
79 
87  template <int dim>
88  std::string
90 
91 
107  template <int dim>
108  void
109  register_particle_interpolator (const std::string &name,
110  const std::string &description,
111  void (*declare_parameters_function) (ParameterHandler &),
112  std::unique_ptr<Interface<dim>> (*factory_function) ());
113 
114 
125  template <int dim>
126  std::unique_ptr<Interface<dim>>
127  create_particle_interpolator (const std::string &interpolator_name);
128 
129 
141  template <int dim>
142  std::unique_ptr<Interface<dim>>
144 
145 
151  template <int dim>
152  void
154 
155 
165  template <int dim>
166  void
167  write_plugin_graph (std::ostream &output_stream);
168 
176 #define ASPECT_REGISTER_PARTICLE_INTERPOLATOR(classname, name, description) \
177  template class classname<2>; \
178  template class classname<3>; \
179  namespace ASPECT_REGISTER_PARTICLE_INTERPOLATOR_ ## classname \
180  { \
181  aspect::internal::Plugins::RegisterHelper<aspect::Particle::Interpolator::Interface<2>,classname<2>> \
182  dummy_ ## classname ## _2d (&aspect::Particle::Interpolator::register_particle_interpolator<2>, \
183  name, description); \
184  aspect::internal::Plugins::RegisterHelper<aspect::Particle::Interpolator::Interface<3>,classname<3>> \
185  dummy_ ## classname ## _3d (&aspect::Particle::Interpolator::register_particle_interpolator<3>, \
186  name, description); \
187  }
188  }
189  }
190 }
191 
192 
193 #endif
typename ::Triangulation< dim, spacedim >::active_cell_iterator active_cell_iterator
std::string get_valid_interpolator_names_pattern()
virtual std::vector< std::vector< double > > properties_at_points(const ParticleHandler< dim > &particle_handler, const std::vector< Point< dim >> &positions, const ComponentMask &selected_properties, const typename parallel::distributed::Triangulation< dim >::active_cell_iterator &cell) const =0
void write_plugin_graph(std::ostream &output_stream)
void register_particle_interpolator(const std::string &name, const std::string &description, void(*declare_parameters_function)(ParameterHandler &), std::unique_ptr< Interface< dim >>(*factory_function)())
static void declare_parameters(ParameterHandler &prm)
std::unique_ptr< Interface< dim > > create_particle_interpolator(const std::string &interpolator_name)