Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM > Class Template Reference

////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// More...

#include <boussinesq_elements.h>

Inheritance diagram for oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >:

Public Member Functions

 RefineableBuoyantQCrouzeixRaviartElement ()
 Constructor: call the underlying constructors and initialise the pointer to the Rayleigh number to address the default value of 0.0. More...
 
unsigned required_nvalue (const unsigned &n) const
 The required number of values stored at the nodes is the sum of the required values of the two single-physics elements. This step is generic for any composed element of this type. More...
 
const double & ra () const
 Access function for the Rayleigh number (const version) More...
 
double *& ra_pt ()
 Access function for the pointer to the Rayleigh number. More...
 
void disable_ALE ()
 Final override for disable ALE. More...
 
void enable_ALE ()
 Final override for enable ALE. More...
 
unsigned nscalar_paraview () const
 Number of scalars/fields output by this element. Broken virtual. Needs to be implemented for each new specific element type. Temporary dummy. More...
 
void scalar_value_paraview (std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
 Write values of the i-th scalar field at the plot points. Broken virtual. Needs to be implemented for each new specific element type. Temporary dummy. More...
 
std::string scalar_name_paraview (const unsigned &i) const
 Name of the i-th scalar field. Default implementation returns V1 for the first one, V2 for the second etc. Can (should!) be overloaded with more meaningful names. More...
 
void output (std::ostream &outfile)
 Overload the standard output function with the broken default. More...
 
void output (std::ostream &outfile, const unsigned &nplot)
 Output function: x,y,u or x,y,z,u at Nplot^DIM plot points. More...
 
void output (FILE *file_pt)
 C-style output function: Broken default. More...
 
void output (FILE *file_pt, const unsigned &n_plot)
 C-style output function: Broken default. More...
 
void output_fct (std::ostream &outfile, const unsigned &Nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
 Output function for an exact solution: Broken default. More...
 
void output_fct (std::ostream &outfile, const unsigned &Nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
 Output function for a time-dependent exact solution. Broken default. More...
 
unsigned u_index_adv_diff () const
 Overload the index at which the temperature variable is stored. We choose to store is after the fluid velocities. More...
 
unsigned nvertex_node () const
 Number of vertex nodes in the element is obtained from the geometric element. More...
 
Node * vertex_node_pt (const unsigned &j) const
 Pointer to the j-th vertex node in the element, Call the geometric element's function. More...
 
unsigned ncont_interpolated_values () const
 The total number of continously interpolated values is DIM+1 (DIM fluid velocities and one temperature). More...
 
void get_interpolated_values (const Vector< double > &s, Vector< double > &values)
 Get the continuously interpolated values at the local coordinate s. We choose to put the fluid velocities first, followed by the temperature. More...
 
void get_interpolated_values (const unsigned &t, const Vector< double > &s, Vector< double > &values)
 Get all continuously interpolated values at the local coordinate s at time level t (t=0: present; t>0: previous). We choose to put the fluid velocities first, followed by the temperature. More...
 
void further_setup_hanging_nodes ()
 The additional hanging node information must be set up for both single-physics elements. More...
 
void rebuild_from_sons (Mesh *&mesh_pt)
 Call the rebuild_from_sons functions for each of the constituent multi-physics elements. More...
 
void further_build ()
 Call the underlying single-physics element's further_build() functions and make sure that the pointer to the Rayleigh number is passed to the sons. More...
 
unsigned nrecovery_order ()
 The recovery order is that of the NavierStokes elements. More...
 
unsigned num_Z2_flux_terms ()
 The number of Z2 flux terms is the same as that in the fluid element plus that in the advection-diffusion element. More...
 
void get_Z2_flux (const Vector< double > &s, Vector< double > &flux)
 Get the Z2 flux by concatenating the fluxes from the fluid and the advection diffusion elements. More...
 
unsigned ncompound_fluxes ()
 The number of compound fluxes is two (one for the fluid and one for the temperature) More...
 
void get_Z2_compound_flux_indices (Vector< unsigned > &flux_index)
 Fill in which flux components are associated with the fluid measure and which are associated with the temperature measure. More...
 
void compute_error (std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
 Validate against exact solution at given time Solution is provided via function pointer. Plot at a given number of plot points and compute L2 error and L2 norm of velocity solution over element Overload to broken default. More...
 
void compute_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 Validate against exact solution. Solution is provided via function pointer. Plot at a given number of plot points and compute L2 error and L2 norm of velocity solution over element Overload to broken default. More...
 
void get_wind_adv_diff (const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &wind) const
 Overload the wind function in the advection-diffusion equations. This provides the coupling from the Navier–Stokes equations to the advection-diffusion equations because the wind is the fluid velocity. More...
 
void get_body_force_nst (const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &result)
 Overload the body force in the navier-stokes equations This provides the coupling from the advection-diffusion equations to the Navier–Stokes equations, the body force is the temperature multiplied by the Rayleigh number acting in the direction opposite to gravity. More...
 
void fill_in_contribution_to_residuals (Vector< double > &residuals)
 Fill in the constituent elements' contribution to the residual vector. More...
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 Compute the element's residual Vector and the jacobian matrix using full finite differences, the default implementation. More...
 
void fill_in_contribution_to_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 Add the element's contribution to its residuals vector, jacobian matrix and mass matrix. More...
 
void fill_in_off_diagonal_jacobian_blocks_analytic (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 Compute the contribution of the off-diagonal blocks analytically. More...
 

Private Member Functions

double Default_Physical_Constant_Value
 Set the default value of the Rayleigh number to be zero. More...
 
double Default_Physical_Constant_Value
 

Private Attributes

double * Ra_pt
 Pointer to a new physical variable, the Rayleigh number. More...
 

Static Private Attributes

static double Default_Physical_Constant_Value
 The static default value of the Rayleigh number. More...
 

Detailed Description

template<unsigned DIM>
class oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >

////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

A RefineableElement class that solves the Boussinesq approximation of the Navier–Stokes and energy equations by coupling two pre-existing classes. The RefineableQAdvectionDiffusionElement with bi-quadratic interpolation for the scalar variable (temperature) and RefineableQCrouzeixRaviartElement which solves the Navier–Stokes equations using bi-quadratic interpolation for the velocities and a discontinuous bi-linear interpolation for the pressure. Note that we are free to choose the order in which we store the variables at the nodes. In this case we choose to store the variables in the order fluid velocities followed by temperature. We must, therefore, overload the function AdvectionDiffusionEquations<DIM>::u_index_adv_diff() to indicate that the temperature is stored at the DIM-th position not the 0-th. We do not need to overload the corresponding function in the NavierStokesEquations<DIM> class because the velocities are stored first. Finally, we choose to use the flux-recovery calculation from the fluid velocities to provide the error used in the mesh adaptation.

Definition at line 800 of file boussinesq_elements.h.

Constructor & Destructor Documentation

◆ RefineableBuoyantQCrouzeixRaviartElement()

Constructor: call the underlying constructors and initialise the pointer to the Rayleigh number to address the default value of 0.0.

Definition at line 815 of file boussinesq_elements.h.

References oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::Default_Physical_Constant_Value, and oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::Ra_pt.

Member Function Documentation

◆ compute_error() [1/2]

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::compute_error ( std::ostream &  outfile,
FiniteElement::SteadyExactSolutionFctPt  exact_soln_pt,
double &  error,
double &  norm 
)
inline

Validate against exact solution. Solution is provided via function pointer. Plot at a given number of plot points and compute L2 error and L2 norm of velocity solution over element Overload to broken default.

Definition at line 1205 of file boussinesq_elements.h.

◆ compute_error() [2/2]

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::compute_error ( std::ostream &  outfile,
FiniteElement::UnsteadyExactSolutionFctPt  exact_soln_pt,
const double &  time,
double &  error,
double &  norm 
)
inline

Validate against exact solution at given time Solution is provided via function pointer. Plot at a given number of plot points and compute L2 error and L2 norm of velocity solution over element Overload to broken default.

Definition at line 1191 of file boussinesq_elements.h.

◆ Default_Physical_Constant_Value() [1/2]

double oomph::RefineableBuoyantQCrouzeixRaviartElement< 2 >::Default_Physical_Constant_Value
private

Set the default value of the Rayleigh number to be zero.

Definition at line 1589 of file boussinesq_elements.h.

◆ Default_Physical_Constant_Value() [2/2]

double oomph::RefineableBuoyantQCrouzeixRaviartElement< 3 >::Default_Physical_Constant_Value
private

Definition at line 1593 of file boussinesq_elements.h.

◆ disable_ALE()

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::disable_ALE ( )
inline

Final override for disable ALE.

Definition at line 845 of file boussinesq_elements.h.

◆ enable_ALE()

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::enable_ALE ( )
inline

Final override for enable ALE.

Definition at line 853 of file boussinesq_elements.h.

◆ fill_in_contribution_to_jacobian()

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::fill_in_contribution_to_jacobian ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
inline

Compute the element's residual Vector and the jacobian matrix using full finite differences, the default implementation.

Definition at line 1266 of file boussinesq_elements.h.

References oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::fill_in_off_diagonal_jacobian_blocks_analytic().

◆ fill_in_contribution_to_jacobian_and_mass_matrix()

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::fill_in_contribution_to_jacobian_and_mass_matrix ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
DenseMatrix< double > &  mass_matrix 
)
inline

Add the element's contribution to its residuals vector, jacobian matrix and mass matrix.

Definition at line 1289 of file boussinesq_elements.h.

◆ fill_in_contribution_to_residuals()

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::fill_in_contribution_to_residuals ( Vector< double > &  residuals)
inline

Fill in the constituent elements' contribution to the residual vector.

Definition at line 1252 of file boussinesq_elements.h.

◆ fill_in_off_diagonal_jacobian_blocks_analytic()

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::fill_in_off_diagonal_jacobian_blocks_analytic ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
inline

◆ further_build()

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::further_build ( )
inline

Call the underlying single-physics element's further_build() functions and make sure that the pointer to the Rayleigh number is passed to the sons.

Definition at line 1091 of file boussinesq_elements.h.

References oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::ra_pt().

◆ further_setup_hanging_nodes()

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::further_setup_hanging_nodes ( )
inline

The additional hanging node information must be set up for both single-physics elements.

Definition at line 1071 of file boussinesq_elements.h.

◆ get_body_force_nst()

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::get_body_force_nst ( const double &  time,
const unsigned &  ipt,
const Vector< double > &  s,
const Vector< double > &  x,
Vector< double > &  result 
)
inline

Overload the body force in the navier-stokes equations This provides the coupling from the advection-diffusion equations to the Navier–Stokes equations, the body force is the temperature multiplied by the Rayleigh number acting in the direction opposite to gravity.

Definition at line 1231 of file boussinesq_elements.h.

References oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::ra().

◆ get_interpolated_values() [1/2]

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::get_interpolated_values ( const unsigned &  t,
const Vector< double > &  s,
Vector< double > &  values 
)
inline

Get all continuously interpolated values at the local coordinate s at time level t (t=0: present; t>0: previous). We choose to put the fluid velocities first, followed by the temperature.

Definition at line 1039 of file boussinesq_elements.h.

◆ get_interpolated_values() [2/2]

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::get_interpolated_values ( const Vector< double > &  s,
Vector< double > &  values 
)
inline

Get the continuously interpolated values at the local coordinate s. We choose to put the fluid velocities first, followed by the temperature.

Definition at line 1007 of file boussinesq_elements.h.

◆ get_wind_adv_diff()

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::get_wind_adv_diff ( const unsigned &  ipt,
const Vector< double > &  s,
const Vector< double > &  x,
Vector< double > &  wind 
) const
inline

Overload the wind function in the advection-diffusion equations. This provides the coupling from the Navier–Stokes equations to the advection-diffusion equations because the wind is the fluid velocity.

Definition at line 1216 of file boussinesq_elements.h.

◆ get_Z2_compound_flux_indices()

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::get_Z2_compound_flux_indices ( Vector< unsigned > &  flux_index)
inline

Fill in which flux components are associated with the fluid measure and which are associated with the temperature measure.

Definition at line 1160 of file boussinesq_elements.h.

◆ get_Z2_flux()

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::get_Z2_flux ( const Vector< double > &  s,
Vector< double > &  flux 
)
inline

Get the Z2 flux by concatenating the fluxes from the fluid and the advection diffusion elements.

Definition at line 1126 of file boussinesq_elements.h.

◆ ncompound_fluxes()

template<unsigned DIM>
unsigned oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::ncompound_fluxes ( )
inline

The number of compound fluxes is two (one for the fluid and one for the temperature)

Definition at line 1153 of file boussinesq_elements.h.

◆ ncont_interpolated_values()

template<unsigned DIM>
unsigned oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::ncont_interpolated_values ( ) const
inline

The total number of continously interpolated values is DIM+1 (DIM fluid velocities and one temperature).

Definition at line 998 of file boussinesq_elements.h.

◆ nrecovery_order()

template<unsigned DIM>
unsigned oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::nrecovery_order ( )
inline

The recovery order is that of the NavierStokes elements.

Definition at line 1109 of file boussinesq_elements.h.

◆ nscalar_paraview()

template<unsigned DIM>
unsigned oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::nscalar_paraview ( ) const
inline

Number of scalars/fields output by this element. Broken virtual. Needs to be implemented for each new specific element type. Temporary dummy.

Definition at line 864 of file boussinesq_elements.h.

◆ num_Z2_flux_terms()

template<unsigned DIM>
unsigned oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::num_Z2_flux_terms ( )
inline

The number of Z2 flux terms is the same as that in the fluid element plus that in the advection-diffusion element.

Definition at line 1116 of file boussinesq_elements.h.

◆ nvertex_node()

template<unsigned DIM>
unsigned oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::nvertex_node ( ) const
inline

Number of vertex nodes in the element is obtained from the geometric element.

Definition at line 984 of file boussinesq_elements.h.

◆ output() [1/4]

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::output ( FILE *  file_pt)
inline

C-style output function: Broken default.

Definition at line 945 of file boussinesq_elements.h.

◆ output() [2/4]

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::output ( FILE *  file_pt,
const unsigned &  n_plot 
)
inline

C-style output function: Broken default.

Definition at line 951 of file boussinesq_elements.h.

◆ output() [3/4]

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::output ( std::ostream &  outfile)
inline

Overload the standard output function with the broken default.

Definition at line 898 of file boussinesq_elements.h.

◆ output() [4/4]

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::output ( std::ostream &  outfile,
const unsigned &  nplot 
)
inline

Output function: x,y,u or x,y,z,u at Nplot^DIM plot points.

Definition at line 905 of file boussinesq_elements.h.

◆ output_fct() [1/2]

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::output_fct ( std::ostream &  outfile,
const unsigned &  Nplot,
const double &  time,
FiniteElement::UnsteadyExactSolutionFctPt  exact_soln_pt 
)
inline

Output function for a time-dependent exact solution. Broken default.

Definition at line 967 of file boussinesq_elements.h.

◆ output_fct() [2/2]

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::output_fct ( std::ostream &  outfile,
const unsigned &  Nplot,
FiniteElement::SteadyExactSolutionFctPt  exact_soln_pt 
)
inline

Output function for an exact solution: Broken default.

Definition at line 957 of file boussinesq_elements.h.

◆ ra()

template<unsigned DIM>
const double& oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::ra ( ) const
inline

◆ ra_pt()

template<unsigned DIM>
double*& oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::ra_pt ( )
inline

Access function for the pointer to the Rayleigh number.

Definition at line 838 of file boussinesq_elements.h.

References oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::Ra_pt.

Referenced by oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::further_build().

◆ rebuild_from_sons()

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::rebuild_from_sons ( Mesh *&  mesh_pt)
inline

Call the rebuild_from_sons functions for each of the constituent multi-physics elements.

Definition at line 1081 of file boussinesq_elements.h.

◆ required_nvalue()

template<unsigned DIM>
unsigned oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::required_nvalue ( const unsigned &  n) const
inline

The required number of values stored at the nodes is the sum of the required values of the two single-physics elements. This step is generic for any composed element of this type.

Definition at line 825 of file boussinesq_elements.h.

◆ scalar_name_paraview()

template<unsigned DIM>
std::string oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::scalar_name_paraview ( const unsigned &  i) const
inline

Name of the i-th scalar field. Default implementation returns V1 for the first one, V2 for the second etc. Can (should!) be overloaded with more meaningful names.

Definition at line 892 of file boussinesq_elements.h.

◆ scalar_value_paraview()

template<unsigned DIM>
void oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::scalar_value_paraview ( std::ofstream &  file_out,
const unsigned &  i,
const unsigned &  nplot 
) const
inline

Write values of the i-th scalar field at the plot points. Broken virtual. Needs to be implemented for each new specific element type. Temporary dummy.

Definition at line 878 of file boussinesq_elements.h.

◆ u_index_adv_diff()

template<unsigned DIM>
unsigned oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::u_index_adv_diff ( ) const
inline

Overload the index at which the temperature variable is stored. We choose to store is after the fluid velocities.

Definition at line 977 of file boussinesq_elements.h.

Referenced by oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::fill_in_off_diagonal_jacobian_blocks_analytic().

◆ vertex_node_pt()

template<unsigned DIM>
Node* oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::vertex_node_pt ( const unsigned &  j) const
inline

Pointer to the j-th vertex node in the element, Call the geometric element's function.

Definition at line 991 of file boussinesq_elements.h.

Member Data Documentation

◆ Default_Physical_Constant_Value

template<unsigned DIM>
double oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::Default_Physical_Constant_Value
staticprivate

The static default value of the Rayleigh number.

Definition at line 809 of file boussinesq_elements.h.

Referenced by oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::RefineableBuoyantQCrouzeixRaviartElement().

◆ Ra_pt

template<unsigned DIM>
double* oomph::RefineableBuoyantQCrouzeixRaviartElement< DIM >::Ra_pt
private

The documentation for this class was generated from the following file: