ASPECT
parameters.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 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_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  {
75  no_Advection_no_Stokes
76  };
77  };
78 
83  {
84  enum Kind
85  {
86  none = 0,
87  net_translation_x = 0x1,
88  net_translation_y = 0x2,
89  net_translation_z = 0x4,
90  net_translation = 0x1+0x2+0x4,
91  linear_momentum_x = 0x8,
92  linear_momentum_y = 0x10,
93  linear_momentum_z = 0x20,
94  linear_momentum = 0x8+0x10+0x20,
95  net_rotation = 0x40,
96  angular_momentum = 0x80
97  };
98  };
99 
111  {
112  enum Kind
113  {
120  prescribed_field_with_diffusion
121  };
122  };
123 
130  struct Formulation
131  {
138  enum Kind
139  {
143  custom
144  };
145 
150  static
151  Kind
152  parse(const std::string &input)
153  {
154  if (input == "isentropic compression")
155  return Formulation::isentropic_compression;
156  else if (input == "anelastic liquid approximation")
157  return Formulation::anelastic_liquid_approximation;
158  else if (input == "Boussinesq approximation")
159  return Formulation::boussinesq_approximation;
160  else if (input == "custom")
161  return Formulation::custom;
162  else
163  AssertThrow(false, ExcNotImplemented());
164 
165  return Formulation::Kind();
166  }
167 
175  {
180  enum Kind
181  {
187  ask_material_model
188  };
189 
194  static Kind
195  parse(const std::string &input)
196  {
197  if (input == "isentropic compression")
198  return Formulation::MassConservation::isentropic_compression;
199  else if (input == "hydrostatic compression")
200  return Formulation::MassConservation::hydrostatic_compression;
201  else if (input == "reference density profile")
202  return Formulation::MassConservation::reference_density_profile;
203  else if (input == "implicit reference density profile")
204  return Formulation::MassConservation::implicit_reference_density_profile;
205  else if (input == "incompressible")
206  return Formulation::MassConservation::incompressible;
207  else if (input == "ask material model")
208  return Formulation::MassConservation::ask_material_model;
209  else
210  AssertThrow(false, ExcNotImplemented());
211 
213  }
214  };
215 
222  {
227  enum Kind
228  {
230  reference_density_profile
231  };
232 
237  static
238  Kind
239  parse(const std::string &input)
240  {
241  if (input == "real density")
242  return Formulation::TemperatureEquation::real_density;
243  else if (input == "reference density profile")
244  return Formulation::TemperatureEquation::reference_density_profile;
245  else
246  AssertThrow(false, ExcNotImplemented());
247 
249  }
250  };
251  };
252 
257  {
258  enum Kind
259  {
261  supg
262  };
263 
268  static
269  Kind
270  parse(const std::string &input)
271  {
272  if (input == "entropy viscosity")
273  return entropy_viscosity;
274  else if (input == "SUPG")
275  return supg;
276  else
277  AssertThrow(false, ExcNotImplemented());
278 
279  return Kind();
280  }
281 
282  static std::string get_options_string()
283  {
284  return "entropy viscosity|SUPG";
285  }
286  };
287 
293  {
294  enum Kind
295  {
298  block_gmg
299  };
300 
301  static const std::string pattern()
302  {
303  return "block AMG|direct solver|block GMG";
304  }
305 
306  static Kind
307  parse(const std::string &input)
308  {
309  if (input == "block AMG")
310  return block_amg;
311  else if (input == "direct solver")
312  return direct_solver;
313  else if (input == "block GMG")
314  return block_gmg;
315  else
316  AssertThrow(false, ExcNotImplemented());
317 
318  return Kind();
319  }
320  };
321 
334  MPI_Comm mpi_communicator);
335 
344  static
346 
362  void parse_parameters (ParameterHandler &prm,
363  const MPI_Comm mpi_communicator);
364 
381  void parse_geometry_dependent_parameters (ParameterHandler &prm,
382  const GeometryModel::Interface<dim> &geometry_model);
383 
389 
393  double start_time;
394  double CFL_number;
401  std::string output_directory;
408  std::string world_builder_file;
409 
420 
421  // subsection: Advection solver parameters
423 
424  // subsection: Stokes solver parameters
427 
435 
436  // subsection: AMG parameters
437  std::string AMG_smoother_type;
438  unsigned int AMG_smoother_sweeps;
441 
442  // subsection: Operator splitting parameters
445 
446  // subsection: Diffusion solver parameters
448 
467 
475 
482 
488 
499 
506  std::map<types::boundary_id, std::pair<std::string,std::string> > prescribed_traction_boundary_indicators;
507 
512  std::set<types::boundary_id> fixed_heat_flux_boundary_indicators;
513 
532  unsigned int min_grid_level;
533  std::vector<double> additional_refinement_times;
548  unsigned int stabilization_alpha;
549  std::vector<double> stabilization_c_R;
550  std::vector<double> stabilization_beta;
557  std::vector<double> global_composition_max_preset;
558  std::vector<double> global_composition_min_preset;
582  unsigned int temperature_degree;
583  unsigned int composition_degree;
586 
596  std::vector<std::string> names_of_compositional_fields;
597 
602  std::vector<typename AdvectionFieldMethod::Kind> compositional_field_methods;
603 
613  std::map<unsigned int, std::pair<std::string,unsigned int> > mapped_particle_properties;
614 
615  std::vector<unsigned int> normalized_fields;
638  };
639 
640 }
641 #endif
The NullspaceRemoval struct.
Definition: parameters.h:82
bool use_full_A_block_preconditioner
Definition: parameters.h:432
unsigned int min_grid_level
Definition: parameters.h:532
unsigned int n_expensive_stokes_solver_steps
Definition: parameters.h:430
std::vector< double > global_composition_min_preset
Definition: parameters.h:558
unsigned int composition_degree
Definition: parameters.h:583
double linear_stokes_solver_tolerance
Definition: parameters.h:428
unsigned int n_cheap_stokes_solver_steps
Definition: parameters.h:429
double maximum_time_step
Definition: parameters.h:395
static Kind parse(const std::string &input)
Definition: parameters.h:307
unsigned int initial_adaptive_refinement
Definition: parameters.h:528
double coarsening_fraction
Definition: parameters.h:530
std::vector< unsigned int > normalized_fields
Definition: parameters.h:615
double maximum_first_time_step
Definition: parameters.h:397
static Kind parse(const std::string &input)
Definition: parameters.h:239
double global_temperature_max_preset
Definition: parameters.h:555
std::map< types::boundary_id, std::pair< std::string, std::string > > prescribed_traction_boundary_indicators
Definition: parameters.h:506
unsigned int initial_global_refinement
Definition: parameters.h:527
static const std::string pattern()
Definition: parameters.h:301
double AMG_aggregation_threshold
Definition: parameters.h:439
unsigned int stabilization_alpha
Definition: parameters.h:548
double linear_solver_A_block_tolerance
Definition: parameters.h:431
std::vector< double > additional_refinement_times
Definition: parameters.h:533
std::map< unsigned int, std::pair< std::string, unsigned int > > mapped_particle_properties
Definition: parameters.h:613
bool use_limiter_for_discontinuous_temperature_solution
Definition: parameters.h:553
bool use_locally_conservative_discretization
Definition: parameters.h:578
#define AssertThrow(cond, exc)
double nonlinear_tolerance
Definition: parameters.h:391
unsigned int stokes_gmres_restart_length
Definition: parameters.h:434
static Kind parse(const std::string &input)
Definition: parameters.h:270
unsigned int temperature_degree
Definition: parameters.h:582
bool mesh_deformation_enabled
Definition: parameters.h:623
Formulation::MassConservation::Kind formulation_mass_conservation
Definition: parameters.h:474
bool skip_solvers_on_initial_refinement
Definition: parameters.h:535
bool run_postprocessors_on_initial_refinement
Definition: parameters.h:537
bool use_discontinuous_composition_discretization
Definition: parameters.h:581
bool adapt_by_fraction_of_cells
Definition: parameters.h:531
unsigned int AMG_smoother_sweeps
Definition: parameters.h:438
double temperature_solver_tolerance
Definition: parameters.h:418
NonlinearSolver::Kind nonlinear_solver
Definition: parameters.h:388
std::string world_builder_file
Definition: parameters.h:408
AdvectionStabilizationMethod::Kind advection_stabilization_method
Definition: parameters.h:390
unsigned int stokes_velocity_degree
Definition: parameters.h:577
void declare_parameters(ParameterHandler &prm)
bool enable_additional_stokes_rhs
Definition: parameters.h:498
NullspaceRemoval::Kind nullspace_removal
Definition: parameters.h:518
bool use_artificial_viscosity_smoothing
Definition: parameters.h:398
double discontinuous_penalty
Definition: parameters.h:552
bool volume_of_fluid_tracking_enabled
Definition: parameters.h:632
double reaction_time_step
Definition: parameters.h:443
double stabilization_gamma
Definition: parameters.h:551
double linear_solver_S_block_tolerance
Definition: parameters.h:433
bool use_direct_stokes_solver
Definition: parameters.h:425
bool use_limiter_for_discontinuous_composition_solution
Definition: parameters.h:554
bool use_operator_splitting
Definition: parameters.h:407
double refinement_fraction
Definition: parameters.h:529
unsigned int n_compositional_fields
Definition: parameters.h:595
MaterialModel::MaterialAveraging::AveragingOperation material_averaging
Definition: parameters.h:585
unsigned int reaction_steps_per_advection_step
Definition: parameters.h:444
bool use_conduction_timestep
Definition: parameters.h:399
double maximum_relative_increase_time_step
Definition: parameters.h:396
double composition_solver_tolerance
Definition: parameters.h:419
std::vector< std::string > names_of_compositional_fields
Definition: parameters.h:596
unsigned int max_nonlinear_iterations
Definition: parameters.h:405
Definition: compat.h:37
bool run_postprocessors_on_nonlinear_iterations
Definition: parameters.h:538
bool use_discontinuous_temperature_discretization
Definition: parameters.h:580
static Kind parse(const std::string &input)
Definition: parameters.h:195
std::set< types::boundary_id > fixed_heat_flux_boundary_indicators
Definition: parameters.h:512
std::string output_directory
Definition: parameters.h:401
std::vector< double > stabilization_beta
Definition: parameters.h:550
std::vector< double > stabilization_c_R
Definition: parameters.h:549
std::string pressure_normalization
Definition: parameters.h:584
bool use_equal_order_interpolation_for_stokes
Definition: parameters.h:579
StokesSolverType::Kind stokes_solver_type
Definition: parameters.h:426
unsigned int advection_gmres_restart_length
Definition: parameters.h:422
std::string AMG_smoother_type
Definition: parameters.h:437
double surface_pressure
Definition: parameters.h:402
static ::ExceptionBase & ExcNotImplemented()
double global_temperature_min_preset
Definition: parameters.h:556
Formulation::TemperatureEquation::Kind formulation_temperature_equation
Definition: parameters.h:481
bool include_melt_transport
Definition: parameters.h:497
double adiabatic_surface_temperature
Definition: parameters.h:403
unsigned int max_nonlinear_iterations_in_prerefinement
Definition: parameters.h:406
std::vector< double > global_composition_max_preset
Definition: parameters.h:557
unsigned int timing_output_frequency
Definition: parameters.h:404
std::vector< typename AdvectionFieldMethod::Kind > compositional_field_methods
Definition: parameters.h:602
Formulation::Kind formulation
Definition: parameters.h:466
bool skip_setup_initial_conditions_on_initial_refinement
Definition: parameters.h:536
unsigned int adaptive_refinement_interval
Definition: parameters.h:534
double diffusion_length_scale
Definition: parameters.h:447
static Kind parse(const std::string &input)
Definition: parameters.h:152