1 #include "periodic_1D_unsteady.h" 11 template <
int dim,
int nstate>
14 , unsteady_data_table_filename_with_extension(this->all_param.flow_solver_param.unsteady_data_table_filename+
".txt")
20 template <
int dim,
int nstate>
26 dealii::LinearAlgebra::distributed::Vector<double> temp;
27 temp.reinit(dg->solution);
29 dg->apply_global_mass_matrix(dg->solution, temp);
31 dg->global_mass_matrix.vmult(temp,dg->solution);
33 return temp * dg->solution;
36 template <
int dim,
int nstate>
44 template <
int dim,
int nstate>
46 const unsigned int current_iteration,
47 const double current_time,
49 const std::shared_ptr <dealii::TableHandler> unsteady_data_table )
59 if (pde_type == PDEEnum::advection){
60 if ((current_iteration % output_solution_every_n_iterations) == 0){
61 this->
pcout <<
" Iter: " << current_iteration
62 <<
" Time: " << current_time
66 (void) unsteady_data_table;
68 else if (pde_type == PDEEnum::burgers_inviscid){
71 if ((current_iteration % output_solution_every_n_iterations) == 0){
72 this->
pcout <<
" Iter: " << current_iteration
73 <<
" Time: " << current_time
74 <<
" Energy: " << energy
81 const bool is_reference_solution = (dt < 2 * final_time/number_timesteps_ref);
83 if(this->
mpi_rank==0 && !is_reference_solution) {
85 unsteady_data_table->add_value(
"iteration", current_iteration);
89 unsteady_data_table->write_text(unsteady_data_table_file);
const Parameters::AllParameters all_param
All parameters.
double final_time
Final solution time.
PartialDifferentialEquation pde_type
Store the PDE type to be solved.
double compute_energy(const std::shared_ptr< DGBase< dim, double >> dg) const
Calculate energy as a matrix-vector product, solution^T (M+K) solution.
TimeRefinementStudyParam time_refinement_study_param
Contains the parameters for time refinement study.
FlowSolverParam flow_solver_param
Contains the parameters for simulation cases (flow solver test)
Periodic1DUnsteady(const Parameters::AllParameters *const parameters_input)
Constructor.
int output_solution_every_x_steps
Outputs the solution every x steps to .vtk file.
PartialDifferentialEquation
Possible Partial Differential Equations to solve.
Files for the baseline physics.
int number_of_timesteps_for_reference_solution
For time refinement study with reference solution, number of steps for reference solution.
double output_solution_every_dt_time_intervals
Outputs the solution every dt time intervals to .vtk file.
Main parameter class that contains the various other sub-parameter classes.
void add_value_to_data_table(const double value, const std::string value_string, const std::shared_ptr< dealii::TableHandler > data_table) const
Add a value to a given data table with scientific format.
ODESolverParam ode_solver_param
Contains parameters for ODE solver.
double initial_time_step
Time step used in ODE solver.
std::string unsteady_data_table_filename_with_extension
Filename for unsteady data.
bool use_inverse_mass_on_the_fly
Flag to use inverse mass matrix on-the-fly for explicit solves.
double get_numerical_entropy(const std::shared_ptr< DGBase< dim, double >> dg) const
const int mpi_rank
MPI rank.
DGBase is independent of the number of state variables.
dealii::ConditionalOStream pcout
ConditionalOStream.
void compute_unsteady_data_and_write_to_table(const unsigned int current_iteration, const double current_time, const std::shared_ptr< DGBase< dim, double >> dg, const std::shared_ptr< dealii::TableHandler > unsteady_data_table) override
Compute the desired unsteady data and write it to a table.