[P]arallel [Hi]gh-order [Li]brary for [P]DEs  Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
dg_base_state.hpp
1 #ifndef PHILIP_DG_BASE_STATE_HPP
2 #define PHILIP_DG_BASE_STATE_HPP
3 
4 #include <deal.II/distributed/tria.h>
5 
6 #include "dg_base.hpp"
7 #include "parameters/all_parameters.h"
8 namespace PHiLiP {
9 
11 /* Contains the objects and functions that need to be templated on the number of state variables.
12  */
13 #if PHILIP_DIM==1 // dealii::parallel::distributed::Triangulation<dim> does not work for 1D
14 template <int dim, int nspecies, int nstate, typename real, typename MeshType = dealii::Triangulation<dim>>
15 #else
16 template <int dim, int nspecies, int nstate, typename real, typename MeshType = dealii::parallel::distributed::Triangulation<dim>>
17 #endif
18 class DGBaseState : public DGBase<dim, nspecies, real, MeshType>
19 {
20 protected:
23 
24 public:
26 
29  const Parameters::AllParameters *const parameters_input,
30  const unsigned int degree,
31  const unsigned int max_degree_input,
32  const unsigned int grid_degree_input,
33  const std::shared_ptr<Triangulation> triangulation_input);
34 
36  std::shared_ptr < Physics::PhysicsBase<dim, nspecies, nstate, real > > pde_physics_double;
38  std::shared_ptr < Physics::ModelBase<dim, nspecies, nstate, real > > pde_model_double;
40  std::unique_ptr < NumericalFlux::NumericalFluxConvective<dim, nspecies, nstate, real > > conv_num_flux_double;
42  std::unique_ptr < NumericalFlux::NumericalFluxDissipative<dim, nspecies, nstate, real > > diss_num_flux_double;
44  std::shared_ptr <ArtificialDissipationBase<dim,nspecies,nstate>> artificial_dissip;
45 
47  std::shared_ptr < Physics::PhysicsBase<dim, nspecies, nstate, FadType > > pde_physics_fad;
49  std::shared_ptr < Physics::ModelBase<dim, nspecies, nstate, FadType > > pde_model_fad;
51  std::unique_ptr < NumericalFlux::NumericalFluxConvective<dim, nspecies, nstate, FadType > > conv_num_flux_fad;
53  std::unique_ptr < NumericalFlux::NumericalFluxDissipative<dim, nspecies, nstate, FadType > > diss_num_flux_fad;
54 
56  std::shared_ptr < Physics::PhysicsBase<dim, nspecies, nstate, RadType > > pde_physics_rad;
58  std::shared_ptr < Physics::ModelBase<dim, nspecies, nstate, RadType > > pde_model_rad;
60  std::unique_ptr < NumericalFlux::NumericalFluxConvective<dim, nspecies, nstate, RadType > > conv_num_flux_rad;
62  std::unique_ptr < NumericalFlux::NumericalFluxDissipative<dim, nspecies, nstate, RadType > > diss_num_flux_rad;
63 
65  std::shared_ptr < Physics::PhysicsBase<dim, nspecies, nstate, FadFadType > > pde_physics_fad_fad;
67  std::shared_ptr < Physics::ModelBase<dim, nspecies, nstate, FadFadType > > pde_model_fad_fad;
69  std::unique_ptr < NumericalFlux::NumericalFluxConvective<dim, nspecies, nstate, FadFadType > > conv_num_flux_fad_fad;
71  std::unique_ptr < NumericalFlux::NumericalFluxDissipative<dim, nspecies, nstate, FadFadType > > diss_num_flux_fad_fad;
72 
74  std::shared_ptr < Physics::PhysicsBase<dim, nspecies, nstate, RadFadType > > pde_physics_rad_fad;
76  std::shared_ptr < Physics::ModelBase<dim, nspecies, nstate, RadFadType > > pde_model_rad_fad;
78  std::unique_ptr < NumericalFlux::NumericalFluxConvective<dim, nspecies, nstate, RadFadType > > conv_num_flux_rad_fad;
80  std::unique_ptr < NumericalFlux::NumericalFluxDissipative<dim, nspecies, nstate, RadFadType > > diss_num_flux_rad_fad;
81 
85  void set_physics(
86  std::shared_ptr< Physics::PhysicsBase<dim, nspecies, nstate, real > > pde_physics_double_input,
87  std::shared_ptr< Physics::PhysicsBase<dim, nspecies, nstate, FadType > > pde_physics_fad_input,
88  std::shared_ptr< Physics::PhysicsBase<dim, nspecies, nstate, RadType > > pde_physics_rad_input,
89  std::shared_ptr< Physics::PhysicsBase<dim, nspecies, nstate, FadFadType > > pde_physics_fad_fad_input,
90  std::shared_ptr< Physics::PhysicsBase<dim, nspecies, nstate, RadFadType > > pde_physics_rad_fad_input);
91 
93  virtual void allocate_model_variables();
94 
96  virtual void update_model_variables();
97 
99  void set_unsteady_model_time_step(const double time_step);
100 
102  void set_use_auxiliary_eq();
103 
106 
109 
110 protected:
112 
119  real evaluate_CFL (std::vector< std::array<real,nstate> > soln_at_q, const real artificial_dissipation, const real cell_diameter, const unsigned int cell_degree);
120 
122 
124  void reset_numerical_fluxes();
125 
126 }; // end of DGBaseState class
127 
128 } // namespace PHiLiP
129 
130 #endif // PHILIP_DG_BASE_STATE_HPP
std::shared_ptr< Physics::ModelBase< dim, nspecies, nstate, FadFadType > > pde_model_fad_fad
Contains the model terms of the PDEType == PhysicsModel with FadFadType.
void set_use_auxiliary_eq()
Set use_auxiliary_eq flag.
void set_store_vol_flux_nodes()
Set store_vol_flux_nodes flag.
Base class from which Advection, Diffusion, ConvectionDiffusion, and Euler is derived.
Definition: physics.h:34
std::shared_ptr< Physics::ModelBase< dim, nspecies, nstate, RadFadType > > pde_model_rad_fad
Contains the model terms of the PDEType == PhysicsModel with RadFadType.
DGBaseState(const Parameters::AllParameters *const parameters_input, const unsigned int degree, const unsigned int max_degree_input, const unsigned int grid_degree_input, const std::shared_ptr< Triangulation > triangulation_input)
< Input parameters.
std::shared_ptr< ArtificialDissipationBase< dim, nspecies, nstate > > artificial_dissip
Link to Artificial dissipation class (with three dissipation types, depending on the input)...
Files for the baseline physics.
Definition: ADTypes.hpp:10
std::shared_ptr< Physics::ModelBase< dim, nspecies, nstate, real > > pde_model_double
Contains the model terms of the PDEType == PhysicsModel with real type.
std::unique_ptr< NumericalFlux::NumericalFluxConvective< dim, nspecies, nstate, RadFadType > > conv_num_flux_rad_fad
Convective numerical flux with RadFadDtype.
std::shared_ptr< Physics::ModelBase< dim, nspecies, nstate, FadType > > pde_model_fad
Contains the model terms of the PDEType == PhysicsModel with FadType.
std::unique_ptr< NumericalFlux::NumericalFluxDissipative< dim, nspecies, nstate, FadType > > diss_num_flux_fad
Dissipative numerical flux with FadType.
std::shared_ptr< Physics::PhysicsBase< dim, nspecies, nstate, FadType > > pde_physics_fad
Contains the physics of the PDE with FadType.
Main parameter class that contains the various other sub-parameter classes.
void set_physics(std::shared_ptr< Physics::PhysicsBase< dim, nspecies, nstate, real > > pde_physics_double_input, std::shared_ptr< Physics::PhysicsBase< dim, nspecies, nstate, FadType > > pde_physics_fad_input, std::shared_ptr< Physics::PhysicsBase< dim, nspecies, nstate, RadType > > pde_physics_rad_input, std::shared_ptr< Physics::PhysicsBase< dim, nspecies, nstate, FadFadType > > pde_physics_fad_fad_input, std::shared_ptr< Physics::PhysicsBase< dim, nspecies, nstate, RadFadType > > pde_physics_rad_fad_input)
std::unique_ptr< NumericalFlux::NumericalFluxConvective< dim, nspecies, nstate, FadType > > conv_num_flux_fad
Convective numerical flux with FadType.
std::unique_ptr< NumericalFlux::NumericalFluxDissipative< dim, nspecies, nstate, RadType > > diss_num_flux_rad
Dissipative numerical flux with RadType.
MeshType Triangulation
Definition: dg_base.hpp:89
virtual void update_model_variables()
Update the necessary variables declared in src/physics/model.h.
std::shared_ptr< Physics::PhysicsBase< dim, nspecies, nstate, FadFadType > > pde_physics_fad_fad
Contains the physics of the PDE with FadFadType.
std::shared_ptr< Physics::PhysicsBase< dim, nspecies, nstate, RadFadType > > pde_physics_rad_fad
Contains the physics of the PDE with RadFadDtype.
std::unique_ptr< NumericalFlux::NumericalFluxConvective< dim, nspecies, nstate, real > > conv_num_flux_double
Convective numerical flux with real type.
Abstract class templated on the number of state variables.
std::shared_ptr< Physics::PhysicsBase< dim, nspecies, nstate, RadType > > pde_physics_rad
Contains the physics of the PDE with RadType.
std::unique_ptr< NumericalFlux::NumericalFluxDissipative< dim, nspecies, nstate, FadFadType > > diss_num_flux_fad_fad
Dissipative numerical flux with FadFadType.
std::unique_ptr< NumericalFlux::NumericalFluxDissipative< dim, nspecies, nstate, RadFadType > > diss_num_flux_rad_fad
Dissipative numerical flux with RadFadDtype.
void reset_numerical_fluxes()
Reinitializes the numerical fluxes based on the current physics.
void set_store_surf_flux_nodes()
Set store_surf_flux_nodes flag.
std::unique_ptr< NumericalFlux::NumericalFluxConvective< dim, nspecies, nstate, FadFadType > > conv_num_flux_fad_fad
Convective numerical flux with FadFadType.
DGBase is independent of the number of state variables.
Definition: dg_base.hpp:82
std::unique_ptr< NumericalFlux::NumericalFluxDissipative< dim, nspecies, nstate, real > > diss_num_flux_double
Dissipative numerical flux with real type.
void set_unsteady_model_time_step(const double time_step)
Set the necessary unsteady variables declared in src/physics/model.h.
std::shared_ptr< Physics::ModelBase< dim, nspecies, nstate, RadType > > pde_model_rad
Contains the model terms of the PDEType == PhysicsModel with RadType.
std::unique_ptr< NumericalFlux::NumericalFluxConvective< dim, nspecies, nstate, RadType > > conv_num_flux_rad
Convective numerical flux with RadType.
virtual void allocate_model_variables()
Allocate the necessary variables declared in src/physics/model.h.
std::shared_ptr< Physics::PhysicsBase< dim, nspecies, nstate, real > > pde_physics_double
Contains the physics of the PDE with real type.
real evaluate_CFL(std::vector< std::array< real, nstate > > soln_at_q, const real artificial_dissipation, const real cell_diameter, const unsigned int cell_degree)
Evaluate the time it takes for the maximum wavespeed to cross the cell domain.