oomph::RefineableSpaceTimeNavierStokesEquations< DIM > Class Template Referenceabstract

Refineable version of the Navier-Stokes equations. More...

#include <refineable_discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h>

+ Inheritance diagram for oomph::RefineableSpaceTimeNavierStokesEquations< DIM >:

Public Member Functions

 RefineableSpaceTimeNavierStokesEquations ()
 Constructor. More...
 
virtual Nodepressure_node_pt (const unsigned &n_p)
 
void get_pressure_and_velocity_mass_matrix_diagonal (Vector< double > &press_mass_diag, Vector< double > &veloc_mass_diag, const unsigned &which_one=0)
 
unsigned num_Z2_flux_terms ()
 Number of 'flux' terms for Z2 error estimation. More...
 
void get_Z2_flux (const Vector< double > &s, Vector< double > &flux)
 
void further_build ()
 Further build, pass the pointers down to the sons. More...
 
void dinterpolated_u_nst_ddata (const Vector< double > &s, const unsigned &i, Vector< double > &du_ddata, Vector< unsigned > &global_eqn_number)
 
 RefineableSpaceTimeNavierStokesEquations ()
 Constructor. More...
 
virtual Nodepressure_node_pt (const unsigned &n_p)
 
void get_pressure_and_velocity_mass_matrix_diagonal (Vector< double > &press_mass_diag, Vector< double > &veloc_mass_diag, const unsigned &which_one=0)
 
unsigned num_Z2_flux_terms ()
 Number of 'flux' terms for Z2 error estimation. More...
 
void get_Z2_flux (const Vector< double > &s, Vector< double > &flux)
 
void further_build ()
 Further build, pass the pointers down to the sons. More...
 
void dinterpolated_u_nst_ddata (const Vector< double > &s, const unsigned &i, Vector< double > &du_ddata, Vector< unsigned > &global_eqn_number)
 
 RefineableSpaceTimeNavierStokesEquations ()
 Constructor. More...
 
virtual Nodepressure_node_pt (const unsigned &n_p)
 
void get_pressure_and_velocity_mass_matrix_diagonal (Vector< double > &press_mass_diag, Vector< double > &veloc_mass_diag, const unsigned &which_one=0)
 
unsigned num_Z2_flux_terms ()
 Number of 'flux' terms for Z2 error estimation. More...
 
void get_Z2_flux (const Vector< double > &s, Vector< double > &flux)
 
void further_build ()
 Further build, pass the pointers down to the sons. More...
 
void dinterpolated_u_nst_ddata (const Vector< double > &s, const unsigned &i, Vector< double > &du_ddata, Vector< unsigned > &global_eqn_number)
 
- Public Member Functions inherited from oomph::SpaceTimeNavierStokesEquations< DIM >
 SpaceTimeNavierStokesEquations ()
 
void store_strouhal_as_external_data (Data *strouhal_data_pt)
 Function that tells us whether the period is stored as external data. More...
 
const doublere () const
 Reynolds number. More...
 
double *& re_pt ()
 Pointer to Reynolds number. More...
 
bool is_strouhal_stored_as_external_data () const
 Are we storing the Strouhal number as external data? More...
 
const doublest () const
 Strouhal parameter (const. version) More...
 
doublest_pt () const
 Pointer to Strouhal parameter (const. version) More...
 
double *& st_pt ()
 Pointer to Strouhal number (can only assign to private member data) More...
 
double re_st () const
 Product of Reynolds and Strouhal number (=Womersley number) More...
 
const doubleviscosity_ratio () const
 
double *& viscosity_ratio_pt ()
 Pointer to Viscosity Ratio. More...
 
const doubledensity_ratio () const
 
double *& density_ratio_pt ()
 Pointer to Density ratio. More...
 
const doublere_invfr () const
 Global inverse Froude number. More...
 
double *& re_invfr_pt ()
 Pointer to global inverse Froude number. More...
 
const Vector< double > & g () const
 Vector of gravitational components. More...
 
Vector< double > *& g_pt ()
 Pointer to Vector of gravitational components. More...
 
NavierStokesBodyForceFctPtbody_force_fct_pt ()
 Access function for the body-force pointer. More...
 
NavierStokesBodyForceFctPt body_force_fct_pt () const
 Access function for the body-force pointer. Const version. More...
 
NavierStokesSourceFctPtsource_fct_pt ()
 Access function for the source-function pointer. More...
 
NavierStokesSourceFctPt source_fct_pt () const
 Access function for the source-function pointer. Const version. More...
 
NavierStokesPressureAdvDiffSourceFctPtsource_fct_for_pressure_adv_diff ()
 
NavierStokesPressureAdvDiffSourceFctPt source_fct_for_pressure_adv_diff () const
 
intpinned_fp_pressure_eqn ()
 
virtual unsigned npres_nst () const =0
 Function to return number of pressure degrees of freedom. More...
 
virtual void pshape_nst (const Vector< double > &s, Shape &psi) const =0
 Compute the pressure shape functions at local coordinate s. More...
 
virtual void pshape_nst (const Vector< double > &s, Shape &psi, Shape &test) const =0
 
double u_nst (const unsigned &n, const unsigned &i) const
 
double u_nst (const unsigned &t, const unsigned &n, const unsigned &i) const
 
virtual unsigned u_index_nst (const unsigned &i) const
 
unsigned n_u_nst () const
 
double get_du_dt (const unsigned &n, const unsigned &i) const
 
double du_dt_nst (const unsigned &n, const unsigned &i) const
 
double interpolated_du_dt_nst (const Vector< double > &s, const unsigned &i) const
 
void disable_ALE ()
 
void enable_ALE ()
 
virtual double p_nst (const unsigned &n_p) const =0
 
virtual double p_nst (const unsigned &t, const unsigned &n_p) const =0
 Pressure at local pressure "node" n_p at time level t. More...
 
virtual void fix_pressure (const unsigned &p_dof, const double &p_value)=0
 Pin p_dof-th pressure dof and set it to value specified by p_value. More...
 
virtual int p_nodal_index_nst () const
 
double pressure_integral () const
 Integral of pressure over element. More...
 
double dissipation () const
 Return integral of dissipation over element. More...
 
double dissipation (const Vector< double > &s) const
 Return dissipation at local coordinate s. More...
 
void get_vorticity (const Vector< double > &s, Vector< double > &vorticity) const
 Compute the vorticity vector at local coordinate s. More...
 
void get_vorticity (const Vector< double > &s, double &vorticity) const
 Compute the vorticity vector at local coordinate s. More...
 
double kin_energy () const
 Get integral of kinetic energy over element. More...
 
double d_kin_energy_dt () const
 Get integral of time derivative of kinetic energy over element. More...
 
void strain_rate (const Vector< double > &s, DenseMatrix< double > &strain_rate) const
 Strain-rate tensor: 1/2 (du_i/dx_j+du_j/dx_i) More...
 
void get_traction (const Vector< double > &s, const Vector< double > &N, Vector< double > &traction)
 
void get_traction (const Vector< double > &s, const Vector< double > &N, Vector< double > &traction_p, Vector< double > &traction_visc_n, Vector< double > &traction_visc_t)
 
void get_load (const Vector< double > &s, const Vector< double > &N, Vector< double > &load)
 
unsigned nscalar_paraview () const
 
