ASPECT
quadratic_least_squares.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) 2019-2024 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_quadratic_least_squares_h
16 #define _aspect_particle_interpolator_quadratic_least_squares_h
17 
21 
22 namespace aspect
23 {
24  namespace Particle
25  {
26  namespace Interpolator
27  {
42  template <int dim>
43  class QuadraticLeastSquares : public Interface<dim>, public aspect::SimulatorAccess<dim>
44  {
45  public:
49  std::vector<std::vector<double>>
50  properties_at_points(const ParticleHandler<dim> &particle_handler,
51  const std::vector<Point<dim>> &positions,
52  const ComponentMask &selected_properties,
53  const typename parallel::distributed::Triangulation<dim>::active_cell_iterator &cell) const override;
54 
55  // avoid -Woverloaded-virtual:
57 
61  static
62  void
64 
68  void
69  parse_parameters (ParameterHandler &prm) override;
70 
71  private:
77 
84 
89 
93  double evaluate_interpolation_function(const Vector<double> &coefficients, const Point<dim> &position) const;
94 
99  std::pair<double, double> get_interpolation_bounds(const ::Vector<double> &coefficients) const;
100 
101  /*
102  * Find all points that may contain the minimum or maximum values of the interpolation in the cell.
103  */
104  std::vector<::Point<dim>> get_critical_points(const ::Vector<double> &coefficients) const;
105 
106  };
107  }
108  }
109 }
110 
111 #endif
void parse_parameters(ParameterHandler &prm) override
typename ::Triangulation< dim, spacedim >::active_cell_iterator active_cell_iterator
std::vector<::Point< dim > > get_critical_points(const ::Vector< double > &coefficients) const
double evaluate_interpolation_function(const Vector< double > &coefficients, const Point< dim > &position) const
std::pair< double, double > get_interpolation_bounds(const ::Vector< double > &coefficients) const
static void declare_parameters(ParameterHandler &prm)
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 override