ASPECT
interface.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2015 - 2025 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_interpolator_interface_h
22 #define _aspect_particle_interpolator_interface_h
23 
25 #include <aspect/global.h>
26 
29 #include <deal.II/base/point.h>
33 
34 namespace aspect
35 {
36  namespace Particle
37  {
38  namespace Interpolator
39  {
40  using namespace ::Particles;
41 
48  template <int dim>
50  {
51  public:
77  virtual
78  std::vector<std::vector<double>>
79  properties_at_points(const ParticleHandler<dim> &particle_handler,
80  const std::vector<Point<dim>> &positions,
81  const ComponentMask &selected_properties,
83  };
84 
85 
93  template <int dim>
94  std::string
96 
97 
113  template <int dim>
114  void
115  register_particle_interpolator (const std::string &name,
116  const std::string &description,
117  void (*declare_parameters_function) (ParameterHandler &),
118  std::unique_ptr<Interface<dim>> (*factory_function) ());
119 
120 
131  template <int dim>
132  std::unique_ptr<Interface<dim>>
133  create_particle_interpolator (const std::string &interpolator_name);
134 
135 
147  template <int dim>
148  std::unique_ptr<Interface<dim>>
150 
151 
157  template <int dim>
158  void
160 
161 
171  template <int dim>
172  void
173  write_plugin_graph (std::ostream &output_stream);
174 
182 #define ASPECT_REGISTER_PARTICLE_INTERPOLATOR(classname, name, description) \
183  template class classname<2>; \
184  template class classname<3>; \
185  namespace ASPECT_REGISTER_PARTICLE_INTERPOLATOR_ ## classname \
186  { \
187  aspect::internal::Plugins::RegisterHelper<aspect::Particle::Interpolator::Interface<2>,classname<2>> \
188  dummy_ ## classname ## _2d (&aspect::Particle::Interpolator::register_particle_interpolator<2>, \
189  name, description); \
190  aspect::internal::Plugins::RegisterHelper<aspect::Particle::Interpolator::Interface<3>,classname<3>> \
191  dummy_ ## classname ## _3d (&aspect::Particle::Interpolator::register_particle_interpolator<3>, \
192  name, description); \
193  }
194  }
195  }
196 }
197 
198 
199 #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)