void scalar_value_paraview (std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
 
void scalar_value_fct_paraview (std::ofstream &file_out, const unsigned &i, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt) const
 
std::string scalar_name_paraview (const unsigned &i) const
 
void output (std::ostream &outfile)
 
void output (std::ostream &outfile, const unsigned &n_plot)
 
void output (FILE *file_pt)
 
void output (FILE *file_pt, const unsigned &n_plot)
 
void full_output (std::ostream &outfile)
 
void full_output (std::ostream &outfile, const unsigned &n_plot)
 
void output_veloc (std::ostream &outfile, const unsigned &nplot, const unsigned &t)
 
void output_vorticity (std::ostream &outfile, const unsigned &nplot)
 
void output_fct (std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
 
void output_fct (std::ostream &outfile, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
 
void compute_norm (Vector< double > &norm)
 Compute the vector norm of the FEM solution. More...
 
void compute_error (std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
 
void compute_error (std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
 
void compute_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 
void compute_error (FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
 
void compute_error (FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 
void fill_in_contribution_to_residuals (Vector< double > &residuals)
 Compute the element's residual Vector. More...
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void fill_in_contribution_to_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
void fill_in_contribution_to_dresiduals_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam)
 
void fill_in_contribution_to_djacobian_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 
void fill_in_contribution_to_djacobian_and_dmass_matrix_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
 
void fill_in_pressure_advection_diffusion_residuals (Vector< double > &residuals)
 
void fill_in_pressure_advection_diffusion_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void pin_all_non_pressure_dofs (std::map< Data *, std::vector< int >> &eqn_number_backup)
 Pin all non-pressure dofs and backup eqn numbers. More...
 
virtual void build_fp_press_adv_diff_robin_bc_element (const unsigned &face_index)=0
 
void output_pressure_advection_diffusion_robin_elements (std::ostream &outfile)
 
void delete_pressure_advection_diffusion_robin_elements ()
 
void interpolated_u_nst (const Vector< double > &s, Vector< double > &velocity) const
 Compute vector of FE interpolated velocity u at local coordinate s. More...
 
double interpolated_u_nst (const Vector< double > &s, const unsigned &i) const
 Return FE interpolated velocity u[i] at local coordinate s. More...
 
double interpolated_u_nst (const unsigned &t, const Vector< double > &s, const unsigned &i) const
 
virtual double interpolated_p_nst (const Vector< double > &s) const
 Return FE interpolated pressure at local coordinate s. More...
 
double interpolated_p_nst (const unsigned &t, const Vector< double > &s) const
 Return FE interpolated pressure at local coordinate s at time level t. More...
 
void point_output_data (const Vector< double > &s, Vector< double > &data)
 
 SpaceTimeNavierStokesEquations ()
 
void store_strouhal_as_external_data (Data *strouhal_data_pt)
 Function that tells us whether the period is stored as external data. More...
 
const doublere () const
 Reynolds number. More...
 
double *& re_pt ()
 Pointer to Reynolds number. More...
 
bool is_strouhal_stored_as_external_data () const
 Are we storing the Strouhal number as external data? More...
 
const doublest () const
 Strouhal parameter (const. version) More...
 
doublest_pt () const
 Pointer to Strouhal parameter (const. version) More...
 
double *& st_pt ()
 Pointer to Strouhal number (can only assign to private member data) More...
 
double re_st () const
 Product of Reynolds and Strouhal number (=Womersley number) More...
 
const doubleviscosity_ratio () const
 
double *& viscosity_ratio_pt ()
 Pointer to Viscosity Ratio. More...
 
const doubledensity_ratio () const
 
double *& density_ratio_pt ()
 Pointer to Density ratio. More...
 
const doublere_invfr () const
 Global inverse Froude number. More...
 
double *& re_invfr_pt ()
 Pointer to global inverse Froude number. More...
 
const Vector< double > & g () const
 Vector of gravitational components. More...
 
Vector< double > *& g_pt ()
 Pointer to Vector of gravitational components. More...
 
NavierStokesBodyForceFctPtbody_force_fct_pt ()
 Access function for the body-force pointer. More...
 
NavierStokesBodyForceFctPt body_force_fct_pt () const
 Access function for the body-force pointer. Const version. More...
 
NavierStokesSourceFctPtsource_fct_pt ()
 Access function for the source-function pointer. More...
 
NavierStokesSourceFctPt source_fct_pt () const
 Access function for the source-function pointer. Const version. More...
 
NavierStokesPressureAdvDiffSourceFctPtsource_fct_for_pressure_adv_diff ()
 
NavierStokesPressureAdvDiffSourceFctPt source_fct_for_pressure_adv_diff () const
 
intpinned_fp_pressure_eqn ()
 
virtual unsigned npres_nst () const =0
 Function to return number of pressure degrees of freedom. More...
 
virtual void pshape_nst (const Vector< double > &s, Shape &psi) const =0
 Compute the pressure shape functions at local coordinate s. More...
 
virtual void pshape_nst (const Vector< double > &s, Shape &psi, Shape &test) const =0
 
double u_nst (const unsigned &n, const unsigned &i) const
 
double u_nst (const unsigned &t, const unsigned &n, const unsigned &i) const
 
virtual unsigned u_index_nst (const unsigned &i) const
 
unsigned n_u_nst () const
 
double get_du_dt (const unsigned &n, const unsigned &i) const
 
double du_dt_nst (const unsigned &n, const unsigned &i) const
 
double interpolated_du_dt_nst (const Vector< double > &s, const unsigned &i) const
 
void disable_ALE ()
 
void enable_ALE ()
 
virtual double p_nst (const unsigned &n_p) const =0
 
virtual double p_nst (const unsigned &t, const unsigned &n_p) const =0
 Pressure at local pressure "node" n_p at time level t. More...
 
virtual void fix_pressure (const unsigned &p_dof, const double &p_value)=0
 Pin p_dof-th pressure dof and set it to value specified by p_value. More...
 
virtual int p_nodal_index_nst () const
 
double pressure_integral () const
 Integral of pressure over element. More...
 
double dissipation () const
 Return integral of dissipation over element. More...
 
double dissipation (const Vector< double > &s) const
 Return dissipation at local coordinate s. More...
 
void get_vorticity (const Vector< double > &s, Vector< double > &vorticity) const
 Compute the vorticity vector at local coordinate s. More...
 
void get_vorticity (const Vector< double > &s, double &vorticity) const
 Compute the vorticity vector at local coordinate s. More...
 
double kin_energy () const
 Get integral of kinetic energy over element. More...
 
double d_kin_energy_dt () const
 Get integral of time derivative of kinetic energy over element. More...
 
void strain_rate (const Vector< double > &s, DenseMatrix< double > &strain_rate) const
 Strain-rate tensor: 1/2 (du_i/dx_j+du_j/dx_i) More...
 
void get_traction (const Vector< double > &s, const Vector< double > &N, Vector< double > &traction)
 
void get_traction (const Vector< double > &s, const Vector< double > &N, Vector< double > &traction_p, Vector< double > &traction_visc_n, Vector< double > &traction_visc_t)
 
void get_load (const Vector< double > &s, const Vector< double > &N, Vector< double > &load)
 
unsigned nscalar_paraview () const
 
void scalar_value_paraview (std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
 
void scalar_value_fct_paraview (std::ofstream &file_out, const unsigned &i, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt) const
 
std::string scalar_name_paraview (const unsigned &i) const
 
void output (std::ostream &outfile)
 
void output (std::ostream &outfile, const unsigned &n_plot)
 
void output (FILE *file_pt)
 
void output (FILE *file_pt, const unsigned &n_plot)
 
void full_output (std::ostream &outfile)
 
void full_output (std::ostream &outfile, const unsigned &n_plot)
 
void output_veloc (std::ostream &outfile, const unsigned &nplot, const unsigned &t)
 
void output_vorticity (std::ostream &outfile, const unsigned &nplot)
 
void output_fct (std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
 
void output_fct (std::ostream &outfile, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
 
void compute_norm (Vector< double > &norm)
 Compute the vector norm of the FEM solution. More...
 
void compute_error (std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
 
void compute_error (std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
 
void compute_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 
void compute_error (FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
 
void compute_error (FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 
void fill_in_contribution_to_residuals (Vector< double > &residuals)
 Compute the element's residual Vector. More...
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void fill_in_contribution_to_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
void fill_in_contribution_to_dresiduals_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam)
 
void fill_in_contribution_to_djacobian_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 
void fill_in_contribution_to_djacobian_and_dmass_matrix_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
 
void fill_in_pressure_advection_diffusion_residuals (Vector< double > &residuals)
 
void fill_in_pressure_advection_diffusion_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void pin_all_non_pressure_dofs (std::map< Data *, std::vector< int >> &eqn_number_backup)
 Pin all non-pressure dofs and backup eqn numbers. More...
 
virtual void build_fp_press_adv_diff_robin_bc_element (const unsigned &face_index)=0
 
void output_pressure_advection_diffusion_robin_elements (std::ostream &outfile)
 
void delete_pressure_advection_diffusion_robin_elements ()
 
void interpolated_u_nst (const Vector< double > &s, Vector< double > &velocity) const
 Compute vector of FE interpolated velocity u at local coordinate s. More...
 
double interpolated_u_nst (const Vector< double > &s, const unsigned &i) const
 Return FE interpolated velocity u[i] at local coordinate s. More...
 
double interpolated_u_nst (const unsigned &t, const Vector< double > &s, const unsigned &i) const
 
virtual double interpolated_p_nst (const Vector< double > &s) const
 Return FE interpolated pressure at local coordinate s. More...
 
double interpolated_p_nst (const unsigned &t, const Vector< double > &s) const
 Return FE interpolated pressure at local coordinate s at time level t. More...
 
void point_output_data (const Vector< double > &s, Vector< double > &data)
 
 SpaceTimeNavierStokesEquations ()
 
void store_strouhal_as_external_data (Data *strouhal_data_pt)
 Function that tells us whether the period is stored as external data. More...
 
bool is_reynolds_strouhal_stored_as_external_data () const
 Are we storing the Strouhal number as external data? More...
 
const doublere () const
 Reynolds number. More...
 
double *& re_pt ()
 Pointer to Reynolds number. More...
 
const doublere_st () const
 ReSt parameter (const. version) More...
 
doublere_st_pt () const
 Pointer to Strouhal parameter (const. version) More...
 
double *& re_st_pt ()
 Pointer to ReSt number (can only assign to private member data) More...
 
const doubleviscosity_ratio () const
 
double *& viscosity_ratio_pt ()
 Pointer to Viscosity Ratio. More...
 
const doubledensity_ratio () const
 
double *& density_ratio_pt ()
 Pointer to Density ratio. More...
 
const doublere_invfr () const
 Global inverse Froude number. More...
 
double *& re_invfr_pt ()
 Pointer to global inverse Froude number. More...
 
const Vector< double > & g () const
 Vector of gravitational components. More...
 
Vector< double > *& g_pt ()
 Pointer to Vector of gravitational components. More...
 
NavierStokesBodyForceFctPtbody_force_fct_pt ()
 Access function for the body-force pointer. More...
 
NavierStokesBodyForceFctPt body_force_fct_pt () const
 Access function for the body-force pointer. Const version. More...
 
NavierStokesSourceFctPtsource_fct_pt ()
 Access function for the source-function pointer. More...
 
NavierStokesSourceFctPt source_fct_pt () const
 Access function for the source-function pointer. Const version. More...
 
NavierStokesPressureAdvDiffSourceFctPtsource_fct_for_pressure_adv_diff ()
 
NavierStokesPressureAdvDiffSourceFctPt source_fct_for_pressure_adv_diff () const
 
intpinned_fp_pressure_eqn ()
 
virtual unsigned npres_nst () const =0
 Function to return number of pressure degrees of freedom. More...
 
virtual void pshape_nst (const Vector< double > &s, Shape &psi) const =0
 Compute the pressure shape functions at local coordinate s. More...
 
virtual void pshape_nst (const Vector< double > &s, Shape &psi, Shape &test) const =0
 
double u_nst (const unsigned &n, const unsigned &i) const
 
double u_nst (const unsigned &t, const unsigned &n, const unsigned &i) const
 
virtual unsigned u_index_nst (const unsigned &i) const
 
unsigned n_u_nst () const
 
double get_du_dt (const unsigned &n, const unsigned &i) const
 
double du_dt_nst (const unsigned &n, const unsigned &i) const
 
double interpolated_du_dt_nst (const Vector< double > &s, const unsigned &i) const
 
void disable_ALE ()
 
void enable_ALE ()
 
virtual double p_nst (const unsigned &n_p) const =0
 
virtual double p_nst (const unsigned &t, const unsigned &n_p) const =0
 Pressure at local pressure "node" n_p at time level t. More...
 
virtual void fix_pressure (const unsigned &p_dof, const double &p_value)=0
 Pin p_dof-th pressure dof and set it to value specified by p_value. More...
 
virtual int p_nodal_index_nst () const
 
double pressure_integral () const
 Integral of pressure over element. More...
 
double dissipation () const
 Return integral of dissipation over element. More...
 
double dissipation (const Vector< double > &s) const
 Return dissipation at local coordinate s. More...
 
void get_vorticity (const Vector< double > &s, Vector< double > &vorticity) const
 Compute the vorticity vector at local coordinate s. More...
 
void get_vorticity (const Vector< double > &s, double &vorticity) const
 Compute the vorticity vector at local coordinate s. More...
 
double kin_energy () const
 Get integral of kinetic energy over element. More...
 
double d_kin_energy_dt () const
 Get integral of time derivative of kinetic energy over element. More...
 
void strain_rate (const Vector< double > &s, DenseMatrix< double > &strain_rate) const
 Strain-rate tensor: 1/2 (du_i/dx_j+du_j/dx_i) More...
 
void get_traction (const Vector< double > &s, const Vector< double > &N, Vector< double > &traction)
 
void get_traction (const Vector< double > &s, const Vector< double > &N, Vector< double > &traction_p, Vector< double > &traction_visc_n, Vector< double > &traction_visc_t)
 
void get_load (const Vector< double > &s, const Vector< double > &N, Vector< double > &load)
 
void get_pressure_and_velocity_mass_matrix_diagonal (Vector< double > &press_mass_diag, Vector< double > &veloc_mass_diag, const unsigned &which_one=0)
 
unsigned nscalar_paraview () const
 
void scalar_value_paraview (std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
 
void scalar_value_fct_paraview (std::ofstream &file_out, const unsigned &i, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt) const
 
std::string scalar_name_paraview (const unsigned &i) const
 
void output (std::ostream &outfile)
 
void output (std::ostream &outfile, const unsigned &n_plot)
 
void output (FILE *file_pt)
 
void output (FILE *file_pt, const unsigned &n_plot)
 
void full_output (std::ostream &outfile)
 
void full_output (std::ostream &outfile, const unsigned &n_plot)
 
void output_veloc (std::ostream &outfile, const unsigned &nplot, const unsigned &t)
 
void output_vorticity (std::ostream &outfile, const unsigned &nplot)
 
void output_fct (std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
 
void output_fct (std::ostream &outfile, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
 
void compute_error (std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
 
void compute_norm (Vector< double > &norm)
 Compute the vector norm of the FEM solution. More...
 
void compute_error (std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
 
void compute_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 
void compute_error (FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
 
void compute_error (FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 
void fill_in_contribution_to_residuals (Vector< double > &residuals)
 Compute the element's residual Vector. More...
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void fill_in_contribution_to_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
void fill_in_contribution_to_dresiduals_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam)
 
void fill_in_contribution_to_djacobian_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 
void fill_in_contribution_to_djacobian_and_dmass_matrix_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
 
void fill_in_pressure_advection_diffusion_residuals (Vector< double > &residuals)
 
void fill_in_pressure_advection_diffusion_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void pin_all_non_pressure_dofs (std::map< Data *, std::vector< int >> &eqn_number_backup)
 Pin all non-pressure dofs and backup eqn numbers. More...
 
virtual void build_fp_press_adv_diff_robin_bc_element (const unsigned &face_index)=0
 
void output_pressure_advection_diffusion_robin_elements (std::ostream &outfile)
 
void delete_pressure_advection_diffusion_robin_elements ()
 
void interpolated_u_nst (const Vector< double > &s, Vector< double > &velocity) const
 Compute vector of FE interpolated velocity u at local coordinate s. More...
 
double interpolated_u_nst (const Vector< double > &s, const unsigned &i) const
 Return FE interpolated velocity u[i] at local coordinate s. More...
 
double interpolated_u_nst (const unsigned &t, const Vector< double > &s, const unsigned &i) const
 
virtual double interpolated_p_nst (const Vector< double > &s) const
 Return FE interpolated pressure at local coordinate s. More...
 
double interpolated_p_nst (const unsigned &t, const Vector< double > &s) const
 Return FE interpolated pressure at local coordinate s at time level t. More...
 
void point_output_data (const Vector< double > &s, Vector< double > &data)
 
void get_vorticity (const Vector< double > &s, Vector< double > &vorticity) const
 
void get_vorticity (const Vector< double > &s, double &vorticity) const
 
void get_vorticity (const Vector< double > &s, Vector< double > &vorticity) const
 
void get_vorticity (const Vector< double > &s, double &vorticity) const
 
void get_vorticity (const Vector< double > &s, Vector< double > &vorticity) const
 
void get_vorticity (const Vector< double > &s, double &vorticity) const
 
- Public Member Functions inherited from oomph::FSIFluidElement
 FSIFluidElement ()
 Constructor. More...
 
 FSIFluidElement (const FSIFluidElement &)=delete
 Broken copy constructor. More...
 
void operator= (const FSIFluidElement &)=delete
 Broken assignment operator. More...
 
virtual void identify_load_data (std::set< std::pair< Data *, unsigned >> &paired_load_data)=0
 
virtual void identify_pressure_data (std::set< std::pair< Data *, unsigned >> &paired_pressure_data)=0
 
- Public Member Functions inherited from oomph::FiniteElement
void set_dimension (const unsigned &dim)
 
void set_nodal_dimension (const unsigned &nodal_dim)
 
void set_nnodal_position_type (const unsigned &nposition_type)
 Set the number of types required to interpolate the coordinate. More...
 
void set_n_node (const unsigned &n)
 
int nodal_local_eqn (const unsigned &n, const unsigned &i) const
 
double dJ_eulerian_at_knot (const unsigned &ipt, Shape &psi, DenseMatrix< double > &djacobian_dX) const
 
 FiniteElement ()
 Constructor. More...
 
virtual ~FiniteElement ()
 
 FiniteElement (const FiniteElement &)=delete
 Broken copy constructor. More...
 
virtual bool local_coord_is_valid (const Vector< double > &s)
 Broken assignment operator. More...
 
virtual void move_local_coord_back_into_element (Vector< double > &s) const
 
void get_centre_of_gravity_and_max_radius_in_terms_of_zeta (Vector< double > &cog, double &max_radius) const
 
virtual void local_coordinate_of_node (const unsigned &j, Vector< double > &s) const
 
virtual void local_fraction_of_node (const unsigned &j, Vector< double > &s_fraction)
 
virtual double local_one_d_fraction_of_node (const unsigned &n1d, const unsigned &i)
 
virtual void set_macro_elem_pt (MacroElement *macro_elem_pt)
 
MacroElementmacro_elem_pt ()
 Access function to pointer to macro element. More...
 
void get_x (const Vector< double > &s, Vector< double > &x) const
 
void get_x (const unsigned &t, const Vector< double > &s, Vector< double > &x)
 
virtual void get_x_from_macro_element (const Vector< double > &s, Vector< double > &x) const
 
virtual void get_x_from_macro_element (const unsigned &t, const Vector< double > &s, Vector< double > &x)
 
virtual void set_integration_scheme (Integral *const &integral_pt)
 Set the spatial integration scheme. More...
 
Integral *const & integral_pt () const
 Return the pointer to the integration scheme (const version) More...
 
virtual void shape (const Vector< double > &s, Shape &psi) const =0
 
virtual void shape_at_knot (const unsigned &ipt, Shape &psi) const
 
virtual void dshape_local (const Vector< double > &s, Shape &psi, DShape &dpsids) const
 
virtual void dshape_local_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsids) const
 
virtual void d2shape_local (const Vector< double > &s, Shape &psi, DShape &dpsids, DShape &d2psids) const
 
virtual void d2shape_local_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsids, DShape &d2psids) const
 
virtual double J_eulerian (const Vector< double > &s) const
 
virtual double J_eulerian_at_knot (const unsigned &ipt) const
 
void check_J_eulerian_at_knots (bool &passed) const
 
void check_jacobian (const double &jacobian) const
 
double dshape_eulerian (const Vector< double > &s, Shape &psi, DShape &dpsidx) const
 
virtual double dshape_eulerian_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsidx) const
 
virtual double dshape_eulerian_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsi, DenseMatrix< double > &djacobian_dX, RankFourTensor< double > &d_dpsidx_dX) const
 
double d2shape_eulerian (const Vector< double > &s, Shape &psi, DShape &dpsidx, DShape &d2psidx) const
 
virtual double d2shape_eulerian_at_knot (const unsigned &ipt, Shape &psi, DShape &dpsidx, DShape &d2psidx) const
 
virtual void describe_local_dofs (std::ostream &out, const std::string &current_string) const
 
virtual void describe_nodal_local_dofs (std::ostream &out, const std::string &current_string) const
 
virtual void assign_all_generic_local_eqn_numbers (const bool &store_local_dof_pt)
 
Node *& node_pt (const unsigned &n)
 Return a pointer to the local node n. More...
 
Node *const & node_pt (const unsigned &n) const
 Return a pointer to the local node n (const version) More...
 
unsigned nnode () const
 Return the number of nodes. More...
 
virtual unsigned nnode_1d () const
 
double raw_nodal_position (const unsigned &n, const unsigned &i) const
 
double raw_nodal_position (const unsigned &t, const unsigned &n, const unsigned &i) const
 
double raw_dnodal_position_dt (const unsigned &n, const unsigned &i) const
 
double raw_dnodal_position_dt (const unsigned &n, const unsigned &j, const unsigned &i) const
 
double raw_nodal_position_gen (const unsigned &n, const unsigned &k, const unsigned &i) const
 
double raw_nodal_position_gen (const unsigned &t, const unsigned &n, const unsigned &k, const unsigned &i) const
 
double raw_dnodal_position_gen_dt (const unsigned &n, const unsigned &k, const unsigned &i) const
 
double raw_dnodal_position_gen_dt (const unsigned &j, const unsigned &n, const unsigned &k, const unsigned &i) const
 
double nodal_position (const unsigned &n, const unsigned &i) const
 
double nodal_position (const unsigned &t, const unsigned &n, const unsigned &i) const
 
double dnodal_position_dt (const unsigned &n, const unsigned &i) const
 Return the i-th component of nodal velocity: dx/dt at local node n. More...
 
double dnodal_position_dt (const unsigned &n, const unsigned &j, const unsigned &i) const
 
double nodal_position_gen (const unsigned &n, const unsigned &k, const unsigned &i) const
 
double nodal_position_gen (const unsigned &t, const unsigned &n, const unsigned &k, const unsigned &i) const
 
double dnodal_position_gen_dt (const unsigned &n, const unsigned &k, const unsigned &i) const
 
double dnodal_position_gen_dt (const unsigned &j, const unsigned &n, const unsigned &k, const unsigned &i) const
 
virtual unsigned required_nvalue (const unsigned &n) const
 
unsigned nnodal_position_type () const
 
bool has_hanging_nodes () const
 
unsigned nodal_dimension () const
 Return the required Eulerian dimension of the nodes in this element. More...
 
virtual Nodeconstruct_node (const unsigned &n)
 
virtual Nodeconstruct_node (const unsigned &n, TimeStepper *const &time_stepper_pt)
 
virtual Nodeconstruct_boundary_node (const unsigned &n)
 
virtual Nodeconstruct_boundary_node (const unsigned &n, TimeStepper *const &time_stepper_pt)
 
int get_node_number (Node *const &node_pt) const
 
virtual Nodeget_node_at_local_coordinate (const Vector< double > &s) const
 
double raw_nodal_value (const unsigned &n, const unsigned &i) const
 
double raw_nodal_value (const unsigned &t, const unsigned &n, const unsigned &i) const
 
double nodal_value (const unsigned &n, const unsigned &i) const
 
double nodal_value (const unsigned &t, const unsigned &n, const unsigned &i) const
 
unsigned dim () const
 
virtual ElementGeometry::ElementGeometry element_geometry () const
 Return the geometry type of the element (either Q or T usually). More...
 
virtual double interpolated_x (const Vector< double > &s, const unsigned &i) const
 Return FE interpolated coordinate x[i] at local coordinate s. More...
 
virtual double interpolated_x (const unsigned &t, const Vector< double > &s, const unsigned &i) const
 
virtual void interpolated_x (const Vector< double > &s, Vector< double > &x) const
 Return FE interpolated position x[] at local coordinate s as Vector. More...
 
virtual void interpolated_x (const unsigned &t, const Vector< double > &s, Vector< double > &x) const
 
virtual double interpolated_dxdt (const Vector< double > &s, const unsigned &i, const unsigned &t)
 
virtual void interpolated_dxdt (const Vector< double > &s, const unsigned &t, Vector< double > &dxdt)
 
unsigned ngeom_data () const
 
Datageom_data_pt (const unsigned &j)
 
void position (const Vector< double > &zeta, Vector< double > &r) const
 
void position (const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
 
void dposition_dt (const Vector< double > &zeta, const unsigned &t, Vector< double > &drdt)
 
virtual double zeta_nodal (const unsigned &n, const unsigned &k, const unsigned &i) const
 
void interpolated_zeta (const Vector< double > &s, Vector< double > &zeta) const
 
void locate_zeta (const Vector< double > &zeta, GeomObject *&geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
 
virtual void node_update ()
 
virtual void identify_geometric_data (std::set< Data * > &geometric_data_pt)
 
virtual double s_min () const
 Min value of local coordinate. More...
 
virtual double s_max () const
 Max. value of local coordinate. More...
 
double size () const
 
virtual double compute_physical_size () const
 
void point_output (std::ostream &outfile, const Vector< double > &s)
 
virtual unsigned nplot_points_paraview (const unsigned &nplot) const
 
virtual unsigned nsub_elements_paraview (const unsigned &nplot) const
 
void output_paraview (std::ofstream &file_out, const unsigned &nplot) const
 
virtual void write_paraview_output_offset_information (std::ofstream &file_out, const unsigned &nplot, unsigned &counter) const
 
virtual void write_paraview_type (std::ofstream &file_out, const unsigned &nplot) const
 
virtual void write_paraview_offsets (std::ofstream &file_out, const unsigned &nplot, unsigned &offset_sum) const
 
virtual void scalar_value_fct_paraview (std::ofstream &file_out, const unsigned &i, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt) const
 
virtual void output (const unsigned &t, std::ostream &outfile, const unsigned &n_plot) const
 
virtual void output_fct (std::ostream &outfile, const unsigned &n_plot, const double &time, const SolutionFunctorBase &exact_soln) const
 Output a time-dependent exact solution over the element. More...
 
virtual void get_s_plot (const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
 
virtual std::string tecplot_zone_string (const unsigned &nplot) const
 
virtual void write_tecplot_zone_footer (std::ostream &outfile, const unsigned &nplot) const
 
virtual void write_tecplot_zone_footer (FILE *file_pt, const unsigned &nplot) const
 
virtual unsigned nplot_points (const unsigned &nplot) const
 
virtual void compute_error (FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_error (FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
 
virtual void compute_abs_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error)
 
void integrate_fct (FiniteElement::SteadyExactSolutionFctPt integrand_fct_pt, Vector< double > &integral)
 Integrate Vector-valued function over element. More...
 
void integrate_fct (FiniteElement::UnsteadyExactSolutionFctPt integrand_fct_pt, const double &time, Vector< double > &integral)
 Integrate Vector-valued time-dep function over element. More...
 
virtual void build_face_element (const int &face_index, FaceElement *face_element_pt)
 
virtual unsigned self_test ()
 
virtual unsigned get_bulk_node_number (const int &face_index, const unsigned &i) const
 
virtual int face_outer_unit_normal_sign (const int &face_index) const
 Get the sign of the outer unit normal on the face given by face_index. More...
 
virtual unsigned nnode_on_face () const
 
void face_node_number_error_check (const unsigned &i) const
 Range check for face node numbers. More...
 
virtual CoordinateMappingFctPt face_to_bulk_coordinate_fct_pt (const int &face_index) const
 
virtual BulkCoordinateDerivativesFctPt bulk_coordinate_derivatives_fct_pt (const int &face_index) const
 
- Public Member Functions inherited from oomph::GeneralisedElement
 GeneralisedElement ()
 Constructor: Initialise all pointers and all values to zero. More...
 
virtual ~GeneralisedElement ()
 Virtual destructor to clean up any memory allocated by the object. More...
 
 GeneralisedElement (const GeneralisedElement &)=delete
 Broken copy constructor. More...
 
void operator= (const GeneralisedElement &)=delete
 Broken assignment operator. More...
 
Data *& internal_data_pt (const unsigned &i)
 Return a pointer to i-th internal data object. More...
 
Data *const & internal_data_pt (const unsigned &i) const
 Return a pointer to i-th internal data object (const version) More...
 
Data *& external_data_pt (const unsigned &i)
 Return a pointer to i-th external data object. More...
 
Data *const & external_data_pt (const unsigned &i) const
 Return a pointer to i-th external data object (const version) More...
 
unsigned long eqn_number (const unsigned &ieqn_local) const
 
int local_eqn_number (const unsigned long &ieqn_global) const
 
unsigned add_external_data (Data *const &data_pt, const bool &fd=true)
 
bool external_data_fd (const unsigned &i) const
 
void exclude_external_data_fd (const unsigned &i)
 
void include_external_data_fd (const unsigned &i)
 
void flush_external_data ()
 Flush all external data. More...
 
void flush_external_data (Data *const &data_pt)
 Flush the object addressed by data_pt from the external data array. More...
 
unsigned ninternal_data () const
 Return the number of internal data objects. More...
 
unsigned nexternal_data () const
 Return the number of external data objects. More...
 
unsigned ndof () const
 Return the number of equations/dofs in the element. More...
 
void dof_vector (const unsigned &t, Vector< double > &dof)
 Return the vector of dof values at time level t. More...
 
void dof_pt_vector (Vector< double * > &dof_pt)
 Return the vector of pointers to dof values. More...
 
void set_internal_data_time_stepper (const unsigned &i, TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
 
void assign_internal_eqn_numbers (unsigned long &global_number, Vector< double * > &Dof_pt)
 
void describe_dofs (std::ostream &out, const std::string &current_string) const
 
void add_internal_value_pt_to_map (std::map< unsigned, double * > &map_of_value_pt)
 
virtual void assign_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void complete_setup_of_dependencies ()
 
virtual void get_residuals (Vector< double > &residuals)
 
virtual void get_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
virtual void get_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
 
virtual void get_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
virtual void get_dresiduals_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam)
 
virtual void get_djacobian_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 
virtual void get_djacobian_and_dmass_matrix_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
 
virtual void get_hessian_vector_products (Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 
virtual void get_inner_products (Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
 
virtual void get_inner_product_vectors (Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
 
virtual void compute_norm (double &norm)
 
virtual unsigned ndof_types () const
 
virtual void get_dof_numbers_for_unknowns (std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
 
- Public Member Functions inherited from oomph::GeomObject
 GeomObject ()
 Default constructor. More...
 
 GeomObject (const unsigned &ndim)
 
 GeomObject (const unsigned &nlagrangian, const unsigned &ndim)
 
 GeomObject (const unsigned &nlagrangian, const unsigned &ndim, TimeStepper *time_stepper_pt)
 
 GeomObject (const GeomObject &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const GeomObject &)=delete
 Broken assignment operator. More...
 
virtual ~GeomObject ()
 (Empty) destructor More...
 
unsigned nlagrangian () const
 Access function to # of Lagrangian coordinates. More...
 
unsigned ndim () const
 Access function to # of Eulerian coordinates. More...
 
void set_nlagrangian_and_ndim (const unsigned &n_lagrangian, const unsigned &n_dim)
 Set # of Lagrangian and Eulerian coordinates. More...
 
TimeStepper *& time_stepper_pt ()
 
TimeSteppertime_stepper_pt () const
 
virtual void position (const double &t, const Vector< double > &zeta, Vector< double > &r) const
 
virtual void dposition (const Vector< double > &zeta, DenseMatrix< double > &drdzeta) const
 
virtual void d2position (const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
 
virtual void d2position (const Vector< double > &zeta, Vector< double > &r, DenseMatrix< double > &drdzeta, RankThreeTensor< double > &ddrdzeta) const
 
- Public Member Functions inherited from oomph::TemplateFreeSpaceTimeNavierStokesEquationsBase
 TemplateFreeSpaceTimeNavierStokesEquationsBase ()
 Constructor (empty) More...
 
virtual ~TemplateFreeSpaceTimeNavierStokesEquationsBase ()
 Virtual destructor (empty) More...
 
virtual int p_local_eqn (const unsigned &n) const =0
 
 TemplateFreeSpaceTimeNavierStokesEquationsBase ()
 Constructor (empty) More...
 
virtual ~TemplateFreeSpaceTimeNavierStokesEquationsBase ()
 Virtual destructor (empty) More...
 
virtual int p_local_eqn (const unsigned &n) const =0
 
 TemplateFreeSpaceTimeNavierStokesEquationsBase ()
 Constructor (empty) More...
 
virtual ~TemplateFreeSpaceTimeNavierStokesEquationsBase ()
 Virtual destructor (empty) More...
 
virtual int p_local_eqn (const unsigned &n) const =0
 
- Public Member Functions inherited from oomph::NavierStokesElementWithDiagonalMassMatrices
 NavierStokesElementWithDiagonalMassMatrices ()
 Empty constructor. More...
 
virtual ~NavierStokesElementWithDiagonalMassMatrices ()
 Virtual destructor. More...
 
 NavierStokesElementWithDiagonalMassMatrices (const NavierStokesElementWithDiagonalMassMatrices &)=delete
 Broken copy constructor. More...
 
void operator= (const NavierStokesElementWithDiagonalMassMatrices &)=delete
 Broken assignment operator. More...
 
- Public Member Functions inherited from oomph::RefineableElement
 RefineableElement ()
 
virtual ~RefineableElement ()
 Destructor, delete the allocated storage for the hanging equations. More...
 
 RefineableElement (const RefineableElement &)=delete
 Broken copy constructor. More...
 
void operator= (const RefineableElement &)=delete
 Broken assignment operator. More...
 
Treetree_pt ()
 Access function: Pointer to quadtree representation of this element. More...
 
void set_tree_pt (Tree *my_tree_pt)
 Set pointer to quadtree representation of this element. More...
 
virtual unsigned required_nsons () const
 
bool refinement_is_enabled ()
 Flag to indicate suppression of any refinement. More...
 
void disable_refinement ()
 Suppress of any refinement for this element. More...
 
void enable_refinement ()
 Emnable refinement for this element. More...
 
template<class ELEMENT >
void split (Vector< ELEMENT * > &son_pt) const
 
int local_hang_eqn (Node *const &node_pt, const unsigned &i)
 
virtual void build (Mesh *&mesh_pt, Vector< Node * > &new_node_pt, bool &was_already_built, std::ofstream &new_nodes_file)=0
 
void set_refinement_level (const int &refine_level)
 Set the refinement level. More...
 
unsigned refinement_level () const
 Return the Refinement level. More...
 
void select_for_refinement ()
 Select the element for refinement. More...
 
void deselect_for_refinement ()
 Deselect the element for refinement. More...
 
void select_sons_for_unrefinement ()
 Unrefinement will be performed by merging the four sons of this element. More...
 
void deselect_sons_for_unrefinement ()
 
bool to_be_refined ()
 Has the element been selected for refinement? More...
 
bool sons_to_be_unrefined ()
 Has the element been selected for unrefinement? More...
 
virtual void rebuild_from_sons (Mesh *&mesh_pt)=0
 
virtual void unbuild ()
 
virtual void deactivate_element ()
 
virtual bool nodes_built ()
 Return true if all the nodes have been built, false if not. More...
 
long number () const
 Element number (for debugging/plotting) More...
 
void set_number (const long &mynumber)
 Set element number (for debugging/plotting) More...
 
virtual unsigned ncont_interpolated_values () const =0
 
virtual void get_interpolated_values (const Vector< double > &s, Vector< double > &values)
 
virtual void get_interpolated_values (const unsigned &t, const Vector< double > &s, Vector< double > &values)=0
 
virtual Nodeinterpolating_node_pt (const unsigned &n, const int &value_id)
 
virtual double local_one_d_fraction_of_interpolating_node (const unsigned &n1d, const unsigned &i, const int &value_id)
 
virtual Nodeget_interpolating_node_at_local_coordinate (const Vector< double > &s, const int &value_id)
 
virtual unsigned ninterpolating_node (const int &value_id)
 
virtual unsigned ninterpolating_node_1d (const int &value_id)
 
virtual void interpolating_basis (const Vector< double > &s, Shape &psi, const int &value_id) const
 
virtual void check_integrity (double &max_error)=0
 
void identify_field_data_for_interactions (std::set< std::pair< Data *, unsigned >> &paired_field_data)
 
void assign_nodal_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual RefineableElementroot_element_pt ()
 
virtual RefineableElementfather_element_pt () const
 Return a pointer to the father element. More...
 
void get_father_at_refinement_level (unsigned &refinement_level, RefineableElement *&father_at_reflevel_pt)
 
virtual void initial_setup (Tree *const &adopted_father_pt=0, const unsigned &initial_p_order=0)
 
virtual void pre_build (Mesh *&mesh_pt, Vector< Node * > &new_node_pt)
 Pre-build the element. More...
 
virtual void setup_hanging_nodes (Vector< std::ofstream * > &output_stream)
 
virtual void further_setup_hanging_nodes ()
 
unsigned nshape_controlling_nodes ()
 
std::map< Node *, unsignedshape_controlling_node_lookup ()
 
- Public Member Functions inherited from oomph::ElementWithZ2ErrorEstimator
 ElementWithZ2ErrorEstimator ()
 Default empty constructor. More...
 
 ElementWithZ2ErrorEstimator (const ElementWithZ2ErrorEstimator &)=delete
 Broken copy constructor. More...
 
void operator= (const ElementWithZ2ErrorEstimator &)=delete
 Broken assignment operator. More...
 
virtual unsigned ncompound_fluxes ()
 
virtual void compute_exact_Z2_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_flux_pt, double &error, double &norm)
 
virtual void get_Z2_compound_flux_indices (Vector< unsigned > &flux_index)
 
virtual unsigned nvertex_node () const =0
 Number of vertex nodes in the element. More...
 
virtual Nodevertex_node_pt (const unsigned &j) const =0
 
virtual unsigned nrecovery_order ()=0
 Order of recovery shape functions. More...
 
virtual double geometric_jacobian (const Vector< double > &x)
 

Static Public Member Functions

static void pin_redundant_nodal_pressures (const Vector< GeneralisedElement * > &element_pt)
 
static void unpin_all_pressure_dofs (const Vector< GeneralisedElement * > &element_pt)
 Unpin all pressure dofs in elements listed in vector. More...
 
static void pin_redundant_nodal_pressures (const Vector< GeneralisedElement * > &element_pt)
 
static void unpin_all_pressure_dofs (const Vector< GeneralisedElement * > &element_pt)
 Unpin all pressure dofs in elements listed in vector. More...
 
static void pin_redundant_nodal_pressures (const Vector< GeneralisedElement * > &element_pt)
 
static void unpin_all_pressure_dofs (const Vector< GeneralisedElement * > &element_pt)
 Unpin all pressure dofs in elements listed in vector. More...
 
- Static Public Member Functions inherited from oomph::RefineableElement
static doublemax_integrity_tolerance ()
 Max. allowed discrepancy in element integrity check. More...
 

Protected Member Functions

virtual void unpin_elemental_pressure_dofs ()=0
 Unpin all pressure dofs in the element. More...
 
virtual void pin_elemental_redundant_nodal_pressure_dofs ()
 
void fill_in_generic_residual_contribution_nst (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, const unsigned &compute_jacobian_flag)
 
void fill_in_generic_pressure_advection_diffusion_contribution_nst (Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &compute_jacobian_flag)
 
virtual void get_dresidual_dnodal_coordinates (RankThreeTensor< double > &dresidual_dnodal_coordinates)
 
virtual void unpin_elemental_pressure_dofs ()=0
 Unpin all pressure dofs in the element. More...
 
virtual void pin_elemental_redundant_nodal_pressure_dofs ()
 
void fill_in_generic_residual_contribution_nst (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, const unsigned &compute_jacobian_flag)
 
void fill_in_generic_pressure_advection_diffusion_contribution_nst (Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &compute_jacobian_flag)
 
virtual void get_dresidual_dnodal_coordinates (RankThreeTensor< double > &dresidual_dnodal_coordinates)
 
virtual void unpin_elemental_pressure_dofs ()=0
 Unpin all pressure dofs in the element. More...
 
virtual void pin_elemental_redundant_nodal_pressure_dofs ()
 
void fill_in_generic_residual_contribution_nst (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, const unsigned &compute_jacobian_flag)
 
void fill_in_generic_pressure_advection_diffusion_contribution_nst (Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &compute_jacobian_flag)
 
virtual void get_dresidual_dnodal_coordinates (RankThreeTensor< double > &dresidual_dnodal_coordinates)
 
- Protected Member Functions inherited from oomph::SpaceTimeNavierStokesEquations< DIM >
virtual double dshape_and_dtest_eulerian_nst (const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
 
virtual double dshape_and_dtest_eulerian_at_knot_nst (const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
 
virtual double dshape_and_dtest_eulerian_at_knot_nst (const unsigned &ipt, Shape &psi, DShape &dpsidx, RankFourTensor< double > &d_dpsidx_dX, Shape &test, DShape &dtestdx, RankFourTensor< double > &d_dtestdx_dX, DenseMatrix< double > &djacobian_dX) const =0
 
virtual double dpshape_eulerian (const Vector< double > &s, Shape &ppsi, DShape &dppsidx) const =0
 
virtual double dptest_eulerian (const Vector< double > &s, Shape &ptest, DShape &dptestdx) const =0
 
virtual double dpshape_and_dptest_eulerian_nst (const Vector< double > &s, Shape &ppsi, DShape &dppsidx, Shape &ptest, DShape &dptestdx) const =0
 
virtual void get_body_force_nst (const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &result)
 
virtual void get_body_force_gradient_nst (const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, DenseMatrix< double > &d_body_force_dx)
 
virtual double get_source_nst (const double &time, const unsigned &ipt, const Vector< double > &x)
 Calculate the source fct at a given time and Eulerian position. More...
 
virtual void get_source_gradient_nst (const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &gradient)
 
virtual void fill_in_generic_dresidual_contribution_nst (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam, const unsigned &flag)
 
void fill_in_contribution_to_hessian_vector_products (Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 
virtual double dshape_and_dtest_eulerian_nst (const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
 
virtual double dshape_and_dtest_eulerian_at_knot_nst (const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
 
virtual double dshape_and_dtest_eulerian_at_knot_nst (const unsigned &ipt, Shape &psi, DShape &dpsidx, RankFourTensor< double > &d_dpsidx_dX, Shape &test, DShape &dtestdx, RankFourTensor< double > &d_dtestdx_dX, DenseMatrix< double > &djacobian_dX) const =0
 
virtual double dpshape_eulerian (const Vector< double > &s, Shape &ppsi, DShape &dppsidx) const =0
 
virtual double dptest_eulerian (const Vector< double > &s, Shape &ptest, DShape &dptestdx) const =0
 
virtual double dpshape_and_dptest_eulerian_nst (const Vector< double > &s, Shape &ppsi, DShape &dppsidx, Shape &ptest, DShape &dptestdx) const =0
 
virtual void get_body_force_nst (const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &result)
 
virtual void get_body_force_gradient_nst (const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, DenseMatrix< double > &d_body_force_dx)
 
virtual double get_source_nst (const double &time, const unsigned &ipt, const Vector< double > &x)
 Calculate the source fct at a given time and Eulerian position. More...
 
virtual void get_source_gradient_nst (const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &gradient)
 
virtual void fill_in_generic_dresidual_contribution_nst (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam, const unsigned &flag)
 
void fill_in_contribution_to_hessian_vector_products (Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 
virtual double dshape_and_dtest_eulerian_nst (const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
 
virtual double dshape_and_dtest_eulerian_at_knot_nst (const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
 
virtual double dshape_and_dtest_eulerian_at_knot_nst (const unsigned &ipt, Shape &psi, DShape &dpsidx, RankFourTensor< double > &d_dpsidx_dX, Shape &test, DShape &dtestdx, RankFourTensor< double > &d_dtestdx_dX, DenseMatrix< double > &djacobian_dX) const =0
 
virtual double dpshape_and_dptest_eulerian_nst (const Vector< double > &s, Shape &ppsi, DShape &dppsidx, Shape &ptest, DShape &dptestdx) const =0
 
virtual void get_body_force_nst (const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &result)
 
virtual void get_body_force_gradient_nst (const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, DenseMatrix< double > &d_body_force_dx)
 
virtual double get_source_nst (const double &time, const unsigned &ipt, const Vector< double > &x)
 Calculate the source fct at a given time and Eulerian position. More...
 
virtual void get_source_gradient_nst (const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &gradient)
 
virtual void fill_in_generic_dresidual_contribution_nst (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam, const unsigned &flag)
 
void fill_in_contribution_to_hessian_vector_products (Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 
- Protected Member Functions inherited from oomph::FiniteElement
template<unsigned DIM>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual double invert_jacobian_mapping (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
virtual double local_to_eulerian_mapping (const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
double local_to_eulerian_mapping (const DShape &dpsids, DenseMatrix< double > &inverse_jacobian) const
 
virtual void dJ_eulerian_dnodal_coordinates (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<unsigned DIM>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
virtual void d_dshape_eulerian_dnodal_coordinates (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<unsigned DIM>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
virtual void transform_derivatives (const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
 
void transform_derivatives_diagonal (const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
 
virtual void transform_second_derivatives (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<unsigned DIM>
void transform_second_derivatives_template (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<unsigned DIM>
void transform_second_derivatives_diagonal (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
void fill_in_jacobian_from_nodal_by_fd (DenseMatrix< double > &jacobian)
 
virtual void update_before_nodal_fd ()
 
virtual void reset_after_nodal_fd ()
 
virtual void update_in_nodal_fd (const unsigned &i)
 
virtual void reset_in_nodal_fd (const unsigned &i)
 
template<>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 Zero-d specialisation of function to calculate inverse of jacobian mapping. More...
 
template<>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 One-d specialisation of function to calculate inverse of jacobian mapping. More...
 
template<>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 Two-d specialisation of function to calculate inverse of jacobian mapping. More...
 
template<>
double invert_jacobian (const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
template<>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<>
void dJ_eulerian_dnodal_coordinates_templated_helper (const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
 
template<>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<>
void d_dshape_eulerian_dnodal_coordinates_templated_helper (const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
 
template<>
void transform_second_derivatives_template (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<>
void transform_second_derivatives_template (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<>
void transform_second_derivatives_diagonal (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
template<>
void transform_second_derivatives_diagonal (const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
 
- Protected Member Functions inherited from oomph::GeneralisedElement
unsigned add_internal_data (Data *const &data_pt, const bool &fd=true)
 
bool internal_data_fd (const unsigned &i) const
 
void exclude_internal_data_fd (const unsigned &i)
 
void include_internal_data_fd (const unsigned &i)
 
void clear_global_eqn_numbers ()
 
void add_global_eqn_numbers (std::deque< unsigned long > const &global_eqn_numbers, std::deque< double * > const &global_dof_pt)
 
virtual void assign_internal_and_external_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void assign_additional_local_eqn_numbers ()
 
int internal_local_eqn (const unsigned &i, const unsigned &j) const
 
int external_local_eqn (const unsigned &i, const unsigned &j)
 
void fill_in_jacobian_from_internal_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_internal_by_fd (DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_external_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_external_by_fd (DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
virtual void update_before_internal_fd ()
 
virtual void reset_after_internal_fd ()
 
virtual void update_in_internal_fd (const unsigned &i)
 
virtual void reset_in_internal_fd (const unsigned &i)
 
virtual void update_before_external_fd ()
 
virtual void reset_after_external_fd ()
 
virtual void update_in_external_fd (const unsigned &i)
 
virtual void reset_in_external_fd (const unsigned &i)
 
virtual void fill_in_contribution_to_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
 
virtual void fill_in_contribution_to_inner_products (Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
 
virtual void fill_in_contribution_to_inner_product_vectors (Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
 
- Protected Member Functions inherited from oomph::RefineableElement
void assemble_local_to_eulerian_jacobian (const DShape &dpsids, DenseMatrix< double > &jacobian) const
 
void assemble_local_to_eulerian_jacobian2 (const DShape &d2psids, DenseMatrix< double > &jacobian2) const
 
void assemble_eulerian_base_vectors (const DShape &dpsids, DenseMatrix< double > &interpolated_G) const
 
double local_to_eulerian_mapping_diagonal (const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
 
void assign_hanging_local_eqn_numbers (const bool &store_local_dof_pt)
 Assign the local equation numbers for hanging node variables. More...
 
virtual void fill_in_jacobian_from_nodal_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 

Additional Inherited Members

- Public Types inherited from oomph::SpaceTimeNavierStokesEquations< DIM >
typedef void(* NavierStokesBodyForceFctPt) (const double &time, const Vector< double > &x, Vector< double > &body_force)
 
typedef double(* NavierStokesSourceFctPt) (const double &time, const Vector< double > &x)
 Function pointer to source function fct(t,x) (x is a Vector!) More...
 
typedef double(* NavierStokesPressureAdvDiffSourceFctPt) (const Vector< double > &x)
 
typedef void(* NavierStokesBodyForceFctPt) (const double &time, const Vector< double > &x, Vector< double > &body_force)
 
typedef double(* NavierStokesSourceFctPt) (const double &time, const Vector< double > &x)
 Function pointer to source function fct(t,x) (x is a Vector!) More...
 
typedef double(* NavierStokesPressureAdvDiffSourceFctPt) (const Vector< double > &x)
 
typedef void(* NavierStokesBodyForceFctPt) (const double &time, const Vector< double > &x, Vector< double > &body_force)
 
typedef double(* NavierStokesSourceFctPt) (const double &time, const Vector< double > &x)
 Function pointer to source function fct(t,x) (x is a Vector!) More...
 
typedef double(* NavierStokesPressureAdvDiffSourceFctPt) (const Vector< double > &x)
 
- Public Types inherited from oomph::FiniteElement
typedef void(* SteadyExactSolutionFctPt) (const Vector< double > &, Vector< double > &)
 
typedef void(* UnsteadyExactSolutionFctPt) (const double &, const Vector< double > &, Vector< double > &)
 
- Static Public Attributes inherited from oomph::SpaceTimeNavierStokesEquations< DIM >
static Vector< doubleGamma
 Navier-Stokes equations static data. More...
 
- Static Public Attributes inherited from oomph::FiniteElement
static double Tolerance_for_singular_jacobian = 1.0e-16
 Tolerance below which the jacobian is considered singular. More...
 
static bool Accept_negative_jacobian = false
 
static bool Suppress_output_while_checking_for_inverted_elements
 
- Static Public Attributes inherited from oomph::GeneralisedElement
static bool Suppress_warning_about_repeated_internal_data
 
static bool Suppress_warning_about_repeated_external_data = true
 
static double Default_fd_jacobian_step = 1.0e-8
 
- Static Protected Member Functions inherited from oomph::RefineableElement
static void check_value_id (const int &n_continuously_interpolated_values, const int &value_id)
 
- Protected Attributes inherited from oomph::SpaceTimeNavierStokesEquations< DIM >
doubleViscosity_Ratio_pt
 
doubleDensity_Ratio_pt
 
doubleRe_pt
 Pointer to global Reynolds number. More...
 
doubleSt_pt
 Pointer to global Reynolds number x Strouhal number (=Womersley) More...
 
bool Strouhal_is_stored_as_external_data
 
doubleReInvFr_pt
 
Vector< double > * G_pt
 Pointer to global gravity Vector. More...
 
NavierStokesBodyForceFctPt Body_force_fct_pt
 Pointer to body force function. More...
 
NavierStokesSourceFctPt Source_fct_pt
 Pointer to volumetric source function. More...
 
NavierStokesPressureAdvDiffSourceFctPt Press_adv_diff_source_fct_pt
 
bool ALE_is_disabled
 
Vector< FpPressureAdvDiffRobinBCSpaceTimeElementBase * > Pressure_advection_diffusion_robin_element_pt
 
int Pinned_fp_pressure_eqn
 
doubleReSt_pt
 Pointer to global Reynolds number x Strouhal number (= Womersley) More...
 
bool ReynoldsStrouhal_is_stored_as_external_data
 
- Protected Attributes inherited from oomph::FiniteElement
MacroElementMacro_elem_pt
 Pointer to the element's macro element (NULL by default) More...
 
- Protected Attributes inherited from oomph::GeomObject
unsigned NLagrangian
 Number of Lagrangian (intrinsic) coordinates. More...
 
unsigned Ndim
 Number of Eulerian coordinates. More...
 
TimeStepperGeom_object_time_stepper_pt
 
- Protected Attributes inherited from oomph::RefineableElement
TreeTree_pt
 A pointer to a general tree object. More...
 
unsigned Refine_level
 Refinement level. More...
 
bool To_be_refined
 Flag for refinement. More...
 
bool Refinement_is_enabled
 Flag to indicate suppression of any refinement. More...
 
bool Sons_to_be_unrefined
 Flag for unrefinement. More...
 
long Number
 Global element number – for plotting/validation purposes. More...
 
- Static Protected Attributes inherited from oomph::FiniteElement
static const unsigned Default_Initial_Nvalue = 0
 Default value for the number of values at a node. More...
 
static const double Node_location_tolerance = 1.0e-14
 
static const unsigned N2deriv [] = {0, 1, 3, 6}
 
- Static Protected Attributes inherited from oomph::GeneralisedElement
static DenseMatrix< doubleDummy_matrix
 
static std::deque< double * > Dof_pt_deque
 
- Static Protected Attributes inherited from oomph::RefineableElement
static double Max_integrity_tolerance = 1.0e-8
 Max. allowed discrepancy in element integrity check. More...
 

Detailed Description

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

Refineable version of the Navier-Stokes equations.

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

Constructor & Destructor Documentation

◆ RefineableSpaceTimeNavierStokesEquations() [1/3]

Constructor.

355  : SpaceTimeNavierStokesEquations<DIM>(),
358  {
359  }
ElementWithZ2ErrorEstimator()
Default empty constructor.
Definition: error_estimator.h:82
RefineableElement()
Definition: refineable_elements.h:188

◆ RefineableSpaceTimeNavierStokesEquations() [2/3]

Constructor.

355  : SpaceTimeNavierStokesEquations<DIM>(),
358  {
359  }

◆ RefineableSpaceTimeNavierStokesEquations() [3/3]

Constructor.

355  : SpaceTimeNavierStokesEquations<DIM>(),
358  {
359  }

Member Function Documentation

◆ dinterpolated_u_nst_ddata() [1/3]

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::dinterpolated_u_nst_ddata ( const Vector< double > &  s,
const unsigned i,
Vector< double > &  du_ddata,
Vector< unsigned > &  global_eqn_number 
)
inlinevirtual

Compute the derivatives of the i-th component of velocity at point s with respect to all data that can affect its value. In addition, return the global equation numbers corresponding to the data. Overload the non-refineable version to take account of hanging node information

Reimplemented from oomph::SpaceTimeNavierStokesEquations< DIM >.

583  {
584  // Find the number of nodes in the element
585  unsigned n_node = this->nnode();
586  // Local shape function
587  Shape psi(n_node);
588  // Find values of shape function at the given local coordinate
589  this->shape(s, psi);
590 
591  // Find the index at which the velocity component is stored
592  const unsigned u_nodal_index = this->u_index_nst(i);
593 
594  // Storage for hang info pointer
595  HangInfo* hang_info_pt = 0;
596  // Storage for global equation
597  int global_eqn = 0;
598 
599  // Find the number of dofs associated with interpolated u
600  unsigned n_u_dof = 0;
601  for (unsigned l = 0; l < n_node; l++)
602  {
603  unsigned n_master = 1;
604 
605  // Local bool (is the node hanging)
606  bool is_node_hanging = this->node_pt(l)->is_hanging();
607 
608  // If the node is hanging, get the number of master nodes
609  if (is_node_hanging)
610  {
611  hang_info_pt = this->node_pt(l)->hanging_pt();
612  n_master = hang_info_pt->nmaster();
613  }
614  // Otherwise there is just one master node, the node itself
615  else
616  {
617  n_master = 1;
618  }
619 
620  // Loop over the master nodes
621  for (unsigned m = 0; m < n_master; m++)
622  {
623  // Get the equation number
624  if (is_node_hanging)
625  {
626  // Get the equation number from the master node
627  global_eqn =
628  hang_info_pt->master_node_pt(m)->eqn_number(u_nodal_index);
629  }
630  else
631  {
632  // Global equation number
633  global_eqn = this->node_pt(l)->eqn_number(u_nodal_index);
634  }
635 
636  // If it's positive add to the count
637  if (global_eqn >= 0)
638  {
639  ++n_u_dof;
640  }
641  }
642  }
643 
644  // Now resize the storage schemes
645  du_ddata.resize(n_u_dof, 0.0);
646  global_eqn_number.resize(n_u_dof, 0);
647 
648  // Loop over the nodes again and set the derivatives
649  unsigned count = 0;
650 
651  // Loop over the nodes in the element
652  for (unsigned l = 0; l < n_node; l++)
653  {
654  // Initialise the number of master nodes to one
655  unsigned n_master = 1;
656 
657  // Initialise the hang weight to one
658  double hang_weight = 1.0;
659 
660  // Local bool (is the node hanging)
661  bool is_node_hanging = this->node_pt(l)->is_hanging();
662 
663  // If the node is hanging, get the number of master nodes
664  if (is_node_hanging)
665  {
666  // Get the HangInfo pointer associated with the l-th node
667  hang_info_pt = this->node_pt(l)->hanging_pt();
668 
669  // How many master nodes does this node have?
670  n_master = hang_info_pt->nmaster();
671  }
672  // Otherwise there is just one master node, the node itself
673  else
674  {
675  // Set n_master to one
676  n_master = 1;
677  }
678 
679  // Loop over the master nodes
680  for (unsigned m = 0; m < n_master; m++)
681  {
682  // If the node is hanging get weight from master node
683  if (is_node_hanging)
684  {
685  // Get the hang weight from the master node
686  hang_weight = hang_info_pt->master_weight(m);
687  }
688  else
689  {
690  // Node contributes with full weight
691  hang_weight = 1.0;
692  }
693 
694  // Get the equation number
695  if (is_node_hanging)
696  {
697  // Get the equation number from the master node
698  global_eqn =
699  hang_info_pt->master_node_pt(m)->eqn_number(u_nodal_index);
700  }
701  else
702  {
703  // Get the global equation number
704  global_eqn = this->node_pt(l)->eqn_number(u_nodal_index);
705  }
706 
707  // If it's a proper degree of freedom
708  if (global_eqn >= 0)
709  {
710  // Set the global equation number
711  global_eqn_number[count] = global_eqn;
712 
713  // Set the derivative with respect to the unknown
714  du_ddata[count] = psi[l] * hang_weight;
715 
716  // Increase the counter
717  ++count;
718  }
719  } // for (unsigned m=0;m<n_master;m++)
720  } // for (unsigned l=0;l<n_node;l++)
721  } // End of dinterpolated_u_nst_ddata
long & eqn_number(const unsigned &i)
Return the equation number of the i-th stored variable.
Definition: nodes.h:367
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
virtual void shape(const Vector< double > &s, Shape &psi) const =0
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
HangInfo *const & hanging_pt() const
Definition: nodes.h:1228
bool is_hanging() const
Test whether the node is geometrically hanging.
Definition: nodes.h:1285
virtual unsigned u_index_nst(const unsigned &i) const
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:1102
int * m
Definition: level2_cplx_impl.h:294

References oomph::Data::eqn_number(), oomph::Node::hanging_pt(), oomph::Node::is_hanging(), m, oomph::HangInfo::master_node_pt(), oomph::HangInfo::master_weight(), oomph::HangInfo::nmaster(), oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), oomph::FiniteElement::shape(), and oomph::SpaceTimeNavierStokesEquations< DIM >::u_index_nst().

◆ dinterpolated_u_nst_ddata() [2/3]

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::dinterpolated_u_nst_ddata ( const Vector< double > &  s,
const unsigned i,
Vector< double > &  du_ddata,
Vector< unsigned > &  global_eqn_number 
)
inlinevirtual

Compute the derivatives of the i-th component of velocity at point s with respect to all data that can affect its value. In addition, return the global equation numbers corresponding to the data. Overload the non-refineable version to take account of hanging node information

Reimplemented from oomph::SpaceTimeNavierStokesEquations< DIM >.

583  {
584  // Find the number of nodes in the element
585  unsigned n_node = this->nnode();
586  // Local shape function
587  Shape psi(n_node);
588  // Find values of shape function at the given local coordinate
589  this->shape(s, psi);
590 
591  // Find the index at which the velocity component is stored
592  const unsigned u_nodal_index = this->u_index_nst(i);
593 
594  // Storage for hang info pointer
595  HangInfo* hang_info_pt = 0;
596  // Storage for global equation
597  int global_eqn = 0;
598 
599  // Find the number of dofs associated with interpolated u
600  unsigned n_u_dof = 0;
601  for (unsigned l = 0; l < n_node; l++)
602  {
603  unsigned n_master = 1;
604 
605  // Local bool (is the node hanging)
606  bool is_node_hanging = this->node_pt(l)->is_hanging();
607 
608  // If the node is hanging, get the number of master nodes
609  if (is_node_hanging)
610  {
611  hang_info_pt = this->node_pt(l)->hanging_pt();
612  n_master = hang_info_pt->nmaster();
613  }
614  // Otherwise there is just one master node, the node itself
615  else
616  {
617  n_master = 1;
618  }
619 
620  // Loop over the master nodes
621  for (unsigned m = 0; m < n_master; m++)
622  {
623  // Get the equation number
624  if (is_node_hanging)
625  {
626  // Get the equation number from the master node
627  global_eqn =
628  hang_info_pt->master_node_pt(m)->eqn_number(u_nodal_index);
629  }
630  else
631  {
632  // Global equation number
633  global_eqn = this->node_pt(l)->eqn_number(u_nodal_index);
634  }
635 
636  // If it's positive add to the count
637  if (global_eqn >= 0)
638  {
639  ++n_u_dof;
640  }
641  }
642  }
643 
644  // Now resize the storage schemes
645  du_ddata.resize(n_u_dof, 0.0);
646  global_eqn_number.resize(n_u_dof, 0);
647 
648  // Loop over the nodes again and set the derivatives
649  unsigned count = 0;
650 
651  // Loop over the nodes in the element
652  for (unsigned l = 0; l < n_node; l++)
653  {
654  // Initialise the number of master nodes to one
655  unsigned n_master = 1;
656 
657  // Initialise the hang weight to one
658  double hang_weight = 1.0;
659 
660  // Local bool (is the node hanging)
661  bool is_node_hanging = this->node_pt(l)->is_hanging();
662 
663  // If the node is hanging, get the number of master nodes
664  if (is_node_hanging)
665  {
666  // Get the HangInfo pointer associated with the l-th node
667  hang_info_pt = this->node_pt(l)->hanging_pt();
668 
669  // How many master nodes does this node have?
670  n_master = hang_info_pt->nmaster();
671  }
672  // Otherwise there is just one master node, the node itself
673  else
674  {
675  // Set n_master to one
676  n_master = 1;
677  }
678 
679  // Loop over the master nodes
680  for (unsigned m = 0; m < n_master; m++)
681  {
682  // If the node is hanging get weight from master node
683  if (is_node_hanging)
684  {
685  // Get the hang weight from the master node
686  hang_weight = hang_info_pt->master_weight(m);
687  }
688  else
689  {
690  // Node contributes with full weight
691  hang_weight = 1.0;
692  }
693 
694  // Get the equation number
695  if (is_node_hanging)
696  {
697  // Get the equation number from the master node
698  global_eqn =
699  hang_info_pt->master_node_pt(m)->eqn_number(u_nodal_index);
700  }
701  else
702  {
703  // Get the global equation number
704  global_eqn = this->node_pt(l)->eqn_number(u_nodal_index);
705  }
706 
707  // If it's a proper degree of freedom
708  if (global_eqn >= 0)
709  {
710  // Set the global equation number
711  global_eqn_number[count] = global_eqn;
712 
713  // Set the derivative with respect to the unknown
714  du_ddata[count] = psi[l] * hang_weight;
715 
716  // Increase the counter
717  ++count;
718  }
719  } // for (unsigned m=0;m<n_master;m++)
720  } // for (unsigned l=0;l<n_node;l++)
721  } // End of dinterpolated_u_nst_ddata

References oomph::Data::eqn_number(), oomph::Node::hanging_pt(), oomph::Node::is_hanging(), m, oomph::HangInfo::master_node_pt(), oomph::HangInfo::master_weight(), oomph::HangInfo::nmaster(), oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), oomph::FiniteElement::shape(), and oomph::SpaceTimeNavierStokesEquations< DIM >::u_index_nst().

◆ dinterpolated_u_nst_ddata() [3/3]

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::dinterpolated_u_nst_ddata ( const Vector< double > &  s,
const unsigned i,
Vector< double > &  du_ddata,
Vector< unsigned > &  global_eqn_number 
)
inlinevirtual

Compute the derivatives of the i-th component of velocity at point s with respect to all data that can affect its value. In addition, return the global equation numbers corresponding to the data. Overload the non-refineable version to take account of hanging node information

Reimplemented from oomph::SpaceTimeNavierStokesEquations< DIM >.

583  {
584  // Find the number of nodes in the element
585  unsigned n_node = this->nnode();
586  // Local shape function
587  Shape psi(n_node);
588  // Find values of shape function at the given local coordinate
589  this->shape(s, psi);
590 
591  // Find the index at which the velocity component is stored
592  const unsigned u_nodal_index = this->u_index_nst(i);
593 
594  // Storage for hang info pointer
595  HangInfo* hang_info_pt = 0;
596  // Storage for global equation
597  int global_eqn = 0;
598 
599  // Find the number of dofs associated with interpolated u
600  unsigned n_u_dof = 0;
601  for (unsigned l = 0; l < n_node; l++)
602  {
603  unsigned n_master = 1;
604 
605  // Local bool (is the node hanging)
606  bool is_node_hanging = this->node_pt(l)->is_hanging();
607 
608  // If the node is hanging, get the number of master nodes
609  if (is_node_hanging)
610  {
611  hang_info_pt = this->node_pt(l)->hanging_pt();
612  n_master = hang_info_pt->nmaster();
613  }
614  // Otherwise there is just one master node, the node itself
615  else
616  {
617  n_master = 1;
618  }
619 
620  // Loop over the master nodes
621  for (unsigned m = 0; m < n_master; m++)
622  {
623  // Get the equation number
624  if (is_node_hanging)
625  {
626  // Get the equation number from the master node
627  global_eqn =
628  hang_info_pt->master_node_pt(m)->eqn_number(u_nodal_index);
629  }
630  else
631  {
632  // Global equation number
633  global_eqn = this->node_pt(l)->eqn_number(u_nodal_index);
634  }
635 
636  // If it's positive add to the count
637  if (global_eqn >= 0)
638  {
639  ++n_u_dof;
640  }
641  }
642  }
643 
644  // Now resize the storage schemes
645  du_ddata.resize(n_u_dof, 0.0);
646  global_eqn_number.resize(n_u_dof, 0);
647 
648  // Loop over the nodes again and set the derivatives
649  unsigned count = 0;
650 
651  // Loop over the nodes in the element
652  for (unsigned l = 0; l < n_node; l++)
653  {
654  // Initialise the number of master nodes to one
655  unsigned n_master = 1;
656 
657  // Initialise the hang weight to one
658  double hang_weight = 1.0;
659 
660  // Local bool (is the node hanging)
661  bool is_node_hanging = this->node_pt(l)->is_hanging();
662 
663  // If the node is hanging, get the number of master nodes
664  if (is_node_hanging)
665  {
666  // Get the HangInfo pointer associated with the l-th node
667  hang_info_pt = this->node_pt(l)->hanging_pt();
668 
669  // How many master nodes does this node have?
670  n_master = hang_info_pt->nmaster();
671  }
672  // Otherwise there is just one master node, the node itself
673  else
674  {
675  // Set n_master to one
676  n_master = 1;
677  }
678 
679  // Loop over the master nodes
680  for (unsigned m = 0; m < n_master; m++)
681  {
682  // If the node is hanging get weight from master node
683  if (is_node_hanging)
684  {
685  // Get the hang weight from the master node
686  hang_weight = hang_info_pt->master_weight(m);
687  }
688  else
689  {
690  // Node contributes with full weight
691  hang_weight = 1.0;
692  }
693 
694  // Get the equation number
695  if (is_node_hanging)
696  {
697  // Get the equation number from the master node
698  global_eqn =
699  hang_info_pt->master_node_pt(m)->eqn_number(u_nodal_index);
700  }
701  else
702  {
703  // Get the global equation number
704  global_eqn = this->node_pt(l)->eqn_number(u_nodal_index);
705  }
706 
707  // If it's a proper degree of freedom
708  if (global_eqn >= 0)
709  {
710  // Set the global equation number
711  global_eqn_number[count] = global_eqn;
712 
713  // Set the derivative with respect to the unknown
714  du_ddata[count] = psi[l] * hang_weight;
715 
716  // Increase the counter
717  ++count;
718  }
719  } // for (unsigned m=0;m<n_master;m++)
720  } // for (unsigned l=0;l<n_node;l++)
721  } // End of dinterpolated_u_nst_ddata

References oomph::Data::eqn_number(), oomph::Node::hanging_pt(), oomph::Node::is_hanging(), m, oomph::HangInfo::master_node_pt(), oomph::HangInfo::master_weight(), oomph::HangInfo::nmaster(), oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), oomph::FiniteElement::shape(), and oomph::SpaceTimeNavierStokesEquations< DIM >::u_index_nst().

◆ fill_in_generic_pressure_advection_diffusion_contribution_nst() [1/3]

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::fill_in_generic_pressure_advection_diffusion_contribution_nst ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
const unsigned flag 
)
protectedvirtual

Compute the residuals for the associated pressure advection diffusion problem. Used by the Fp preconditioner. flag=1(or 0): do (or don't) compute the Jacobian as well.

Reimplemented from oomph::SpaceTimeNavierStokesEquations< DIM >.

290  {
291  OomphLibWarning("I'm not sure this is correct yet...",
294 
295  // Return immediately if there are no dofs
296  if (ndof() == 0) return;
297 
298  // Find out how many nodes there are
299  unsigned n_node = nnode();
300 
301  // Find out how many pressure dofs there are
302  unsigned n_pres = this->npres_nst();
303 
304  // Find the indices at which the local velocities are stored
305  unsigned u_nodal_index[DIM];
306  for (unsigned i = 0; i < DIM; i++)
307  {
308  u_nodal_index[i] = this->u_index_nst(i);
309  }
310 
311 
312  // Which nodal value represents the pressure? (Negative if pressure
313  // is not based on nodal interpolation).
314  int p_index = this->p_nodal_index_nst();
315 
316  // Local array of booleans that are true if the l-th pressure value is
317  // hanging (avoid repeated virtual function calls)
318  bool pressure_dof_is_hanging[n_pres];
319  // If the pressure is stored at a node
320  if (p_index >= 0)
321  {
322  // Read out whether the pressure is hanging
323  for (unsigned l = 0; l < n_pres; ++l)
324  {
325  pressure_dof_is_hanging[l] = pressure_node_pt(l)->is_hanging(p_index);
326  }
327  }
328  // Otherwise the pressure is not stored at a node and so cannot hang
329  else
330  {
331  // pressure advection diffusion doesn't work for this one!
332  throw OomphLibError(
333  "Pressure advection diffusion does not work in this case\n",
336 
337  for (unsigned l = 0; l < n_pres; ++l)
338  {
339  pressure_dof_is_hanging[l] = false;
340  }
341  }
342 
343  // Set up memory for the velocity shape fcts
344  Shape psif(n_node);
345  DShape dpsidx(n_node, DIM);
346 
347  // Set up memory for pressure shape and test functions
348  Shape psip(n_pres), testp(n_pres);
349  DShape dpsip(n_pres, DIM);
350  DShape dtestp(n_pres, DIM);
351 
352  // Number of integration points
353  unsigned n_intpt = integral_pt()->nweight();
354 
355  // Set the Vector to hold local coordinates
356  Vector<double> s(DIM);
357 
358  // Get Physical Variables from Element
359  // Reynolds number must be multiplied by the density ratio
360  double scaled_re = this->re() * this->density_ratio();
361 
362  // Integers to store the local equations and unknowns
363  int local_eqn = 0, local_unknown = 0;
364 
365  // Pointers to hang info objects
366  HangInfo *hang_info_pt = 0, *hang_info2_pt = 0;
367 
368  // Loop over the integration points
369  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
370  {
371  // Assign values of s
372  for (unsigned i = 0; i < DIM; i++) s[i] = integral_pt()->knot(ipt, i);
373 
374  // Get the integral weight
375  double w = integral_pt()->weight(ipt);
376 
377  // Call the derivatives of the veloc shape functions
378  // (Derivs not needed but they are free)
379  double J = this->dshape_eulerian_at_knot(ipt, psif, dpsidx);
380 
381  // Call the pressure shape and test functions
382  this->dpshape_and_dptest_eulerian_nst(s, psip, dpsip, testp, dtestp);
383 
384  // Premultiply the weights and the Jacobian
385  double W = w * J;
386 
387  // Calculate local values of the pressure and velocity components
388  // Allocate
389  Vector<double> interpolated_u(DIM, 0.0);
390  Vector<double> interpolated_x(DIM, 0.0);
391  Vector<double> interpolated_dpdx(DIM, 0.0);
392 
393  // Calculate pressure gradient
394  for (unsigned l = 0; l < n_pres; l++)
395  {
396  for (unsigned i = 0; i < DIM; i++)
397  {
398  interpolated_dpdx[i] += this->p_nst(l) * dpsip(l, i);
399  }
400  }
401 
402  // Calculate velocities
403 
404  // Loop over nodes
405  for (unsigned l = 0; l < n_node; l++)
406  {
407  // Loop over directions
408  for (unsigned i = 0; i < DIM; i++)
409  {
410  // Get the nodal value
411  double u_value = nodal_value(l, u_nodal_index[i]);
412  interpolated_u[i] += u_value * psif[l];
413  interpolated_x[i] += nodal_position(l, i) * psif[l];
414  }
415  }
416 
417  // Source function (for validaton only)
418  double source = 0.0;
419  if (this->Press_adv_diff_source_fct_pt != 0)
420  {
422  }
423 
424 
425  // Number of master nodes and storage for the weight of the shape function
426  unsigned n_master = 1;
427  double hang_weight = 1.0;
428 
429 
430  // Loop over the pressure shape functions
431  for (unsigned l = 0; l < n_pres; l++)
432  {
433  // If the pressure dof is hanging
434  if (pressure_dof_is_hanging[l])
435  {
436  // Pressure dof is hanging so it must be nodal-based
437  // Get the hang info object
438  hang_info_pt = this->pressure_node_pt(l)->hanging_pt(p_index);
439 
440  // Get the number of master nodes from the pressure node
441  n_master = hang_info_pt->nmaster();
442  }
443  // Otherwise the node is its own master
444  else
445  {
446  n_master = 1;
447  }
448 
449  // Loop over the master nodes
450  for (unsigned m = 0; m < n_master; m++)
451  {
452  // Get the number of the unknown
453  // If the pressure dof is hanging
454  if (pressure_dof_is_hanging[l])
455  {
456  // Get the local equation from the master node
457  local_eqn =
458  this->local_hang_eqn(hang_info_pt->master_node_pt(m), p_index);
459  // Get the weight for the node
460  hang_weight = hang_info_pt->master_weight(m);
461  }
462  else
463  {
464  local_eqn = this->p_local_eqn(l);
465  hang_weight = 1.0;
466  }
467 
468  // If the equation is not pinned
469  if (local_eqn >= 0)
470  {
471  residuals[local_eqn] -= source * testp[l] * W * hang_weight;
472  for (unsigned k = 0; k < DIM; k++)
473  {
474  residuals[local_eqn] +=
475  interpolated_dpdx[k] *
476  (scaled_re * interpolated_u[k] * testp[l] + dtestp(l, k)) * W *
477  hang_weight;
478  }
479 
480  // Jacobian too?
481  if (flag)
482  {
483  // Number of master nodes and weights
484  unsigned n_master2 = 1;
485  double hang_weight2 = 1.0;
486 
487  // Loop over the pressure shape functions
488  for (unsigned l2 = 0; l2 < n_pres; l2++)
489  {
490  // If the pressure dof is hanging
491  if (pressure_dof_is_hanging[l2])
492  {
493  hang_info2_pt =
494  this->pressure_node_pt(l2)->hanging_pt(p_index);
495  // Pressure dof is hanging so it must be nodal-based
496  // Get the number of master nodes from the pressure node
497  n_master2 = hang_info2_pt->nmaster();
498  }
499  // Otherwise the node is its own master
500  else
501  {
502  n_master2 = 1;
503  }
504 
505  // Loop over the master nodes
506  for (unsigned m2 = 0; m2 < n_master2; m2++)
507  {
508  // Get the number of the unknown
509  // If the pressure dof is hanging
510  if (pressure_dof_is_hanging[l2])
511  {
512  // Get the unknown from the master node
513  local_unknown = this->local_hang_eqn(
514  hang_info2_pt->master_node_pt(m2), p_index);
515  // Get the weight from the hanging object
516  hang_weight2 = hang_info2_pt->master_weight(m2);
517  }
518  else
519  {
520  local_unknown = this->p_local_eqn(l2);
521  hang_weight2 = 1.0;
522  }
523 
524  // If the unknown is not pinned
525  if (local_unknown >= 0)
526  {
527  if ((int(eqn_number(local_eqn)) !=
528  this->Pinned_fp_pressure_eqn) &&
529  (int(eqn_number(local_unknown)) !=
530  this->Pinned_fp_pressure_eqn))
531  {
532  for (unsigned k = 0; k < DIM; k++)
533  {
534  jacobian(local_eqn, local_unknown) +=
535  dtestp(l2, k) *
536  (scaled_re * interpolated_u[k] * testp[l] +
537  dtestp(l, k)) *
538  W * hang_weight * hang_weight2;
539  }
540  }
541  else
542  {
543  if ((int(eqn_number(local_eqn)) ==
544  this->Pinned_fp_pressure_eqn) &&
545  (int(eqn_number(local_unknown)) ==
546  this->Pinned_fp_pressure_eqn))
547  {
548  jacobian(local_eqn, local_unknown) = 1.0;
549  }
550  }
551  }
552  }
553  }
554  } /*End of Jacobian calculation*/
555  } // End of if not boundary condition
556  } // End of loop over master nodes
557  } // End of loop over l
558  } // end of integration loop
559 
560  // Now add boundary contributions from Robin BCs
561  unsigned nrobin =
563  for (unsigned e = 0; e < nrobin; e++)
564  {
566  ->fill_in_generic_residual_contribution_fp_press_adv_diff_robin_bc(
567  residuals, jacobian, flag);
568  }
569  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Array< double, 1, 3 > e(1./3., 0.5, 2.)
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
RowVector3d w
Definition: Matrix_resize_int.cpp:3
MatrixType m2(n_dims)
double nodal_value(const unsigned &n, const unsigned &i) const
Definition: elements.h:2593
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
Definition: elements.cc:3962
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Definition: elements.h:1963
double nodal_position(const unsigned &n, const unsigned &i) const
Definition: elements.h:2317
virtual double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Definition: elements.cc:3325
unsigned ndof() const
Return the number of equations/dofs in the element.
Definition: elements.h:835
unsigned long eqn_number(const unsigned &ieqn_local) const
Definition: elements.h:704
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
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.
int local_hang_eqn(Node *const &node_pt, const unsigned &i)
Definition: refineable_elements.h:278
virtual Node * pressure_node_pt(const unsigned &n_p)
Definition: refineable_discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:409
virtual double dpshape_and_dptest_eulerian_nst(const Vector< double > &s, Shape &ppsi, DShape &dppsidx, Shape &ptest, DShape &dptestdx) const =0
int Pinned_fp_pressure_eqn
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:552
NavierStokesPressureAdvDiffSourceFctPt Press_adv_diff_source_fct_pt
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:538
virtual int p_nodal_index_nst() const
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:1229
const double & re() const
Reynolds number.
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:870
const double & density_ratio() const
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:973
Vector< FpPressureAdvDiffRobinBCSpaceTimeElementBase * > Pressure_advection_diffusion_robin_element_pt
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:548
virtual double p_nst(const unsigned &n_p) const =0
virtual unsigned npres_nst() const =0
Function to return number of pressure degrees of freedom.
virtual int p_local_eqn(const unsigned &n) const =0
RealScalar s
Definition: level1_cplx_impl.h:130
return int(ret)+1
char char char int int * k
Definition: level2_impl.h:374
#define DIM
Definition: linearised_navier_stokes_elements.h:44
void source(const Vector< double > &x, Vector< double > &f)
Source function.
Definition: unstructured_two_d_circle.cc:46
@ W
Definition: quadtree.h:63
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References DIM, e(), i, int(), J, k, m, m2(), oomph::HangInfo::master_node_pt(), oomph::HangInfo::master_weight(), oomph::HangInfo::nmaster(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, s, TestProblem::source(), w, and oomph::QuadTreeNames::W.

◆ fill_in_generic_pressure_advection_diffusion_contribution_nst() [2/3]

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::fill_in_generic_pressure_advection_diffusion_contribution_nst ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
const unsigned compute_jacobian_flag 
)
protectedvirtual

Compute the residuals for the associated pressure advection diffusion problem. Used by the Fp preconditioner. flag=1(or 0): do (or don't) compute the Jacobian as well.

Reimplemented from oomph::SpaceTimeNavierStokesEquations< DIM >.

◆ fill_in_generic_pressure_advection_diffusion_contribution_nst() [3/3]

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::fill_in_generic_pressure_advection_diffusion_contribution_nst ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
const unsigned compute_jacobian_flag 
)
protectedvirtual

Compute the residuals for the associated pressure advection diffusion problem. Used by the Fp preconditioner. flag=1(or 0): do (or don't) compute the Jacobian as well.

Reimplemented from oomph::SpaceTimeNavierStokesEquations< DIM >.

◆ fill_in_generic_residual_contribution_nst() [1/3]

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::fill_in_generic_residual_contribution_nst ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
DenseMatrix< double > &  mass_matrix,
const unsigned flag 
)
protectedvirtual

Add the elements contribution to elemental residual vector and/or Jacobian matrix. compute_jacobian_flag=0: compute residual vector only compute_jacobian_flag=1: compute both

Add element's contribution to the elemental residual vector and/or Jacobian matrix. flag=1: compute both flag=0: compute only residual vector

Reimplemented from oomph::SpaceTimeNavierStokesEquations< DIM >.

584  {
585  // Return immediately if there are no dofs
586  if (ndof() == 0) return;
587 
588  // Find out how many nodes there are
589  unsigned n_node = nnode();
590 
591  // Find out how many pressure dofs there are
592  unsigned n_pres = this->npres_nst();
593 
594  // Allocate storage for the indices of the velocity components
595  unsigned u_nodal_index[DIM];
596 
597  // Loop over the velocity components
598  for (unsigned i = 0; i < DIM; i++)
599  {
600  // Find the index at which the i-th local velocity is stored
601  u_nodal_index[i] = this->u_index_nst(i);
602  }
603 
604  // Which nodal value represents the pressure? (Negative if pressure
605  // is not based on nodal interpolation).
606  int p_index = this->p_nodal_index_nst();
607 
608  // Local array of booleans that are true if the l-th pressure value is
609  // hanging (avoid repeated virtual function calls)
610  bool pressure_dof_is_hanging[n_pres];
611 
612  // If the pressure is stored at a node
613  if (p_index >= 0)
614  {
615  // Loop over the pressure nodes
616  for (unsigned l = 0; l < n_pres; ++l)
617  {
618  // Get the hang status of the l-th pressure node
619  pressure_dof_is_hanging[l] = pressure_node_pt(l)->is_hanging(p_index);
620  }
621  }
622  // Otherwise the pressure is not stored at a node and so cannot hang
623  else
624  {
625  // Loop over the pressure nodes
626  for (unsigned l = 0; l < n_pres; ++l)
627  {
628  // Indicate that the l-th pressure node is not hangings
629  pressure_dof_is_hanging[l] = false;
630  }
631  } // if (p_index>=0)
632 
633  // Set up memory for the shape functions
634  Shape psif(n_node);
635 
636  // Set up memory for the test functions
637  Shape testf(n_node);
638 
639  // Allocate space for the derivatives of the shape functions
640  DShape dpsifdx(n_node, DIM + 1);
641 
642  // Allocate space for the derivatives of the test functions
643  DShape dtestfdx(n_node, DIM + 1);
644 
645  // Set up memory for pressure shape functions
646  Shape psip(n_pres);
647 
648  // Set up memory for pressure test functions
649  Shape testp(n_pres);
650 
651  // Number of integration points
652  unsigned n_intpt = integral_pt()->nweight();
653 
654  // Set the Vector to hold local coordinates
655  Vector<double> s(DIM + 1, 0.0);
656 
657  //-------------------------------------
658  // Get physical variables from element:
659  //-------------------------------------
660  // Reynolds number must be multiplied by the density ratio
661  double scaled_re = this->re() * this->density_ratio();
662 
663  // Get the scaled Womersley value
664  double scaled_re_st = this->re() * this->st() * this->density_ratio();
665 
666  // Get the scaled Womersley value differentiated w.r.t. the Strouhal number
667  double scaled_dre_st_dst = this->re() * this->density_ratio();
668 
669  // Get the scaled Reynolds / Froude number
670  double scaled_re_inv_fr = this->re_invfr() * this->density_ratio();
671 
672  // Get the viscosity ratio
673  double visc_ratio = this->viscosity_ratio();
674 
675  // Get the gravity vector
676  Vector<double> G = this->g();
677 
678  // Integer to store the local equation number
679  int local_eqn = 0;
680 
681  // Integer to store the local unknown number
682  int local_unknown = 0;
683 
684  // Pointers to first hang info object
685  HangInfo* hang_info_pt = 0;
686 
687  // Pointers to second hang info object
688  HangInfo* hang_info2_pt = 0;
689 
690  // Loop over the integration points
691  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
692  {
693  // Assign values of s
694  for (unsigned i = 0; i < DIM + 1; i++)
695  {
696  // Calculate the i-th local coordinate
697  s[i] = integral_pt()->knot(ipt, i);
698  }
699 
700  // Get the integral weight
701  double w = integral_pt()->weight(ipt);
702 
703  // Call the derivatives of the shape and test functions
705  ipt, psif, dpsifdx, testf, dtestfdx);
706 
707  // Call the pressure shape and test functions
708  this->pshape_nst(s, psip, testp);
709 
710  // Pre-multiply the weights and the Jacobian
711  double W = w * J;
712 
713  // Storage for the interpolated time value
714  double interpolated_t = 0.0;
715 
716  // Storage for the interpolated pressure value
717  double interpolated_p = 0.0;
718 
719  // Storage for the spatial coordinates
720  Vector<double> interpolated_x(DIM, 0.0);
721 
722  // Storage for the interpolated velocity components
723  Vector<double> interpolated_u(DIM, 0.0);
724 
725  // Storage for the interpolated time-derivative of the velocities
726  Vector<double> interpolated_dudt(DIM, 0.0);
727 
728  // Storage for the mesh velocity
729  Vector<double> mesh_velocity(DIM, 0.0);
730 
731  // Storage for the spatial derivatives of the velocity components
732  DenseMatrix<double> interpolated_dudx(DIM, DIM, 0.0);
733 
734  // Calculate pressure
735  for (unsigned l = 0; l < n_pres; l++)
736  {
737  // Update the current approximation to the interpolated pressure
738  interpolated_p += this->p_nst(l) * psip[l];
739  }
740 
741  //-------------------------------------------------------------------
742  // Calculate velocities, derivatives, source function and body force:
743  //-------------------------------------------------------------------
744  // Loop over nodes
745  for (unsigned l = 0; l < n_node; l++)
746  {
747  // Update the interpolated time value
748  interpolated_t += this->nodal_position(l, DIM) * psif(l);
749 
750  // Loop over coordinate directions
751  for (unsigned i = 0; i < DIM; i++)
752  {
753  // Get the nodal value
754  double u_value = this->nodal_value(l, u_nodal_index[i]);
755 
756  // Update the i-th interpolated velocity component
757  interpolated_u[i] += u_value * psif[l];
758 
759  // Update the i-th interpolated coordinate value
760  interpolated_x[i] += this->nodal_position(l, i) * psif[l];
761 
762  // Update the interpolated du_i/dt value
763  interpolated_dudt[i] += u_value * dpsifdx(l, DIM);
764 
765  // Loop over derivative directions
766  for (unsigned j = 0; j < DIM; j++)
767  {
768  // Update the interpolated du_i/dx_j value
769  interpolated_dudx(i, j) += u_value * dpsifdx(l, j);
770  }
771  } // for (unsigned i=0;i<DIM;i++)
772  } // for (unsigned l=0;l<n_node;l++)
773 
774  // If ALE is enabled
775  if (!(this->ALE_is_disabled))
776  {
777  // Loop over nodes
778  for (unsigned l = 0; l < n_node; l++)
779  {
780  // Loop over directions
781  for (unsigned i = 0; i < DIM; i++)
782  {
783  // Update the i-th mesh velocity component
784  mesh_velocity[i] += this->nodal_position(l, i) * dpsifdx(l, DIM);
785  }
786  } // for (unsigned l=0;l<n_node;l++)
787  } // if (!(this->ALE_is_disabled))
788 
789  // Allocate space for the body force
790  Vector<double> body_force(DIM, 0.0);
791 
792  // Get the user-defined body force term
793  this->get_body_force_nst(
794  interpolated_t, ipt, s, interpolated_x, body_force);
795 
796  // Get the user-defined source function
797  double source = this->get_source_nst(interpolated_t, ipt, interpolated_x);
798 
799  //---------------------------------
800  // Assemble residuals and Jacobian:
801  //---------------------------------
802  //--------------------
803  // Momentum equations:
804  //--------------------
805  // Number of master nodes
806  unsigned n_master = 1;
807 
808  // Storage for the weight of the shape function
809  double hang_weight = 1.0;
810 
811  // Loop over the test functions
812  for (unsigned l = 0; l < n_node; l++)
813  {
814  // Local boolean to indicate whether the node is hanging
815  bool is_node_hanging = node_pt(l)->is_hanging();
816 
817  // If the node is hanging
818  if (is_node_hanging)
819  {
820  // Get the HangInfo object associated with the l-th node
821  hang_info_pt = node_pt(l)->hanging_pt();
822 
823  // Read out number of master nodes from hanging data
824  n_master = hang_info_pt->nmaster();
825  }
826  // Otherwise the node is its own master
827  else
828  {
829  // There is only one node to consider; the node itself
830  n_master = 1;
831  }
832 
833  // Loop over the master nodes
834  for (unsigned m = 0; m < n_master; m++)
835  {
836  // Loop over velocity components
837  for (unsigned i = 0; i < DIM; i++)
838  {
839  // Check if the node is hanging
840  if (is_node_hanging)
841  {
842  // Get the equation number from the master node
843  local_eqn = this->local_hang_eqn(hang_info_pt->master_node_pt(m),
844  u_nodal_index[i]);
845 
846  // Get the hang weight from the master node
847  hang_weight = hang_info_pt->master_weight(m);
848  }
849  // If the node is not hanging
850  else
851  {
852  // Local equation number
853  local_eqn = this->nodal_local_eqn(l, u_nodal_index[i]);
854 
855  // Node contributes with full weight
856  hang_weight = 1.0;
857  }
858 
859  // If it's not a boundary condition
860  if (local_eqn >= 0)
861  {
862  // Add the user-defined body force terms
863  residuals[local_eqn] +=
864  body_force[i] * testf[l] * W * hang_weight;
865 
866  // Add the gravitational body force term
867  residuals[local_eqn] +=
868  scaled_re_inv_fr * testf[l] * G[i] * W * hang_weight;
869 
870  // Add the pressure gradient term
871  residuals[local_eqn] +=
872  interpolated_p * dtestfdx(l, i) * W * hang_weight;
873 
874  // Add in the contribution from the time derivative
875  residuals[local_eqn] -= (scaled_re_st * interpolated_dudt[i] *
876  testf[l] * W * hang_weight);
877 
878  // If ALE is enabled
879  if (!(this->ALE_is_disabled))
880  {
881  // Loop over the coordinate directions
882  for (unsigned k = 0; k < DIM; k++)
883  {
884  // Add in the mesh velocity contribution
885  residuals[local_eqn] +=
886  (scaled_re_st * mesh_velocity[k] * interpolated_dudx(i, k) *
887  testf[l] * W * hang_weight);
888  }
889  } // if (!(this->ALE_is_disabled))
890 
891  // Loop over the coordinate directions
892  for (unsigned k = 0; k < DIM; k++)
893  {
894  // Add in the convective term contribution
895  residuals[local_eqn] -=
896  (scaled_re * interpolated_u[k] * interpolated_dudx(i, k) *
897  testf[l] * W * hang_weight);
898  }
899 
900  // Loop over the coordinate directions
901  for (unsigned k = 0; k < DIM; k++)
902  {
903  // Add in the stress tensor terms:
904  // NOTE: The viscosity ratio needs to go in here to ensure
905  // continuity of normal stress is satisfied even in flows
906  // with zero pressure gradient!
907  residuals[local_eqn] -=
908  ((interpolated_dudx(i, k) +
909  this->Gamma[i] * interpolated_dudx(k, i)) *
910  visc_ratio * dtestfdx(l, k) * W * hang_weight);
911  }
912 
913  //------------------------
914  // Calculate the Jacobian:
915  //------------------------
916  // If we also need to construct the Jacobian
917  if (flag)
918  {
919  // Number of master nodes
920  unsigned n_master2 = 1;
921 
922  // Storage for the weight of the shape function
923  double hang_weight2 = 1.0;
924 
925  // Loop over the velocity nodes for columns
926  for (unsigned l2 = 0; l2 < n_node; l2++)
927  {
928  // Local boolean to indicate whether the node is hanging
929  bool is_node2_hanging = node_pt(l2)->is_hanging();
930 
931  // If the node is hanging
932  if (is_node2_hanging)
933  {
934  // Get the HangInfo object associated with the l-th node
935  hang_info2_pt = node_pt(l2)->hanging_pt();
936 
937  // Read out number of master nodes from hanging data
938  n_master2 = hang_info2_pt->nmaster();
939  }
940  // Otherwise the node is its own master
941  else
942  {
943  // There is only one node to consider; the node itself
944  n_master2 = 1;
945  }
946 
947  // Loop over the master nodes
948  for (unsigned m2 = 0; m2 < n_master2; m2++)
949  {
950  // Loop over the velocity components
951  for (unsigned i2 = 0; i2 < DIM; i2++)
952  {
953  // Check if the node is hanging
954  if (is_node2_hanging)
955  {
956  // Get the equation number from the master node
957  local_unknown = this->local_hang_eqn(
958  hang_info2_pt->master_node_pt(m2), u_nodal_index[i2]);
959 
960  // Get the hang weight from the master node
961  hang_weight2 = hang_info2_pt->master_weight(m2);
962  }
963  // If the node is not hanging
964  else
965  {
966  // Get the local equation number
967  local_unknown =
968  this->nodal_local_eqn(l2, u_nodal_index[i2]);
969 
970  // Node contributes with full weight
971  hang_weight2 = 1.0;
972  }
973 
974  // If the unknown is non-zero
975  if (local_unknown >= 0)
976  {
977  // Add contribution to elemental matrix
978  jacobian(local_eqn, local_unknown) -=
979  (visc_ratio * this->Gamma[i] * dpsifdx(l2, i) *
980  dtestfdx(l, i2) * W * hang_weight * hang_weight2);
981 
982  // Now add in the inertial terms
983  jacobian(local_eqn, local_unknown) -=
984  (scaled_re * psif[l2] * interpolated_dudx(i, i2) *
985  testf[l] * W * hang_weight * hang_weight2);
986 
987  // Extra component if i2=i
988  if (i2 == i)
989  {
990  // If we also need to construct the mass matrix (only
991  // diagonal entries)
992  if (flag == 2)
993  {
994  // NOTE: This is positive because the mass matrix is
995  // taken to the other side of the equation when
996  // formulating the generalised eigenproblem.
997  mass_matrix(local_eqn, local_unknown) +=
998  (scaled_re_st * psif[l2] * testf[l] * W *
999  hang_weight * hang_weight2);
1000  }
1001 
1002  // Add in the time-derivative contribution
1003  jacobian(local_eqn, local_unknown) -=
1004  (scaled_re_st * dpsifdx(l2, DIM) * testf[l] * W *
1005  hang_weight * hang_weight2);
1006 
1007  // Loop over the velocity components
1008  for (unsigned k = 0; k < DIM; k++)
1009  {
1010  // Add in the convective term contribution
1011  jacobian(local_eqn, local_unknown) -=
1012  (scaled_re * interpolated_u[k] * dpsifdx(l2, k) *
1013  testf[l] * W * hang_weight * hang_weight2);
1014  }
1015 
1016  // If ALE is enabled
1017  if (!(this->ALE_is_disabled))
1018  {
1019  // Loop over the velocity components
1020  for (unsigned k = 0; k < DIM; k++)
1021  {
1022  // Add in the mesh velocity contribution
1023  jacobian(local_eqn, local_unknown) +=
1024  (scaled_re_st * mesh_velocity[k] *
1025  dpsifdx(l2, k) * testf[l] * W * hang_weight *
1026  hang_weight2);
1027  }
1028  } // if (!(this->ALE_is_disabled))
1029 
1030  // Loop over velocity components
1031  for (unsigned k = 0; k < DIM; k++)
1032  {
1033  // Add in the velocity gradient terms
1034  jacobian(local_eqn, local_unknown) -=
1035  (visc_ratio * dpsifdx(l2, k) * dtestfdx(l, k) *
1036  W * hang_weight * hang_weight2);
1037  }
1038  } // if (i2==i)
1039  } // if (local_unknown>=0)
1040  } // for (unsigned i2=0;i2<DIM;i2++)
1041  } // for (unsigned m2=0;m2<n_master2;m2++)
1042  } // for (unsigned l2=0;l2<n_node;l2++)
1043 
1044  // Loop over the pressure shape functions
1045  for (unsigned l2 = 0; l2 < n_pres; l2++)
1046  {
1047  // If the pressure dof is hanging
1048  if (pressure_dof_is_hanging[l2])
1049  {
1050  // Get the HangInfo object associated with the l2-th
1051  // pressure node
1052  hang_info2_pt =
1053  this->pressure_node_pt(l2)->hanging_pt(p_index);
1054 
1055  // Get the number of master nodes from the pressure node
1056  n_master2 = hang_info2_pt->nmaster();
1057  }
1058  // Otherwise the node is its own master
1059  else
1060  {
1061  // There is only one node to consider; the node itself
1062  n_master2 = 1;
1063  }
1064 
1065  // Loop over the master nodes
1066  for (unsigned m2 = 0; m2 < n_master2; m2++)
1067  {
1068  // If the pressure dof is hanging
1069  if (pressure_dof_is_hanging[l2])
1070  {
1071  // Get the unknown from the master node
1072  local_unknown = this->local_hang_eqn(
1073  hang_info2_pt->master_node_pt(m2), p_index);
1074 
1075  // Get the weight from the HangInfo object
1076  hang_weight2 = hang_info2_pt->master_weight(m2);
1077  }
1078  // If the node is not hanging
1079  else
1080  {
1081  // Get the local equation number
1082  local_unknown = this->p_local_eqn(l2);
1083 
1084  // Node contributes with full weight
1085  hang_weight2 = 1.0;
1086  }
1087 
1088  // If the unknown is not pinned
1089  if (local_unknown >= 0)
1090  {
1091  jacobian(local_eqn, local_unknown) +=
1092  (psip[l2] * dtestfdx(l, i) * W * hang_weight *
1093  hang_weight2);
1094  }
1095  } // for (unsigned m2=0;m2<n_master2;m2++)
1096  } // for (unsigned l2=0;l2<n_pres;l2++)
1097 
1098  //------------------------------------
1099  // Calculate external data information
1100  //------------------------------------
1101  // If we're storing the Strouhal number as external data then we
1102  // need to calculate dr/d(St) in the elemental Jacobian
1104  {
1105  // The index of the external data (there's only one!)
1106  unsigned data_index = 0;
1107 
1108  // The index of the unknown value stored in the external data
1109  unsigned value_index = 0;
1110 
1111  // Get the local equation number associated with the extra
1112  // unknown
1113  local_unknown =
1114  this->external_local_eqn(data_index, value_index);
1115 
1116  // If we're at a non-zero degree of freedom add in the entry
1117  if (local_unknown >= 0)
1118  {
1119  // Add in the contribution from the time derivative
1120  jacobian(local_eqn, local_unknown) -=
1121  (scaled_dre_st_dst * interpolated_dudt[i] * testf[l] * W *
1122  hang_weight);
1123 
1124  // If ALE is enabled
1125  if (!this->ALE_is_disabled)
1126  {
1127  // Loop over the coordinate directions
1128  for (unsigned k = 0; k < DIM; k++)
1129  {
1130  // Add in the mesh velocity contribution
1131  jacobian(local_eqn, local_unknown) +=
1132  (scaled_dre_st_dst * mesh_velocity[k] *
1133  interpolated_dudx(i, k) * testf[l] * W *
1134  hang_weight);
1135  }
1136  } // if (!ALE_is_disabled)
1137  } // if (local_unknown>=0)
1138  } // if (Strouhal_is_stored_as_external_data)
1139  } // if (flag)
1140  } // if (local_eqn>=0)
1141  } // for (unsigned i=0;i<DIM;i++)
1142  } // for (unsigned m=0;m<n_master;m++)
1143  } // for (unsigned l=0;l<n_node;l++)
1144 
1145  //---------------------
1146  // Continuity equation:
1147  //---------------------
1148  // Loop over the pressure shape functions
1149  for (unsigned l = 0; l < n_pres; l++)
1150  {
1151  // If the pressure dof is hanging
1152  if (pressure_dof_is_hanging[l])
1153  {
1154  // Get the HangInfo object associated with the l2-th pressure node
1155  hang_info_pt = this->pressure_node_pt(l)->hanging_pt(p_index);
1156 
1157  // Get the number of master nodes from the pressure node
1158  n_master = hang_info_pt->nmaster();
1159  }
1160  // Otherwise the node is its own master
1161  else
1162  {
1163  // There is only one node to consider; the node itself
1164  n_master = 1;
1165  }
1166 
1167  // Loop over the master nodes
1168  for (unsigned m = 0; m < n_master; m++)
1169  {
1170  // If the pressure dof is hanging
1171  if (pressure_dof_is_hanging[l])
1172  {
1173  // Get the unknown from the master node
1174  local_eqn =
1175  this->local_hang_eqn(hang_info_pt->master_node_pt(m), p_index);
1176 
1177  // Get the weight from the HangInfo object
1178  hang_weight = hang_info_pt->master_weight(m);
1179  }
1180  // If the node is not hanging
1181  else
1182  {
1183  // Get the local equation number
1184  local_eqn = this->p_local_eqn(l);
1185 
1186  // Node contributes with full weight
1187  hang_weight = 1.0;
1188  }
1189 
1190  // If the equation is not pinned
1191  if (local_eqn >= 0)
1192  {
1193  // Add in the source term contribution
1194  residuals[local_eqn] -= source * testp[l] * W * hang_weight;
1195 
1196  // Loop over velocity components
1197  for (unsigned k = 0; k < DIM; k++)
1198  {
1199  // Add in the velocity gradient terms
1200  residuals[local_eqn] +=
1201  interpolated_dudx(k, k) * testp[l] * W * hang_weight;
1202  }
1203 
1204  //------------------------
1205  // Calculate the Jacobian:
1206  //------------------------
1207  // If we also need to construct the Jacobian
1208  if (flag)
1209  {
1210  // Number of master nodes
1211  unsigned n_master2 = 1;
1212 
1213  // Storage for the weight of the shape function
1214  double hang_weight2 = 1.0;
1215 
1216  // Loop over the velocity nodes for columns
1217  for (unsigned l2 = 0; l2 < n_node; l2++)
1218  {
1219  // Local boolean to indicate whether the node is hanging
1220  bool is_node2_hanging = node_pt(l2)->is_hanging();
1221 
1222  // If the node is hanging
1223  if (is_node2_hanging)
1224  {
1225  // Get the HangInfo object associated with the l2-th node
1226  hang_info2_pt = node_pt(l2)->hanging_pt();
1227 
1228  // Read out number of master nodes from hanging data
1229  n_master2 = hang_info2_pt->nmaster();
1230  }
1231  // Otherwise the node is its own master
1232  else
1233  {
1234  // There is only one node to consider; the node itself
1235  n_master2 = 1;
1236  }
1237 
1238  // Loop over the master nodes
1239  for (unsigned m2 = 0; m2 < n_master2; m2++)
1240  {
1241  // Loop over the velocity components
1242  for (unsigned i2 = 0; i2 < DIM; i2++)
1243  {
1244  // If the node is hanging
1245  if (is_node2_hanging)
1246  {
1247  // Get the equation number from the master node
1248  local_unknown = this->local_hang_eqn(
1249  hang_info2_pt->master_node_pt(m2), u_nodal_index[i2]);
1250 
1251  // Get the weight from the HangInfo object
1252  hang_weight2 = hang_info2_pt->master_weight(m2);
1253  }
1254  // If the node is not hanging
1255  else
1256  {
1257  // Get the local equation number
1258  local_unknown =
1259  this->nodal_local_eqn(l2, u_nodal_index[i2]);
1260 
1261  // Node contributes with full weight
1262  hang_weight2 = 1.0;
1263  }
1264 
1265  // If the unknown is not pinned
1266  if (local_unknown >= 0)
1267  {
1268  // Add in the velocity gradient contribution
1269  jacobian(local_eqn, local_unknown) +=
1270  (dpsifdx(l2, i2) * testp[l] * W * hang_weight *
1271  hang_weight2);
1272  }
1273  } // for (unsigned i2=0;i2<DIM;i2++)s
1274  } // for (unsigned m2=0;m2<n_master2;m2++)
1275  } // for (unsigned l2=0;l2<n_node;l2++)
1276  } // if (flag)
1277  } // if (local_eqn>=0)
1278  } // for (unsigned m=0;m<n_master;m++)
1279  } // for (unsigned l=0;l<n_pres;l++)
1280  } // for (unsigned ipt=0;ipt<n_intpt;ipt++)
1281  } // End of fill_in_generic_residual_contribution_nst
JacobiRotation< float > G
Definition: Jacobi_makeGivens.cpp:2
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Definition: elements.h:1432
int external_local_eqn(const unsigned &i, const unsigned &j)
Definition: elements.h:311
unsigned nmaster() const
Return the number of master nodes.
Definition: nodes.h:785
static Vector< double > Gamma
Navier-Stokes equations static data.
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:833
const double & st() const
Strouhal parameter (const. version)
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:894
virtual double dshape_and_dtest_eulerian_at_knot_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
const Vector< double > & g() const
Vector of gravitational components.
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:997
virtual void get_body_force_nst(const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &result)
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:620
const double & re_invfr() const
Global inverse Froude number.
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:985
virtual void pshape_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
virtual double get_source_nst(const double &time, const unsigned &ipt, const Vector< double > &x)
Calculate the source fct at a given time and Eulerian position.
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:691
const double & viscosity_ratio() const
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:960
bool Strouhal_is_stored_as_external_data
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:521
bool ALE_is_disabled
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:543
void body_force(const double &time, const Vector< double > &x, Vector< double > &result)
Definition: axisym_linear_elasticity/cylinder/cylinder.cc:96
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::ALE_is_disabled, Global_Parameters::body_force(), DIM, G, GlobalPhysicalVariables::Gamma, i, J, j, k, m, m2(), oomph::HangInfo::master_node_pt(), oomph::HangInfo::master_weight(), oomph::HangInfo::nmaster(), s, TestProblem::source(), w, and oomph::QuadTreeNames::W.

◆ fill_in_generic_residual_contribution_nst() [2/3]

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::fill_in_generic_residual_contribution_nst ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
DenseMatrix< double > &  mass_matrix,
const unsigned compute_jacobian_flag 
)
protectedvirtual

Add the elements contribution to elemental residual vector and/or Jacobian matrix. compute_jacobian_flag=0: compute residual vector only compute_jacobian_flag=1: compute both

Reimplemented from oomph::SpaceTimeNavierStokesEquations< DIM >.

◆ fill_in_generic_residual_contribution_nst() [3/3]

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::fill_in_generic_residual_contribution_nst ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
DenseMatrix< double > &  mass_matrix,
const unsigned compute_jacobian_flag 
)
protectedvirtual

Add the elements contribution to elemental residual vector and/or Jacobian matrix. compute_jacobian_flag=0: compute residual vector only compute_jacobian_flag=1: compute both

Reimplemented from oomph::SpaceTimeNavierStokesEquations< DIM >.

◆ further_build() [1/3]

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::further_build ( )
inlinevirtual

Further build, pass the pointers down to the sons.

Reimplemented from oomph::RefineableElement.

522  {
523  // Find the father element
524  RefineableSpaceTimeNavierStokesEquations<DIM>* cast_father_element_pt =
525  dynamic_cast<RefineableSpaceTimeNavierStokesEquations<DIM>*>(
526  this->father_element_pt());
527 
528  // Set the viscosity ratio pointer
529  this->Viscosity_Ratio_pt = cast_father_element_pt->viscosity_ratio_pt();
530 
531  // Set the density ratio pointer
532  this->Density_Ratio_pt = cast_father_element_pt->density_ratio_pt();
533 
534  // Set pointer to global Reynolds number
535  this->Re_pt = cast_father_element_pt->re_pt();
536 
537  // Set pointer to global Reynolds number x Strouhal number (=Womersley)
538  this->St_pt = cast_father_element_pt->st_pt();
539 
540  // The Strouhal number (which is a proxy for the period here) is not
541  // stored as external data
543  cast_father_element_pt->is_strouhal_stored_as_external_data();
544 
545  // If we're storing the Strouhal number as external data
547  {
548  // The index of the external data (which contains the st)
549  unsigned data_index = 0;
550 
551  // Get the external data pointer from the father and store it
553  cast_father_element_pt->external_data_pt(data_index));
554  }
555 
556  // Set pointer to global Reynolds number x inverse Froude number
557  this->ReInvFr_pt = cast_father_element_pt->re_invfr_pt();
558 
559  // Set pointer to global gravity Vector
560  this->G_pt = cast_father_element_pt->g_pt();
561 
562  // Set pointer to body force function
563  this->Body_force_fct_pt = cast_father_element_pt->body_force_fct_pt();
564 
565  // Set pointer to volumetric source function
566  this->Source_fct_pt = cast_father_element_pt->source_fct_pt();
567 
568  // Set the ALE flag
569  this->ALE_is_disabled = cast_father_element_pt->ALE_is_disabled;
570  } // End of further_build
virtual RefineableElement * father_element_pt() const
Return a pointer to the father element.
Definition: refineable_elements.h:539
double * ReInvFr_pt
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:525
NavierStokesBodyForceFctPt Body_force_fct_pt
Pointer to body force function.
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:531
double * St_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:517
double * Density_Ratio_pt
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:509
Vector< double > * G_pt
Pointer to global gravity Vector.
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:528
void store_strouhal_as_external_data(Data *strouhal_data_pt)
Function that tells us whether the period is stored as external data.
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:837
double * Viscosity_Ratio_pt
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:505
double * Re_pt
Pointer to global Reynolds number.
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:514
NavierStokesSourceFctPt Source_fct_pt
Pointer to volumetric source function.
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:534

References oomph::SpaceTimeNavierStokesEquations< DIM >::ALE_is_disabled, oomph::SpaceTimeNavierStokesEquations< DIM >::Body_force_fct_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::body_force_fct_pt(), oomph::SpaceTimeNavierStokesEquations< DIM >::Density_Ratio_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::density_ratio_pt(), oomph::GeneralisedElement::external_data_pt(), oomph::RefineableElement::father_element_pt(), oomph::SpaceTimeNavierStokesEquations< DIM >::G_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::g_pt(), oomph::SpaceTimeNavierStokesEquations< DIM >::is_strouhal_stored_as_external_data(), oomph::SpaceTimeNavierStokesEquations< DIM >::re_invfr_pt(), oomph::SpaceTimeNavierStokesEquations< DIM >::Re_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::re_pt(), oomph::SpaceTimeNavierStokesEquations< DIM >::ReInvFr_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::Source_fct_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::source_fct_pt(), oomph::SpaceTimeNavierStokesEquations< DIM >::St_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::st_pt(), oomph::SpaceTimeNavierStokesEquations< DIM >::store_strouhal_as_external_data(), oomph::SpaceTimeNavierStokesEquations< DIM >::Strouhal_is_stored_as_external_data, oomph::SpaceTimeNavierStokesEquations< DIM >::Viscosity_Ratio_pt, and oomph::SpaceTimeNavierStokesEquations< DIM >::viscosity_ratio_pt().

◆ further_build() [2/3]

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::further_build ( )
inlinevirtual

Further build, pass the pointers down to the sons.

Reimplemented from oomph::RefineableElement.

522  {
523  // Find the father element
524  RefineableSpaceTimeNavierStokesEquations<DIM>* cast_father_element_pt =
525  dynamic_cast<RefineableSpaceTimeNavierStokesEquations<DIM>*>(
526  this->father_element_pt());
527 
528  // Set the viscosity ratio pointer
529  this->Viscosity_Ratio_pt = cast_father_element_pt->viscosity_ratio_pt();
530 
531  // Set the density ratio pointer
532  this->Density_Ratio_pt = cast_father_element_pt->density_ratio_pt();
533 
534  // Set pointer to global Reynolds number
535  this->Re_pt = cast_father_element_pt->re_pt();
536 
537  // Set pointer to global Reynolds number x Strouhal number (=Womersley)
538  this->St_pt = cast_father_element_pt->st_pt();
539 
540  // The Strouhal number (which is a proxy for the period here) is not
541  // stored as external data
543  cast_father_element_pt->is_strouhal_stored_as_external_data();
544 
545  // If we're storing the Strouhal number as external data
547  {
548  // The index of the external data (which contains the st)
549  unsigned data_index = 0;
550 
551  // Get the external data pointer from the father and store it
553  cast_father_element_pt->external_data_pt(data_index));
554  }
555 
556  // Set pointer to global Reynolds number x inverse Froude number
557  this->ReInvFr_pt = cast_father_element_pt->re_invfr_pt();
558 
559  // Set pointer to global gravity Vector
560  this->G_pt = cast_father_element_pt->g_pt();
561 
562  // Set pointer to body force function
563  this->Body_force_fct_pt = cast_father_element_pt->body_force_fct_pt();
564 
565  // Set pointer to volumetric source function
566  this->Source_fct_pt = cast_father_element_pt->source_fct_pt();
567 
568  // Set the ALE flag
569  this->ALE_is_disabled = cast_father_element_pt->ALE_is_disabled;
570  } // End of further_build

References oomph::SpaceTimeNavierStokesEquations< DIM >::ALE_is_disabled, oomph::SpaceTimeNavierStokesEquations< DIM >::Body_force_fct_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::Density_Ratio_pt, oomph::RefineableElement::father_element_pt(), oomph::SpaceTimeNavierStokesEquations< DIM >::G_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::Re_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::ReInvFr_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::Source_fct_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::St_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::store_strouhal_as_external_data(), oomph::SpaceTimeNavierStokesEquations< DIM >::Strouhal_is_stored_as_external_data, and oomph::SpaceTimeNavierStokesEquations< DIM >::Viscosity_Ratio_pt.

◆ further_build() [3/3]

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::further_build ( )
inlinevirtual

Further build, pass the pointers down to the sons.

Reimplemented from oomph::RefineableElement.

522  {
523  // Find the father element
524  RefineableSpaceTimeNavierStokesEquations<DIM>* cast_father_element_pt =
525  dynamic_cast<RefineableSpaceTimeNavierStokesEquations<DIM>*>(
526  this->father_element_pt());
527 
528  // Set the viscosity ratio pointer
529  this->Viscosity_Ratio_pt = cast_father_element_pt->viscosity_ratio_pt();
530 
531  // Set the density ratio pointer
532  this->Density_Ratio_pt = cast_father_element_pt->density_ratio_pt();
533 
534  // Set pointer to global Reynolds number
535  this->Re_pt = cast_father_element_pt->re_pt();
536 
537  // Set pointer to global Reynolds number x Strouhal number (=Womersley)
538  this->St_pt = cast_father_element_pt->st_pt();
539 
540  // The Strouhal number (which is a proxy for the period here) is not
541  // stored as external data
543  cast_father_element_pt->is_strouhal_stored_as_external_data();
544 
545  // If we're storing the Strouhal number as external data
547  {
548  // The index of the external data (which contains the st)
549  unsigned data_index = 0;
550 
551  // Get the external data pointer from the father and store it
553  cast_father_element_pt->external_data_pt(data_index));
554  }
555 
556  // Set pointer to global Reynolds number x inverse Froude number
557  this->ReInvFr_pt = cast_father_element_pt->re_invfr_pt();
558 
559  // Set pointer to global gravity Vector
560  this->G_pt = cast_father_element_pt->g_pt();
561 
562  // Set pointer to body force function
563  this->Body_force_fct_pt = cast_father_element_pt->body_force_fct_pt();
564 
565  // Set pointer to volumetric source function
566  this->Source_fct_pt = cast_father_element_pt->source_fct_pt();
567 
568  // Set the ALE flag
569  this->ALE_is_disabled = cast_father_element_pt->ALE_is_disabled;
570  } // End of further_build

References oomph::SpaceTimeNavierStokesEquations< DIM >::ALE_is_disabled, oomph::SpaceTimeNavierStokesEquations< DIM >::Body_force_fct_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::Density_Ratio_pt, oomph::RefineableElement::father_element_pt(), oomph::SpaceTimeNavierStokesEquations< DIM >::G_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::Re_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::ReInvFr_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::Source_fct_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::St_pt, oomph::SpaceTimeNavierStokesEquations< DIM >::store_strouhal_as_external_data(), oomph::SpaceTimeNavierStokesEquations< DIM >::Strouhal_is_stored_as_external_data, and oomph::SpaceTimeNavierStokesEquations< DIM >::Viscosity_Ratio_pt.

◆ get_dresidual_dnodal_coordinates() [1/3]

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::get_dresidual_dnodal_coordinates ( RankThreeTensor< double > &  dresidual_dnodal_coordinates)
protectedvirtual

Compute derivatives of elemental residual vector with respect to nodal coordinates. Overwrites default implementation in FiniteElement base class. dresidual_dnodal_coordinates(l,i,j) = d res(l) / dX_{ij}

Compute derivatives of elemental residual vector with respect to nodal coordinates. dresidual_dnodal_coordinates(l,i,j) = d res(l) / dX_{ij} Overloads the FD-based version in the FE base class.

Reimplemented from oomph::RefineableElement.

1294  {
1295  // Throw a warning
1296  throw OomphLibError("Space-time update needs to be checked!",
1299 
1300  // Return immediately if there are no dofs
1301  if (ndof() == 0)
1302  {
1303  return;
1304  }
1305 
1306  // Determine number of nodes in element
1307  const unsigned n_node = nnode();
1308 
1309  // Get continuous time from timestepper of first node
1310  double time = node_pt(0)->time_stepper_pt()->time_pt()->time();
1311 
1312  // Determine number of pressure dofs in element
1313  const unsigned n_pres = this->npres_nst();
1314 
1315  // Find the indices at which the local velocities are stored
1316  unsigned u_nodal_index[DIM];
1317  for (unsigned i = 0; i < DIM; i++)
1318  {
1319  u_nodal_index[i] = this->u_index_nst(i);
1320  }
1321 
1322  // Which nodal value represents the pressure? (Negative if pressure
1323  // is not based on nodal interpolation).
1324  const int p_index = this->p_nodal_index_nst();
1325 
1326  // Local array of booleans that are true if the l-th pressure value is
1327  // hanging (avoid repeated virtual function calls)
1328  bool pressure_dof_is_hanging[n_pres];
1329 
1330  // If the pressure is stored at a node
1331  if (p_index >= 0)
1332  {
1333  // Read out whether the pressure is hanging
1334  for (unsigned l = 0; l < n_pres; ++l)
1335  {
1336  pressure_dof_is_hanging[l] = pressure_node_pt(l)->is_hanging(p_index);
1337  }
1338  }
1339  // Otherwise the pressure is not stored at a node and so cannot hang
1340  else
1341  {
1342  for (unsigned l = 0; l < n_pres; ++l)
1343  {
1344  pressure_dof_is_hanging[l] = false;
1345  }
1346  }
1347 
1348  // Set up memory for the shape and test functions
1349  Shape psif(n_node), testf(n_node);
1350  DShape dpsifdx(n_node, DIM), dtestfdx(n_node, DIM);
1351 
1352  // Set up memory for pressure shape and test functions
1353  Shape psip(n_pres), testp(n_pres);
1354 
1355  // Determine number of shape controlling nodes
1356  const unsigned n_shape_controlling_node = nshape_controlling_nodes();
1357 
1358  // Deriatives of shape fct derivatives w.r.t. nodal coords
1359  RankFourTensor<double> d_dpsifdx_dX(
1360  DIM, n_shape_controlling_node, n_node, DIM);
1361  RankFourTensor<double> d_dtestfdx_dX(
1362  DIM, n_shape_controlling_node, n_node, DIM);
1363 
1364  // Derivative of Jacobian of mapping w.r.t. to nodal coords
1365  DenseMatrix<double> dJ_dX(DIM, n_shape_controlling_node);
1366 
1367  // Derivatives of derivative of u w.r.t. nodal coords
1368  RankFourTensor<double> d_dudx_dX(DIM, n_shape_controlling_node, DIM, DIM);
1369 
1370  // Derivatives of nodal velocities w.r.t. nodal coords:
1371  // Assumption: Interaction only local via no-slip so
1372  // X_ij only affects U_ij.
1373  DenseMatrix<double> d_U_dX(DIM, n_shape_controlling_node, 0.0);
1374 
1375  // Determine the number of integration points
1376  const unsigned n_intpt = integral_pt()->nweight();
1377 
1378  // Vector to hold local coordinates
1379  Vector<double> s(DIM);
1380 
1381  // Get physical variables from element
1382  // (Reynolds number must be multiplied by the density ratio)
1383  double scaled_re = this->re() * this->density_ratio();
1384  double scaled_re_st = this->re_st() * this->density_ratio();
1385  double scaled_re_inv_fr = this->re_invfr() * this->density_ratio();
1386  double visc_ratio = this->viscosity_ratio();
1387  Vector<double> G = this->g();
1388 
1389  // FD step
1391 
1392  // Pre-compute derivatives of nodal velocities w.r.t. nodal coords:
1393  // Assumption: Interaction only local via no-slip so
1394  // X_ij only affects U_ij.
1395  bool element_has_node_with_aux_node_update_fct = false;
1396 
1397  std::map<Node*, unsigned> local_shape_controlling_node_lookup =
1399 
1400  // FD loop over shape-controlling nodes
1401  for (std::map<Node*, unsigned>::iterator it =
1402  local_shape_controlling_node_lookup.begin();
1403  it != local_shape_controlling_node_lookup.end();
1404  it++)
1405  {
1406  // Get node
1407  Node* nod_pt = it->first;
1408 
1409  // Get its number
1410  unsigned q = it->second;
1411 
1412  // Only compute if there's a node-update fct involved
1413  if (nod_pt->has_auxiliary_node_update_fct_pt())
1414  {
1415  element_has_node_with_aux_node_update_fct = true;
1416 
1417  // Current nodal velocity
1418  Vector<double> u_ref(DIM);
1419  for (unsigned i = 0; i < DIM; i++)
1420  {
1421  u_ref[i] = *(nod_pt->value_pt(u_nodal_index[i]));
1422  }
1423 
1424  // FD
1425  for (unsigned p = 0; p < DIM; p++)
1426  {
1427  // Make backup
1428  double backup = nod_pt->x(p);
1429 
1430  // Do FD step. No node update required as we're
1431  // attacking the coordinate directly...
1432  nod_pt->x(p) += eps_fd;
1433 
1434  // Do auxiliary node update (to apply no slip)
1435  nod_pt->perform_auxiliary_node_update_fct();
1436 
1437  // Evaluate
1438  d_U_dX(p, q) =
1439  (*(nod_pt->value_pt(u_nodal_index[p])) - u_ref[p]) / eps_fd;
1440 
1441  // Reset
1442  nod_pt->x(p) = backup;
1443 
1444  // Do auxiliary node update (to apply no slip)
1445  nod_pt->perform_auxiliary_node_update_fct();
1446  }
1447  }
1448  }
1449 
1450  // Integer to store the local equation number
1451  int local_eqn = 0;
1452 
1453  // Pointers to hang info object
1454  HangInfo* hang_info_pt = 0;
1455 
1456  // Loop over the integration points
1457  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
1458  {
1459  // Assign values of s
1460  for (unsigned i = 0; i < DIM; i++)
1461  {
1462  s[i] = integral_pt()->knot(ipt, i);
1463  }
1464 
1465  // Get the integral weight
1466  const double w = integral_pt()->weight(ipt);
1467 
1468  // Call the derivatives of the shape and test functions
1469  const double J =
1471  psif,
1472  dpsifdx,
1473  d_dpsifdx_dX,
1474  testf,
1475  dtestfdx,
1476  d_dtestfdx_dX,
1477  dJ_dX);
1478 
1479  // Call the pressure shape and test functions
1480  this->pshape_nst(s, psip, testp);
1481 
1482  // Calculate local values of the pressure and velocity components
1483  // Allocate
1484  double interpolated_p = 0.0;
1485  Vector<double> interpolated_u(DIM, 0.0);
1486  Vector<double> interpolated_x(DIM, 0.0);
1487  Vector<double> mesh_velocity(DIM, 0.0);
1488  Vector<double> dudt(DIM, 0.0);
1489  DenseMatrix<double> interpolated_dudx(DIM, DIM, 0.0);
1490 
1491  // Calculate pressure
1492  for (unsigned l = 0; l < n_pres; l++)
1493  {
1494  interpolated_p += this->p_nst(l) * psip[l];
1495  }
1496 
1497  // Calculate velocities and derivatives:
1498 
1499  // Loop over nodes
1500  for (unsigned l = 0; l < n_node; l++)
1501  {
1502  // Loop over directions
1503  for (unsigned i = 0; i < DIM; i++)
1504  {
1505  // Get the nodal value
1506  const double u_value = nodal_value(l, u_nodal_index[i]);
1507  interpolated_u[i] += u_value * psif[l];
1508  interpolated_x[i] += nodal_position(l, i) * psif[l];
1509  dudt[i] += this->du_dt_nst(l, i) * psif[l];
1510 
1511  // Loop over derivative directions
1512  for (unsigned j = 0; j < DIM; j++)
1513  {
1514  interpolated_dudx(i, j) += u_value * dpsifdx(l, j);
1515  }
1516  }
1517  }
1518 
1519  if (!this->ALE_is_disabled)
1520  {
1521  // Loop over nodes
1522  for (unsigned l = 0; l < n_node; l++)
1523  {
1524  // Loop over directions
1525  for (unsigned i = 0; i < DIM; i++)
1526  {
1527  mesh_velocity[i] += this->dnodal_position_dt(l, i) * psif[l];
1528  }
1529  }
1530  }
1531 
1532  // Calculate derivative of du_i/dx_k w.r.t. nodal positions X_{pq}
1533 
1534  // Loop over shape-controlling nodes
1535  for (unsigned q = 0; q < n_shape_controlling_node; q++)
1536  {
1537  // Loop over coordinate directions
1538  for (unsigned p = 0; p < DIM; p++)
1539  {
1540  for (unsigned i = 0; i < DIM; i++)
1541  {
1542  for (unsigned k = 0; k < DIM; k++)
1543  {
1544  double aux = 0.0;
1545  for (unsigned j = 0; j < n_node; j++)
1546  {
1547  aux +=
1548  nodal_value(j, u_nodal_index[i]) * d_dpsifdx_dX(p, q, j, k);
1549  }
1550  d_dudx_dX(p, q, i, k) = aux;
1551  }
1552  }
1553  }
1554  }
1555 
1556  // Get weight of actual nodal position/value in computation of mesh
1557  // velocity from positional/value time stepper
1558  const double pos_time_weight =
1560  const double val_time_weight =
1561  node_pt(0)->time_stepper_pt()->weight(1, 0);
1562 
1563  // Get the user-defined body force terms
1564  Vector<double> body_force(DIM);
1565  this->get_body_force_nst(time, ipt, s, interpolated_x, body_force);
1566 
1567  // Get the user-defined source function
1568  const double source = this->get_source_nst(time, ipt, interpolated_x);
1569 
1570  // Get gradient of body force function
1571  DenseMatrix<double> d_body_force_dx(DIM, DIM, 0.0);
1573  time, ipt, s, interpolated_x, d_body_force_dx);
1574 
1575  // Get gradient of source function
1576  Vector<double> source_gradient(DIM, 0.0);
1577  this->get_source_gradient_nst(time, ipt, interpolated_x, source_gradient);
1578 
1579 
1580  // Assemble shape derivatives
1581  //---------------------------
1582 
1583  // MOMENTUM EQUATIONS
1584  // ------------------
1585 
1586  // Number of master nodes and storage for the weight of the shape function
1587  unsigned n_master = 1;
1588  double hang_weight = 1.0;
1589 
1590  // Loop over the test functions
1591  for (unsigned l = 0; l < n_node; l++)
1592  {
1593  // Local boolean to indicate whether the node is hanging
1594  bool is_node_hanging = node_pt(l)->is_hanging();
1595 
1596  // If the node is hanging
1597  if (is_node_hanging)
1598  {
1599  hang_info_pt = node_pt(l)->hanging_pt();
1600 
1601  // Read out number of master nodes from hanging data
1602  n_master = hang_info_pt->nmaster();
1603  }
1604  // Otherwise the node is its own master
1605  else
1606  {
1607  n_master = 1;
1608  }
1609 
1610  // Loop over the master nodes
1611  for (unsigned m = 0; m < n_master; m++)
1612  {
1613  // Loop over coordinate directions
1614  for (unsigned i = 0; i < DIM; i++)
1615  {
1616  // Get the equation number
1617  // If the node is hanging
1618  if (is_node_hanging)
1619  {
1620  // Get the equation number from the master node
1621  local_eqn = this->local_hang_eqn(hang_info_pt->master_node_pt(m),
1622  u_nodal_index[i]);
1623  // Get the hang weight from the master node
1624  hang_weight = hang_info_pt->master_weight(m);
1625  }
1626  // If the node is not hanging
1627  else
1628  {
1629  // Local equation number
1630  local_eqn = this->nodal_local_eqn(l, u_nodal_index[i]);
1631 
1632  // Node contributes with full weight
1633  hang_weight = 1.0;
1634  }
1635 
1636  // IF it's not a boundary condition
1637  if (local_eqn >= 0)
1638  {
1639  // Loop over coordinate directions
1640  for (unsigned p = 0; p < DIM; p++)
1641  {
1642  // Loop over shape controlling nodes
1643  for (unsigned q = 0; q < n_shape_controlling_node; q++)
1644  {
1645  // Residual x deriv of Jacobian
1646  // ----------------------------
1647 
1648  // Add the user-defined body force terms
1649  double sum = body_force[i] * testf[l];
1650 
1651  // Add the gravitational body force term
1652  sum += scaled_re_inv_fr * testf[l] * G[i];
1653 
1654  // Add the pressure gradient term
1655  sum += interpolated_p * dtestfdx(l, i);
1656 
1657  // Add in the stress tensor terms
1658  // The viscosity ratio needs to go in here to ensure
1659  // continuity of normal stress is satisfied even in flows
1660  // with zero pressure gradient!
1661  for (unsigned k = 0; k < DIM; k++)
1662  {
1663  sum -= visc_ratio *
1664  (interpolated_dudx(i, k) +
1665  this->Gamma[i] * interpolated_dudx(k, i)) *
1666  dtestfdx(l, k);
1667  }
1668 
1669  // Add in the inertial terms
1670 
1671  // du/dt term
1672  sum -= scaled_re_st * dudt[i] * testf[l];
1673 
1674  // Convective terms, including mesh velocity
1675  for (unsigned k = 0; k < DIM; k++)
1676  {
1677  double tmp = scaled_re * interpolated_u[k];
1678  if (!this->ALE_is_disabled)
1679  {
1680  tmp -= scaled_re_st * mesh_velocity[k];
1681  }
1682  sum -= tmp * interpolated_dudx(i, k) * testf[l];
1683  }
1684 
1685  // Multiply throsugh by deriv of Jacobian and integration
1686  // weight
1687  dresidual_dnodal_coordinates(local_eqn, p, q) +=
1688  sum * dJ_dX(p, q) * w * hang_weight;
1689 
1690  // Derivative of residual x Jacobian
1691  // ---------------------------------
1692 
1693  // Body force
1694  sum = d_body_force_dx(i, p) * psif(q) * testf(l);
1695 
1696  // Pressure gradient term
1697  sum += interpolated_p * d_dtestfdx_dX(p, q, l, i);
1698 
1699  // Viscous term
1700  for (unsigned k = 0; k < DIM; k++)
1701  {
1702  sum -=
1703  visc_ratio * ((interpolated_dudx(i, k) +
1704  this->Gamma[i] * interpolated_dudx(k, i)) *
1705  d_dtestfdx_dX(p, q, l, k) +
1706  (d_dudx_dX(p, q, i, k) +
1707  this->Gamma[i] * d_dudx_dX(p, q, k, i)) *
1708  dtestfdx(l, k));
1709  }
1710 
1711  // Convective terms, including mesh velocity
1712  for (unsigned k = 0; k < DIM; k++)
1713  {
1714  double tmp = scaled_re * interpolated_u[k];
1715  if (!this->ALE_is_disabled)
1716  {
1717  tmp -= scaled_re_st * mesh_velocity[k];
1718  }
1719  sum -= tmp * d_dudx_dX(p, q, i, k) * testf(l);
1720  }
1721  if (!this->ALE_is_disabled)
1722  {
1723  sum += scaled_re_st * pos_time_weight * psif(q) *
1724  interpolated_dudx(i, p) * testf(l);
1725  }
1726 
1727  // Multiply through by Jacobian and integration weight
1728  dresidual_dnodal_coordinates(local_eqn, p, q) +=
1729  sum * J * w * hang_weight;
1730 
1731  } // End of loop over shape controlling nodes q
1732  } // End of loop over coordinate directions p
1733 
1734 
1735  // Derivs w.r.t. to nodal velocities
1736  // ---------------------------------
1737  if (element_has_node_with_aux_node_update_fct)
1738  {
1739  // Loop over local nodes
1740  for (unsigned q_local = 0; q_local < n_node; q_local++)
1741  {
1742  // Number of master nodes and storage for the weight of
1743  // the shape function
1744  unsigned n_master2 = 1;
1745  double hang_weight2 = 1.0;
1746  HangInfo* hang_info2_pt = 0;
1747 
1748  // Local boolean to indicate whether the node is hanging
1749  bool is_node_hanging2 = node_pt(q_local)->is_hanging();
1750 
1751  Node* actual_shape_controlling_node_pt = node_pt(q_local);
1752 
1753  // If the node is hanging
1754  if (is_node_hanging2)
1755  {
1756  hang_info2_pt = node_pt(q_local)->hanging_pt();
1757 
1758  // Read out number of master nodes from hanging data
1759  n_master2 = hang_info2_pt->nmaster();
1760  }
1761  // Otherwise the node is its own master
1762  else
1763  {
1764  n_master2 = 1;
1765  }
1766 
1767  // Loop over the master nodes
1768  for (unsigned mm = 0; mm < n_master2; mm++)
1769  {
1770  if (is_node_hanging2)
1771  {
1772  actual_shape_controlling_node_pt =
1773  hang_info2_pt->master_node_pt(mm);
1774  hang_weight2 = hang_info2_pt->master_weight(mm);
1775  }
1776 
1777  // Find the corresponding number
1778  unsigned q = local_shape_controlling_node_lookup
1779  [actual_shape_controlling_node_pt];
1780 
1781  // Loop over coordinate directions
1782  for (unsigned p = 0; p < DIM; p++)
1783  {
1784  double sum = -visc_ratio * this->Gamma[i] *
1785  dpsifdx(q_local, i) * dtestfdx(l, p) -
1786  scaled_re * psif(q_local) *
1787  interpolated_dudx(i, p) * testf(l);
1788  if (i == p)
1789  {
1790  sum -= scaled_re_st * val_time_weight * psif(q_local) *
1791  testf(l);
1792  for (unsigned k = 0; k < DIM; k++)
1793  {
1794  sum -=
1795  visc_ratio * dpsifdx(q_local, k) * dtestfdx(l, k);
1796  double tmp = scaled_re * interpolated_u[k];
1797  if (!this->ALE_is_disabled)
1798  {
1799  tmp -= scaled_re_st * mesh_velocity[k];
1800  }
1801  sum -= tmp * dpsifdx(q_local, k) * testf(l);
1802  }
1803  }
1804 
1805  dresidual_dnodal_coordinates(local_eqn, p, q) +=
1806  sum * d_U_dX(p, q) * J * w * hang_weight * hang_weight2;
1807  }
1808  } // End of loop over master nodes
1809  } // End of loop over local nodes
1810  } // End of if(element_has_node_with_aux_node_update_fct)
1811 
1812 
1813  } // local_eqn>=0
1814  }
1815  }
1816  } // End of loop over test functions
1817 
1818 
1819  // CONTINUITY EQUATION
1820  // -------------------
1821 
1822  // Loop over the shape functions
1823  for (unsigned l = 0; l < n_pres; l++)
1824  {
1825  // If the pressure dof is hanging
1826  if (pressure_dof_is_hanging[l])
1827  {
1828  // Pressure dof is hanging so it must be nodal-based
1829  // Get the hang info object
1830  hang_info_pt = this->pressure_node_pt(l)->hanging_pt(p_index);
1831 
1832  // Get the number of master nodes from the pressure node
1833  n_master = hang_info_pt->nmaster();
1834  }
1835  // Otherwise the node is its own master
1836  else
1837  {
1838  n_master = 1;
1839  }
1840 
1841  // Loop over the master nodes
1842  for (unsigned m = 0; m < n_master; m++)
1843  {
1844  // Get the number of the unknown
1845  // If the pressure dof is hanging
1846  if (pressure_dof_is_hanging[l])
1847  {
1848  // Get the local equation from the master node
1849  local_eqn =
1850  this->local_hang_eqn(hang_info_pt->master_node_pt(m), p_index);
1851  // Get the weight for the node
1852  hang_weight = hang_info_pt->master_weight(m);
1853  }
1854  else
1855  {
1856  local_eqn = this->p_local_eqn(l);
1857  hang_weight = 1.0;
1858  }
1859 
1860  // If not a boundary conditions
1861  if (local_eqn >= 0)
1862  {
1863  // Loop over coordinate directions
1864  for (unsigned p = 0; p < DIM; p++)
1865  {
1866  // Loop over nodes
1867  for (unsigned q = 0; q < n_shape_controlling_node; q++)
1868  {
1869  // Residual x deriv of Jacobian
1870  //-----------------------------
1871 
1872  // Source term
1873  double aux = -source;
1874 
1875  // Loop over velocity components
1876  for (unsigned k = 0; k < DIM; k++)
1877  {
1878  aux += interpolated_dudx(k, k);
1879  }
1880 
1881  // Multiply through by deriv of Jacobian and integration weight
1882  dresidual_dnodal_coordinates(local_eqn, p, q) +=
1883  aux * dJ_dX(p, q) * testp[l] * w * hang_weight;
1884 
1885 
1886  // Derivative of residual x Jacobian
1887  // ---------------------------------
1888 
1889  // Loop over velocity components
1890  aux = -source_gradient[p] * psif(q);
1891  for (unsigned k = 0; k < DIM; k++)
1892  {
1893  aux += d_dudx_dX(p, q, k, k);
1894  }
1895  // Multiply through by Jacobian and integration weight
1896  dresidual_dnodal_coordinates(local_eqn, p, q) +=
1897  aux * testp[l] * J * w * hang_weight;
1898  }
1899  }
1900 
1901 
1902  // Derivs w.r.t. to nodal velocities
1903  // ---------------------------------
1904  if (element_has_node_with_aux_node_update_fct)
1905  {
1906  // Loop over local nodes
1907  for (unsigned q_local = 0; q_local < n_node; q_local++)
1908  {
1909  // Number of master nodes and storage for the weight of
1910  // the shape function
1911  unsigned n_master2 = 1;
1912  double hang_weight2 = 1.0;
1913  HangInfo* hang_info2_pt = 0;
1914 
1915  // Local boolean to indicate whether the node is hanging
1916  bool is_node_hanging2 = node_pt(q_local)->is_hanging();
1917 
1918  Node* actual_shape_controlling_node_pt = node_pt(q_local);
1919 
1920  // If the node is hanging
1921  if (is_node_hanging2)
1922  {
1923  hang_info2_pt = node_pt(q_local)->hanging_pt();
1924 
1925  // Read out number of master nodes from hanging data
1926  n_master2 = hang_info2_pt->nmaster();
1927  }
1928  // Otherwise the node is its own master
1929  else
1930  {
1931  n_master2 = 1;
1932  }
1933 
1934  // Loop over the master nodes
1935  for (unsigned mm = 0; mm < n_master2; mm++)
1936  {
1937  if (is_node_hanging2)
1938  {
1939  actual_shape_controlling_node_pt =
1940  hang_info2_pt->master_node_pt(mm);
1941  hang_weight2 = hang_info2_pt->master_weight(mm);
1942  }
1943 
1944  // Find the corresponding number
1945  unsigned q = local_shape_controlling_node_lookup
1946  [actual_shape_controlling_node_pt];
1947 
1948  // Loop over coordinate directions
1949  for (unsigned p = 0; p < DIM; p++)
1950  {
1951  double aux = dpsifdx(q_local, p) * testp(l);
1952  dresidual_dnodal_coordinates(local_eqn, p, q) +=
1953  aux * d_U_dX(p, q) * J * w * hang_weight * hang_weight2;
1954  }
1955  } // End of loop over (mm) master nodes
1956  } // End of loop over local nodes q_local
1957  } // End of if(element_has_node_with_aux_node_update_fct)
1958  } // End of if it's not a boundary condition
1959  } // End of loop over (m) master nodes
1960  } // End of loop over shape functions for continuity eqn
1961 
1962  } // End of loop over integration points
1963  }
float * p
Definition: Tutorial_Map_using.cpp:9
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238
double dnodal_position_dt(const unsigned &n, const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt at local node n.
Definition: elements.h:2333
static double Default_fd_jacobian_step
Definition: elements.h:1198
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
Definition: nodes.h:1022
unsigned nshape_controlling_nodes()
Definition: refineable_elements.h:627
std::map< Node *, unsigned > shape_controlling_node_lookup()
Definition: refineable_elements.h:636
double du_dt_nst(const unsigned &n, const unsigned &i) const
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:1149
double re_st() const
Product of Reynolds and Strouhal number (=Womersley number)
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:951
virtual void get_body_force_gradient_nst(const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, DenseMatrix< double > &d_body_force_dx)
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:646
virtual void get_source_gradient_nst(const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &gradient)
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:715
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
Definition: timesteppers.h:594
Time *const & time_pt() const
Access function for the pointer to time (const version)
Definition: timesteppers.h:572
double & time()
Return the current value of the continuous time.
Definition: timesteppers.h:123
Eigen::Matrix< Scalar, Dynamic, Dynamic, ColMajor > tmp
Definition: level3_impl.h:365
EIGEN_DEVICE_FUNC const Scalar & q
Definition: SpecialFunctionsImpl.h:2019

References oomph::ALE_is_disabled, Global_Parameters::body_force(), oomph::GeneralisedElement::Default_fd_jacobian_step, DIM, G, GlobalPhysicalVariables::Gamma, oomph::Node::has_auxiliary_node_update_fct_pt(), i, J, j, k, m, oomph::HangInfo::master_node_pt(), oomph::HangInfo::master_weight(), oomph::HangInfo::nmaster(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, p, oomph::Node::perform_auxiliary_node_update_fct(), Eigen::numext::q, s, TestProblem::source(), tmp, oomph::Data::value_pt(), w, and oomph::Node::x().

◆ get_dresidual_dnodal_coordinates() [2/3]

template<unsigned DIM>
virtual void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::get_dresidual_dnodal_coordinates ( RankThreeTensor< double > &  dresidual_dnodal_coordinates)
protectedvirtual

Compute derivatives of elemental residual vector with respect to nodal coordinates. Overwrites default implementation in FiniteElement base class. dresidual_dnodal_coordinates(l,i,j) = d res(l) / dX_{ij}

Reimplemented from oomph::RefineableElement.

◆ get_dresidual_dnodal_coordinates() [3/3]

template<unsigned DIM>
virtual void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::get_dresidual_dnodal_coordinates ( RankThreeTensor< double > &  dresidual_dnodal_coordinates)
protectedvirtual

Compute derivatives of elemental residual vector with respect to nodal coordinates. Overwrites default implementation in FiniteElement base class. dresidual_dnodal_coordinates(l,i,j) = d res(l) / dX_{ij}

Reimplemented from oomph::RefineableElement.

◆ get_pressure_and_velocity_mass_matrix_diagonal() [1/3]

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::get_pressure_and_velocity_mass_matrix_diagonal ( Vector< double > &  press_mass_diag,
Vector< double > &  veloc_mass_diag,
const unsigned which_one = 0 
)
virtual

Compute the diagonal of the velocity/pressure mass matrices. If which one=0, both are computed, otherwise only the pressure (which_one=1) or the velocity mass matrix (which_one=2 – the LSC version of the preconditioner only needs that one)

Reimplemented from oomph::SpaceTimeNavierStokesEquations< DIM >.

47  {
48  // Resize and initialise
49  unsigned n_dof = ndof();
50 
51  // If the pressure mass matrix needs to be constructed
52  if ((which_one == 0) || (which_one == 1))
53  {
54  // Assign the appropriate amount of space
55  press_mass_diag.assign(n_dof, 0.0);
56  }
57 
58  // If the velocity mass matrix needs to be constructed
59  if ((which_one == 0) || (which_one == 2))
60  {
61  // Assign the appropriate amount of space
62  veloc_mass_diag.assign(n_dof, 0.0);
63  }
64 
65  // Pointer to hang info object
66  HangInfo* hang_info_pt = 0;
67 
68  // Number of master nodes
69  unsigned n_master = 1;
70 
71  // Hang weight for shape functions
72  double hang_weight = 1.0;
73 
74  // Find out how many nodes there are in the element
75  unsigned n_node = nnode();
76 
77  // Local coordinates
78  Vector<double> s(DIM + 1, 0.0);
79 
80  // Storage for the local velocity indices
81  Vector<unsigned> u_nodal_index(DIM, 0.0);
82 
83  // Find the indices at which the local velocities are stored
84  for (unsigned i = 0; i < DIM; i++)
85  {
86  // Calculate the i-th local velocity component
87  u_nodal_index[i] = this->u_index_nst(i);
88  }
89 
90  // Set up memory for velocity shape functions
91  Shape psi(n_node);
92 
93  // Find number of pressure dofs
94  unsigned n_pres = this->npres_nst();
95 
96  // Pressure shape function
97  Shape psi_p(n_pres);
98 
99  // Which nodal value represents the pressure? (Negative if pressure
100  // is not based on nodal interpolation).
101  int p_index = this->p_nodal_index_nst();
102 
103  // Local array of booleans that are true if the l-th pressure value is
104  // hanging (avoid repeated virtual function calls)
105  bool pressure_dof_is_hanging[n_pres];
106 
107  // If the pressure is stored at a node
108  if (p_index >= 0)
109  {
110  // Loop over the pressure nodes
111  for (unsigned l = 0; l < n_pres; l++)
112  {
113  // Read out the hang status of the pressure node
114  pressure_dof_is_hanging[l] = pressure_node_pt(l)->is_hanging(p_index);
115  }
116  }
117  // Otherwise the pressure is not stored at a node and so cannot hang
118  else
119  {
120  // Loop over the pressures nodes
121  for (unsigned l = 0; l < n_pres; l++)
122  {
123  // Indicate that the pressure node is not hanging
124  pressure_dof_is_hanging[l] = false;
125  }
126  } // if (p_index>=0)
127 
128  // Number of integration points
129  unsigned n_intpt = integral_pt()->nweight();
130 
131  // Integer to store the local equations no
132  int local_eqn = 0;
133 
134  // Loop over the integration points
135  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
136  {
137  // Get the integral weight
138  double w = integral_pt()->weight(ipt);
139 
140  // Get determinant of Jacobian of the mapping
141  double J = J_eulerian_at_knot(ipt);
142 
143  // Assign values of s
144  for (unsigned i = 0; i < DIM + 1; i++)
145  {
146  // Calculate the i-th local coordinate at the ipt-th integration point
147  s[i] = integral_pt()->knot(ipt, i);
148  }
149 
150  // Premultiply weights and Jacobian
151  double W = w * J;
152 
153  // Do we want the velocity one?
154  if ((which_one == 0) || (which_one == 2))
155  {
156  // Get the velocity shape functions
157  shape_at_knot(ipt, psi);
158 
159  // Loop over the velocity shape functions
160  for (unsigned l = 0; l < n_node; l++)
161  {
162  // Local boolean to indicate whether or not the node is hanging
163  bool is_node_hanging = node_pt(l)->is_hanging();
164 
165  // If the node is hanging
166  if (is_node_hanging)
167  {
168  // Get the HangInfo pointer from the node
169  hang_info_pt = node_pt(l)->hanging_pt();
170 
171  // Read out number of master nodes from hanging data
172  n_master = hang_info_pt->nmaster();
173  }
174  // Otherwise the node is its own master
175  else
176  {
177  // There is only one node to consider; the node itself
178  n_master = 1;
179  }
180 
181  // Loop over the master nodes
182  for (unsigned m = 0; m < n_master; m++)
183  {
184  // Loop over velocity components for equations
185  for (unsigned i = 0; i < DIM; i++)
186  {
187  // If the node is hanging
188  if (is_node_hanging)
189  {
190  // Get the equation number from the master node
191  local_eqn = this->local_hang_eqn(
192  hang_info_pt->master_node_pt(m), u_nodal_index[i]);
193 
194  // Get the hang weight from the master node
195  hang_weight = hang_info_pt->master_weight(m);
196  }
197  // If the node is not hanging
198  else
199  {
200  // Local equation number
201  local_eqn = this->nodal_local_eqn(l, u_nodal_index[i]);
202 
203  // Node contributes with full weight
204  hang_weight = 1.0;
205  }
206 
207  // If it's not a boundary condition
208  if (local_eqn >= 0)
209  {
210  // Add the contribution
211  veloc_mass_diag[local_eqn] += pow(psi[l] * hang_weight, 2) * W;
212  }
213  } // for (unsigned i=0;i<DIM;i++)
214  } // for (unsigned m=0;m<n_master;m++)
215  } // if ((which_one==0)||(which_one==2))
216  } // for (unsigned ipt=0;ipt<n_intpt;ipt++)
217 
218  // Do we want the pressure one?
219  if ((which_one == 0) || (which_one == 1))
220  {
221  // Get the pressure shape functions
222  this->pshape_nst(s, psi_p);
223 
224  // Loop over the pressure shape functions
225  for (unsigned l = 0; l < n_pres; l++)
226  {
227  // If the pressure dof is hanging
228  if (pressure_dof_is_hanging[l])
229  {
230  // Get the HangInfo object
231  hang_info_pt = this->pressure_node_pt(l)->hanging_pt(p_index);
232 
233  // Get the number of master nodes from the pressure node
234  n_master = hang_info_pt->nmaster();
235  }
236  // Otherwise the node is its own master
237  else
238  {
239  // There is only one node to consider; the node itself
240  n_master = 1;
241  }
242 
243  // Loop over the master nodes
244  for (unsigned m = 0; m < n_master; m++)
245  {
246  // If the pressure dof is hanging
247  if (pressure_dof_is_hanging[l])
248  {
249  // Get the local equation from the master node
250  local_eqn =
251  this->local_hang_eqn(hang_info_pt->master_node_pt(m), p_index);
252 
253  // Get the weight for the node
254  hang_weight = hang_info_pt->master_weight(m);
255  }
256  // If the pressure dof is not hanging
257  else
258  {
259  // Get the local equation number of this pressure dof
260  local_eqn = this->p_local_eqn(l);
261 
262  // Get the hang weight associated with this pressure node
263  hang_weight = 1.0;
264  }
265 
266  // If the equation is not pinned
267  if (local_eqn >= 0)
268  {
269  // Add the contribution
270  press_mass_diag[local_eqn] += pow(psi_p[l] * hang_weight, 2) * W;
271  }
272  } // for (unsigned m=0;m<n_master;m++)
273  } // for (unsigned l=0;l<n_pres;l++)
274  } // if ((which_one==0)||(which_one==1))
275  } // for (unsigned ipt=0;ipt<n_intpt;ipt++)
276  } // End of get_pressure_and_velocity_mass_matrix_diagonal
virtual double J_eulerian_at_knot(const unsigned &ipt) const
Definition: elements.cc:4168
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Definition: elements.cc:3220
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625

References DIM, i, J, m, oomph::HangInfo::master_node_pt(), oomph::HangInfo::master_weight(), oomph::HangInfo::nmaster(), Eigen::bfloat16_impl::pow(), s, w, and oomph::QuadTreeNames::W.

◆ get_pressure_and_velocity_mass_matrix_diagonal() [2/3]

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::get_pressure_and_velocity_mass_matrix_diagonal ( Vector< double > &  press_mass_diag,
Vector< double > &  veloc_mass_diag,
const unsigned which_one = 0 
)
virtual

Compute the diagonal of the velocity/pressure mass matrices. If which one=0, both are computed, otherwise only the pressure (which_one=1) or the velocity mass matrix (which_one=2 – the LSC version of the preconditioner only needs that one)

Reimplemented from oomph::SpaceTimeNavierStokesEquations< DIM >.

◆ get_pressure_and_velocity_mass_matrix_diagonal() [3/3]

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::get_pressure_and_velocity_mass_matrix_diagonal ( Vector< double > &  press_mass_diag,
Vector< double > &  veloc_mass_diag,
const unsigned which_one = 0 
)
virtual

Compute the diagonal of the velocity/pressure mass matrices. If which one=0, both are computed, otherwise only the pressure (which_one=1) or the velocity mass matrix (which_one=2 – the LSC version of the preconditioner only needs that one)

Reimplemented from oomph::SpaceTimeNavierStokesEquations< DIM >.

◆ get_Z2_flux() [1/3]

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

Get 'flux' for Z2 error recovery: Upper triangular entries in strain rate tensor.

Implements oomph::ElementWithZ2ErrorEstimator.

438  {
439 #ifdef PARANOID
440  // Calculate the number of entries there should be
441  unsigned num_entries = (DIM + (DIM * (DIM - 1)) / 2) + DIM;
442 
443  // Check if the flux vector has the correct size
444  if (flux.size() < num_entries)
445  {
446  std::ostringstream error_message;
447  error_message << "The flux vector has the wrong number of entries, "
448  << flux.size() << ", whereas it should be at least "
449  << num_entries << std::endl;
450  throw OomphLibError(error_message.str(),
453  }
454 #endif
455 
456  // Allocate space for the strain-rate
457  DenseMatrix<double> strainrate(DIM, DIM, 0.0);
458 
459  // Get strain rate matrix
460  this->strain_rate(s, strainrate);
461 
462  // Pack into flux Vector
463  unsigned icount = 0;
464 
465  // Loop over the diagonal entries
466  for (unsigned i = 0; i < DIM; i++)
467  {
468  // Add the next strain rate entry to the flux vector
469  flux[icount] = strainrate(i, i);
470 
471  // Increment the counter
472  icount++;
473  }
474 
475  // Loop over the rows of the matrix
476  for (unsigned i = 0; i < DIM; i++)
477  {
478  // Loop over the lower triangular columns
479  for (unsigned j = i + 1; j < DIM; j++)
480  {
481  // Add the next strain rate entry to the flux vector
482  flux[icount] = strainrate(i, j);
483 
484  // Increment the counter
485  icount++;
486  }
487  } // for (unsigned i=0;i<DIM;i++)
488 
489  // The number of nodes in the element
490  unsigned n_node = this->nnode();
491 
492  // Set up memory for the shape and test functions
493  Shape psif(n_node);
494 
495  // Set up memory for the derivatives of the shape and test functions
496  DShape dpsifdx(n_node, DIM + 1);
497 
498  // Call the derivatives of the shape and test functions
499  dshape_eulerian(s, psif, dpsifdx);
500 
501  // Loop over velocity components
502  for (unsigned j = 0; j < DIM; j++)
503  {
504  // Find the index at which the variable is stored
505  unsigned u_nodal_index = this->u_index_nst(j);
506 
507  // Loop over nodes
508  for (unsigned l = 0; l < n_node; l++)
509  {
510  // Add the time-derivative contribution from the l-th node
511  flux[icount] += this->nodal_value(l, u_nodal_index) * dpsifdx(l, DIM);
512  }
513 
514  // Increment the counter
515  icount++;
516  } // for (unsigned j=0;j<DIM;j++)
517  } // End of get_Z2_flux
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Definition: elements.cc:3298
void strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Strain-rate tensor: 1/2 (du_i/dx_j+du_j/dx_i)
Definition: discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.cc:1468
void flux(const double &time, const Vector< double > &x, double &flux)
Get flux applied along boundary x=0.
Definition: pretend_melt.cc:59

References DIM, oomph::FiniteElement::dshape_eulerian(), ProblemParameters::flux(), i, j, oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_value(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, s, oomph::SpaceTimeNavierStokesEquations< DIM >::strain_rate(), and oomph::SpaceTimeNavierStokesEquations< DIM >::u_index_nst().

◆ get_Z2_flux() [2/3]

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

Get 'flux' for Z2 error recovery: Upper triangular entries in strain rate tensor.

Implements oomph::ElementWithZ2ErrorEstimator.

438  {
439 #ifdef PARANOID
440  // Calculate the number of entries there should be
441  unsigned num_entries = (DIM + (DIM * (DIM - 1)) / 2) + DIM;
442 
443  // Check if the flux vector has the correct size
444  if (flux.size() < num_entries)
445  {
446  std::ostringstream error_message;
447  error_message << "The flux vector has the wrong number of entries, "
448  << flux.size() << ", whereas it should be at least "
449  << num_entries << std::endl;
450  throw OomphLibError(error_message.str(),
453  }
454 #endif
455 
456  // Allocate space for the strain-rate
457  DenseMatrix<double> strainrate(DIM, DIM, 0.0);
458 
459  // Get strain rate matrix
460  this->strain_rate(s, strainrate);
461 
462  // Pack into flux Vector
463  unsigned icount = 0;
464 
465  // Loop over the diagonal entries
466  for (unsigned i = 0; i < DIM; i++)
467  {
468  // Add the next strain rate entry to the flux vector
469  flux[icount] = strainrate(i, i);
470 
471  // Increment the counter
472  icount++;
473  }
474 
475  // Loop over the rows of the matrix
476  for (unsigned i = 0; i < DIM; i++)
477  {
478  // Loop over the lower triangular columns
479  for (unsigned j = i + 1; j < DIM; j++)
480  {
481  // Add the next strain rate entry to the flux vector
482  flux[icount] = strainrate(i, j);
483 
484  // Increment the counter
485  icount++;
486  }
487  } // for (unsigned i=0;i<DIM;i++)
488 
489  // The number of nodes in the element
490  unsigned n_node = this->nnode();
491 
492  // Set up memory for the shape and test functions
493  Shape psif(n_node);
494 
495  // Set up memory for the derivatives of the shape and test functions
496  DShape dpsifdx(n_node, DIM + 1);
497 
498  // Call the derivatives of the shape and test functions
499  dshape_eulerian(s, psif, dpsifdx);
500 
501  // Loop over velocity components
502  for (unsigned j = 0; j < DIM; j++)
503  {
504  // Find the index at which the variable is stored
505  unsigned u_nodal_index = this->u_index_nst(j);
506 
507  // Loop over nodes
508  for (unsigned l = 0; l < n_node; l++)
509  {
510  // Add the time-derivative contribution from the l-th node
511  flux[icount] += this->nodal_value(l, u_nodal_index) * dpsifdx(l, DIM);
512  }
513 
514  // Increment the counter
515  icount++;
516  } // for (unsigned j=0;j<DIM;j++)
517  } // End of get_Z2_flux

References DIM, oomph::FiniteElement::dshape_eulerian(), ProblemParameters::flux(), i, j, oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_value(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, s, oomph::SpaceTimeNavierStokesEquations< DIM >::strain_rate(), and oomph::SpaceTimeNavierStokesEquations< DIM >::u_index_nst().

◆ get_Z2_flux() [3/3]

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

Get 'flux' for Z2 error recovery: Upper triangular entries in strain rate tensor.

Implements oomph::ElementWithZ2ErrorEstimator.

438  {
439 #ifdef PARANOID
440  // Calculate the number of entries there should be
441  unsigned num_entries = (DIM + (DIM * (DIM - 1)) / 2) + DIM;
442 
443  // Check if the flux vector has the correct size
444  if (flux.size() < num_entries)
445  {
446  std::ostringstream error_message;
447  error_message << "The flux vector has the wrong number of entries, "
448  << flux.size() << ", whereas it should be at least "
449  << num_entries << std::endl;
450  throw OomphLibError(error_message.str(),
453  }
454 #endif
455 
456  // Allocate space for the strain-rate
457  DenseMatrix<double> strainrate(DIM, DIM, 0.0);
458 
459  // Get strain rate matrix
460  this->strain_rate(s, strainrate);
461 
462  // Pack into flux Vector
463  unsigned icount = 0;
464 
465  // Loop over the diagonal entries
466  for (unsigned i = 0; i < DIM; i++)
467  {
468  // Add the next strain rate entry to the flux vector
469  flux[icount] = strainrate(i, i);
470 
471  // Increment the counter
472  icount++;
473  }
474 
475  // Loop over the rows of the matrix
476  for (unsigned i = 0; i < DIM; i++)
477  {
478  // Loop over the lower triangular columns
479  for (unsigned j = i + 1; j < DIM; j++)
480  {
481  // Add the next strain rate entry to the flux vector
482  flux[icount] = strainrate(i, j);
483 
484  // Increment the counter
485  icount++;
486  }
487  } // for (unsigned i=0;i<DIM;i++)
488 
489  // The number of nodes in the element
490  unsigned n_node = this->nnode();
491 
492  // Set up memory for the shape and test functions
493  Shape psif(n_node);
494 
495  // Set up memory for the derivatives of the shape and test functions
496  DShape dpsifdx(n_node, DIM + 1);
497 
498  // Call the derivatives of the shape and test functions
499  dshape_eulerian(s, psif, dpsifdx);
500 
501  // Loop over velocity components
502  for (unsigned j = 0; j < DIM; j++)
503  {
504  // Find the index at which the variable is stored
505  unsigned u_nodal_index = this->u_index_nst(j);
506 
507  // Loop over nodes
508  for (unsigned l = 0; l < n_node; l++)
509  {
510  // Add the time-derivative contribution from the l-th node
511  flux[icount] += this->nodal_value(l, u_nodal_index) * dpsifdx(l, DIM);
512  }
513 
514  // Increment the counter
515  icount++;
516  } // for (unsigned j=0;j<DIM;j++)
517  } // End of get_Z2_flux

References DIM, oomph::FiniteElement::dshape_eulerian(), ProblemParameters::flux(), i, j, oomph::FiniteElement::nnode(), oomph::FiniteElement::nodal_value(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, s, oomph::SpaceTimeNavierStokesEquations< DIM >::strain_rate(), and oomph::SpaceTimeNavierStokesEquations< DIM >::u_index_nst().

◆ num_Z2_flux_terms() [1/3]

template<unsigned DIM>
unsigned oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::num_Z2_flux_terms ( )
inlinevirtual

Number of 'flux' terms for Z2 error estimation.

Implements oomph::ElementWithZ2ErrorEstimator.

428  {
429  // DIM diagonal strain rates, DIM(DIM-1)/2 off diagonal rates (plus
430  // DIM velocity time-derivatives)
431  return (DIM + (DIM * (DIM - 1)) / 2) + DIM;
432  } // End of num_Z2_flux_terms

References DIM.

◆ num_Z2_flux_terms() [2/3]

template<unsigned DIM>
unsigned oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::num_Z2_flux_terms ( )
inlinevirtual

Number of 'flux' terms for Z2 error estimation.

Implements oomph::ElementWithZ2ErrorEstimator.

428  {
429  // DIM diagonal strain rates, DIM(DIM-1)/2 off diagonal rates (plus
430  // DIM velocity time-derivatives)
431  return (DIM + (DIM * (DIM - 1)) / 2) + DIM;
432  } // End of num_Z2_flux_terms

References DIM.

◆ num_Z2_flux_terms() [3/3]

template<unsigned DIM>
unsigned oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::num_Z2_flux_terms ( )
inlinevirtual

Number of 'flux' terms for Z2 error estimation.

Implements oomph::ElementWithZ2ErrorEstimator.

428  {
429  // DIM diagonal strain rates, DIM(DIM-1)/2 off diagonal rates (plus
430  // DIM velocity time-derivatives)
431  return (DIM + (DIM * (DIM - 1)) / 2) + DIM;
432  } // End of num_Z2_flux_terms

References DIM.

◆ pin_elemental_redundant_nodal_pressure_dofs() [1/3]

template<unsigned DIM>
virtual void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::pin_elemental_redundant_nodal_pressure_dofs ( )
inlineprotectedvirtual

Pin unused nodal pressure dofs (empty by default, because by default pressure dofs are not associated with nodes)

Reimplemented in oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, and oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >.

350 {}

Referenced by oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::pin_redundant_nodal_pressures().

◆ pin_elemental_redundant_nodal_pressure_dofs() [2/3]

template<unsigned DIM>
virtual void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::pin_elemental_redundant_nodal_pressure_dofs ( )
inlineprotectedvirtual

Pin unused nodal pressure dofs (empty by default, because by default pressure dofs are not associated with nodes)

Reimplemented in oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, and oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >.

350 {}

◆ pin_elemental_redundant_nodal_pressure_dofs() [3/3]

template<unsigned DIM>
virtual void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::pin_elemental_redundant_nodal_pressure_dofs ( )
inlineprotectedvirtual

Pin unused nodal pressure dofs (empty by default, because by default pressure dofs are not associated with nodes)

Reimplemented in oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, and oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >.

350 {}

◆ pin_redundant_nodal_pressures() [1/3]

template<unsigned DIM>
static void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::pin_redundant_nodal_pressures ( const Vector< GeneralisedElement * > &  element_pt)
inlinestatic

Loop over all elements in Vector (which typically contains all the elements in a fluid mesh) and pin the nodal pressure degrees of freedom that are not being used. Function uses the member function

  • RefineableSpaceTimeNavierStokesEquations:: pin_elemental_redundant_nodal_pressure_dofs()

which is empty by default and should be implemented for elements with nodal pressure degrees of freedom (e.g. for refineable Taylor-Hood.)

374  {
375  // How many elements are there?
376  unsigned n_element = element_pt.size();
377 
378  // Loop over all elements
379  for (unsigned e = 0; e < n_element; e++)
380  {
381  // Call the function that pins the unused nodal pressure data
382  dynamic_cast<RefineableSpaceTimeNavierStokesEquations<DIM>*>(
383  element_pt[e])
385  }
386  } // End of pin_redundant_nodal_pressures
virtual void pin_elemental_redundant_nodal_pressure_dofs()
Definition: refineable_discontinuous_galerkin_equal_order_pressure_spacetime_navier_stokes_elements.h:350

References e(), and oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::pin_elemental_redundant_nodal_pressure_dofs().

◆ pin_redundant_nodal_pressures() [2/3]

template<unsigned DIM>
static void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::pin_redundant_nodal_pressures ( const Vector< GeneralisedElement * > &  element_pt)
inlinestatic

Loop over all elements in Vector (which typically contains all the elements in a fluid mesh) and pin the nodal pressure degrees of freedom that are not being used. Function uses the member function

  • RefineableSpaceTimeNavierStokesEquations:: pin_elemental_redundant_nodal_pressure_dofs()

which is empty by default and should be implemented for elements with nodal pressure degrees of freedom (e.g. for refineable Taylor-Hood.)

374  {
375  // How many elements are there?
376  unsigned n_element = element_pt.size();
377 
378  // Loop over all elements
379  for (unsigned e = 0; e < n_element; e++)
380  {
381  // Call the function that pins the unused nodal pressure data
382  dynamic_cast<RefineableSpaceTimeNavierStokesEquations<DIM>*>(
383  element_pt[e])
385  }
386  } // End of pin_redundant_nodal_pressures

References e(), and oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::pin_elemental_redundant_nodal_pressure_dofs().

◆ pin_redundant_nodal_pressures() [3/3]

template<unsigned DIM>
static void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::pin_redundant_nodal_pressures ( const Vector< GeneralisedElement * > &  element_pt)
inlinestatic

Loop over all elements in Vector (which typically contains all the elements in a fluid mesh) and pin the nodal pressure degrees of freedom that are not being used. Function uses the member function

  • RefineableSpaceTimeNavierStokesEquations:: pin_elemental_redundant_nodal_pressure_dofs()

which is empty by default and should be implemented for elements with nodal pressure degrees of freedom (e.g. for refineable Taylor-Hood.)

374  {
375  // How many elements are there?
376  unsigned n_element = element_pt.size();
377 
378  // Loop over all elements
379  for (unsigned e = 0; e < n_element; e++)
380  {
381  // Call the function that pins the unused nodal pressure data
382  dynamic_cast<RefineableSpaceTimeNavierStokesEquations<DIM>*>(
383  element_pt[e])
385  }
386  } // End of pin_redundant_nodal_pressures

References e(), and oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::pin_elemental_redundant_nodal_pressure_dofs().

◆ pressure_node_pt() [1/3]

template<unsigned DIM>
virtual Node* oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::pressure_node_pt ( const unsigned n_p)
inlinevirtual

Pointer to n_p-th pressure node (Default: NULL, indicating that pressure is not based on nodal interpolation).

Reimplemented in oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, and oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >.

410  {
411  // Return a null pointer
412  return NULL;
413  } // End of pressure_node_pt

◆ pressure_node_pt() [2/3]

template<unsigned DIM>
virtual Node* oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::pressure_node_pt ( const unsigned n_p)
inlinevirtual

Pointer to n_p-th pressure node (Default: NULL, indicating that pressure is not based on nodal interpolation).

Reimplemented in oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, and oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >.

410  {
411  // Return a null pointer
412  return NULL;
413  } // End of pressure_node_pt

◆ pressure_node_pt() [3/3]

template<unsigned DIM>
virtual Node* oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::pressure_node_pt ( const unsigned n_p)
inlinevirtual

Pointer to n_p-th pressure node (Default: NULL, indicating that pressure is not based on nodal interpolation).

Reimplemented in oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >, and oomph::RefineableQTaylorHoodSpaceTimeElement< DIM >.

410  {
411  // Return a null pointer
412  return NULL;
413  } // End of pressure_node_pt

◆ unpin_all_pressure_dofs() [1/3]

template<unsigned DIM>
static void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::unpin_all_pressure_dofs ( const Vector< GeneralisedElement * > &  element_pt)
inlinestatic

Unpin all pressure dofs in elements listed in vector.

392  {
393  // How many elements are there?
394  unsigned n_element = element_pt.size();
395 
396  // Loop over all elements
397  for (unsigned e = 0; e < n_element; e++)
398  {
399  // Unpin the pressure dofs in the e-th element
400  dynamic_cast<RefineableSpaceTimeNavierStokesEquations<DIM>*>(
401  element_pt[e])
403  }
404  } // End of unpin_all_pressure_dofs
virtual void unpin_elemental_pressure_dofs()=0
Unpin all pressure dofs in the element.

References e(), and oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::unpin_elemental_pressure_dofs().

◆ unpin_all_pressure_dofs() [2/3]

template<unsigned DIM>
static void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::unpin_all_pressure_dofs ( const Vector< GeneralisedElement * > &  element_pt)
inlinestatic

Unpin all pressure dofs in elements listed in vector.

392  {
393  // How many elements are there?
394  unsigned n_element = element_pt.size();
395 
396  // Loop over all elements
397  for (unsigned e = 0; e < n_element; e++)
398  {
399  // Unpin the pressure dofs in the e-th element
400  dynamic_cast<RefineableSpaceTimeNavierStokesEquations<DIM>*>(
401  element_pt[e])
403  }
404  } // End of unpin_all_pressure_dofs

References e(), and oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::unpin_elemental_pressure_dofs().

◆ unpin_all_pressure_dofs() [3/3]

template<unsigned DIM>
static void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::unpin_all_pressure_dofs ( const Vector< GeneralisedElement * > &  element_pt)
inlinestatic

Unpin all pressure dofs in elements listed in vector.

392  {
393  // How many elements are there?
394  unsigned n_element = element_pt.size();
395 
396  // Loop over all elements
397  for (unsigned e = 0; e < n_element; e++)
398  {
399  // Unpin the pressure dofs in the e-th element
400  dynamic_cast<RefineableSpaceTimeNavierStokesEquations<DIM>*>(
401  element_pt[e])
403  }
404  } // End of unpin_all_pressure_dofs

References e(), and oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::unpin_elemental_pressure_dofs().

◆ unpin_elemental_pressure_dofs() [1/3]

◆ unpin_elemental_pressure_dofs() [2/3]

template<unsigned DIM>
virtual void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::unpin_elemental_pressure_dofs ( )
protectedpure virtual

◆ unpin_elemental_pressure_dofs() [3/3]

template<unsigned DIM>
virtual void oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::unpin_elemental_pressure_dofs ( )
protectedpure virtual

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