ASPECT
newton.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2016 - 2022 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 
22 #ifndef _aspect_newton_h
23 #define _aspect_newton_h
24 
27 #include <aspect/global.h>
29 
30 #include <deal.II/base/signaling_nan.h>
31 
32 namespace aspect
33 {
34  using namespace dealii;
35 
36  namespace MaterialModel
37  {
41  template <int dim>
43  {
44  public:
49  MaterialModelDerivatives (const unsigned int n_points);
50 
54  std::vector<double> viscosity_derivative_wrt_pressure;
55  std::vector<SymmetricTensor<2,dim>> viscosity_derivative_wrt_strain_rate;
56 
57  };
58  }
59 
60 
61  namespace Newton
62  {
63  struct Parameters
64  {
65 
75  {
76  none = 0,
77  symmetric = 1,
78  PD = 2,
79  SPD = symmetric | PD
80  };
81 
82 
88  friend
91  const Stabilization b)
92  {
93  return static_cast<Stabilization>(
94  static_cast<int>(a) | static_cast<int>(b));
95  }
96 
97 
103  friend
105  operator& (const Stabilization a,
106  const Stabilization b)
107  {
108  return static_cast<Stabilization>(
109  static_cast<int>(a) & static_cast<int>(b));
110  }
111 
112 
117  static void declare_parameters (ParameterHandler &prm);
118 
123  void parse_parameters (ParameterHandler &prm);
124 
141 
144 
151 
158 
165  };
166 
167 
172  std::string
173  to_string(const Newton::Parameters::Stabilization preconditioner_stabilization);
174  }
175 
176 
177 
181  template <int dim>
182  class NewtonHandler : public SimulatorAccess<dim>
183  {
184  public:
190  void set_assemblers (Assemblers::Manager<dim> &assemblers) const;
191 
197  static void create_material_model_outputs(MaterialModel::MaterialModelOutputs<dim> &output);
198 
204  };
205 
206 
207  namespace Assemblers
208  {
213  template <int dim>
215  public SimulatorAccess<dim>
216  {
217  public:
223  void
224  create_additional_material_model_outputs(MaterialModel::MaterialModelOutputs<dim> &outputs) const override;
225  };
226 
230  template <int dim>
232  {
233  public:
234  void
235  execute (internal::Assembly::Scratch::ScratchBase<dim> &scratch_base,
236  internal::Assembly::CopyData::CopyDataBase<dim> &data_base) const override;
237  };
238 
243  template <int dim>
245  {
246  public:
247  void
248  execute (internal::Assembly::Scratch::ScratchBase<dim> &scratch_base,
249  internal::Assembly::CopyData::CopyDataBase<dim> &data_base) const override;
250 
256  void create_additional_material_model_outputs(MaterialModel::MaterialModelOutputs<dim> &outputs) const override;
257  };
258 
263  template <int dim>
265  public SimulatorAccess<dim>
266  {
267  public:
268  void
269  execute(internal::Assembly::Scratch::ScratchBase<dim> &scratch_base,
270  internal::Assembly::CopyData::CopyDataBase<dim> &data_base) const override;
271  };
272 
279  template <int dim>
281  public SimulatorAccess<dim>
282  {
283  public:
284  void
285  execute(internal::Assembly::Scratch::ScratchBase<dim> &scratch_base,
286  internal::Assembly::CopyData::CopyDataBase<dim> &data_base) const override;
287  };
288 
297  template <int dim>
299  public SimulatorAccess<dim>
300  {
301  public:
302  void
303  execute(internal::Assembly::Scratch::ScratchBase<dim> &scratch_base,
304  internal::Assembly::CopyData::CopyDataBase<dim> &data_base) const override;
305  };
306 
313  template <int dim>
315  public SimulatorAccess<dim>
316  {
317  public:
318  void
319  execute(internal::Assembly::Scratch::ScratchBase<dim> &scratch_base,
320  internal::Assembly::CopyData::CopyDataBase<dim> &data_base) const override;
321  };
322 
331  template <int dim>
333  public SimulatorAccess<dim>
334  {
335  public:
336  void
339  };
340  }
341 }
342 
343 #endif
unsigned int max_pre_newton_nonlinear_iterations
Definition: newton.h:160
bool use_newton_residual_scaling_method
Definition: newton.h:162
double maximum_linear_stokes_solver_tolerance
Definition: newton.h:163
double nonlinear_switch_tolerance
Definition: newton.h:157
std::string to_string(const Newton::Parameters::Stabilization preconditioner_stabilization)
bool use_Eisenstat_Walker_method_for_Picard_iterations
Definition: newton.h:159
Stabilization preconditioner_stabilization
Definition: newton.h:142
std::vector< SymmetricTensor< 2, dim > > viscosity_derivative_wrt_strain_rate
Definition: newton.h:55
void declare_parameters(ParameterHandler &prm)
Stabilization velocity_block_stabilization
Definition: newton.h:143
double newton_derivative_scaling_factor
Definition: newton.h:140
Newton::Parameters parameters
Definition: newton.h:203
Dependence operator|(const Dependence d1, const Dependence d2)
Definition: interface.h:101
Definition: compat.h:42
unsigned int max_newton_line_search_iterations
Definition: newton.h:161
std::vector< double > viscosity_derivative_wrt_pressure
Definition: newton.h:54