[P]arallel [Hi]gh-order [Li]brary for [P]DEs  Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
all_parameters.cpp
1 #include <deal.II/base/mpi.h>
2 #include <deal.II/base/utilities.h>
3 #include <deal.II/base/patterns.h>
4 
5 #include "parameters/all_parameters.h"
6 
7 //for checking output directories
8 #include <sys/types.h>
9 #include <sys/stat.h>
10 
11 namespace PHiLiP {
12 namespace Parameters {
13 
15  : manufactured_convergence_study_param(ManufacturedConvergenceStudyParam())
16  , ode_solver_param(ODESolverParam())
17  , linear_solver_param(LinearSolverParam())
18  , euler_param(EulerParam())
19  , navier_stokes_param(NavierStokesParam())
20  , reduced_order_param(ReducedOrderModelParam())
21  , hyper_reduction_param(HyperReductionParam())
22  , burgers_param(BurgersParam())
23  , physics_model_param(PhysicsModelParam())
24  , grid_refinement_study_param(GridRefinementStudyParam())
25  , artificial_dissipation_param(ArtificialDissipationParam())
26  , limiter_param(LimiterParam())
27  , flow_solver_param(FlowSolverParam())
28  , mesh_adaptation_param(MeshAdaptationParam())
29  , functional_param(FunctionalParam())
30  , time_refinement_study_param(TimeRefinementStudyParam())
31  , pcout(std::cout, dealii::Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)==0)
32 { }
33 
34 void AllParameters::declare_parameters (dealii::ParameterHandler &prm)
35 {
36  const int mpi_rank = dealii::Utilities::MPI::this_mpi_process(MPI_COMM_WORLD);
37  dealii::ConditionalOStream pcout(std::cout, mpi_rank==0);
38  pcout << "Declaring inputs." << std::endl;
39  prm.declare_entry("dimension", "-1",
40  dealii::Patterns::Integer(),
41  "Number of dimensions");
42 
43  prm.declare_entry("run_type", "integration_test",
44  dealii::Patterns::Selection(
45  " integration_test | "
46  " flow_simulation"),
47  "Type of run (default is integration_test). "
48  "Choices are <integration_test | flow_simulation>.");
49 
50  prm.declare_entry("mesh_type", "default_triangulation",
51  dealii::Patterns::Selection(
52  " default_triangulation | "
53  " triangulation | "
54  " parallel_shared_triangulation | "
55  " parallel_distributed_triangulation"),
56  "Type of triangulation to be used."
57  "Note: parralel_distributed_triangulation not availible int 1D."
58  " <default_triangulation | "
59  " triangulation | "
60  " parallel_shared_triangulation |"
61  " parallel_distributed_triangulation>.");
62 
63  prm.declare_entry("overintegration", "0",
64  dealii::Patterns::Integer(),
65  "Number of extra quadrature points to use."
66  "If overintegration=0, then we use n_quad = soln_degree + 1.");
67 
68  prm.declare_entry("use_weak_form", "true",
69  dealii::Patterns::Bool(),
70  "Use weak form by default. If false, use strong form.");
71 
72  prm.declare_entry("flux_nodes_type", "GL",
73  dealii::Patterns::Selection(
74  "GL | GLL"),
75  "Flux nodes type, default is GL for uncollocated. NOTE: Solution nodes are type GLL."
76  "Choices are <GL | GLL>.");
77 
78  prm.declare_entry("use_split_form", "false",
79  dealii::Patterns::Bool(),
80  "Use original form by defualt. Otherwise, split the fluxes.");
81 
82  prm.declare_entry("two_point_num_flux_type", "KG",
83  dealii::Patterns::Selection(
84  "KG | IR | CH | Ra"),
85  "Two point flux type. "
86  "Choices are <KG | IR | CH | Ra>.");
87 
88  prm.declare_entry("use_curvilinear_split_form", "false",
89  dealii::Patterns::Bool(),
90  "Use original form by defualt. Otherwise, split the curvilinear fluxes.");
91 
92  prm.declare_entry("store_residual_cpu_time", "false",
93  dealii::Patterns::Bool(),
94  "Do not store the residual local processor cpu time by default. Store the residual cpu time if true.");
95 
96  prm.declare_entry("use_weight_adjusted_mass", "false",
97  dealii::Patterns::Bool(),
98  "Use original form by defualt. Otherwise, use the weight adjusted low storage mass matrix for curvilinear.");
99 
100  prm.declare_entry("use_periodic_bc", "false",
101  dealii::Patterns::Bool(),
102  "Use other boundary conditions by default. Otherwise use periodic (for 1d burgers only");
103 
104  prm.declare_entry("use_curvilinear_grid", "false",
105  dealii::Patterns::Bool(),
106  "Use straight grid by default. Curvilinear is true. Only used in taylor_green_scaling test.");
107 
108  prm.declare_entry("use_energy", "false",
109  dealii::Patterns::Bool(),
110  "Not calculate energy by default. Otherwise, get energy per iteration.");
111 
112  prm.declare_entry("use_L2_norm", "false",
113  dealii::Patterns::Bool(),
114  "Not calculate L2 norm by default (M+K). Otherwise, get L2 norm per iteration.");
115 
116  prm.declare_entry("use_classical_FR", "false",
117  dealii::Patterns::Bool(),
118  "Not use Classical Flux Reconstruction by default. Otherwise, use Classical Flux Reconstruction.");
119 
120  prm.declare_entry("flux_reconstruction", "cDG",
121  dealii::Patterns::Selection(
122  "cDG | cSD | cHU | cNegative | cNegative2 | cPlus | c10Thousand | cHULumped"),
123  "Flux Reconstruction. "
124  "Choices are "
125  " <cDG | cSD | cHU | cNegative | cNegative2 | cPlus | c10Thousand | cHULumped>.");
126 
127  prm.declare_entry("flux_reconstruction_aux", "kDG",
128  dealii::Patterns::Selection(
129  "kDG | kSD | kHU | kNegative | kNegative2 | kPlus | k10Thousand"),
130  "Flux Reconstruction for Auxiliary Equation. "
131  "Choices are <kDG | kSD | kHU | kNegative | kNegative2 | kPlus | k10Thousand>.");
132 
133  prm.declare_entry("sipg_penalty_factor", "1.0",
134  dealii::Patterns::Double(1.0,1e200),
135  "Scaling of Symmetric Interior Penalty term to ensure coercivity.");
136 
137  prm.declare_entry("use_invariant_curl_form", "false",
138  dealii::Patterns::Bool(),
139  "Use conservative curl form for metric cofactor by default. If true, then use invariant curl form.");
140 
141  prm.declare_entry("use_inverse_mass_on_the_fly", "false",
142  dealii::Patterns::Bool(),
143  "Build global mass inverse matrix and apply it. Otherwise, use inverse mass on-the-fly by default for explicit timestepping.");
144 
145  prm.declare_entry("check_valid_metric_Jacobian", "true",
146  dealii::Patterns::Bool(),
147  "Check validty of metric Jacobian when high-order grid is constructed by default. Do not check if false. Not checking is useful if the metric terms are built on the fly with operators, it reduces the memory cost for high polynomial grids. The metric Jacobian is never checked for strong form, regardless of the user input.");
148 
149  prm.declare_entry("energy_file", "energy_file",
150  dealii::Patterns::FileName(dealii::Patterns::FileName::FileType::input),
151  "Input file for energy test.");
152 
153  prm.declare_entry("test_type", "run_control",
154  dealii::Patterns::Selection(
155  " run_control | "
156  " grid_refinement_study | "
157  " advection_limiter | "
158  " burgers_limiter | "
159  " burgers_energy_stability | "
160  " diffusion_exact_adjoint | "
161  " optimization_inverse_manufactured | "
162  " euler_gaussian_bump | "
163  " euler_gaussian_bump_enthalpy | "
164  " euler_gaussian_bump_adjoint | "
165  " euler_cylinder | "
166  " euler_cylinder_adjoint | "
167  " euler_vortex | "
168  " euler_entropy_waves | "
169  " euler_split_taylor_green | "
170  " taylor_green_scaling | "
171  " euler_bump_optimization | "
172  " euler_naca_optimization | "
173  " shock_1d | "
174  " euler_naca0012 | "
175  " reduced_order | "
176  " unsteady_reduced_order |"
177  " convection_diffusion_periodicity |"
178  " POD_adaptation | "
179  " POD_adaptive_sampling_run | "
180  " adaptive_sampling_testing | "
181  " finite_difference_sensitivity | "
182  " advection_periodicity | "
183  " dual_weighted_residual_mesh_adaptation | "
184  " anisotropic_mesh_adaptation | "
185  " taylor_green_vortex_energy_check | "
186  " taylor_green_vortex_restart_check | "
187  " homogeneous_isotropic_turbulence_initialization_check | "
188  " time_refinement_study | "
189  " time_refinement_study_reference | "
190  " rrk_numerical_entropy_conservation_check | "
191  " euler_entropy_conserving_split_forms_check | "
192  " h_refinement_study_isentropic_vortex | "
193  " build_NNLS_problem |"
194  " hyper_reduction_comparison |"
195  " hyper_adaptive_sampling_run |"
196  " hyper_reduction_post_sampling |"
197  " ROM_error_post_sampling |"
198  " HROM_error_post_sampling | "
199  " hyper_adaptive_sampling_new_error |"
200  " halton_sampling_run |"
201  " naca0012_unsteady_check_quick | "
202  " khi_robustness | "
203  " low_density "),
204  "The type of test we want to solve. "
205  "Choices are "
206  " <run_control | "
207  " grid_refinement_study | "
208  " advection_limiter | "
209  " burgers_limiter | "
210  " burgers_energy_stability | "
211  " diffusion_exact_adjoint | "
212  " optimization_inverse_manufactured | "
213  " euler_gaussian_bump | "
214  " euler_gaussian_bump_enthalpy | "
215  " euler_gaussian_bump_adjoint | "
216  " euler_cylinder | "
217  " euler_cylinder_adjoint | "
218  " euler_vortex | "
219  " euler_entropy_waves | "
220  " euler_split_taylor_green |"
221  " taylor_green_scaling | "
222  " euler_bump_optimization | "
223  " euler_naca_optimization | "
224  " shock_1d | "
225  " euler_naca0012 | "
226  " convection_diffusion_periodicity |"
227  " reduced_order | "
228  " unsteady_reduced_order | "
229  " POD_adaptation | "
230  " POD_adaptive_sampling_run | "
231  " adaptive_sampling_testing | "
232  " finite_difference_sensitivity | "
233  " advection_periodicity | "
234  " dual_weighted_residual_mesh_adaptation | "
235  " anisotropic_mesh_adaptation | "
236  " taylor_green_vortex_energy_check | "
237  " taylor_green_vortex_restart_check | "
238  " homogeneous_isotropic_turbulence_initialization_check | "
239  " time_refinement_study | "
240  " time_refinement_study_reference | "
241  " rrk_numerical_entropy_conservation_check | "
242  " euler_entropy_conserving_split_forms_check | "
243  " h_refinement_study_isentropic_vortex | "
244  " build_NNLS_problem |"
245  " hyper_reduction_comparison |"
246  " hyper_adaptive_sampling_run |"
247  " hyper_reduction_post_sampling |"
248  " ROM_error_post_sampling |"
249  " HROM_error_post_sampling | "
250  " hyper_adaptive_sampling_new_error |"
251  " halton_sampling_run |"
252  " naca0012_unsteady_check_quick | "
253  " khi_robustness | "
254  " low_density>.");
255 
256  prm.declare_entry("pde_type", "advection",
257  dealii::Patterns::Selection(
258  " advection | "
259  " diffusion | "
260  " convection_diffusion | "
261  " advection_vector | "
262  " burgers_inviscid | "
263  " burgers_viscous | "
264  " burgers_rewienski | "
265  " euler |"
266  " mhd |"
267  " navier_stokes |"
268  " physics_model"),
269  "The PDE we want to solve. "
270  "Choices are "
271  " <advection | "
272  " diffusion | "
273  " convection_diffusion | "
274  " advection_vector | "
275  " burgers_inviscid | "
276  " burgers_viscous | "
277  " burgers_rewienski | "
278  " euler | "
279  " mhd |"
280  " navier_stokes |"
281  " physics_model>.");
282 
283  prm.declare_entry("model_type", "large_eddy_simulation",
284  dealii::Patterns::Selection(
285  "large_eddy_simulation | reynolds_averaged_navier_stokes"),
286  "Enum of physics models "
287  "(i.e. model equations and/or terms additional to Navier-Stokes or a chosen underlying baseline physics)."
288  "Choices are "
289  " <large_eddy_simulation | reynolds_averaged_navier_stokes>.");
290 
291  prm.declare_entry("conv_num_flux", "lax_friedrichs",
292  dealii::Patterns::Selection(
293  " lax_friedrichs | "
294  " roe | "
295  " l2roe | "
296  " central_flux | "
297  " two_point_flux | "
298  " two_point_flux_with_lax_friedrichs_dissipation | "
299  " two_point_flux_with_roe_dissipation | "
300  " two_point_flux_with_l2roe_dissipation"),
301  "Convective numerical flux. "
302  "Choices are "
303  " <lax_friedrichs | "
304  " roe | "
305  " l2roe | "
306  " central_flux | "
307  " two_point_flux | "
308  " two_point_flux_with_lax_friedrichs_dissipation | "
309  " two_point_flux_with_roe_dissipation | "
310  " two_point_flux_with_l2roe_dissipation>.");
311 
312  prm.declare_entry("diss_num_flux", "symm_internal_penalty",
313  dealii::Patterns::Selection("symm_internal_penalty | bassi_rebay_2 | central_visc_flux"),
314  "Dissipative numerical flux. "
315  "Choices are <symm_internal_penalty | bassi_rebay_2 | central_visc_flux>.");
316 
317  prm.declare_entry("non_physical_behavior", "return_big_number",
318  dealii::Patterns::Selection("return_big_number | abort_run | print_warning"),
319  "Behavior when a nonphysical result is detected in physics, "
320  "For example negative density or NaN. "
321  "return_big_number will set the quantity to BIG_NUMBER without any warnings "
322  "abort_run will std::abort() "
323  "print_warning will return BIG_NUMBER and print a warning to console. "
324  "Choices are <return_big_number | abort_run | print_warning>.");
325 
326  prm.declare_entry("solution_vtk_files_directory_name", ".",
327  dealii::Patterns::FileName(dealii::Patterns::FileName::FileType::input),
328  "Name of directory for writing solution vtk files. Current directory by default.");
329 
330  prm.declare_entry("output_high_order_grid", "false",
331  dealii::Patterns::Bool(),
332  "Outputs the high-order mesh vtu files. False by default");
333 
334  prm.declare_entry("enable_higher_order_vtk_output", "true",
335  dealii::Patterns::Bool(),
336  "Enable writing of higher-order vtk files. True by default; "
337  "number of subdivisions is chosen according to the max of grid_degree and poly_degree.");
338 
339  prm.declare_entry("output_face_results_vtk", "false",
340  dealii::Patterns::Bool(),
341  "Outputs the surface solution vtk files. False by default");
342 
343  prm.declare_entry("do_renumber_dofs", "true",
344  dealii::Patterns::Bool(),
345  "Flag for renumbering DOFs using Cuthill-McKee renumbering. True by default. Set to false if doing 3D unsteady flow simulations.");
346 
347  prm.declare_entry("renumber_dofs_type", "CuthillMckee",
348  dealii::Patterns::Selection(
349  "CuthillMckee"),
350  "Renumber the dof handler type. Currently the only choice is Cuthill-Mckee.");
351 
352  prm.declare_entry("matching_surface_jac_det_tolerance", "1.3e-11",
353  dealii::Patterns::Double(0, dealii::Patterns::Double::max_double_value),
354  "Tolerance for checking that the determinant of surface jacobians at element faces matches. "
355  "Note: Currently only used in weak dg.");
356 
373 
374  pcout << "Done declaring inputs." << std::endl;
375 }
376 
377 void AllParameters::parse_parameters (dealii::ParameterHandler &prm)
378 {
379  pcout << "Parsing main input..." << std::endl;
380 
381  dimension = prm.get_integer("dimension");
382 
383  const std::string run_type_string = prm.get("run_type");
384  if (run_type_string == "integration_test") { run_type = integration_test; }
385  else if (run_type_string == "flow_simulation") { run_type = flow_simulation; }
386 
387  const std::string mesh_type_string = prm.get("mesh_type");
388  if (mesh_type_string == "default_triangulation") { mesh_type = default_triangulation; }
389  else if (mesh_type_string == "triangulation") { mesh_type = triangulation; }
390  else if (mesh_type_string == "parallel_shared_triangulation") { mesh_type = parallel_shared_triangulation; }
391  else if (mesh_type_string == "parallel_distributed_triangulation") { mesh_type = parallel_distributed_triangulation; }
392 
393 const std::string test_string = prm.get("test_type");
394  if (test_string == "run_control") { test_type = run_control; }
395  else if (test_string == "grid_refinement_study") { test_type = grid_refinement_study; }
396  else if (test_string == "advection_limiter") { test_type = advection_limiter; }
397  else if (test_string == "burgers_limiter") { test_type = burgers_limiter; }
398  else if (test_string == "burgers_energy_stability") { test_type = burgers_energy_stability; }
399  else if (test_string == "diffusion_exact_adjoint") { test_type = diffusion_exact_adjoint; }
400  else if (test_string == "euler_gaussian_bump") { test_type = euler_gaussian_bump; }
401  else if (test_string == "euler_gaussian_bump_enthalpy") { test_type = euler_gaussian_bump_enthalpy; }
402  else if (test_string == "euler_gaussian_bump_adjoint") { test_type = euler_gaussian_bump_adjoint; }
403  else if (test_string == "euler_cylinder") { test_type = euler_cylinder; }
404  else if (test_string == "euler_cylinder_adjoint") { test_type = euler_cylinder_adjoint; }
405  else if (test_string == "euler_vortex") { test_type = euler_vortex; }
406  else if (test_string == "euler_entropy_waves") { test_type = euler_entropy_waves; }
407  else if (test_string == "advection_periodicity") { test_type = advection_periodicity; }
408  else if (test_string == "convection_diffusion_periodicity") { test_type = convection_diffusion_periodicity; }
409  else if (test_string == "euler_split_taylor_green") { test_type = euler_split_taylor_green; }
410  else if (test_string == "taylor_green_scaling") { test_type = taylor_green_scaling; }
411  else if (test_string == "euler_bump_optimization") { test_type = euler_bump_optimization; }
412  else if (test_string == "euler_naca_optimization") { test_type = euler_naca_optimization; }
413  else if (test_string == "shock_1d") { test_type = shock_1d; }
414  else if (test_string == "reduced_order") { test_type = reduced_order; }
415  else if (test_string == "unsteady_reduced_order") { test_type = unsteady_reduced_order; }
416  else if (test_string == "POD_adaptation") { test_type = POD_adaptation; }
417  else if (test_string == "POD_adaptive_sampling_run") { test_type = POD_adaptive_sampling_run; }
418  else if (test_string == "adaptive_sampling_testing") { test_type = adaptive_sampling_testing; }
419  else if (test_string == "finite_difference_sensitivity") { test_type = finite_difference_sensitivity; }
420  else if (test_string == "euler_naca0012") { test_type = euler_naca0012; }
421  else if (test_string == "optimization_inverse_manufactured") { test_type = optimization_inverse_manufactured; }
422  else if (test_string == "dual_weighted_residual_mesh_adaptation") { test_type = dual_weighted_residual_mesh_adaptation; }
423  else if (test_string == "anisotropic_mesh_adaptation") { test_type = anisotropic_mesh_adaptation; }
424  else if (test_string == "taylor_green_vortex_energy_check") { test_type = taylor_green_vortex_energy_check; }
425  else if (test_string == "taylor_green_vortex_restart_check") { test_type = taylor_green_vortex_restart_check; }
426  else if (test_string == "homogeneous_isotropic_turbulence_initialization_check")
427  { test_type = homogeneous_isotropic_turbulence_initialization_check; }
428  else if (test_string == "time_refinement_study") { test_type = time_refinement_study; }
429  else if (test_string == "time_refinement_study_reference") { test_type = time_refinement_study_reference; }
430  else if (test_string == "h_refinement_study_isentropic_vortex") { test_type = h_refinement_study_isentropic_vortex; }
431  else if (test_string == "rrk_numerical_entropy_conservation_check") { test_type = rrk_numerical_entropy_conservation_check; }
432  else if (test_string == "euler_entropy_conserving_split_forms_check")
433  { test_type = euler_entropy_conserving_split_forms_check; }
434  else if (test_string == "h_refinement_study_isentropic_vortex") { test_type = h_refinement_study_isentropic_vortex; }
435  else if (test_string == "khi_robustness") { test_type = khi_robustness; }
436  else if (test_string == "build_NNLS_problem") { test_type = build_NNLS_problem; }
437  else if (test_string == "hyper_reduction_comparison") { test_type = hyper_reduction_comparison; }
438  else if (test_string == "hyper_adaptive_sampling_run") { test_type = hyper_adaptive_sampling_run; }
439  else if (test_string == "hyper_reduction_post_sampling") { test_type = hyper_reduction_post_sampling; }
440  else if (test_string == "ROM_error_post_sampling") { test_type = ROM_error_post_sampling; }
441  else if (test_string == "HROM_error_post_sampling") { test_type = HROM_error_post_sampling; }
442  else if (test_string == "hyper_adaptive_sampling_new_error") { test_type = hyper_adaptive_sampling_new_error; }
443  else if (test_string == "halton_sampling_run") { test_type = halton_sampling_run; }
444  else if (test_string == "low_density") { test_type = low_density; }
445  else if (test_string == "naca0012_unsteady_check_quick") { test_type = naca0012_unsteady_check_quick; }
446 
447  overintegration = prm.get_integer("overintegration");
448 
449  use_weak_form = prm.get_bool("use_weak_form");
450 
451  const std::string flux_nodes_string = prm.get("flux_nodes_type");
452  if (flux_nodes_string == "GL") { flux_nodes_type = FluxNodes::GL; }
453  if (flux_nodes_string == "GLL") { flux_nodes_type = FluxNodes::GLL; }
454 
455  use_collocated_nodes = (flux_nodes_type==FluxNodes::GLL) && (overintegration==0);
456 
457  use_split_form = prm.get_bool("use_split_form");
458 
459  const std::string two_point_num_flux_string = prm.get("two_point_num_flux_type");
460  if (two_point_num_flux_string == "KG") { two_point_num_flux_type = TwoPointNumericalFlux::KG; }
461  if (two_point_num_flux_string == "IR") { two_point_num_flux_type = TwoPointNumericalFlux::IR; }
462  if (two_point_num_flux_string == "CH") { two_point_num_flux_type = TwoPointNumericalFlux::CH; }
463  if (two_point_num_flux_string == "Ra") { two_point_num_flux_type = TwoPointNumericalFlux::Ra; }
464 
465  use_curvilinear_split_form = prm.get_bool("use_curvilinear_split_form");
466  use_curvilinear_grid = prm.get_bool("use_curvilinear_grid");
467  store_residual_cpu_time = prm.get_bool("store_residual_cpu_time");
468  use_weight_adjusted_mass = prm.get_bool("use_weight_adjusted_mass");
469  use_periodic_bc = prm.get_bool("use_periodic_bc");
470  use_energy = prm.get_bool("use_energy");
471  use_L2_norm = prm.get_bool("use_L2_norm");
472  use_classical_FR = prm.get_bool("use_classical_FR");
473  sipg_penalty_factor = prm.get_double("sipg_penalty_factor");
474  use_invariant_curl_form = prm.get_bool("use_invariant_curl_form");
475  use_inverse_mass_on_the_fly = prm.get_bool("use_inverse_mass_on_the_fly");
476  check_valid_metric_Jacobian = prm.get_bool("check_valid_metric_Jacobian");
477  if(!use_weak_form){
479  }
480 
481  energy_file = prm.get("energy_file");
482 
483  const std::string conv_num_flux_string = prm.get("conv_num_flux");
484  if (conv_num_flux_string == "lax_friedrichs") { conv_num_flux_type = ConvectiveNumericalFlux::lax_friedrichs; }
485  if (conv_num_flux_string == "roe") { conv_num_flux_type = ConvectiveNumericalFlux::roe; }
486  if (conv_num_flux_string == "l2roe") { conv_num_flux_type = ConvectiveNumericalFlux::l2roe; }
487  if (conv_num_flux_string == "central_flux") { conv_num_flux_type = ConvectiveNumericalFlux::central_flux; }
488  if (conv_num_flux_string == "two_point_flux") { conv_num_flux_type = ConvectiveNumericalFlux::two_point_flux; }
489  if (conv_num_flux_string == "two_point_flux_with_lax_friedrichs_dissipation") { conv_num_flux_type = ConvectiveNumericalFlux::two_point_flux_with_lax_friedrichs_dissipation; }
490  if (conv_num_flux_string == "two_point_flux_with_roe_dissipation") { conv_num_flux_type = ConvectiveNumericalFlux::two_point_flux_with_roe_dissipation; }
491  if (conv_num_flux_string == "two_point_flux_with_l2roe_dissipation") { conv_num_flux_type = ConvectiveNumericalFlux::two_point_flux_with_l2roe_dissipation; }
492 
493  const std::string diss_num_flux_string = prm.get("diss_num_flux");
494  if (diss_num_flux_string == "symm_internal_penalty") { diss_num_flux_type = symm_internal_penalty; }
495  if (diss_num_flux_string == "bassi_rebay_2") {
496  diss_num_flux_type = bassi_rebay_2;
497  sipg_penalty_factor = 0.0;
498  }
499  if (diss_num_flux_string == "central_visc_flux") diss_num_flux_type = central_visc_flux;
500 
501  const std::string flux_reconstruction_string = prm.get("flux_reconstruction");
502  if (flux_reconstruction_string == "cDG") { flux_reconstruction_type = cDG; }
503  if (flux_reconstruction_string == "cSD") { flux_reconstruction_type = cSD; }
504  if (flux_reconstruction_string == "cHU") { flux_reconstruction_type = cHU; }
505  if (flux_reconstruction_string == "cNegative") { flux_reconstruction_type = cNegative; }
506  if (flux_reconstruction_string == "cNegative2") { flux_reconstruction_type = cNegative2; }
507  if (flux_reconstruction_string == "cPlus") { flux_reconstruction_type = cPlus; }
508  if (flux_reconstruction_string == "c10Thousand") { flux_reconstruction_type = c10Thousand; }
509  if (flux_reconstruction_string == "cHULumped") { flux_reconstruction_type = cHULumped; }
510 
511  const std::string flux_reconstruction_aux_string = prm.get("flux_reconstruction_aux");
512  if (flux_reconstruction_aux_string == "kDG") { flux_reconstruction_aux_type = kDG; }
513  if (flux_reconstruction_aux_string == "kSD") { flux_reconstruction_aux_type = kSD; }
514  if (flux_reconstruction_aux_string == "kHU") { flux_reconstruction_aux_type = kHU; }
515  if (flux_reconstruction_aux_string == "kNegative") { flux_reconstruction_aux_type = kNegative; }
516  if (flux_reconstruction_aux_string == "kNegative2") { flux_reconstruction_aux_type = kNegative2; }
517  if (flux_reconstruction_aux_string == "kPlus") { flux_reconstruction_aux_type = kPlus; }
518  if (flux_reconstruction_aux_string == "k10Thousand") { flux_reconstruction_aux_type = k10Thousand; }
519 
520  const std::string non_physical_behavior_string = prm.get("non_physical_behavior");
521  if (non_physical_behavior_string == "return_big_number") { non_physical_behavior_type = NonPhysicalBehaviorEnum::return_big_number;}
522  if (non_physical_behavior_string == "abort_run") { non_physical_behavior_type = NonPhysicalBehaviorEnum::abort_run;}
523  if (non_physical_behavior_string == "print_warning") { non_physical_behavior_type = NonPhysicalBehaviorEnum::print_warning;}
524 
525  solution_vtk_files_directory_name = prm.get("solution_vtk_files_directory_name");
526  // Check if directory exists - see https://stackoverflow.com/a/18101042
527  struct stat info_vtk;
528  if( stat( solution_vtk_files_directory_name.c_str(), &info_vtk ) != 0 ){
529  pcout << "Error: No solution vtk files directory named " << solution_vtk_files_directory_name << " exists." << std::endl
530  << "Please create the directory and restart. Aborting..." << std::endl;
531  std::abort();
532  }
533  output_high_order_grid = prm.get_bool("output_high_order_grid");
534  enable_higher_order_vtk_output = prm.get_bool("enable_higher_order_vtk_output");
535  output_face_results_vtk = prm.get_bool("output_face_results_vtk");
536  do_renumber_dofs = prm.get_bool("do_renumber_dofs");
537 
538  const std::string renumber_dofs_type_string = prm.get("renumber_dofs_type");
539  if (renumber_dofs_type_string == "CuthillMckee") { renumber_dofs_type = RenumberDofsType::CuthillMckee; }
540 
541  matching_surface_jac_det_tolerance = prm.get_double("matching_surface_jac_det_tolerance");
542 
543  pcout << "Parsing linear solver subsection..." << std::endl;
545 
546  pcout << "Parsing ODE solver subsection..." << std::endl;
548 
549  pcout << "Parsing manufactured convergence study subsection..." << std::endl;
551 
552  pcout << "Parsing euler subsection..." << std::endl;
554 
555  pcout << "Parsing navier stokes subsection..." << std::endl;
557 
558  pcout << "Parsing reduced order subsection..." << std::endl;
560 
561  pcout << "Parsing hyperreduction subsection..." << std::endl;
563 
564  pcout << "Parsing Burgers subsection..." << std::endl;
566 
567  pcout << "Parsing physics model subsection..." << std::endl;
569 
570  pcout << "Parsing grid refinement study subsection..." << std::endl;
572 
573  pcout << "Parsing artificial dissipation subsection..." << std::endl;
575 
576  pcout << "Parsing limiter subsection..." << std::endl;
578 
579  pcout << "Parsing flow solver subsection..." << std::endl;
581 
582  pcout << "Parsing mesh adaptation subsection..." << std::endl;
584 
585  pcout << "Parsing functional subsection..." << std::endl;
587 
588  // WARNING: Must assign model_type before pde_type
589  const std::string model_string = prm.get("model_type");
590  if (model_string == "large_eddy_simulation") { model_type = large_eddy_simulation; }
591  else if (model_string == "reynolds_averaged_navier_stokes") { model_type = reynolds_averaged_navier_stokes; }
592 
593  const std::string pde_string = prm.get("pde_type");
594  if (pde_string == "advection") {
595  pde_type = advection;
596  nstate = 1;
597  } else if (pde_string == "advection_vector") {
598  pde_type = advection_vector;
599  nstate = 2;
600  } else if (pde_string == "diffusion") {
601  pde_type = diffusion;
602  nstate = 1;
603  } else if (pde_string == "convection_diffusion") {
604  pde_type = convection_diffusion;
605  nstate = 1;
606  } else if (pde_string == "burgers_inviscid") {
607  pde_type = burgers_inviscid;
608  nstate = dimension;
609  } else if (pde_string == "burgers_viscous") {
610  pde_type = burgers_viscous;
611  nstate = dimension;
612  } else if (pde_string == "burgers_rewienski") {
613  pde_type = burgers_rewienski;
614  nstate = dimension;
615  } else if (pde_string == "euler") {
616  pde_type = euler;
617  nstate = dimension+2;
618  }
619  else if (pde_string == "navier_stokes") {
620  pde_type = navier_stokes;
621  nstate = dimension+2;
622  }
623  else if (pde_string == "physics_model") {
624  pde_type = physics_model;
625  if (model_type == large_eddy_simulation)
626  {
627  nstate = dimension+2;
628  }
629  else if (model_type == reynolds_averaged_navier_stokes)
630  {
631  if(physics_model_param.RANS_model_type == Parameters::PhysicsModelParam::ReynoldsAveragedNavierStokesModel::SA_negative)
632  nstate = dimension+3;
633  }
634  }
635 
636  pcout << "Parsing time refinement study subsection..." << std::endl;
638 
639  pcout << "Done parsing." << std::endl;
640 }
641 
642 } // Parameters namespace
643 } // PHiLiP namespace
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
TwoPointNumericalFlux two_point_num_flux_type
Store selected TwoPointNumericalFlux from the input file.
PartialDifferentialEquation pde_type
Store the PDE type to be solved.
bool use_curvilinear_grid
Flag to use curvilinear grid.
LimiterParam limiter_param
Contains parameters for limiter.
Parameters related to the linear solver.
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.
TimeRefinementStudyParam time_refinement_study_param
Contains the parameters for time refinement study.
NonPhysicalBehaviorEnum non_physical_behavior_type
Specify behavior on nonphysical results.
FlowSolverParam flow_solver_param
Contains the parameters for simulation cases (flow solver test)
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
Parameters related to the manufactured convergence study.
bool output_face_results_vtk
Flag for outputting the surface solution vtk files.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
Parameters related to time refinement studies.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
bool use_energy
Flag to use an energy monotonicity test.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
void parse_parameters(dealii::ParameterHandler &prm)
Function to parse parameters.
Files for the baseline physics.
Definition: ADTypes.hpp:10
GridRefinementStudyParam grid_refinement_study_param
Contains the parameters for grid refinement study.
bool use_weak_form
Flag to use weak or strong form of DG.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
dealii::ConditionalOStream pcout
Parallel std::cout that only outputs on mpi_rank==0.
bool use_invariant_curl_form
Flag to use invariant curl form for metric cofactor operator.
Parameters related to reduced-order model.
ReducedOrderModelParam reduced_order_param
Contains parameters for the Reduced-Order model.
Flux_Reconstruction_Aux flux_reconstruction_aux_type
Store flux reconstruction type for the auxiliary variables.
EulerParam euler_param
Contains parameters for the Euler equations non-dimensionalization.
void parse_parameters(dealii::ParameterHandler &prm)
Parse parameters.
Parameters related to the limiter.
unsigned int dimension
Number of dimensions. Note that it has to match the executable PHiLiP_xD.
RunType run_type
Selected RunType from the input file.
MeshAdaptationParam mesh_adaptation_param
Constains parameters for mesh adaptation.
std::string energy_file
Energy file.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
static void declare_parameters(dealii::ParameterHandler &prm)
Function to declare parameters.
ManufacturedConvergenceStudyParam manufactured_convergence_study_param
Contains parameters for manufactured convergence study.
bool enable_higher_order_vtk_output
Enable writing of higher-order vtk results.
Flux_Reconstruction flux_reconstruction_type
Store flux reconstruction type.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
ODESolverParam ode_solver_param
Contains parameters for ODE solver.
Parameters related to reduced-order model.
bool use_classical_FR
Flag to use a Classical ESFR scheme where only the surface is reconstructed.
NavierStokesParam navier_stokes_param
Contains parameters for the Navier-Stokes equations non-dimensionalization.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
LinearSolverParam linear_solver_param
Contains parameters for linear solver.
bool do_renumber_dofs
Flag for renumbering DOFs.
Parameters related to the flow solver.
TestType test_type
Store selected TestType from the input file.
bool check_valid_metric_Jacobian
Flag to check if the metric Jacobian is valid when high-order grid is constructed.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
bool use_L2_norm
Flag to use an L2 energy monotonicity test (for FR)
Parameters related to the Navier Stokes equations.
bool use_split_form
Flag to use split form.
Parameterse related to the functional object.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
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.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
Parameters related to Physics Models.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
ReynoldsAveragedNavierStokesModel RANS_model_type
Store the Reynolds-averaged Navier-Stokes (RANS) model type.
ConvectiveNumericalFlux conv_num_flux_type
Store convective flux type.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
bool use_inverse_mass_on_the_fly
Flag to use inverse mass matrix on-the-fly for explicit solves.
int nstate
Number of state variables. Will depend on PDE.
void parse_parameters(dealii::ParameterHandler &prm)
Retrieve parameters from dealii::ParameterHandler.
std::string solution_vtk_files_directory_name
Name of directory for writing solution vtk files.
Parameters related to collection of grid refinement runs.
FluxNodes flux_nodes_type
Store selected FluxNodes from the input file.
Parameters related to the ODE solver.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
FunctionalParam functional_param
Contains parameters for functional.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
DissipativeNumericalFlux diss_num_flux_type
Store diffusive flux type.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
Parameters related to the artificial dissipation.
static void declare_parameters(dealii::ParameterHandler &prm)
Declare parameters that can be set as inputs and set up the default options.
double sipg_penalty_factor
Scaling of Symmetric Interior Penalty term to ensure coercivity.
bool use_weight_adjusted_mass
Flag to use weight-adjusted Mass Matrix for curvilinear elements.
bool use_periodic_bc
Flag to use periodic BC.
ModelType model_type
Store the model type.
HyperReductionParam hyper_reduction_param
Contains parameters for Hyperreduction.
ArtificialDissipationParam artificial_dissipation_param
Contains parameters for artificial dissipation.
bool output_high_order_grid
Flag for outputting the high-order grid vtk files.
RenumberDofsType renumber_dofs_type
Store selected RenumberDofsType from the input file.
bool use_curvilinear_split_form
Flag to use curvilinear metric split form.
PhysicsModelParam physics_model_param
Contains parameters for Physics Model.
MeshType mesh_type
Store selected MeshType from the input file.
BurgersParam burgers_param
Contains parameters for Burgers equation.
bool use_collocated_nodes
Flag for using collocated nodes; determined based on flux_nodes_type and overintegration input parame...
Parameters related to the linear solver.
int overintegration
Number of additional quadrature points to use.
static void declare_parameters(dealii::ParameterHandler &prm)
Declare parameters.
void parse_parameters(dealii::ParameterHandler &prm)
Function to parse parameters.
static void declare_parameters(dealii::ParameterHandler &prm)
Function to declare parameters.
bool store_residual_cpu_time
Flag to store the residual local processor cput time.
Parameters related to reduced-order model.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.