ASPECT
parameters.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2020 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 
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  {
76  no_Advection_no_Stokes
77  };
78  };
79 
84  {
85  enum Kind
86  {
87  none = 0,
88  net_translation_x = 0x1,
89  net_translation_y = 0x2,
90  net_translation_z = 0x4,
91  net_translation = 0x1+0x2+0x4,
92  linear_momentum_x = 0x8,
93  linear_momentum_y = 0x10,
94  linear_momentum_z = 0x20,
95  linear_momentum = 0x8+0x10+0x20,
96  net_rotation = 0x40,
97  angular_momentum = 0x80
98  };
99  };
100 
112  {
113  enum Kind
114  {
121  prescribed_field_with_diffusion
122  };
123  };
124 
131  struct Formulation
132  {
139  enum Kind
140  {
144  custom
145  };
146 
151  static
152  Kind
153  parse(const std::string &input)
154  {
155  if (input == "isentropic compression")
156  return Formulation::isentropic_compression;
157  else if (input == "anelastic liquid approximation")
158  return Formulation::anelastic_liquid_approximation;
159  else if (input == "Boussinesq approximation")
160  return Formulation::boussinesq_approximation;
161  else if (input == "custom")
162  return Formulation::custom;
163  else
164  AssertThrow(false, ExcNotImplemented());
165 
166  return Formulation::Kind();
167  }
168 
176  {
181  enum Kind
182  {
189  ask_material_model
190  };
191 
196  static Kind
197  parse(const std::string &input)
198  {
199  if (input == "isentropic compression")
200  return Formulation::MassConservation::isentropic_compression;
201  else if (input == "hydrostatic compression")
202  return Formulation::MassConservation::hydrostatic_compression;
203  else if (input == "reference density profile")
204  return Formulation::MassConservation::reference_density_profile;
205  else if (input == "implicit reference density profile")
206  return Formulation::MassConservation::implicit_reference_density_profile;
207  else if (input == "incompressible")
208  return Formulation::MassConservation::incompressible;
209  else if (input == "projected density field")
210  return Formulation::MassConservation::projected_density_field;
211  else if (input == "ask material model")
212  return Formulation::MassConservation::ask_material_model;
213  else
214  AssertThrow(false, ExcNotImplemented());
215 
217  }
218  };
219 
226  {
231  enum Kind
232  {
234  reference_density_profile
235  };
236 
241  static
242  Kind
243  parse(const std::string &input)
244  {
245  if (input == "real density")
246  return Formulation::TemperatureEquation::real_density;
247  else if (input == "reference density profile")
248  return Formulation::TemperatureEquation::reference_density_profile;
249  else
250  AssertThrow(false, ExcNotImplemented());
251 
253  }
254  };
255  };
256 
261  {
262  enum Kind
263  {
265  supg
266  };
267 
272  static
273  Kind
274  parse(const std::string &input)
275  {
276  if (input == "entropy viscosity")
277  return entropy_viscosity;
278  else if (input == "SUPG")
279  return supg;
280  else
281  AssertThrow(false, ExcNotImplemented());
282 
283  return Kind();
284  }
285 
286  static std::string get_options_string()
287  {
288  return "entropy viscosity|SUPG";
289  }
290  };
291 
297  {
298  enum Kind
299  {
302  block_gmg
303  };
304 
305  static const std::string pattern()
306  {
307  return "block AMG|direct solver|block GMG";
308  }
309 
310  static Kind
311  parse(const std::string &input)
312  {
313  if (input == "block AMG")
314  return block_amg;
315  else if (input == "direct solver")
316  return direct_solver;
317  else if (input == "block GMG")
318  return block_gmg;
319  else
320  AssertThrow(false, ExcNotImplemented());
321 
322  return Kind();
323  }
324  };
325 
331  {
332  enum Kind
333  {
335  idr_s
336  };
337 
338  static const std::string pattern()
339  {
340  return "GMRES|IDR(s)";
341  }
342 
343  static Kind
344  parse(const std::string &input)
345  {
346  if (input == "GMRES")
347  return gmres;
348  else if (input == "IDR(s)")
349  return idr_s;
350  else
351  AssertThrow(false, ExcNotImplemented());
352 
353  return Kind();
354  }
355  };
356 
369  MPI_Comm mpi_communicator);
370 
379  static
381 
397  void parse_parameters (ParameterHandler &prm,
398  const MPI_Comm mpi_communicator);
399 
416  void parse_geometry_dependent_parameters (ParameterHandler &prm,
417  const GeometryModel::Interface<dim> &geometry_model);
418 
424 
428  double start_time;
429  double CFL_number;
436  std::string output_directory;
443  std::string world_builder_file;
444 
455 
456  // subsection: Advection solver parameters
458 
459  // subsection: Stokes solver parameters
463  unsigned int idr_s_parameter;
464 
472 
473  // subsection: AMG parameters
474  std::string AMG_smoother_type;
475  unsigned int AMG_smoother_sweeps;
478 
479  // subsection: Operator splitting parameters
482 
483  // subsection: Diffusion solver parameters
485 
504 
512 
519 
525 
537 
544  std::map<types::boundary_id, std::pair<std::string,std::string> > prescribed_traction_boundary_indicators;
545 
550  std::set<types::boundary_id> fixed_heat_flux_boundary_indicators;
551 
570  unsigned int min_grid_level;
571  std::vector<double> additional_refinement_times;
586  unsigned int stabilization_alpha;
587  std::vector<double> stabilization_c_R;
588  std::vector<double> stabilization_beta;
595  std::vector<double> global_composition_max_preset;
596  std::vector<double> global_composition_min_preset;
620  unsigned int temperature_degree;
621  unsigned int composition_degree;
624 
635 
645  std::vector<std::string> names_of_compositional_fields;
646 
651  std::vector<typename AdvectionFieldMethod::Kind> compositional_field_methods;
652 
662  std::map<unsigned int, std::pair<std::string,unsigned int> > mapped_particle_properties;
663 
664  std::vector<unsigned int> normalized_fields;
687  };
688 
689 }
690 #endif
The NullspaceRemoval struct.
Definition: parameters.h:83
bool use_full_A_block_preconditioner
Definition: parameters.h:469
unsigned int min_grid_level
Definition: parameters.h:570
unsigned int n_expensive_stokes_solver_steps
Definition: parameters.h:467
std::vector< double > global_composition_min_preset
Definition: parameters.h:596
unsigned int composition_degree
Definition: parameters.h:621
static Kind parse(const std::string &input)
Definition: parameters.h:344
double linear_stokes_solver_tolerance
Definition: parameters.h:465
unsigned int n_cheap_stokes_solver_steps
Definition: parameters.h:466
double maximum_time_step
Definition: parameters.h:430
static Kind parse(const std::string &input)
Definition: parameters.h:311
unsigned int initial_adaptive_refinement
Definition: parameters.h:566
double coarsening_fraction
Definition: parameters.h:568
none
std::vector< unsigned int > normalized_fields
Definition: parameters.h:664
double maximum_first_time_step
Definition: parameters.h:432
static Kind parse(const std::string &input)
Definition: parameters.h:243
double global_temperature_max_preset
Definition: parameters.h:593
std::map< types::boundary_id, std::pair< std::string, std::string > > prescribed_traction_boundary_indicators
Definition: parameters.h:544
unsigned int initial_global_refinement
Definition: parameters.h:565
static const std::string pattern()
Definition: parameters.h:305
double AMG_aggregation_threshold
Definition: parameters.h:476
unsigned int stabilization_alpha
Definition: parameters.h:586
double linear_solver_A_block_tolerance
Definition: parameters.h:468
std::vector< double > additional_refinement_times
Definition: parameters.h:571
std::map< unsigned int, std::pair< std::string, unsigned int > > mapped_particle_properties
Definition: parameters.h:662
bool use_limiter_for_discontinuous_temperature_solution
Definition: parameters.h:591
bool use_locally_conservative_discretization
Definition: parameters.h:616
#define AssertThrow(cond, exc)
double nonlinear_tolerance
Definition: parameters.h:426
unsigned int stokes_gmres_restart_length
Definition: parameters.h:471
static Kind parse(const std::string &input)
Definition: parameters.h:274
unsigned int temperature_degree
Definition: parameters.h:620
unsigned int idr_s_parameter
Definition: parameters.h:463
bool mesh_deformation_enabled
Definition: parameters.h:672
Formulation::MassConservation::Kind formulation_mass_conservation
Definition: parameters.h:511
bool skip_solvers_on_initial_refinement
Definition: parameters.h:573
bool run_postprocessors_on_initial_refinement
Definition: parameters.h:575
bool use_discontinuous_composition_discretization
Definition: parameters.h:619
bool adapt_by_fraction_of_cells
Definition: parameters.h:569
AdvectionFieldMethod::Kind temperature_method
Definition: parameters.h:634
unsigned int AMG_smoother_sweeps
Definition: parameters.h:475
double temperature_solver_tolerance
Definition: parameters.h:453
NonlinearSolver::Kind nonlinear_solver
Definition: parameters.h:423
std::string world_builder_file
Definition: parameters.h:443
AdvectionStabilizationMethod::Kind advection_stabilization_method
Definition: parameters.h:425
unsigned int stokes_velocity_degree
Definition: parameters.h:615
void declare_parameters(ParameterHandler &prm)
bool enable_additional_stokes_rhs
Definition: parameters.h:535
NullspaceRemoval::Kind nullspace_removal
Definition: parameters.h:556
static const std::string pattern()
Definition: parameters.h:338
bool use_artificial_viscosity_smoothing
Definition: parameters.h:433
double discontinuous_penalty
Definition: parameters.h:590
bool volume_of_fluid_tracking_enabled
Definition: parameters.h:681
double reaction_time_step
Definition: parameters.h:480
double stabilization_gamma
Definition: parameters.h:589
double linear_solver_S_block_tolerance
Definition: parameters.h:470
bool use_direct_stokes_solver
Definition: parameters.h:460
bool use_limiter_for_discontinuous_composition_solution
Definition: parameters.h:592
bool use_operator_splitting
Definition: parameters.h:442
double refinement_fraction
Definition: parameters.h:567
unsigned int n_compositional_fields
Definition: parameters.h:644
MaterialModel::MaterialAveraging::AveragingOperation material_averaging
Definition: parameters.h:623
unsigned int reaction_steps_per_advection_step
Definition: parameters.h:481
bool use_conduction_timestep
Definition: parameters.h:434
double maximum_relative_increase_time_step
Definition: parameters.h:431
double composition_solver_tolerance
Definition: parameters.h:454
std::vector< std::string > names_of_compositional_fields
Definition: parameters.h:645
unsigned int max_nonlinear_iterations
Definition: parameters.h:440
bool run_postprocessors_on_nonlinear_iterations
Definition: parameters.h:576
bool use_discontinuous_temperature_discretization
Definition: parameters.h:618
static Kind parse(const std::string &input)
Definition: parameters.h:197
std::set< types::boundary_id > fixed_heat_flux_boundary_indicators
Definition: parameters.h:550
std::string output_directory
Definition: parameters.h:436
std::vector< double > stabilization_beta
Definition: parameters.h:588
std::vector< double > stabilization_c_R
Definition: parameters.h:587
std::string pressure_normalization
Definition: parameters.h:622
bool use_equal_order_interpolation_for_stokes
Definition: parameters.h:617
StokesSolverType::Kind stokes_solver_type
Definition: parameters.h:461
unsigned int advection_gmres_restart_length
Definition: parameters.h:457
bool enable_prescribed_dilation
Definition: parameters.h:536
std::string AMG_smoother_type
Definition: parameters.h:474
double surface_pressure
Definition: parameters.h:437
static ::ExceptionBase & ExcNotImplemented()
StokesKrylovType::Kind stokes_krylov_type
Definition: parameters.h:462
double global_temperature_min_preset
Definition: parameters.h:594
Formulation::TemperatureEquation::Kind formulation_temperature_equation
Definition: parameters.h:518
bool include_melt_transport
Definition: parameters.h:534
double adiabatic_surface_temperature
Definition: parameters.h:438
unsigned int max_nonlinear_iterations_in_prerefinement
Definition: parameters.h:441
std::vector< double > global_composition_max_preset
Definition: parameters.h:595
unsigned int timing_output_frequency
Definition: parameters.h:439
std::vector< typename AdvectionFieldMethod::Kind > compositional_field_methods
Definition: parameters.h:651
Formulation::Kind formulation
Definition: parameters.h:503
bool skip_setup_initial_conditions_on_initial_refinement
Definition: parameters.h:574
unsigned int adaptive_refinement_interval
Definition: parameters.h:572
double diffusion_length_scale
Definition: parameters.h:484
static Kind parse(const std::string &input)
Definition: parameters.h:153