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  {
74  no_Advection_no_Stokes
75  };
76  };
77 
82  {
83  enum Kind
84  {
85  none = 0,
86  net_translation_x = 0x1,
87  net_translation_y = 0x2,
88  net_translation_z = 0x4,
89  net_translation = 0x1+0x2+0x4,
90  linear_momentum_x = 0x8,
91  linear_momentum_y = 0x10,
92  linear_momentum_z = 0x20,
93  linear_momentum = 0x8+0x10+0x20,
94  net_rotation = 0x40,
95  angular_momentum = 0x80
96  };
97  };
98 
110  {
111  enum Kind
112  {
119  prescribed_field_with_diffusion
120  };
121  };
122 
129  struct Formulation
130  {
137  enum Kind
138  {
142  custom
143  };
144 
149  static
150  Kind
151  parse(const std::string &input)
152  {
153  if (input == "isothermal compression")
154  return Formulation::isothermal_compression;
155  else if (input == "anelastic liquid approximation")
156  return Formulation::anelastic_liquid_approximation;
157  else if (input == "Boussinesq approximation")
158  return Formulation::boussinesq_approximation;
159  else if (input == "custom")
160  return Formulation::custom;
161  else
162  AssertThrow(false, ExcNotImplemented());
163 
164  return Formulation::Kind();
165  }
166 
174  {
179  enum Kind
180  {
186  ask_material_model
187  };
188 
193  static Kind
194  parse(const std::string &input)
195  {
196  if (input == "isothermal compression")
197  return Formulation::MassConservation::isothermal_compression;
198  else if (input == "hydrostatic compression")
199  return Formulation::MassConservation::hydrostatic_compression;
200  else if (input == "reference density profile")
201  return Formulation::MassConservation::reference_density_profile;
202  else if (input == "implicit reference density profile")
203  return Formulation::MassConservation::implicit_reference_density_profile;
204  else if (input == "incompressible")
205  return Formulation::MassConservation::incompressible;
206  else if (input == "ask material model")
207  return Formulation::MassConservation::ask_material_model;
208  else
209  AssertThrow(false, ExcNotImplemented());
210 
212  }
213  };
214 
221  {
226  enum Kind
227  {
229  reference_density_profile
230  };
231 
236  static
237  Kind
238  parse(const std::string &input)
239  {
240  if (input == "real density")
241  return Formulation::TemperatureEquation::real_density;
242  else if (input == "reference density profile")
243  return Formulation::TemperatureEquation::reference_density_profile;
244  else
245  AssertThrow(false, ExcNotImplemented());
246 
248  }
249  };
250  };
251 
256  {
257  enum Kind
258  {
260  supg
261  };
262 
267  static
268  Kind
269  parse(const std::string &input)
270  {
271  if (input == "entropy viscosity")
272  return entropy_viscosity;
273  else if (input == "SUPG")
274  return supg;
275  else
276  AssertThrow(false, ExcNotImplemented());
277 
278  return Kind();
279  }
280 
281  static std::string get_options_string()
282  {
283  return "entropy viscosity|SUPG";
284  }
285  };
286 
292  {
293  enum Kind
294  {
297  block_gmg
298  };
299 
300  static const std::string pattern()
301  {
302  return "block AMG|direct solver|block GMG";
303  }
304 
305  static Kind
306  parse(const std::string &input)
307  {
308  if (input == "block AMG")
309  return block_amg;
310  else if (input == "direct solver")
311  return direct_solver;
312  else if (input == "block GMG")
313  return block_gmg;
314  else
315  AssertThrow(false, ExcNotImplemented());
316 
317  return Kind();
318  }
319  };
320 
333  MPI_Comm mpi_communicator);
334 
343  static
345 
361  void parse_parameters (ParameterHandler &prm,
362  const MPI_Comm mpi_communicator);
363 
380  void parse_geometry_dependent_parameters (ParameterHandler &prm,
381  const GeometryModel::Interface<dim> &geometry_model);
382 
388 
392  double start_time;
393  double CFL_number;
400  std::string output_directory;
407  std::string world_builder_file;
408 
419 
420  // subsection: Advection solver parameters
422 
423  // subsection: Stokes solver parameters
426 
434 
435  // subsection: AMG parameters
436  std::string AMG_smoother_type;
437  unsigned int AMG_smoother_sweeps;
440 
441  // subsection: Operator splitting parameters
444 
445  // subsection: Diffusion solver parameters
447 
466 
474 
481 
487 
498 
505  std::map<types::boundary_id, std::pair<std::string,std::string> > prescribed_traction_boundary_indicators;
506 
511  std::set<types::boundary_id> fixed_heat_flux_boundary_indicators;
512 
531  unsigned int min_grid_level;
532  std::vector<double> additional_refinement_times;
547  unsigned int stabilization_alpha;
548  std::vector<double> stabilization_c_R;
549  std::vector<double> stabilization_beta;
556  std::vector<double> global_composition_max_preset;
557  std::vector<double> global_composition_min_preset;
581  unsigned int temperature_degree;
582  unsigned int composition_degree;
585 
595  std::vector<std::string> names_of_compositional_fields;
596 
601  std::vector<typename AdvectionFieldMethod::Kind> compositional_field_methods;
602 
612  std::map<unsigned int, std::pair<std::string,unsigned int> > mapped_particle_properties;
613 
614  std::vector<unsigned int> normalized_fields;
637  };
638 
639 }
640 #endif
The NullspaceRemoval struct.
Definition: parameters.h:81
bool use_full_A_block_preconditioner
Definition: parameters.h:431
unsigned int min_grid_level
Definition: parameters.h:531
unsigned int n_expensive_stokes_solver_steps
Definition: parameters.h:429
std::vector< double > global_composition_min_preset
Definition: parameters.h:557
unsigned int composition_degree
Definition: parameters.h:582
double linear_stokes_solver_tolerance
Definition: parameters.h:427
unsigned int n_cheap_stokes_solver_steps
Definition: parameters.h:428
double maximum_time_step
Definition: parameters.h:394
static Kind parse(const std::string &input)
Definition: parameters.h:306
unsigned int initial_adaptive_refinement
Definition: parameters.h:527
double coarsening_fraction
Definition: parameters.h:529
std::vector< unsigned int > normalized_fields
Definition: parameters.h:614
double maximum_first_time_step
Definition: parameters.h:396
static Kind parse(const std::string &input)
Definition: parameters.h:238
double global_temperature_max_preset
Definition: parameters.h:554
std::map< types::boundary_id, std::pair< std::string, std::string > > prescribed_traction_boundary_indicators
Definition: parameters.h:505
unsigned int initial_global_refinement
Definition: parameters.h:526
static const std::string pattern()
Definition: parameters.h:300
double AMG_aggregation_threshold
Definition: parameters.h:438
unsigned int stabilization_alpha
Definition: parameters.h:547
double linear_solver_A_block_tolerance
Definition: parameters.h:430
std::vector< double > additional_refinement_times
Definition: parameters.h:532
std::map< unsigned int, std::pair< std::string, unsigned int > > mapped_particle_properties
Definition: parameters.h:612
bool use_limiter_for_discontinuous_temperature_solution
Definition: parameters.h:552
bool use_locally_conservative_discretization
Definition: parameters.h:577
#define AssertThrow(cond, exc)
double nonlinear_tolerance
Definition: parameters.h:390
unsigned int stokes_gmres_restart_length
Definition: parameters.h:433
static Kind parse(const std::string &input)
Definition: parameters.h:269
unsigned int temperature_degree
Definition: parameters.h:581
bool mesh_deformation_enabled
Definition: parameters.h:622
Formulation::MassConservation::Kind formulation_mass_conservation
Definition: parameters.h:473
bool skip_solvers_on_initial_refinement
Definition: parameters.h:534
bool run_postprocessors_on_initial_refinement
Definition: parameters.h:536
bool use_discontinuous_composition_discretization
Definition: parameters.h:580
bool adapt_by_fraction_of_cells
Definition: parameters.h:530
unsigned int AMG_smoother_sweeps
Definition: parameters.h:437
double temperature_solver_tolerance
Definition: parameters.h:417
NonlinearSolver::Kind nonlinear_solver
Definition: parameters.h:387
std::string world_builder_file
Definition: parameters.h:407
AdvectionStabilizationMethod::Kind advection_stabilization_method
Definition: parameters.h:389
unsigned int stokes_velocity_degree
Definition: parameters.h:576
void declare_parameters(ParameterHandler &prm)
bool enable_additional_stokes_rhs
Definition: parameters.h:497
NullspaceRemoval::Kind nullspace_removal
Definition: parameters.h:517
bool use_artificial_viscosity_smoothing
Definition: parameters.h:397
double discontinuous_penalty
Definition: parameters.h:551
bool volume_of_fluid_tracking_enabled
Definition: parameters.h:631
double reaction_time_step
Definition: parameters.h:442
double stabilization_gamma
Definition: parameters.h:550
double linear_solver_S_block_tolerance
Definition: parameters.h:432
bool use_direct_stokes_solver
Definition: parameters.h:424
bool use_limiter_for_discontinuous_composition_solution
Definition: parameters.h:553
bool use_operator_splitting
Definition: parameters.h:406
double refinement_fraction
Definition: parameters.h:528
unsigned int n_compositional_fields
Definition: parameters.h:594
MaterialModel::MaterialAveraging::AveragingOperation material_averaging
Definition: parameters.h:584
unsigned int reaction_steps_per_advection_step
Definition: parameters.h:443
bool use_conduction_timestep
Definition: parameters.h:398
double maximum_relative_increase_time_step
Definition: parameters.h:395
double composition_solver_tolerance
Definition: parameters.h:418
std::vector< std::string > names_of_compositional_fields
Definition: parameters.h:595
unsigned int max_nonlinear_iterations
Definition: parameters.h:404
Definition: compat.h:37
bool run_postprocessors_on_nonlinear_iterations
Definition: parameters.h:537
bool use_discontinuous_temperature_discretization
Definition: parameters.h:579
static Kind parse(const std::string &input)
Definition: parameters.h:194
std::set< types::boundary_id > fixed_heat_flux_boundary_indicators
Definition: parameters.h:511
std::string output_directory
Definition: parameters.h:400
std::vector< double > stabilization_beta
Definition: parameters.h:549
std::vector< double > stabilization_c_R
Definition: parameters.h:548
std::string pressure_normalization
Definition: parameters.h:583
bool use_equal_order_interpolation_for_stokes
Definition: parameters.h:578
StokesSolverType::Kind stokes_solver_type
Definition: parameters.h:425
unsigned int advection_gmres_restart_length
Definition: parameters.h:421
std::string AMG_smoother_type
Definition: parameters.h:436
double surface_pressure
Definition: parameters.h:401
static ::ExceptionBase & ExcNotImplemented()
double global_temperature_min_preset
Definition: parameters.h:555
Formulation::TemperatureEquation::Kind formulation_temperature_equation
Definition: parameters.h:480
bool include_melt_transport
Definition: parameters.h:496
double adiabatic_surface_temperature
Definition: parameters.h:402
unsigned int max_nonlinear_iterations_in_prerefinement
Definition: parameters.h:405
std::vector< double > global_composition_max_preset
Definition: parameters.h:556
unsigned int timing_output_frequency
Definition: parameters.h:403
std::vector< typename AdvectionFieldMethod::Kind > compositional_field_methods
Definition: parameters.h:601
Formulation::Kind formulation
Definition: parameters.h:465
bool skip_setup_initial_conditions_on_initial_refinement
Definition: parameters.h:535
unsigned int adaptive_refinement_interval
Definition: parameters.h:533
double diffusion_length_scale
Definition: parameters.h:446
static Kind parse(const std::string &input)
Definition: parameters.h:151