28#ifndef OOMPH_EULER_ELEMENTS_HEADER
29#define OOMPH_EULER_ELEMENTS_HEADER
33#include <oomph-lib-config.h>
45 template<
unsigned DIM>
87 if (this->Average_prim_value != 0)
92 if (this->Average_gradient != 0)
175 for (
unsigned i = 0;
i <
DIM;
i++)
195 norm[
i] += interpolated_u[
i] * interpolated_u[
i] * W;
218 if (this->Average_prim_value == 0)
220 this->Average_prim_value =
new double[
n_flux];
223 if (this->Average_gradient == 0)
225 this->Average_gradient =
new double[
n_flux *
DIM];
255 template<
unsigned DIM,
unsigned NNODE_1D>
298 void output(FILE* file_pt)
300 EulerEquations<NFLUX,DIM>::output(file_pt);
305 void output(FILE* file_pt, const unsigned &n_plot)
307 EulerEquations<NFLUX,DIM>::output(file_pt,n_plot);
312 void output_fct(std::ostream &outfile, const unsigned &n_plot,
313 FiniteElement::SteadyExactSolutionFctPt
316 EulerEquations<NFLUX,DIM>::
317 output_fct(outfile,n_plot,exact_soln_pt);}
323 void output_fct(std::ostream &outfile, const unsigned &n_plot,
325 FiniteElement::UnsteadyExactSolutionFctPt
328 EulerEquations<NFLUX,DIM>::
329 output_fct(outfile,n_plot,time,exact_soln_pt);
362 template<
unsigned DIM,
unsigned NNODE_1D>
378 for (
unsigned j = 0;
j <
DIM;
j++)
395 template<
unsigned DIM,
unsigned NNODE_1D>
426 template<
unsigned DIM,
unsigned NNODE_1D>
440 template<
class ELEMENT>
463 dynamic_cast<ELEMENT*
>(element_pt)->face_integration_pt());
474 const unsigned&
i)
const
501 const unsigned dim = cast_bulk_element_pt->
dim();
517 for (
unsigned j = 0;
j <
dim;
j++)
523 flux.initialise(0.0);
527 for (
unsigned j = 0;
j <
dim;
j++)
537 for (
unsigned i = 0;
i < 2;
i++)
545 for (
unsigned j = 0;
j <
dim;
j++)
550 for (
unsigned j = 0;
j <
dim;
j++)
601 for (
unsigned j = 0;
j <
dim;
j++)
614 for (
unsigned j = 0;
j <
dim;
j++)
624 for (
unsigned j = 0;
j <
dim;
j++)
628 arg *= (gamma - 1.0);
632 oomph_info <<
"Square of sound speed is negative!\n";
640 for (
unsigned j = 0;
j <
dim;
j++)
651 double lambda = std::fabs(
eigA[0]);
652 for (
unsigned i = 1;
i < 3;
i++)
654 if (std::fabs(
eigA[
i]) > lambda)
656 lambda = std::fabs(
eigA[
i]);
685 flux[
i] += 0.5 * lambda *
jump[
i];
695 template<
class ELEMENT>
723 const unsigned&
i)
const
749 dot +=
n[
j] * u[2 +
j];
755 u[2 +
j] -= 2.0 * dot *
n[
j];
764 template<
unsigned DIM,
unsigned NNODE_1D>
773 template<
unsigned NNODE_1D>
785 return this->nflux();
815 Face_element_pt.resize(2);
837 this->add_flux_contributions_to_residuals(
residuals, jacobian,
flag);
889 template<
unsigned NNODE_1D>
901 template<
unsigned NNODE_1D>
913 return this->nflux();
927 this->set_integration_scheme(
935 return &Default_face_integration_scheme;
940 Face_element_pt.resize(4);
964 this->add_flux_contributions_to_residuals(
residuals, jacobian,
flag);
972 template<
unsigned NNODE_1D>
A Base class for DGElements.
FaceElement for Discontinuous Galerkin Problems.
void numerical_flux(const Vector< double > &n_out, const Vector< double > &u_int, const Vector< double > &u_ext, Vector< double > &flux)
Calculate the normal flux, so this is the dot product of the numerical flux with n_out.
unsigned required_nflux()
Set the number of flux components.
DGEulerFaceElement(FiniteElement *const &element_pt, const int &face_index)
Constructor.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Specify the value of nodal zeta from the face geometry The "global" intrinsic coordinate of the eleme...
FaceElement for Discontinuous Galerkin Problems with reflection boundary conditions.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Specify the value of nodal zeta from the face geometry The "global" intrinsic coordinate of the eleme...
void interpolated_u(const Vector< double > &s, Vector< double > &u)
We overload interpolated_u to reflect.
unsigned required_nflux()
Set the number of flux components.
DGEulerFaceReflectionElement(FiniteElement *const &element_pt, const int &face_index)
Constructor.
Base class for Discontinuous Galerkin Faces. These are responsible for calculating the normal fluxes ...
virtual void interpolated_u(const Vector< double > &s, Vector< double > &f)
Return the interpolated values of the unknown fluxes.
Vector< double > Inverse_mass_diagonal
void calculate_element_averages(double *&average_value)
Calculate the averages in the element.
unsigned required_nflux()
Overload the required number of fluxes for the DGElement.
Integral * face_integration_pt() const
void fill_in_generic_residual_contribution_flux_transport(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Compute the residuals for the Navier–Stokes equations; flag=1(or 0): do (or don't) compute the Jacobi...
~DGSpectralEulerElement()
unsigned required_nflux()
Overload the required number of fluxes for the DGElement.
void calculate_element_averages(double *&average_value)
Calculate the averages in the element.
~DGSpectralEulerElement()
static Gauss< 1, NNODE_1D > Default_face_integration_scheme
Integral * face_integration_pt() const
void fill_in_generic_residual_contribution_flux_transport(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Compute the residuals for the Navier–Stokes equations; flag=1(or 0): do (or don't) compute the Jacobi...
General DGEulerClass. Establish the template parameters.
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
Base class for Euler equations.
virtual ~EulerEquations()
Destructor.
double & average_prim_value(const unsigned &i)
Return the average values.
double pressure(const Vector< double > &u) const
Calculate the pressure from the unknowns.
void flux(const Vector< double > &u, DenseMatrix< double > &f)
Return the flux as a function of the unknown.
double * Average_prim_value
Storage for the average primitive values.
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_solution_pt, const double &t, Vector< double > &error, Vector< double > &norm)
Compute the error and norm of solution integrated over the element Does not plot the error in the out...
void output(std::ostream &outfile)
Output function: x,y,u or x,y,z,u.
double gamma() const
Return the value of gamma.
double & average_gradient(const unsigned &i, const unsigned &j)
Return access to the average gradient.
unsigned nflux() const
DIM momentum-components, a density and an energy are transported.
double * Average_gradient
Storage for the approximated gradients.
double *& gamma_pt()
Access function for the pointer to gamma.
unsigned required_nvalue(const unsigned &n) const
The number of unknowns at each node is the number of flux components.
double *const & gamma_pt() const
Access function for the pointer to gamma (const version)
static double Default_Gamma_Value
void allocate_memory_for_averages()
EulerEquations()
Return the flux derivatives as a function of the unknowns.
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
void outer_unit_normal(const Vector< double > &s, Vector< double > &unit_normal) const
Compute outer unit normal at the specified local coordinate.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
In a FaceElement, the "global" intrinsic coordinate of the element along the boundary,...
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
FaceGeometry()
Constructor: Call the constructor for the appropriate lower-dimensional QElement.
FaceGeometry class definition: This policy class is used to allow construction of face elements that ...
A general Finite Element class.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
virtual double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Return the geometric shape functions and also first derivatives w.r.t. global coordinates at the ipt-...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
unsigned nnode() const
Return the number of nodes.
double nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. If the node is hanging, the appropriate interpolation is ...
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Compute the geometric shape functions and also first derivatives w.r.t. global coordinates at local c...
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Function for building a lower dimensional FaceElement on the specified face of the FiniteElement....
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
virtual void set_integration_scheme(Integral *const &integral_pt)
Set the spatial integration scheme.
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
Base class for the flux transport equations templated by the dimension DIM. The equations that are so...
virtual void fill_in_generic_residual_contribution_flux_transport(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Compute the residuals for the Navier–Stokes equations; flag=1(or 0): do (or don't) compute the Jacobi...
void calculate_element_averages(double *&average_values)
Compute the average values of the fluxes.
Generic class for numerical integration schemes:
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
An OomphLibError object which should be thrown when an run-time error is encountered....
Point element has just a single node and a single shape function which is identically equal to one.
General QLegendreElement class.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function: x,y,u or x,y,z,u at n_plot^DIM plot points.
double dshape_and_dtest_eulerian_at_knot_flux_transport(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Shape, test functions & derivs. w.r.t. to global coords. at integration point ipt....
double dshape_and_dtest_eulerian_flux_transport(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Shape, test functions & derivs. w.r.t. to global coords. Return Jacobian.
QSpectralEulerElement()
Constructor: Call constructors for QElement and Advection Diffusion equations.
QSpectralEulerElement(const QSpectralEulerElement< DIM, NNODE_1D > &dummy)=delete
Broken copy constructor.
void output(std::ostream &outfile)
Broken assignment operator.
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
TAdvectionDiffusionReactionElement()
Constructor: Call constructors for TElement and AdvectionDiffusionReaction equations.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...