ASPECT
parameters.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 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_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  struct CompositionalFieldDescription;
36 
37  // forward declaration:
38  namespace GeometryModel
39  {
40  template <int dim>
41  class Interface;
42  }
43 
57  template <int dim>
58  struct Parameters
59  {
60 
66  {
67  enum Kind
68  {
81  no_Advection_no_Stokes
82  };
83  };
84 
85  static
86  bool
88  {
89  return input == NonlinearSolver::iterated_Advection_and_Newton_Stokes ||
90  input == NonlinearSolver::single_Advection_iterated_Newton_Stokes ||
91  input == NonlinearSolver::no_Advection_iterated_defect_correction_Stokes ||
92  input == NonlinearSolver::single_Advection_iterated_defect_correction_Stokes ||
93  input == NonlinearSolver::iterated_Advection_and_defect_correction_Stokes
94  ?
95  true
96  :
97  false;
98  }
99 
104  {
105  enum Kind
106  {
109  abort_program
110  };
111 
115  static
116  Kind
117  parse(const std::string &input)
118  {
119  if (input == "continue with next timestep")
120  return continue_with_next_timestep;
121  else if (input == "cut timestep size")
122  return cut_timestep_size;
123  else if (input == "abort program")
124  return abort_program;
125  else
126  AssertThrow(false, ExcNotImplemented());
127 
128  return Kind();
129  }
130  };
131 
136  {
137  enum Kind
138  {
139  none = 0,
140  net_translation_x = 0x1,
141  net_translation_y = 0x2,
142  net_translation_z = 0x4,
143  net_translation = 0x1+0x2+0x4,
144  linear_momentum_x = 0x8,
145  linear_momentum_y = 0x10,
146  linear_momentum_z = 0x20,
147  linear_momentum = linear_momentum_x+linear_momentum_y+linear_momentum_z,
148  net_rotation = 0x40,
149  angular_momentum = 0x80,
150  net_surface_rotation = 0x100,
151  any_translation = net_translation+linear_momentum,
152  any_rotation = net_rotation+angular_momentum+net_surface_rotation,
153  };
154  };
155 
167  {
168  enum Kind
169  {
177  prescribed_field_with_diffusion
178  };
179  };
180 
187  struct Formulation
188  {
195  enum Kind
196  {
200  custom
201  };
202 
207  static
208  Kind
209  parse(const std::string &input)
210  {
211  if (input == "isentropic compression")
212  return Formulation::isentropic_compression;
213  else if (input == "anelastic liquid approximation")
214  return Formulation::anelastic_liquid_approximation;
215  else if (input == "Boussinesq approximation")
216  return Formulation::boussinesq_approximation;
217  else if (input == "custom")
218  return Formulation::custom;
219  else
220  AssertThrow(false, ExcNotImplemented());
221 
222  return Formulation::Kind();
223  }
224 
232  {
237  enum Kind
238  {
245  ask_material_model
246  };
247 
252  static Kind
253  parse(const std::string &input)
254  {
255  if (input == "isentropic compression")
256  return Formulation::MassConservation::isentropic_compression;
257  else if (input == "hydrostatic compression")
258  return Formulation::MassConservation::hydrostatic_compression;
259  else if (input == "reference density profile")
260  return Formulation::MassConservation::reference_density_profile;
261  else if (input == "implicit reference density profile")
262  return Formulation::MassConservation::implicit_reference_density_profile;
263  else if (input == "incompressible")
264  return Formulation::MassConservation::incompressible;
265  else if (input == "projected density field")
266  return Formulation::MassConservation::projected_density_field;
267  else if (input == "ask material model")
268  return Formulation::MassConservation::ask_material_model;
269  else
270  AssertThrow(false, ExcNotImplemented());
271 
273  }
274  };
275 
282  {
287  enum Kind
288  {
290  reference_density_profile
291  };
292 
297  static
298  Kind
299  parse(const std::string &input)
300  {
301  if (input == "real density")
302  return Formulation::TemperatureEquation::real_density;
303  else if (input == "reference density profile")
304  return Formulation::TemperatureEquation::reference_density_profile;
305  else
306  AssertThrow(false, ExcNotImplemented());
307 
309  }
310  };
311  };
312 
317  {
318  enum Kind
319  {
321  supg
322  };
323 
328  static
329  Kind
330  parse(const std::string &input)
331  {
332  if (input == "entropy viscosity")
333  return entropy_viscosity;
334  else if (input == "SUPG")
335  return supg;
336  else
337  AssertThrow(false, ExcNotImplemented());
338 
339  return Kind();
340  }
341 
342  static std::string get_options_string()
343  {
344  return "entropy viscosity|SUPG";
345  }
346  };
347 
353  {
354  enum Kind
355  {
359  default_solver
360  };
361 
362  static const std::string pattern()
363  {
364  return "default solver|block AMG|direct solver|block GMG";
365  }
366 
367  static Kind
368  parse(const std::string &input)
369  {
370  if (input == "block AMG")
371  return block_amg;
372  else if (input == "direct solver")
373  return direct_solver;
374  else if (input == "block GMG")
375  return block_gmg;
376  else if (input == "default solver")
377  return default_solver;
378  else
379  AssertThrow(false, ExcNotImplemented());
380 
381  return Kind();
382  }
383  };
384 
390  {
391  enum Kind
392  {
394  idr_s
395  };
396 
397  static const std::string pattern()
398  {
399  return "GMRES|IDR(s)";
400  }
401 
402  static Kind
403  parse(const std::string &input)
404  {
405  if (input == "GMRES")
406  return gmres;
407  else if (input == "IDR(s)")
408  return idr_s;
409  else
410  AssertThrow(false, ExcNotImplemented());
411 
412  return Kind();
413  }
414  };
415 
421  {
422  enum Kind
423  {
425  fixed_step
426  };
427 
428  static const std::string pattern()
429  {
430  return "ARKode|fixed step";
431  }
432 
433  static Kind
434  parse(const std::string &input)
435  {
436  if (input == "ARKode")
437  return ARKode;
438  else if (input == "fixed step")
439  return fixed_step;
440  else
441  AssertThrow(false, ExcNotImplemented());
442 
443  return Kind();
444  }
445  };
446 
451 
463  Parameters (ParameterHandler &prm,
464  const MPI_Comm mpi_communicator);
465 
474  static
475  void declare_parameters (ParameterHandler &prm);
476 
492  void parse_parameters (ParameterHandler &prm,
493  const MPI_Comm mpi_communicator);
494 
511  void parse_geometry_dependent_parameters (ParameterHandler &prm,
512  const GeometryModel::Interface<dim> &geometry_model);
513 
520 
524  double start_time;
525  double end_time;
526  double CFL_number;
533  std::string output_directory;
540  std::string world_builder_file;
541  unsigned int n_particle_managers;
542 
553 
554  // subsection: Advection solver parameters
556 
557  // subsection: Stokes solver parameters
559  bool use_bfbt;
562  unsigned int idr_s_parameter;
563 
572 
573  // subsection: AMG parameters
574  std::string AMG_smoother_type;
575  unsigned int AMG_smoother_sweeps;
578 
579  // subsection: Operator splitting parameters
584 
585  // subsection: Diffusion solver parameters
587 
606 
614 
621 
627 
639 
646  std::map<types::boundary_id, std::pair<std::string,std::string>> prescribed_traction_boundary_indicators;
647 
652  std::set<types::boundary_id> fixed_heat_flux_boundary_indicators;
653 
672  unsigned int min_grid_level;
673  std::vector<double> additional_refinement_times;
688  unsigned int stabilization_alpha;
689  std::vector<double> stabilization_c_R;
690  std::vector<double> stabilization_beta;
697  std::vector<double> global_composition_max_preset;
698  std::vector<double> global_composition_min_preset;
699 
725  unsigned int temperature_degree;
726  std::vector<unsigned int> composition_degrees;
730 
741 
751  std::vector<std::string> names_of_compositional_fields;
752  std::vector<aspect::CompositionalFieldDescription> composition_descriptions;
754  std::vector<unsigned int> chemical_composition_indices;
755 
760  std::vector<typename AdvectionFieldMethod::Kind> compositional_field_methods;
761 
771  std::map<unsigned int, std::pair<std::string,unsigned int>> mapped_particle_properties;
772 
773  std::vector<unsigned int> normalized_fields;
796  };
797 
798 }
799 #endif
The NullspaceRemoval struct.
Definition: parameters.h:135
bool use_full_A_block_preconditioner
Definition: parameters.h:568
unsigned int min_grid_level
Definition: parameters.h:672
unsigned int n_expensive_stokes_solver_steps
Definition: parameters.h:566
std::vector< double > global_composition_min_preset
Definition: parameters.h:698
static Kind parse(const std::string &input)
Definition: parameters.h:403
double linear_stokes_solver_tolerance
Definition: parameters.h:564
unsigned int n_cheap_stokes_solver_steps
Definition: parameters.h:565
double maximum_time_step
Definition: parameters.h:527
static Kind parse(const std::string &input)
Definition: parameters.h:368
unsigned int initial_adaptive_refinement
Definition: parameters.h:668
double coarsening_fraction
Definition: parameters.h:670
std::vector< unsigned int > normalized_fields
Definition: parameters.h:773
double maximum_first_time_step
Definition: parameters.h:529
static Kind parse(const std::string &input)
Definition: parameters.h:299
double global_temperature_max_preset
Definition: parameters.h:695
std::map< types::boundary_id, std::pair< std::string, std::string > > prescribed_traction_boundary_indicators
Definition: parameters.h:646
unsigned int initial_global_refinement
Definition: parameters.h:667
static const std::string pattern()
Definition: parameters.h:362
double AMG_aggregation_threshold
Definition: parameters.h:576
std::vector< bool > use_discontinuous_composition_discretization
Definition: parameters.h:723
unsigned int stabilization_alpha
Definition: parameters.h:688
double linear_solver_A_block_tolerance
Definition: parameters.h:567
std::vector< double > additional_refinement_times
Definition: parameters.h:673
std::map< unsigned int, std::pair< std::string, unsigned int > > mapped_particle_properties
Definition: parameters.h:771
bool use_limiter_for_discontinuous_temperature_solution
Definition: parameters.h:693
bool use_locally_conservative_discretization
Definition: parameters.h:720
double nonlinear_tolerance
Definition: parameters.h:522
unsigned int stokes_gmres_restart_length
Definition: parameters.h:571
static Kind parse(const std::string &input)
Definition: parameters.h:330
unsigned int temperature_degree
Definition: parameters.h:725
unsigned int idr_s_parameter
Definition: parameters.h:562
bool force_nonsymmetric_A_block_solver
Definition: parameters.h:569
bool mesh_deformation_enabled
Definition: parameters.h:781
Formulation::MassConservation::Kind formulation_mass_conservation
Definition: parameters.h:613
bool skip_solvers_on_initial_refinement
Definition: parameters.h:675
bool run_postprocessors_on_initial_refinement
Definition: parameters.h:677
bool adapt_by_fraction_of_cells
Definition: parameters.h:671
AdvectionFieldMethod::Kind temperature_method
Definition: parameters.h:740
bool have_discontinuous_composition_discretization
Definition: parameters.h:724
unsigned int AMG_smoother_sweeps
Definition: parameters.h:575
double temperature_solver_tolerance
Definition: parameters.h:551
NonlinearSolver::Kind nonlinear_solver
Definition: parameters.h:518
std::string world_builder_file
Definition: parameters.h:540
std::vector< bool > use_limiter_for_discontinuous_composition_solution
Definition: parameters.h:694
AdvectionStabilizationMethod::Kind advection_stabilization_method
Definition: parameters.h:521
unsigned int stokes_velocity_degree
Definition: parameters.h:719
void declare_parameters(ParameterHandler &prm)
bool enable_additional_stokes_rhs
Definition: parameters.h:637
NullspaceRemoval::Kind nullspace_removal
Definition: parameters.h:658
static const std::string pattern()
Definition: parameters.h:397
bool use_artificial_viscosity_smoothing
Definition: parameters.h:530
double discontinuous_penalty
Definition: parameters.h:692
bool volume_of_fluid_tracking_enabled
Definition: parameters.h:790
double reaction_time_step
Definition: parameters.h:582
double stabilization_gamma
Definition: parameters.h:691
double linear_solver_S_block_tolerance
Definition: parameters.h:570
bool use_direct_stokes_solver
Definition: parameters.h:558
bool use_operator_splitting
Definition: parameters.h:539
double refinement_fraction
Definition: parameters.h:669
unsigned int n_compositional_fields
Definition: parameters.h:750
unsigned int max_composition_degree
Definition: parameters.h:727
std::vector< unsigned int > composition_degrees
Definition: parameters.h:726
MaterialModel::MaterialAveraging::AveragingOperation material_averaging
Definition: parameters.h:729
unsigned int reaction_steps_per_advection_step
Definition: parameters.h:583
unsigned int n_particle_managers
Definition: parameters.h:541
bool use_conduction_timestep
Definition: parameters.h:531
double maximum_relative_increase_time_step
Definition: parameters.h:528
double composition_solver_tolerance
Definition: parameters.h:552
std::vector< std::string > names_of_compositional_fields
Definition: parameters.h:751
unsigned int max_nonlinear_iterations
Definition: parameters.h:537
NonlinearSolverFailureStrategy::Kind nonlinear_solver_failure_strategy
Definition: parameters.h:519
Definition: compat.h:59
bool run_postprocessors_on_nonlinear_iterations
Definition: parameters.h:678
bool use_discontinuous_temperature_discretization
Definition: parameters.h:722
static Kind parse(const std::string &input)
Definition: parameters.h:253
static Kind parse(const std::string &input)
Definition: parameters.h:117
static bool is_defect_correction(const typename NonlinearSolver::Kind &input)
Definition: parameters.h:87
std::set< types::boundary_id > fixed_heat_flux_boundary_indicators
Definition: parameters.h:652
std::string output_directory
Definition: parameters.h:533
std::vector< double > stabilization_beta
Definition: parameters.h:690
std::vector< aspect::CompositionalFieldDescription > composition_descriptions
Definition: parameters.h:752
std::vector< double > stabilization_c_R
Definition: parameters.h:689
std::vector< std::string > compositional_fields_with_disabled_boundary_entropy_viscosity
Definition: parameters.h:700
std::string pressure_normalization
Definition: parameters.h:728
bool use_equal_order_interpolation_for_stokes
Definition: parameters.h:721
double ARKode_relative_tolerance
Definition: parameters.h:581
StokesSolverType::Kind stokes_solver_type
Definition: parameters.h:560
unsigned int advection_gmres_restart_length
Definition: parameters.h:555
bool enable_prescribed_dilation
Definition: parameters.h:638
static const std::string pattern()
Definition: parameters.h:428
std::string AMG_smoother_type
Definition: parameters.h:574
double surface_pressure
Definition: parameters.h:534
StokesKrylovType::Kind stokes_krylov_type
Definition: parameters.h:561
double global_temperature_min_preset
Definition: parameters.h:696
Formulation::TemperatureEquation::Kind formulation_temperature_equation
Definition: parameters.h:620
static Kind parse(const std::string &input)
Definition: parameters.h:434
bool include_melt_transport
Definition: parameters.h:636
double adiabatic_surface_temperature
Definition: parameters.h:535
std::vector< unsigned int > chemical_composition_indices
Definition: parameters.h:754
Definition: compat.h:42
unsigned int max_nonlinear_iterations_in_prerefinement
Definition: parameters.h:538
std::vector< double > global_composition_max_preset
Definition: parameters.h:697
unsigned int timing_output_frequency
Definition: parameters.h:536
std::vector< typename AdvectionFieldMethod::Kind > compositional_field_methods
Definition: parameters.h:760
Formulation::Kind formulation
Definition: parameters.h:605
unsigned int n_chemical_compositions
Definition: parameters.h:753
bool skip_setup_initial_conditions_on_initial_refinement
Definition: parameters.h:676
unsigned int adaptive_refinement_interval
Definition: parameters.h:674
ReactionSolverType::Kind reaction_solver_type
Definition: parameters.h:580
double diffusion_length_scale
Definition: parameters.h:586
static Kind parse(const std::string &input)
Definition: parameters.h:209