1 #include <deal.II/base/tensor.h> 2 #include <deal.II/base/convergence_table.h> 4 #include "stability_fr_parameter_range.h" 5 #include "dg/dg_factory.hpp" 6 #include "ode_solver/ode_solver_base.h" 8 #include "ode_solver/ode_solver_factory.h" 9 #include "physics/initial_conditions/set_initial_condition.h" 10 #include "physics/initial_conditions/initial_condition_function.h" 11 #include "mesh/grids/straight_periodic_cube.hpp" 17 template <
int dim,
int nstate>
20 const dealii::ParameterHandler ¶meter_handler_input)
26 template <
int dim,
int nstate>
35 template <
int dim,
int nstate>
38 this->
pcout <<
" Running stability ESFR parameter range test. " << std::endl;
42 this->
pcout <<
"Warning: order checks in StabilityFRParametersRange are hard-coded for p=2." << std::endl
43 <<
"This test may fail for other poly_degree choices, as FR will lose an order" << std::endl
44 <<
"at a different c value." << std::endl;
50 const double log_c_min = std::log10(c_min);
51 const double log_c_max = std::log10(c_max);
52 std::vector<double> c_array(nb_c_value+1);
54 for (
unsigned int ic = 0; ic < nb_c_value; ic++) {
55 double log_c = log_c_min + (log_c_max - log_c_min) / (nb_c_value - 1) * ic;
56 c_array[ic] = std::pow(10.0, log_c);
62 if (this->
pcout.is_active()){
63 std::ofstream conv_tab_file;
64 const std::string fname =
"convergence_table.txt";
65 conv_tab_file.open(fname);
66 conv_tab_file.close();
70 for (
unsigned int ic = 0; ic < nb_c_value+1; ic++) {
71 double c_value = c_array[ic];
72 this->
pcout <<
"\n\n---------------------------------------------" << std::endl;
73 this->
pcout <<
" Entering refinement loop for a new c value = " << c_value << std::endl;
74 this->
pcout <<
"---------------------------------------------" << std::endl;
76 if (this->
pcout.is_active()){
77 std::ofstream conv_tab_file;
78 const std::string fname =
"convergence_table.txt";
79 conv_tab_file.open(fname, std::ios::app);
80 conv_tab_file <<
"Convergence for c = " << c_value << std::endl;
81 conv_tab_file.close();
89 if (local_testfail == 1) testfail = 1;
RefinementType
Type of refinement to run.
Advection time refinement study.
FlowSolverParam flow_solver_param
Contains the parameters for simulation cases (flow solver test)
int run_test() const override
Run test.
double ESFR_parameter_values_start
For user defined FR parameter tests, value of starting FR param.
int number_ESFR_parameter_values
For user defined FR parameter tests, number of values to be tested.
double ESFR_parameter_values_end
For user defined FR parameter tests, value of final FR param.
Files for the baseline physics.
int run_refinement_study_and_write_result(const Parameters::AllParameters *parameters_in, const double expected_order, const bool check_only_last_refinement=false, const bool append_to_file=false) const
Run the refinements.
unsigned int poly_degree
Polynomial order (P) of the basis functions for DG.
Main parameter class that contains the various other sub-parameter classes.
const Parameters::AllParameters *const all_parameters
Pointer to all parameters.
StabilityFRParametersRange(const Parameters::AllParameters *const parameters_input, const dealii::ParameterHandler ¶meter_handler_input)
Constructor.
double FR_user_specified_correction_parameter_value
User specified flux recontruction correction parameter value.
Burgers' periodic unsteady test.
Parameters::AllParameters reinit_params_c_value(const Parameters::AllParameters *parameters_in, const double c_value) const
Reinitialize parameters for the c loop.
dealii::ConditionalOStream pcout
ConditionalOStream.