ASPECT
interface.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2015 - 2024 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 
27 #include <deal.II/particles/particle.h>
28 #include <deal.II/particles/particle_handler.h>
29 #include <deal.II/base/point.h>
30 #include <deal.II/base/parameter_handler.h>
31 #include <deal.II/distributed/tria.h>
32 #include <deal.II/fe/component_mask.h>
33 
34 namespace aspect
35 {
36  namespace Particle
37  {
38  namespace Interpolator
39  {
40  using namespace dealii;
41  using namespace ::Particles;
42 
49  template <int dim>
51  {
52  public:
78  virtual
79  std::vector<std::vector<double>>
80  properties_at_points(const ParticleHandler<dim> &particle_handler,
81  const std::vector<Point<dim>> &positions,
82  const ComponentMask &selected_properties,
83  const typename parallel::distributed::Triangulation<dim>::active_cell_iterator &cell) const = 0;
84  };
85 
86 
91  std::string
93 
94 
110  template <int dim>
111  void
112  register_particle_interpolator (const std::string &name,
113  const std::string &description,
114  void (*declare_parameters_function) (ParameterHandler &),
115  std::unique_ptr<Interface<dim>> (*factory_function) ());
116 
127  template <int dim>
128  std::unique_ptr<Interface<dim>>
129  create_particle_interpolator (ParameterHandler &prm);
130 
131 
137  template <int dim>
138  void
139  declare_parameters (ParameterHandler &prm);
140 
141 
151  template <int dim>
152  void
153  write_plugin_graph (std::ostream &output_stream);
154 
162 #define ASPECT_REGISTER_PARTICLE_INTERPOLATOR(classname, name, description) \
163  template class classname<2>; \
164  template class classname<3>; \
165  namespace ASPECT_REGISTER_PARTICLE_INTERPOLATOR_ ## classname \
166  { \
167  aspect::internal::Plugins::RegisterHelper<aspect::Particle::Interpolator::Interface<2>,classname<2>> \
168  dummy_ ## classname ## _2d (&aspect::Particle::Interpolator::register_particle_interpolator<2>, \
169  name, description); \
170  aspect::internal::Plugins::RegisterHelper<aspect::Particle::Interpolator::Interface<3>,classname<3>> \
171  dummy_ ## classname ## _3d (&aspect::Particle::Interpolator::register_particle_interpolator<3>, \
172  name, description); \
173  }
174  }
175  }
176 }
177 
178 
179 #endif
std::unique_ptr< Interface< dim > > create_particle_interpolator(ParameterHandler &prm)
void write_plugin_graph(std::ostream &output_stream)
std::string interpolator_object_names()
Definition: compat.h:59
void declare_parameters(ParameterHandler &prm)
Definition: compat.h:42
void register_particle_interpolator(const std::string &name, const std::string &description, void(*declare_parameters_function)(ParameterHandler &), std::unique_ptr< Interface< dim >>(*factory_function)())