ASPECT
newton.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2016 - 2024 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 
31 
32 namespace aspect
33 {
34  namespace MaterialModel
35  {
39  template <int dim>
41  {
42  public:
47  MaterialModelDerivatives (const unsigned int n_points);
48 
52  std::vector<double> viscosity_derivative_wrt_pressure;
53 
57  std::vector<SymmetricTensor<2,dim>> viscosity_derivative_wrt_strain_rate;
58 
64 
71  std::vector<double> dilation_derivative_wrt_pressure;
72 
76  std::vector<SymmetricTensor<2,dim>> dilation_derivative_wrt_strain_rate;
77  };
78  }
79 
80 
81  namespace Newton
82  {
83  struct Parameters
84  {
85 
95  {
96  none = 0,
97  symmetric = 1,
98  PD = 2,
99  SPD = symmetric | PD
100  };
101 
102 
108  friend
111  const Stabilization b)
112  {
113  return static_cast<Stabilization>(
114  static_cast<int>(a) | static_cast<int>(b));
115  }
116 
117 
123  friend
126  const Stabilization b)
127  {
128  return static_cast<Stabilization>(
129  static_cast<int>(a) & static_cast<int>(b));
130  }
131 
132 
138 
144 
161 
164 
171 
178 
185  };
186 
187 
192  std::string
193  to_string(const Newton::Parameters::Stabilization preconditioner_stabilization);
194  }
195 
196 
197 
201  template <int dim>
202  class NewtonHandler : public SimulatorAccess<dim>
203  {
204  public:
210  void set_assemblers (Assemblers::Manager<dim> &assemblers) const;
211 
218 
224  };
225 
226 
227  namespace Assemblers
228  {
233  template <int dim>
235  public SimulatorAccess<dim>
236  {
237  public:
243  void
245  };
246 
250  template <int dim>
252  {
253  public:
254  void
256  internal::Assembly::CopyData::CopyDataBase<dim> &data_base) const override;
257 
263  };
264 
268  template <int dim>
270  {
271  public:
272  void
274  internal::Assembly::CopyData::CopyDataBase<dim> &data_base) const override;
275  };
276 
281  template <int dim>
283  {
284  public:
285  void
287  internal::Assembly::CopyData::CopyDataBase<dim> &data_base) const override;
288 
295  };
296 
301  template <int dim>
303  public SimulatorAccess<dim>
304  {
305  public:
306  void
308  internal::Assembly::CopyData::CopyDataBase<dim> &data_base) const override;
309  };
310  }
311 }
312 
313 #endif
void create_additional_material_model_outputs(MaterialModel::MaterialModelOutputs< dim > &outputs) const override
void execute(internal::Assembly::Scratch::ScratchBase< dim > &scratch_base, internal::Assembly::CopyData::CopyDataBase< dim > &data_base) const override
void execute(internal::Assembly::Scratch::ScratchBase< dim > &scratch_base, internal::Assembly::CopyData::CopyDataBase< dim > &data_base) const override
void create_additional_material_model_outputs(MaterialModel::MaterialModelOutputs< dim > &outputs) const override
void execute(internal::Assembly::Scratch::ScratchBase< dim > &scratch_base, internal::Assembly::CopyData::CopyDataBase< dim > &data_base) const override
void create_additional_material_model_outputs(MaterialModel::MaterialModelOutputs< dim > &outputs) const override
void execute(internal::Assembly::Scratch::ScratchBase< dim > &scratch_base, internal::Assembly::CopyData::CopyDataBase< dim > &data_base) const override
MaterialModelDerivatives(const unsigned int n_points)
std::vector< double > dilation_derivative_wrt_pressure
Definition: newton.h:71
std::vector< double > viscosity_derivative_averaging_weights
Definition: newton.h:63
std::vector< SymmetricTensor< 2, dim > > dilation_derivative_wrt_strain_rate
Definition: newton.h:76
std::vector< double > viscosity_derivative_wrt_pressure
Definition: newton.h:52
std::vector< SymmetricTensor< 2, dim > > viscosity_derivative_wrt_strain_rate
Definition: newton.h:57
Newton::Parameters parameters
Definition: newton.h:223
static void create_material_model_outputs(MaterialModel::MaterialModelOutputs< dim > &output)
void set_assemblers(Assemblers::Manager< dim > &assemblers) const
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
std::string to_string(const Newton::Parameters::Stabilization preconditioner_stabilization)
bool use_newton_residual_scaling_method
Definition: newton.h:182
void parse_parameters(ParameterHandler &prm)
friend Stabilization operator|(const Stabilization a, const Stabilization b)
Definition: newton.h:110
static void declare_parameters(ParameterHandler &prm)
double newton_derivative_scaling_factor
Definition: newton.h:160
friend Stabilization operator&(const Stabilization a, const Stabilization b)
Definition: newton.h:125
bool use_Eisenstat_Walker_method_for_Picard_iterations
Definition: newton.h:179
unsigned int max_pre_newton_nonlinear_iterations
Definition: newton.h:180
double maximum_linear_stokes_solver_tolerance
Definition: newton.h:183
Stabilization velocity_block_stabilization
Definition: newton.h:163
unsigned int max_newton_line_search_iterations
Definition: newton.h:181
double nonlinear_switch_tolerance
Definition: newton.h:177
Stabilization preconditioner_stabilization
Definition: newton.h:162