ASPECT
newton.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2016 - 2019 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
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:
218  virtual ~NewtonInterface () {};
219 
225  virtual
226  void
227  create_additional_material_model_outputs(MaterialModel::MaterialModelOutputs<dim> &outputs) const;
228  };
229 
233  template <int dim>
235  {
236  public:
238 
239  void
240  execute (internal::Assembly::Scratch::ScratchBase<dim> &scratch_base,
242  };
243 
248  template <int dim>
250  {
251  public:
253 
254  void
255  execute (internal::Assembly::Scratch::ScratchBase<dim> &scratch_base,
257  };
258 
263  template <int dim>
265  public SimulatorAccess<dim>
266  {
267  public:
269 
270  virtual
271  void
272  execute(internal::Assembly::Scratch::ScratchBase<dim> &scratch_base,
274  };
275 
282  template <int dim>
284  public SimulatorAccess<dim>
285  {
286  public:
288 
289  virtual
290  void
291  execute(internal::Assembly::Scratch::ScratchBase<dim> &scratch_base,
293  };
294 
303  template <int dim>
305  public SimulatorAccess<dim>
306  {
307  public:
309 
310  virtual
311  void
312  execute(internal::Assembly::Scratch::ScratchBase<dim> &scratch_base,
314  };
315 
322  template <int dim>
324  public SimulatorAccess<dim>
325  {
326  public:
328 
329  virtual
330  void
331  execute(internal::Assembly::Scratch::ScratchBase<dim> &scratch_base,
333  };
334  }
335 }
336 
337 #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
UpdateFlags operator|(const UpdateFlags f1, const UpdateFlags f2)
std::vector< SymmetricTensor< 2, dim > > viscosity_derivative_wrt_strain_rate
Definition: newton.h:55
UpdateFlags operator&(const UpdateFlags f1, const UpdateFlags f2)
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
Definition: compat.h:37
unsigned int max_newton_line_search_iterations
Definition: newton.h:161
std::vector< double > viscosity_derivative_wrt_pressure
Definition: newton.h:54