[P]arallel [Hi]gh-order [Li]brary for [P]DEs  Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
runge_kutta_store_entropy.h
1 #ifndef __RK_NUM_ENTROPY_H__
2 #define __RK_NUM_ENTROPY_H__
3 
4 #include "dg/dg_base.hpp"
5 #include "ode_solver/runge_kutta_ode_solver.h"
6 
7 namespace PHiLiP {
8 namespace ODE {
9 
14 #if PHILIP_DIM==1
15 template <int dim, typename real, typename MeshType = dealii::Triangulation<dim>>
16 #else
17 template <int dim, typename real, typename MeshType = dealii::parallel::distributed::Triangulation<dim>>
18 #endif
19 class RKNumEntropy: public EmptyRRKBase <dim, real, MeshType>
20 {
21 public:
23  explicit RKNumEntropy(
24  std::shared_ptr<RKTableauBase<dim,real,MeshType>> rk_tableau_input);
25 
27 
29  real compute_FR_entropy_contribution(const real dt,
30  std::shared_ptr<DGBase<dim,real,MeshType>> dg,
31  const std::vector<dealii::LinearAlgebra::distributed::Vector<double>> &rk_stage,
32  const bool compute_K_norm) const override;
33 
34  // "using" keyword to prevent compiler complaining
38 
39 
40 protected:
41 
43  std::shared_ptr<RKTableauBase<dim,real,MeshType>> butcher_tableau;
44 
46  const int n_rk_stages;
47 
48  const MPI_Comm mpi_communicator;
49  const int mpi_rank;
50  dealii::ConditionalOStream pcout;
51 
53 
54  std::vector<dealii::LinearAlgebra::distributed::Vector<double>> rk_stage_solution;
55 
57 
58  void store_stage_solutions(const int istage,
59  const dealii::LinearAlgebra::distributed::Vector<double> rk_stage_i) override;
60 
62  dealii::LinearAlgebra::distributed::Vector<double> compute_entropy_vars(
63  const dealii::LinearAlgebra::distributed::Vector<double> &u,
64  std::shared_ptr<DGBase<dim,real,MeshType>> dg) const;
65 
66 };
67 
68 } // ODE namespace
69 } // PHiLiP namespace
70 
71 #endif
const int n_rk_stages
Number of RK stages.
dealii::LinearAlgebra::distributed::Vector< double > compute_entropy_vars(const dealii::LinearAlgebra::distributed::Vector< double > &u, std::shared_ptr< DGBase< dim, real, MeshType >> dg) const
Return the entropy variables from a solution vector u.
real compute_FR_entropy_contribution(const real dt, std::shared_ptr< DGBase< dim, real, MeshType >> dg, const std::vector< dealii::LinearAlgebra::distributed::Vector< double >> &rk_stage, const bool compute_K_norm) const override
Calculate FR entropy adjustment.
Files for the baseline physics.
Definition: ADTypes.hpp:10
void store_stage_solutions(const int istage, const dealii::LinearAlgebra::distributed::Vector< double > rk_stage_i) override
Update stored quantities at the current stage.
dealii::ConditionalOStream pcout
Parallel std::cout that only outputs on mpi_rank==0.
RKNumEntropy(std::shared_ptr< RKTableauBase< dim, real, MeshType >> rk_tableau_input)
Default constructor that will set the constants.
Base class for storing the RK method.
DGBase is independent of the number of state variables.
Definition: dg_base.hpp:82
std::vector< dealii::LinearAlgebra::distributed::Vector< double > > rk_stage_solution
Storage for the solution at each Runge-Kutta stage.
std::shared_ptr< RKTableauBase< dim, real, MeshType > > butcher_tableau
Store pointer to RK tableau.
const MPI_Comm mpi_communicator
MPI communicator.