ASPECT
quadratic_least_squares.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2019 - 2022-2020 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_quadratic_least_squares_h
22 #define _aspect_particle_interpolator_quadratic_least_squares_h
23 
27 #include <deal.II/lac/lapack_full_matrix.h>
28 
29 namespace aspect
30 {
31  namespace Particle
32  {
33  namespace Interpolator
34  {
49  template <int dim>
50  class QuadraticLeastSquares : public Interface<dim>, public aspect::SimulatorAccess<dim>
51  {
52  public:
56  std::vector<std::vector<double>>
57  properties_at_points(const ParticleHandler<dim> &particle_handler,
58  const std::vector<Point<dim>> &positions,
59  const ComponentMask &selected_properties,
60  const typename parallel::distributed::Triangulation<dim>::active_cell_iterator &cell) const override;
61 
62  // avoid -Woverloaded-virtual:
64 
68  static
69  void
70  declare_parameters (ParameterHandler &prm);
71 
75  void
76  parse_parameters (ParameterHandler &prm) override;
77 
78  private:
84 
91 
96 
100  double evaluate_interpolation_function(const Vector<double> &coefficients, const Point<dim> &position) const;
101 
106  std::pair<double, double> get_interpolation_bounds(const ::Vector<double> &coefficients) const;
107 
108  /*
109  * Find all points that may contain the minimum or maximum values of the interpolation in the cell.
110  */
111  std::vector<::Point<dim>> get_critical_points(const ::Vector<double> &coefficients) const;
112 
113  };
114  }
115  }
116 }
117 
118 #endif
void parse_parameters(ParameterHandler &prm) override
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