ASPECT
lateral_averaging.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) 2011-2025 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 
16 #ifndef _aspect_lateral_averaging_h
17 #define _aspect_lateral_averaging_h
18 
20 
21 #include <deal.II/fe/fe_values.h>
22 
23 namespace aspect
24 {
25  namespace internal
26  {
35  template <int dim>
37  {
38  public:
43  virtual
44  bool
46 
51  virtual
52  void
53  create_additional_material_model_outputs (const unsigned int n_points,
55 
60  virtual
61  void
62  setup(const unsigned int q_points);
63 
71  virtual
72  void
75  const FEValues<dim> &fe_values,
76  const LinearAlgebra::BlockVector &solution,
77  std::vector<double> &output) = 0;
78 
82  virtual
83  ~FunctorBase();
84  };
85  }
86 
101  template <int dim>
102  class LateralAveraging : public SimulatorAccess<dim>
103  {
104  public:
121  std::vector<std::vector<double>>
122  compute_lateral_averages(const unsigned int n_slices,
123  const std::vector<std::string> &property_names) const;
124 
147  std::vector<std::vector<double>>
148  compute_lateral_averages(const std::vector<double> &depth_bounds,
149  const std::vector<std::string> &property_names) const;
150 
181  std::vector<std::vector<double>>
182  compute_lateral_averages(const std::vector<double> &depth_bounds,
183  std::vector<std::unique_ptr<internal::FunctorBase<dim>>> &functors) const;
184 
194  void
195  get_density_averages(std::vector<double> &values) const;
196 
206  void
207  get_temperature_averages(std::vector<double> &values) const;
208 
221  void
222  get_composition_averages(const unsigned int composition_index,
223  std::vector<double> &values) const;
224 
232  void
233  get_viscosity_averages(std::vector<double> &values) const;
234 
242  void
243  get_log_viscosity_averages(std::vector<double> &values) const;
244 
252  void
253  get_velocity_magnitude_averages(std::vector<double> &values) const;
254 
262  void
263  get_sinking_velocity_averages(std::vector<double> &values) const;
264 
272  void
273  get_rising_velocity_averages(std::vector<double> &values) const;
274 
282  void
283  get_Vs_averages(std::vector<double> &values) const;
284 
292  void
293  get_Vp_averages(std::vector<double> &values) const;
294 
303  void
304  get_vertical_heat_flux_averages(std::vector<double> &values) const;
305 
315  void
316  get_vertical_mass_flux_averages(std::vector<double> &values) const;
317  };
318 }
319 
320 
321 #endif
virtual void create_additional_material_model_outputs(const unsigned int n_points, MaterialModel::MaterialModelOutputs< dim > &outputs) const
virtual void operator()(const MaterialModel::MaterialModelInputs< dim > &in, const MaterialModel::MaterialModelOutputs< dim > &out, const FEValues< dim > &fe_values, const LinearAlgebra::BlockVector &solution, std::vector< double > &output)=0
virtual bool need_material_properties() const
virtual void setup(const unsigned int q_points)