oomph::RefineableSpaceTimeNavierStokesMixedOrderEquations< DIM > Class Template Referenceabstract

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

#include <refineable_mixed_order_petrov_galerkin_space_time_navier_stokes_elements.h>

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

Public Member Functions

 RefineableSpaceTimeNavierStokesMixedOrderEquations ()
 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::SpaceTimeNavierStokesMixedOrderEquations< DIM >
 SpaceTimeNavierStokesMixedOrderEquations ()
 
void store_reynolds_strouhal_as_external_data (Data *reynolds_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...
 
NavierStokesMixedOrderBodyForceFctPtbody_force_fct_pt ()
 Access function for the body-force pointer. More...
 
NavierStokesMixedOrderBodyForceFctPt body_force_fct_pt () const
 Access function for the body-force pointer. Const version. More...
 
NavierStokesMixedOrderSourceFctPtsource_fct_pt ()
 Access function for the source-function pointer. More...
 
NavierStokesMixedOrderSourceFctPt source_fct_pt () const
 Access function for the source-function pointer. Const version. More...
 
NavierStokesMixedOrderPressureAdvDiffSourceFctPtsource_fct_for_pressure_adv_diff ()
 
NavierStokesMixedOrderPressureAdvDiffSourceFctPt 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)
 
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::TemplateFreeSpaceTimeNavierStokesMixedOrderEquationsBase
 TemplateFreeSpaceTimeNavierStokesMixedOrderEquationsBase ()
 Constructor (empty) More...
 
virtual ~TemplateFreeSpaceTimeNavierStokesMixedOrderEquationsBase ()
 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 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)
 
- Protected Member Functions inherited from oomph::SpaceTimeNavierStokesMixedOrderEquations< 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 void shape_u_nst (const Vector< double > &s, Shape &psi) const =0
 DRAIG: Fill in later... More...
 
virtual void dshape_local_u_nst (const Vector< double > &s, Shape &psi, DShape &dpsidx) const =0
 DRAIG: Fill in later... More...
 
virtual void dtest_local_u_nst (const Vector< double > &s, Shape &test, DShape &dtestdx) const =0
 DRAIG: Fill in later... More...
 
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)
 
- 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::SpaceTimeNavierStokesMixedOrderEquations< DIM >
typedef void(* NavierStokesMixedOrderBodyForceFctPt) (const double &time, const Vector< double > &x, Vector< double > &body_force)
 
typedef double(* NavierStokesMixedOrderSourceFctPt) (const double &time, const Vector< double > &x)
 Function pointer to source function fct(t,x) (x is a Vector!) More...
 
