ASPECT
parameters.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 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_parameters_h
23 #define _aspect_parameters_h
24 
25 #include <deal.II/base/parameter_handler.h>
26 
27 #include <aspect/global.h>
29 
30 
31 namespace aspect
32 {
33  using namespace dealii;
34 
35  // forward declaration:
36  namespace GeometryModel
37  {
38  template <int dim>
39  class Interface;
40  }
41 
55  template <int dim>
56  struct Parameters
57  {
58 
64  {
65  enum Kind
66  {
79  no_Advection_no_Stokes
80  };
81  };
82 
83  static
84  bool
86  {
87  return input == NonlinearSolver::iterated_Advection_and_Newton_Stokes ||
88  input == NonlinearSolver::single_Advection_iterated_Newton_Stokes ||
89  input == NonlinearSolver::no_Advection_iterated_defect_correction_Stokes ||
90  input == NonlinearSolver::single_Advection_iterated_defect_correction_Stokes ||
91  input == NonlinearSolver::iterated_Advection_and_defect_correction_Stokes
92  ?
93  true
94  :
95  false;
96  }
97 
102  {
103  enum Kind
104  {
105  none = 0,
106  net_translation_x = 0x1,
107  net_translation_y = 0x2,
108  net_translation_z = 0x4,
109  net_translation = 0x1+0x2+0x4,
110  linear_momentum_x = 0x8,
111  linear_momentum_y = 0x10,
112  linear_momentum_z = 0x20,
113  linear_momentum = linear_momentum_x+linear_momentum_y+linear_momentum_z,
114  net_rotation = 0x40,
115  angular_momentum = 0x80,
116  net_surface_rotation = 0x100,
117  any_translation = net_translation+linear_momentum,
118  any_rotation = net_rotation+angular_momentum+net_surface_rotation,
119  };
120  };
121 
133  {
134  enum Kind
135  {
143  prescribed_field_with_diffusion
144  };
145  };
146 
153  struct Formulation
154  {
161  enum Kind
162  {
166  custom
167  };
168 
173  static
174  Kind
175  parse(const std::string &input)
176  {
177  if (input == "isentropic compression")
178  return Formulation::isentropic_compression;
179  else if (input == "anelastic liquid approximation")
180  return Formulation::anelastic_liquid_approximation;
181  else if (input == "Boussinesq approximation")
182  return Formulation::boussinesq_approximation;
183  else if (input == "custom")
184  return Formulation::custom;
185  else
186  AssertThrow(false, ExcNotImplemented());
187 
188  return Formulation::Kind();
189  }
190 
198  {
203  enum Kind
204  {
211  ask_material_model
212  };
213 
218  static Kind
219  parse(const std::string &input)
220  {
221  if (input == "isentropic compression")
222  return Formulation::MassConservation::isentropic_compression;
223  else if (input == "hydrostatic compression")
224  return Formulation::MassConservation::hydrostatic_compression;
225  else if (input == "reference density profile")
226  return Formulation::MassConservation::reference_density_profile;
227  else if (input == "implicit reference density profile")
228  return Formulation::MassConservation::implicit_reference_density_profile;
229  else if (input == "incompressible")
230  return Formulation::MassConservation::incompressible;
231  else if (input == "projected density field")
232  return Formulation::MassConservation::projected_density_field;
233  else if (input == "ask material model")
234  return Formulation::MassConservation::ask_material_model;
235  else
236  AssertThrow(false, ExcNotImplemented());
237 
239  }
240  };
241 
248  {
253  enum Kind
254  {
256  reference_density_profile
257  };
258 
263  static
264  Kind
265  parse(const std::string &input)
266  {
267  if (input == "real density")
268  return Formulation::TemperatureEquation::real_density;
269  else if (input == "reference density profile")
270  return Formulation::TemperatureEquation::reference_density_profile;
271  else
272  AssertThrow(false, ExcNotImplemented());
273 
275  }
276  };
277  };
278 
283  {
284  enum Kind
285  {
287  supg
288  };
289 
294  static
295  Kind
296  parse(const std::string &input)
297  {
298  if (input == "entropy viscosity")
299  return entropy_viscosity;
300  else if (input == "SUPG")
301  return supg;
302  else
303  AssertThrow(false, ExcNotImplemented());
304 
305  return Kind();
306  }
307 
308  static std::string get_options_string()
309  {
310  return "entropy viscosity|SUPG";
311  }
312  };
313 
319  {
320  enum Kind
321  {
324  block_gmg
325  };
326 
327  static const std::string pattern()
328  {
329  return "block AMG|direct solver|block GMG";
330  }
331 
332  static Kind
333  parse(const std::string &input)
334  {
335  if (input == "block AMG")
336  return block_amg;
337  else if (input == "direct solver")
338  return direct_solver;
339  else if (input == "block GMG")
340  return block_gmg;
341  else
342  AssertThrow(false, ExcNotImplemented());
343 
344  return Kind();
345  }
346  };
347 
353  {
354  enum Kind
355  {
357  idr_s
358  };
359 
360  static const std::string pattern()
361  {
362  return "GMRES|IDR(s)";
363  }
364 
365  static Kind
366  parse(const std::string &input)
367  {
368  if (input == "GMRES")
369  return gmres;
370  else if (input == "IDR(s)")
371  return idr_s;
372  else
373  AssertThrow(false, ExcNotImplemented());
374 
375  return Kind();
376  }
377  };
378 
385  {
389  enum Type
390  {
396  generic,
397  unspecified
398  } type;
399 
404  static
405  Type
406  parse_type(const std::string &input)
407  {
408  if (input == "chemical composition")
409  return CompositionalFieldDescription::chemical_composition;
410  else if (input == "stress")
411  return CompositionalFieldDescription::stress;
412  else if (input == "grain size")
413  return CompositionalFieldDescription::grain_size;
414  else if (input == "porosity")
415  return CompositionalFieldDescription::porosity;
416  else if (input == "density")
418  else if (input == "generic")
419  return CompositionalFieldDescription::generic;
420  else if (input == "unspecified")
421  return CompositionalFieldDescription::unspecified;
422  else
423  AssertThrow(false, ExcNotImplemented());
424 
426  }
427  };
428 
440  Parameters (ParameterHandler &prm,
441  MPI_Comm mpi_communicator);
442 
451  static
452  void declare_parameters (ParameterHandler &prm);
453 
469  void parse_parameters (ParameterHandler &prm,
470  const MPI_Comm mpi_communicator);
471 
488  void parse_geometry_dependent_parameters (ParameterHandler &prm,
489  const GeometryModel::Interface<dim> &geometry_model);
490 
496 
500  double start_time;
501  double CFL_number;
508  std::string output_directory;
515  std::string world_builder_file;
516 
527 
528  // subsection: Advection solver parameters
530 
531  // subsection: Stokes solver parameters
535  unsigned int idr_s_parameter;
536 
544 
545  // subsection: AMG parameters
546  std::string AMG_smoother_type;
547  unsigned int AMG_smoother_sweeps;
550 
551  // subsection: Operator splitting parameters
554 
555  // subsection: Diffusion solver parameters
557 
576 
584 
591 
597 
609 
616  std::map<types::boundary_id, std::pair<std::string,std::string>> prescribed_traction_boundary_indicators;
617 
622  std::set<types::boundary_id> fixed_heat_flux_boundary_indicators;
623 
642  unsigned int min_grid_level;
643  std::vector<double> additional_refinement_times;
658  unsigned int stabilization_alpha;
659  std::vector<double> stabilization_c_R;
660  std::vector<double> stabilization_beta;
667  std::vector<double> global_composition_max_preset;
668  std::vector<double> global_composition_min_preset;
669 
694  unsigned int temperature_degree;
695  unsigned int composition_degree;
698 
709 
719  std::vector<std::string> names_of_compositional_fields;
720  std::vector<CompositionalFieldDescription> composition_descriptions;
721 
726  std::vector<typename AdvectionFieldMethod::Kind> compositional_field_methods;
727 
737  std::map<unsigned int, std::pair<std::string,unsigned int>> mapped_particle_properties;
738 
739  std::vector<unsigned int> normalized_fields;
762  };
763 
764 }
765 #endif
The NullspaceRemoval struct.
Definition: parameters.h:101
bool use_full_A_block_preconditioner
Definition: parameters.h:541
unsigned int min_grid_level
Definition: parameters.h:642
unsigned int n_expensive_stokes_solver_steps
Definition: parameters.h:539
std::vector< double > global_composition_min_preset
Definition: parameters.h:668
unsigned int composition_degree
Definition: parameters.h:695
static Kind parse(const std::string &input)
Definition: parameters.h:366
double linear_stokes_solver_tolerance
Definition: parameters.h:537
unsigned int n_cheap_stokes_solver_steps
Definition: parameters.h:538
double maximum_time_step
Definition: parameters.h:502
static Kind parse(const std::string &input)
Definition: parameters.h:333
unsigned int initial_adaptive_refinement
Definition: parameters.h:638
double coarsening_fraction
Definition: parameters.h:640
std::vector< unsigned int > normalized_fields
Definition: parameters.h:739
double maximum_first_time_step
Definition: parameters.h:504
static Kind parse(const std::string &input)
Definition: parameters.h:265
double global_temperature_max_preset
Definition: parameters.h:665
std::map< types::boundary_id, std::pair< std::string, std::string > > prescribed_traction_boundary_indicators
Definition: parameters.h:616
unsigned int initial_global_refinement
Definition: parameters.h:637
static const std::string pattern()
Definition: parameters.h:327
double AMG_aggregation_threshold
Definition: parameters.h:548
unsigned int stabilization_alpha
Definition: parameters.h:658
double linear_solver_A_block_tolerance
Definition: parameters.h:540
std::vector< double > additional_refinement_times
Definition: parameters.h:643
std::map< unsigned int, std::pair< std::string, unsigned int > > mapped_particle_properties
Definition: parameters.h:737
bool use_limiter_for_discontinuous_temperature_solution
Definition: parameters.h:663
bool use_locally_conservative_discretization
Definition: parameters.h:690
static Type parse_type(const std::string &input)
Definition: parameters.h:406
double nonlinear_tolerance
Definition: parameters.h:498
unsigned int stokes_gmres_restart_length
Definition: parameters.h:543
static Kind parse(const std::string &input)
Definition: parameters.h:296
unsigned int temperature_degree
Definition: parameters.h:694
unsigned int idr_s_parameter
Definition: parameters.h:535
bool mesh_deformation_enabled
Definition: parameters.h:747
Formulation::MassConservation::Kind formulation_mass_conservation
Definition: parameters.h:583
std::vector< CompositionalFieldDescription > composition_descriptions
Definition: parameters.h:720
bool skip_solvers_on_initial_refinement
Definition: parameters.h:645
bool run_postprocessors_on_initial_refinement
Definition: parameters.h:647
bool use_discontinuous_composition_discretization
Definition: parameters.h:693
bool adapt_by_fraction_of_cells
Definition: parameters.h:641
AdvectionFieldMethod::Kind temperature_method
Definition: parameters.h:708
unsigned int AMG_smoother_sweeps
Definition: parameters.h:547
double temperature_solver_tolerance
Definition: parameters.h:525
NonlinearSolver::Kind nonlinear_solver
Definition: parameters.h:495
std::string world_builder_file
Definition: parameters.h:515
AdvectionStabilizationMethod::Kind advection_stabilization_method
Definition: parameters.h:497
unsigned int stokes_velocity_degree
Definition: parameters.h:689
void declare_parameters(ParameterHandler &prm)
bool enable_additional_stokes_rhs
Definition: parameters.h:607
NullspaceRemoval::Kind nullspace_removal
Definition: parameters.h:628
static const std::string pattern()
Definition: parameters.h:360
bool use_artificial_viscosity_smoothing
Definition: parameters.h:505
double discontinuous_penalty
Definition: parameters.h:662
bool volume_of_fluid_tracking_enabled
Definition: parameters.h:756
double reaction_time_step
Definition: parameters.h:552
double stabilization_gamma
Definition: parameters.h:661
double linear_solver_S_block_tolerance
Definition: parameters.h:542
bool use_direct_stokes_solver
Definition: parameters.h:532
bool use_limiter_for_discontinuous_composition_solution
Definition: parameters.h:664
bool use_operator_splitting
Definition: parameters.h:514
double refinement_fraction
Definition: parameters.h:639
unsigned int n_compositional_fields
Definition: parameters.h:718
MaterialModel::MaterialAveraging::AveragingOperation material_averaging
Definition: parameters.h:697
unsigned int reaction_steps_per_advection_step
Definition: parameters.h:553
bool use_conduction_timestep
Definition: parameters.h:506
double maximum_relative_increase_time_step
Definition: parameters.h:503
double composition_solver_tolerance
Definition: parameters.h:526
std::vector< std::string > names_of_compositional_fields
Definition: parameters.h:719
unsigned int max_nonlinear_iterations
Definition: parameters.h:512
bool run_postprocessors_on_nonlinear_iterations
Definition: parameters.h:648
bool use_discontinuous_temperature_discretization
Definition: parameters.h:692
static Kind parse(const std::string &input)
Definition: parameters.h:219
static bool is_defect_correction(const typename NonlinearSolver::Kind &input)
Definition: parameters.h:85
std::set< types::boundary_id > fixed_heat_flux_boundary_indicators
Definition: parameters.h:622
std::string output_directory
Definition: parameters.h:508
std::vector< double > stabilization_beta
Definition: parameters.h:660
std::vector< double > stabilization_c_R
Definition: parameters.h:659
std::vector< std::string > compositional_fields_with_disabled_boundary_entropy_viscosity
Definition: parameters.h:670
std::string pressure_normalization
Definition: parameters.h:696
bool use_equal_order_interpolation_for_stokes
Definition: parameters.h:691
StokesSolverType::Kind stokes_solver_type
Definition: parameters.h:533
unsigned int advection_gmres_restart_length
Definition: parameters.h:529
bool enable_prescribed_dilation
Definition: parameters.h:608
std::string AMG_smoother_type
Definition: parameters.h:546
double surface_pressure
Definition: parameters.h:509
StokesKrylovType::Kind stokes_krylov_type
Definition: parameters.h:534
double global_temperature_min_preset
Definition: parameters.h:666
Formulation::TemperatureEquation::Kind formulation_temperature_equation
Definition: parameters.h:590
bool include_melt_transport
Definition: parameters.h:606
double adiabatic_surface_temperature
Definition: parameters.h:510
Definition: compat.h:88
unsigned int max_nonlinear_iterations_in_prerefinement
Definition: parameters.h:513
std::vector< double > global_composition_max_preset
Definition: parameters.h:667
unsigned int timing_output_frequency
Definition: parameters.h:511
std::vector< typename AdvectionFieldMethod::Kind > compositional_field_methods
Definition: parameters.h:726
Formulation::Kind formulation
Definition: parameters.h:575
bool skip_setup_initial_conditions_on_initial_refinement
Definition: parameters.h:646
unsigned int adaptive_refinement_interval
Definition: parameters.h:644
double diffusion_length_scale
Definition: parameters.h:556
static Kind parse(const std::string &input)
Definition: parameters.h:175