[P]arallel [Hi]gh-order [Li]brary for [P]DEs  Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
set_initial_condition.h
1 #ifndef __SET_INITIAL_CONDITION_H__
2 #define __SET_INITIAL_CONDITION_H__
3 
4 #include <string>
5 
6 #include "dg/dg_base.hpp"
7 #include "initial_condition_function.h"
8 #include "parameters/all_parameters.h"
9 
10 namespace PHiLiP {
11 
13 template <int dim, int nstate, typename real>
15 {
16 public:
18  static void set_initial_condition(
19  std::shared_ptr< InitialConditionFunction<dim,nstate,double> > initial_condition_function_input,
20  std::shared_ptr< PHiLiP::DGBase<dim,real> > dg_input,
21  const Parameters::AllParameters *const parameters_input);
22 private:
25  std::shared_ptr< InitialConditionFunction<dim,nstate,double> > &initial_condition_function,
26  std::shared_ptr < PHiLiP::DGBase<dim,real> > &dg);
27 
29  /*This is critical for curvilinear coordinates since the physical coordinates are
30  * nonlinear functions of the reference coordinates. This leads to the interpolation
31  * of the dealii::function not equivalent to the projection of the function on the flux
32  * nodes to the modal coefficients. The latter is the correct form.
33  * This differs from dealii::project, since here, the projection is purely in the reference space. That is, we solve
34  * \f$ \hat{\mathbf{f}}^T = \mathbf{M}^{-1} \int_{\mathbf{\Omega}_r} \mathbf{\chi}^T \mathbf{f} d\mathbf{\Omega}_r \f$ where \f$\mathbf{\chi}\f$ are the reference basis functions, and \f$\mathbf{M}\f$ is the reference mass matrix.
35  * Note that the physical mapping only appears in the function to be projected \f$\mathbf{f}\f$ and the determinant of the metric Jacobian is not in the projection.
36  * For more information, please refer to Sections 3.1 and 3.2 in Cicchino, Alexander, et al. "Provably stable flux reconstruction high-order methods on curvilinear elements." Journal of Computational Physics (2022): 111259.
37  */
38  static void project_initial_condition(
39  std::shared_ptr< InitialConditionFunction<dim,nstate,double> > &initial_condition_function,
40  std::shared_ptr < PHiLiP::DGBase<dim,real> > &dg);
41 
44  std::shared_ptr < PHiLiP::DGBase<dim,real> > &dg,
45  const std::string input_filename_prefix);
46 };
47 
48 }//end PHiLiP namespace
49 #endif
static void read_values_from_file_and_project(std::shared_ptr< PHiLiP::DGBase< dim, real > > &dg, const std::string input_filename_prefix)
Reads values from file and projects.
Class for setting/applying the initial condition.
Files for the baseline physics.
Definition: ADTypes.hpp:10
Main parameter class that contains the various other sub-parameter classes.
Initial condition function used to initialize a particular flow setup/case.
static void project_initial_condition(std::shared_ptr< InitialConditionFunction< dim, nstate, double > > &initial_condition_function, std::shared_ptr< PHiLiP::DGBase< dim, real > > &dg)
Projects the initial condition function physical value onto the dg solution modal coefficients...
static void interpolate_initial_condition(std::shared_ptr< InitialConditionFunction< dim, nstate, double > > &initial_condition_function, std::shared_ptr< PHiLiP::DGBase< dim, real > > &dg)
Interpolates the initial condition function onto the dg solution.
DGBase is independent of the number of state variables.
Definition: dg_base.hpp:82
static void set_initial_condition(std::shared_ptr< InitialConditionFunction< dim, nstate, double > > initial_condition_function_input, std::shared_ptr< PHiLiP::DGBase< dim, real > > dg_input, const Parameters::AllParameters *const parameters_input)
Applies the given initial condition function to the given dg object.