1 #include "cube_flow_uniform_grid.h" 2 #include "physics/physics_factory.h" 7 template <
int dim,
int nstate>
9 : FlowSolverCaseBase<dim, nstate>(parameters_input)
12 this->pde_physics = std::dynamic_pointer_cast<Physics::PhysicsBase<dim,nstate,double>>(
16 template <
int dim,
int nstate>
20 const unsigned int number_of_degrees_of_freedom_per_state = dg->dof_handler.n_dofs()/nstate;
23 const double time_step = cfl_number * approximate_grid_spacing / this->maximum_local_wave_speed;
28 template <
int dim,
int nstate>
32 update_maximum_local_wave_speed(*dg);
38 template<
int dim,
int nstate>
42 this->maximum_local_wave_speed = 0.0;
45 int overintegrate = 10;
46 dealii::QGauss<dim> quad_extra(dg.
max_degree+1+overintegrate);
48 dealii::update_values | dealii::update_gradients | dealii::update_JxW_values | dealii::update_quadrature_points);
50 const unsigned int n_quad_pts = fe_values_extra.n_quadrature_points;
51 std::array<double,nstate> soln_at_q;
53 std::vector<dealii::types::global_dof_index> dofs_indices (fe_values_extra.dofs_per_cell);
55 if (!cell->is_locally_owned())
continue;
56 fe_values_extra.reinit (cell);
57 cell->get_dof_indices (dofs_indices);
59 for (
unsigned int iquad=0; iquad<n_quad_pts; ++iquad) {
61 std::fill(soln_at_q.begin(), soln_at_q.end(), 0.0);
62 for (
unsigned int idof=0; idof<fe_values_extra.dofs_per_cell; ++idof) {
63 const unsigned int istate = fe_values_extra.get_fe().system_to_component_index(idof).first;
64 soln_at_q[istate] += dg.
solution[dofs_indices[idof]] * fe_values_extra.shape_value_component(idof, iquad, istate);
68 const double local_wave_speed = this->pde_physics->max_convective_eigenvalue(soln_at_q);
69 if(local_wave_speed > this->maximum_local_wave_speed) this->maximum_local_wave_speed = local_wave_speed;
72 this->maximum_local_wave_speed = dealii::Utilities::MPI::max(this->maximum_local_wave_speed, this->
mpi_communicator);
const Parameters::AllParameters all_param
All parameters.
const MPI_Comm mpi_communicator
MPI communicator.
virtual double get_adaptive_time_step(std::shared_ptr< DGBase< dim, double >> dg) const
Virtual function to compute the adaptive time step.
double courant_friedrichs_lewy_number
Courant-Friedrich-Lewy (CFL) number for constant time step.
FlowSolverParam flow_solver_param
Contains the parameters for simulation cases (flow solver test)
Files for the baseline physics.
Main parameter class that contains the various other sub-parameter classes.
dealii::LinearAlgebra::distributed::Vector< double > solution
Current modal coefficients of the solution.
double grid_left_bound
Left bound of domain for hyper_cube mesh based cases.
const unsigned int max_degree
Maximum degree used for p-refi1nement.
std::shared_ptr< HighOrderGrid< dim, real, MeshType > > high_order_grid
High order grid that will provide the MappingFEField.
static std::shared_ptr< PhysicsBase< dim, nstate, real > > create_Physics(const Parameters::AllParameters *const parameters_input, std::shared_ptr< ModelBase< dim, nstate, real > > model_input=nullptr)
Factory to return the correct physics given input file.
dealii::DoFHandler< dim > dof_handler
Finite Element Collection to represent the high-order grid.
double grid_right_bound
Right bound of domain for hyper_cube mesh based cases.
DGBase is independent of the number of state variables.
const dealii::hp::FECollection< dim > fe_collection
Finite Element Collection for p-finite-element to represent the solution.
double time_step
Current time step.