[P]arallel [Hi]gh-order [Li]brary for [P]DEs  Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
root_finding_rrk_ode_solver.h
1 #ifndef __ENTROPY_RRK_ODESOLVER_H_
2 #define __ENTROPY_RRK_ODESOLVER_H_
3 
4 #include "dg/dg_base.hpp"
5 #include "rrk_ode_solver_base.h"
6 
7 namespace PHiLiP {
8 namespace ODE {
9 
15 #if PHILIP_DIM==1
16 template <int dim, typename real, typename MeshType = dealii::Triangulation<dim>>
17 #else
18 template <int dim, typename real, typename MeshType = dealii::parallel::distributed::Triangulation<dim>>
19 #endif
20 class RootFindingRRKODESolver: public RRKODESolverBase<dim, real, MeshType>
21 {
22 public:
24  explicit RootFindingRRKODESolver(
25  std::shared_ptr<RKTableauBase<dim,real,MeshType>> rk_tableau_input);
26 
27 protected:
28 
31  real compute_relaxation_parameter(const real dt,
32  std::shared_ptr<DGBase<dim,real,MeshType>> dg,
33  const std::vector<dealii::LinearAlgebra::distributed::Vector<double>> &rk_stage,
34  const dealii::LinearAlgebra::distributed::Vector<double> &solution_update
35  ) override;
36 
39  const double gamma,
40  const dealii::LinearAlgebra::distributed::Vector<double> &u_n,
41  const dealii::LinearAlgebra::distributed::Vector<double> &d,
42  const double eta_n,
43  const double e,
44  std::shared_ptr<DGBase<dim,real,MeshType>> dg) const;
45 
48  const dealii::LinearAlgebra::distributed::Vector<double> &u,
49  std::shared_ptr<DGBase<dim,real,MeshType>> dg) const;
50 
53  const dealii::LinearAlgebra::distributed::Vector<double> &u,
54  std::shared_ptr<DGBase<dim,real,MeshType>> dg) const;
55 
57  real compute_entropy_change_estimate(const real dt,
58  std::shared_ptr<DGBase<dim,real,MeshType>> dg,
59  const std::vector<dealii::LinearAlgebra::distributed::Vector<double>> &rk_stage,
60  const bool use_M_norm_for_entropy_change_est = true) const;
61 private:
64 
65 };
66 
67 } // ODE namespace
68 } // PHiLiP namespace
69 
70 #endif
real compute_root_function(const double gamma, const dealii::LinearAlgebra::distributed::Vector< double > &u_n, const dealii::LinearAlgebra::distributed::Vector< double > &d, const double eta_n, const double e, std::shared_ptr< DGBase< dim, real, MeshType >> dg) const
Compute the remainder of the root function Ranocha 2020 Eq. 2.4.
RootFindingRRKODESolver(std::shared_ptr< RKTableauBase< dim, real, MeshType >> rk_tableau_input)
Default constructor that will set the constants.
Files for the baseline physics.
Definition: ADTypes.hpp:10
real compute_integrated_numerical_entropy(const dealii::LinearAlgebra::distributed::Vector< double > &u, std::shared_ptr< DGBase< dim, real, MeshType >> dg) const
Compute numerical entropy by integrating over quadrature points.
real FR_entropy_cumulative
Storing cumulative entropy change for output.
Base class for storing the RK method.
real compute_entropy_change_estimate(const real dt, std::shared_ptr< DGBase< dim, real, MeshType >> dg, const std::vector< dealii::LinearAlgebra::distributed::Vector< double >> &rk_stage, const bool use_M_norm_for_entropy_change_est=true) const
Compute the estimated entropy change during a timestep.
DGBase is independent of the number of state variables.
Definition: dg_base.hpp:82
Relaxation Runge-Kutta ODE solver base class.
real compute_relaxation_parameter(const real dt, std::shared_ptr< DGBase< dim, real, MeshType >> dg, const std::vector< dealii::LinearAlgebra::distributed::Vector< double >> &rk_stage, const dealii::LinearAlgebra::distributed::Vector< double > &solution_update) override
real compute_numerical_entropy(const dealii::LinearAlgebra::distributed::Vector< double > &u, std::shared_ptr< DGBase< dim, real, MeshType >> dg) const
Compute numerical entropy.