typedef double(* NavierStokesMixedOrderPressureAdvDiffSourceFctPt) (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::SpaceTimeNavierStokesMixedOrderEquations< 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::SpaceTimeNavierStokesMixedOrderEquations< DIM >
doubleViscosity_Ratio_pt
 
doubleDensity_Ratio_pt
 
doubleRe_pt
 Pointer to global Reynolds number. More...
 
doubleReSt_pt
 Pointer to global Reynolds number x Strouhal number (=Womersley) More...
 
bool ReynoldsStrouhal_is_stored_as_external_data
 
doubleReInvFr_pt
 
Vector< double > * G_pt
 Pointer to global gravity Vector. More...
 
NavierStokesMixedOrderBodyForceFctPt Body_force_fct_pt
 Pointer to body force function. More...
 
NavierStokesMixedOrderSourceFctPt Source_fct_pt
 Pointer to volumetric source function. More...
 
NavierStokesMixedOrderPressureAdvDiffSourceFctPt Press_adv_diff_source_fct_pt
 
bool ALE_is_disabled
 
Vector< FpPressureAdvDiffRobinBCMixedOrderSpaceTimeElementBase * > Pressure_advection_diffusion_robin_element_pt
 
int Pinned_fp_pressure_eqn
 
- 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::RefineableSpaceTimeNavierStokesMixedOrderEquations< DIM >

Refineable version of the Navier-Stokes equations.

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

Constructor & Destructor Documentation

◆ RefineableSpaceTimeNavierStokesMixedOrderEquations()

Constructor.

354  : SpaceTimeNavierStokesMixedOrderEquations<DIM>(),
357  {
358  }
ElementWithZ2ErrorEstimator()
Default empty constructor.
Definition: error_estimator.h:82
RefineableElement()
Definition: refineable_elements.h:188

Member Function Documentation

◆ dinterpolated_u_nst_ddata()

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesMixedOrderEquations< 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::SpaceTimeNavierStokesMixedOrderEquations< 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: mixed_order_petrov_galerkin_space_time_navier_stokes_elements.h:1115
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::SpaceTimeNavierStokesMixedOrderEquations< DIM >::u_index_nst().

◆ fill_in_generic_pressure_advection_diffusion_contribution_nst()

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesMixedOrderEquations< 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::SpaceTimeNavierStokesMixedOrderEquations< DIM >.

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

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesMixedOrderEquations< 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::SpaceTimeNavierStokesMixedOrderEquations< DIM >.

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

◆ further_build()

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

Further build, pass the pointers down to the sons.

Reimplemented from oomph::RefineableElement.

521  {
522  // Find the father element
524  DIM>* cast_father_element_pt =
525  dynamic_cast<RefineableSpaceTimeNavierStokesMixedOrderEquations<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->ReSt_pt = cast_father_element_pt->re_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_reynolds_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
RefineableSpaceTimeNavierStokesMixedOrderEquations()
Constructor.
Definition: refineable_mixed_order_petrov_galerkin_space_time_navier_stokes_elements.h:353
NavierStokesMixedOrderBodyForceFctPt Body_force_fct_pt
Pointer to body force function.
Definition: mixed_order_petrov_galerkin_space_time_navier_stokes_elements.h:534
double * ReSt_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
Definition: mixed_order_petrov_galerkin_space_time_navier_stokes_elements.h:520
double * Viscosity_Ratio_pt
Definition: mixed_order_petrov_galerkin_space_time_navier_stokes_elements.h:508
double * Re_pt
Pointer to global Reynolds number.
Definition: mixed_order_petrov_galerkin_space_time_navier_stokes_elements.h:517
double * ReInvFr_pt
Definition: mixed_order_petrov_galerkin_space_time_navier_stokes_elements.h:528
Vector< double > * G_pt
Pointer to global gravity Vector.
Definition: mixed_order_petrov_galerkin_space_time_navier_stokes_elements.h:531
NavierStokesMixedOrderSourceFctPt Source_fct_pt
Pointer to volumetric source function.
Definition: mixed_order_petrov_galerkin_space_time_navier_stokes_elements.h:537
double * Density_Ratio_pt
Definition: mixed_order_petrov_galerkin_space_time_navier_stokes_elements.h:512
void store_reynolds_strouhal_as_external_data(Data *reynolds_strouhal_data_pt)
Function that tells us whether the period is stored as external data.
Definition: mixed_order_petrov_galerkin_space_time_navier_stokes_elements.h:857

References oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::ALE_is_disabled, oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::Body_force_fct_pt, oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::Density_Ratio_pt, DIM, oomph::RefineableElement::father_element_pt(), oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::G_pt, oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::Re_pt, oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::ReInvFr_pt, oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::ReSt_pt, oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::ReynoldsStrouhal_is_stored_as_external_data, oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::Source_fct_pt, oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::store_reynolds_strouhal_as_external_data(), and oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::Viscosity_Ratio_pt.

◆ get_dresidual_dnodal_coordinates()

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesMixedOrderEquations< 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.

1297  {
1298  // Throw an error
1299  throw OomphLibError("Space-time version has not been implemented yet!",
1302  } // End of

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ get_pressure_and_velocity_mass_matrix_diagonal()

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesMixedOrderEquations< 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::SpaceTimeNavierStokesMixedOrderEquations< 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] =
115  this->pressure_node_pt(l)->is_hanging(p_index);
116  }
117  }
118  // Otherwise the pressure is not stored at a node and so cannot hang
119  else
120  {
121  // Loop over the pressures nodes
122  for (unsigned l = 0; l < n_pres; l++)
123  {
124  // Indicate that the pressure node is not hanging
125  pressure_dof_is_hanging[l] = false;
126  }
127  } // if (p_index>=0)
128 
129  // Number of integration points
130  unsigned n_intpt = integral_pt()->nweight();
131 
132  // Integer to store the local equations no
133  int local_eqn = 0;
134 
135  // Loop over the integration points
136  for (unsigned ipt = 0; ipt < n_intpt; ipt++)
137  {
138  // Get the integral weight
139  double w = integral_pt()->weight(ipt);
140 
141  // Get determinant of Jacobian of the mapping
142  double J = J_eulerian_at_knot(ipt);
143 
144  // Assign values of s
145  for (unsigned i = 0; i < DIM + 1; i++)
146  {
147  // Calculate the i-th local coordinate at the ipt-th integration point
148  s[i] = integral_pt()->knot(ipt, i);
149  }
150 
151  // Premultiply weights and Jacobian
152  double W = w * J;
153 
154  // Do we want the velocity one?
155  if ((which_one == 0) || (which_one == 2))
156  {
157  // Get the velocity shape functions
158  shape_at_knot(ipt, psi);
159 
160  // Loop over the velocity shape functions
161  for (unsigned l = 0; l < n_node; l++)
162  {
163  // Local boolean to indicate whether or not the node is hanging
164  bool is_node_hanging = node_pt(l)->is_hanging();
165 
166  // If the node is hanging
167  if (is_node_hanging)
168  {
169  // Get the HangInfo pointer from the node
170  hang_info_pt = node_pt(l)->hanging_pt();
171 
172  // Read out number of master nodes from hanging data
173  n_master = hang_info_pt->nmaster();
174  }
175  // Otherwise the node is its own master
176  else
177  {
178  // There is only one node to consider; the node itself
179  n_master = 1;
180  }
181 
182  // Loop over the master nodes
183  for (unsigned m = 0; m < n_master; m++)
184  {
185  // Loop over velocity components for equations
186  for (unsigned i = 0; i < DIM; i++)
187  {
188  // If the node is hanging
189  if (is_node_hanging)
190  {
191  // Get the equation number from the master node
192  local_eqn = this->local_hang_eqn(
193  hang_info_pt->master_node_pt(m), u_nodal_index[i]);
194 
195  // Get the hang weight from the master node
196  hang_weight = hang_info_pt->master_weight(m);
197  }
198  // If the node is not hanging
199  else
200  {
201  // Local equation number
202  local_eqn = this->nodal_local_eqn(l, u_nodal_index[i]);
203 
204  // Node contributes with full weight
205  hang_weight = 1.0;
206  }
207 
208  // If it's not a boundary condition
209  if (local_eqn >= 0)
210  {
211  // Add the contribution
212  veloc_mass_diag[local_eqn] += pow(psi[l] * hang_weight, 2) * W;
213  }
214  } // for (unsigned i=0;i<DIM;i++)
215  } // for (unsigned m=0;m<n_master;m++)
216  } // if ((which_one==0)||(which_one==2))
217  } // for (unsigned ipt=0;ipt<n_intpt;ipt++)
218 
219  // Do we want the pressure one?
220  if ((which_one == 0) || (which_one == 1))
221  {
222  // Get the pressure shape functions
223  this->pshape_nst(s, psi_p);
224 
225  // Loop over the pressure shape functions
226  for (unsigned l = 0; l < n_pres; l++)
227  {
228  // If the pressure dof is hanging
229  if (pressure_dof_is_hanging[l])
230  {
231  // Get the HangInfo object
232  hang_info_pt = this->pressure_node_pt(l)->hanging_pt(p_index);
233 
234  // Get the number of master nodes from the pressure node
235  n_master = hang_info_pt->nmaster();
236  }
237  // Otherwise the node is its own master
238  else
239  {
240  // There is only one node to consider; the node itself
241  n_master = 1;
242  }
243 
244  // Loop over the master nodes
245  for (unsigned m = 0; m < n_master; m++)
246  {
247  // If the pressure dof is hanging
248  if (pressure_dof_is_hanging[l])
249  {
250  // Get the local equation from the master node
251  local_eqn =
252  this->local_hang_eqn(hang_info_pt->master_node_pt(m), p_index);
253 
254  // Get the weight for the node
255  hang_weight = hang_info_pt->master_weight(m);
256  }
257  // If the pressure dof is not hanging
258  else
259  {
260  // Get the local equation number of this pressure dof
261  local_eqn = this->p_local_eqn(l);
262 
263  // Get the hang weight associated with this pressure node
264  hang_weight = 1.0;
265  }
266 
267  // If the equation is not pinned
268  if (local_eqn >= 0)
269  {
270  // Add the contribution
271  press_mass_diag[local_eqn] += pow(psi_p[l] * hang_weight, 2) * W;
272  }
273  } // for (unsigned m=0;m<n_master;m++)
274  } // for (unsigned l=0;l<n_pres;l++)
275  } // if ((which_one==0)||(which_one==1))
276  } // for (unsigned ipt=0;ipt<n_intpt;ipt++)
277  } // 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_Z2_flux()

template<unsigned DIM>
void oomph::RefineableSpaceTimeNavierStokesMixedOrderEquations< 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.

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

◆ num_Z2_flux_terms()

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

Number of 'flux' terms for Z2 error estimation.

Implements oomph::ElementWithZ2ErrorEstimator.

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

References DIM.

◆ pin_elemental_redundant_nodal_pressure_dofs()

template<unsigned DIM>
virtual void oomph::RefineableSpaceTimeNavierStokesMixedOrderEquations< 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::RefineableQTaylorHoodMixedOrderSpaceTimeElement< DIM >.

349 {}

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

◆ pin_redundant_nodal_pressures()

template<unsigned DIM>
static void oomph::RefineableSpaceTimeNavierStokesMixedOrderEquations< 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

  • RefineableSpaceTimeNavierStokesMixedOrderEquations:: 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.)

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

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

◆ pressure_node_pt()

template<unsigned DIM>
virtual Node* oomph::RefineableSpaceTimeNavierStokesMixedOrderEquations< 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::RefineableQTaylorHoodMixedOrderSpaceTimeElement< DIM >.

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

◆ unpin_all_pressure_dofs()

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

Unpin all pressure dofs in elements listed in vector.

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

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

◆ unpin_elemental_pressure_dofs()

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

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