[P]arallel [Hi]gh-order [Li]brary for [P]DEs  Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
parameters_manufactured_convergence_study.cpp
1 #include "parameters_manufactured_convergence_study.h"
2 
3 namespace PHiLiP {
4 namespace Parameters {
5 
6 void ManufacturedConvergenceStudyParam::declare_parameters (dealii::ParameterHandler &prm)
7 {
8  prm.enter_subsection("manufactured solution convergence study");
9  {
11 
12  prm.declare_entry("grid_type", "hypercube",
13  dealii::Patterns::Selection("hypercube|sinehypercube|read_grid"),
14  "Enum of generated grid. "
15  "If read_grid, must have grids xxxx#.msh, where # is the grid numbering from 0 to number_of_grids-1."
16  "Choices are <hypercube|sinehypercube|read_grid>.");
17 
18  prm.declare_entry("input_grids", "xxxx",
19  dealii::Patterns::FileName(dealii::Patterns::FileName::FileType::input),
20  "Prefix of Gmsh grids xxxx#.msh used in the grid convergence if read_grid is chosen as the grid_type. ");
21 
22  prm.declare_entry("output_meshes", "false",
23  dealii::Patterns::Bool(),
24  "Writes out meshes used for the simulation."
25  "Output will be Gmsh grids named grid-#.msh");
26 
27  prm.declare_entry("random_distortion", "0.0",
28  dealii::Patterns::Double(0.0, 0.5),
29  "Randomly disturb grid."
30  "Displaces node by percentage of longest associated edge.");
31 
32  prm.declare_entry("initial_grid_size", "2",
33  dealii::Patterns::Integer(),
34  "Initial grid of size (initial_grid_size)^dim");
35  prm.declare_entry("number_of_grids", "4",
36  dealii::Patterns::Integer(),
37  "Number of grids in grid study");
38  prm.declare_entry("grid_progression", "1.5",
39  dealii::Patterns::Double(),
40  "Multiplier on grid size. "
41  "ith-grid will be of size (initial_grid*(i*grid_progression)+(i*grid_progression_add))^dim");
42  prm.declare_entry("grid_progression_add", "0",
43  dealii::Patterns::Integer(),
44  "Adds number of cell to 1D grid. "
45  "ith-grid will be of size (initial_grid*(i*grid_progression)+(i*grid_progression_add))^dim");
46 
47  prm.declare_entry("slope_deficit_tolerance", "0.1",
48  dealii::Patterns::Double(),
49  "Tolerance within which the convergence orders are considered to be optimal. ");
50 
51  prm.declare_entry("degree_start", "0",
52  dealii::Patterns::Integer(),
53  "Starting degree for convergence study");
54  prm.declare_entry("degree_end", "3",
55  dealii::Patterns::Integer(),
56  "Last degree used for convergence study");
57 
58  prm.declare_entry("output_convergence_tables", "false",
59  dealii::Patterns::Bool(),
60  "Writes the convergence tables for each polynomial degree p."
61  "Output will be txt files named convergence_table_[dim]d_[pde_string]_[conv_num_flux_string]_[diss_num_flux_string]_[manufactured_solution_string]_p[poly_degree].txt");
62 
63  prm.declare_entry("output_solution", "false",
64  dealii::Patterns::Bool(),
65  "Writes the solution files."
66  "Output will be vtu and pvtu files.");
67 
68  prm.declare_entry("add_statewise_solution_error_to_convergence_tables", "false",
69  dealii::Patterns::Bool(),
70  "Adds the soln_L2_error of each state to the convergence table."
71  "Field names are soln_L2_error_state_istate, where istate=[0,1,...,nstate-1]");
72  }
73  prm.leave_subsection();
74 }
75 
76 void ManufacturedConvergenceStudyParam ::parse_parameters (dealii::ParameterHandler &prm)
77 {
78  prm.enter_subsection("manufactured solution convergence study");
79  {
81 
82  const std::string grid_string = prm.get("grid_type");
83  if (grid_string == "hypercube") grid_type = GridEnum::hypercube;
84  if (grid_string == "sinehypercube") grid_type = GridEnum::sinehypercube;
85  if (grid_string == "read_grid") {
86  grid_type = GridEnum::read_grid;
87  input_grids = prm.get("input_grids");
88  }
89 
90  random_distortion = prm.get_double("random_distortion");
91  output_meshes = prm.get_bool("output_meshes");
92 
93  degree_start = prm.get_integer("degree_start");
94  degree_end = prm.get_integer("degree_end");
95 
96  initial_grid_size = prm.get_integer("initial_grid_size");
97  number_of_grids = prm.get_integer("number_of_grids");
98  grid_progression = prm.get_double("grid_progression");
99  grid_progression_add = prm.get_integer("grid_progression_add");
100 
101  slope_deficit_tolerance = prm.get_double("slope_deficit_tolerance");
102 
103  output_convergence_tables = prm.get_bool("output_convergence_tables");
104  output_solution = prm.get_bool("output_solution");
105  add_statewise_solution_error_to_convergence_tables = prm.get_bool("add_statewise_solution_error_to_convergence_tables");
106  }
107  prm.leave_subsection();
108 }
109 
110 } // Parameters namespace
111 } // PHiLiP namespace
unsigned int degree_start
First polynomial degree to start the loop. If diffusion, must be at least 1.
double random_distortion
Will randomly distort mesh except on boundaries.
bool output_solution
Output the solution files (for each p and grid) as vtu and pvtu files; currently only works for tests...
bool add_statewise_solution_error_to_convergence_tables
Adds the statewise solution L2 error to the convergence tables; currently only works for tests using ...
double slope_deficit_tolerance
Tolerance within which the convergence orders are considered to be optimal.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
Files for the baseline physics.
Definition: ADTypes.hpp:10
ManufacturedSolutionParam manufactured_solution_param
Associated manufactured solution parameters.
bool output_convergence_tables
Output the convergence tables (for each p) as txt files; currently only works for tests using grid_st...
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
double grid_progression
Multiplies the last grid size by this amount.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.