31 #ifndef OOMPH_REFINEABLE_AXISYMMETRIC_NAVIER_STOKES_ELEMENTS_HEADER 32 #define OOMPH_REFINEABLE_AXISYMMETRIC_NAVIER_STOKES_ELEMENTS_HEADER 36 #include <oomph-lib-config.h> 40 #include "../generic/refineable_quad_element.h" 41 #include "../generic/error_estimator.h" 92 unsigned num_entries=DIM+((DIM*DIM)-DIM)/2;
93 if (flux.size() < num_entries)
95 std::ostringstream error_message;
96 error_message <<
"The flux vector has the wrong number of entries, " 97 << flux.size() <<
", whereas it should be " 98 << num_entries << std::endl;
101 OOMPH_CURRENT_FUNCTION,
102 OOMPH_EXCEPTION_LOCATION);
115 for(
unsigned i=0;
i<DIM;
i++)
117 flux[icount]=strainrate(
i,
i);
122 for(
unsigned i=0;
i<DIM;
i++)
124 for(
unsigned j=
i+1;j<DIM;j++)
126 flux[icount]=strainrate(
i,j);
149 this->
Re_pt = cast_father_element_pt->
re_pt();
157 this->
G_pt = cast_father_element_pt->
g_pt();
182 unsigned n_node = this->
nnode();
198 for(
unsigned l=0;l<n_node;l++)
200 unsigned n_master = 1;
209 n_master = hang_info_pt->
nmaster();
218 for(
unsigned m=0;m<n_master;m++)
234 if(global_eqn >= 0) {++n_u_dof;}
239 du_ddata.resize(n_u_dof,0.0);
240 global_eqn_number.resize(n_u_dof,0);
245 for(
unsigned l=0;l<n_node;l++)
247 unsigned n_master = 1;
248 double hang_weight = 1.0;
257 n_master = hang_info_pt->
nmaster();
266 for(
unsigned m=0;m<n_master;m++)
296 global_eqn_number[count] = global_eqn;
298 du_ddata[count] = psi[l]*hang_weight;
323 unsigned n_element=element_pt.size();
324 for(
unsigned e=0;
e<n_element;
e++)
337 unsigned n_element = element_pt.size();
338 for(
unsigned e=0;
e<n_element;
e++)
350 dresidual_dnodal_coordinates);
372 double*
const ¶meter_pt,
379 OOMPH_CURRENT_FUNCTION,
380 OOMPH_EXCEPTION_LOCATION);
391 "Not yet implemented\n",
392 OOMPH_CURRENT_FUNCTION,
393 OOMPH_EXCEPTION_LOCATION);
414 {
return this->
node_pt(this->Pconv[n_p]);}
419 unsigned n_node = this->
nnode();
422 for(
unsigned n=0;n<n_node;n++) {this->
node_pt(n)->
unpin(p_index);}
429 unsigned n_node = this->
nnode();
432 for(
unsigned n=0;n<n_node;n++) {this->
node_pt(n)->
pin(p_index);}
436 for(
unsigned l=0;l<n_pres;l++)
487 values.resize(DIM+1,0.0);
506 values.resize(DIM+1);
509 for(
unsigned i=0;
i<DIM+1;
i++) {values[
i]=0.0;}
512 unsigned n_node =
nnode();
519 for(
unsigned i=0;
i<DIM;
i++)
523 for(
unsigned l=0;l<n_node;l++)
540 this->setup_hang_for_value(DIM);
553 if(n_value==DIM) {
return this->
node_pt(this->Pconv[n]);}
555 else {
return this->
node_pt(n);}
586 if(n_value==static_cast<int>(DIM))
589 unsigned total_index=0;
591 unsigned NNODE_1D = 2;
596 for(
unsigned i=0;
i<2;
i++)
606 index[
i] = NNODE_1D-1;
612 double float_index = 0.5*(1.0 + s[
i])*(NNODE_1D-1);
613 index[
i] = int(float_index);
616 double excess = float_index - index[
i];
626 total_index += index[
i]*
627 static_cast<unsigned>(pow(static_cast<float>(NNODE_1D),
628 static_cast<int>(
i)));
631 return this->
node_pt(this->Pconv[total_index]);
646 if(n_value==DIM) {
return 2;}
655 if(n_value==DIM) {
return 4;}
656 else {
return this->
nnode();}
663 const int &n_value)
const 667 else {
return this->
shape(s,psi);}
682 public virtual FaceGeometry<AxisymmetricQTaylorHoodElement>
694 public virtual FaceGeometry<FaceGeometry<AxisymmetricQTaylorHoodElement> >
719 for(
unsigned l=0;l<n_pres;l++)
738 using namespace QuadTreeNames;
750 for (
unsigned ison=0;ison<4;ison++)
753 av_press += quadtree_pt()->son_pt(ison)->object_pt()->
769 double slope1= quadtree_pt()->son_pt(
SE)->object_pt()->
771 quadtree_pt()->son_pt(
SW)->object_pt()->
774 double slope2 = quadtree_pt()->son_pt(
NE)->object_pt()->
776 quadtree_pt()->son_pt(
NW)->object_pt()->
782 set_value(1,0.5*(slope1+slope2));
793 slope1 = quadtree_pt()->son_pt(
NE)->object_pt()->
795 quadtree_pt()->son_pt(
SE)->object_pt()->
798 slope2 = quadtree_pt()->son_pt(
NW)->object_pt()->
800 quadtree_pt()->son_pt(
SW)->object_pt()->
806 set_value(2,0.5*(slope1+slope2));
835 values.resize(DIM,0.0);
859 for(
unsigned i=0;
i<DIM;
i++) {values[
i]=0.0;}
862 unsigned n_node =
nnode();
869 for(
unsigned i=0;
i<DIM;
i++)
873 for(
unsigned l=0;l<n_node;l++)
893 using namespace QuadTreeNames;
896 int son_type=quadtree_pt()->son_type();
900 quadtree_pt()->father_pt()->object_pt();
913 else if (son_type==
SE)
919 else if (son_type==
NE)
926 else if (son_type==
NW)
943 set_value(1,0.5*cast_father_el_pt
948 set_value(2,0.5*cast_father_el_pt
962 public virtual FaceGeometry<AxisymmetricQCrouzeixRaviartElement>
975 public virtual FaceGeometry<FaceGeometry<AxisymmetricQCrouzeixRaviartElement> >
virtual void pshape_axi_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
unsigned ncont_interpolated_values() const
Number of continuously interpolated values: 3 (velocities)
double *& re_invro_pt()
Pointer to global inverse Froude number.
void unpin(const unsigned &i)
Unpin the i-th stored variable.
double value(const unsigned &i) const
Return i-th stored value. This function is not virtual so that it can be inlined. This means that if ...
double *& re_invfr_pt()
Pointer to global inverse Froude number.
Node * interpolating_node_pt(const unsigned &n, const int &n_value)
The velocities are isoparametric and so the "nodes" interpolating the velocities are the geometric no...
void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Get the function value u in Vector. Note: Given the generality of the interface (this function is usu...
Base class for finite elements that can compute the quantities that are required for the Z2 error est...
void(*&)(const double &time, const Vector< double > &x, Vector< double > &f) axi_nst_body_force_fct_pt()
Access function for the body-force pointer.
static void pin_redundant_nodal_pressures(const Vector< GeneralisedElement *> &element_pt)
Loop over all elements in Vector (which typically contains all the elements in a fluid mesh) and pin ...
unsigned nvertex_node() const
Number of vertex nodes in the element.
virtual RefineableElement * father_element_pt() const
Return a pointer to the father element.
void fill_in_generic_dresidual_contribution_axi_nst(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam, unsigned flag)
Add element's contribution to the derivative of the elemental residual vector and/or Jacobian matrix ...
RefineableAxisymmetricQTaylorHoodElement()
Constructor:
void further_build()
Further build: pass the pointers down to the sons.
virtual Node * get_node_at_local_coordinate(const Vector< double > &s) const
If there is a node at this local coordinate, return the pointer to the node.
Node * get_interpolating_node_at_local_coordinate(const Vector< double > &s, const int &n_value)
The velocity nodes are the same as the geometric nodes. The pressure nodes must be calculated by usin...
static void unpin_all_pressure_dofs(const Vector< GeneralisedElement *> &element_pt)
Unpin all pressure dofs in elements listed in vector.
unsigned nvertex_node() const
Number of vertex nodes in the element.
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
RefineableAxisymmetricQCrouzeixRaviartElement()
Constructor:
Node * pressure_node_pt(const unsigned &n_p)
Pointer to n_p-th pressure node.
unsigned required_nvalue(const unsigned &n) const
Number of values (pinned or dofs) required at node n.
void unpin_elemental_pressure_dofs()
Unpin all the internal pressure freedoms.
void fill_in_contribution_to_hessian_vector_products(Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
Compute the hessian tensor vector products required to perform continuation of bifurcations analytica...
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when the time-derivatives are computed...
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
unsigned nmaster() const
Return the number of master nodes.
void strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Strain-rate tensor: where (in that order)
bool is_hanging() const
Test whether the node is geometrically hanging.
long & eqn_number(const unsigned &i)
Return the equation number of the i-th stored variable.
double(* Source_fct_pt)(const double &time, const Vector< double > &x)
Pointer to volumetric source function.
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
virtual Node * pressure_node_pt(const unsigned &n_p)
Pointer to n_p-th pressure node (Default: NULL, indicating that pressure is not based on nodal interp...
double * Viscosity_Ratio_pt
Pointer to the viscosity ratio (relative to the viscosity used in the definition of the Reynolds numb...
void pin(const unsigned &i)
Pin the i-th stored variable.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
double * ReInvRo_pt
Pointer to global Reynolds number x inverse Rossby number (used when in a rotating frame) ...
Vector< double > *& g_pt()
Pointer to Vector of gravitational components.
unsigned ninterpolating_node_1d(const int &n_value)
The number of 1d pressure nodes is 2, the number of 1d velocity nodes is the same as the number of 1d...
double *& re_st_pt()
Pointer to product of Reynolds and Strouhal number (=Womersley number)
void(* Body_force_fct_pt)(const double &time, const Vector< double > &x, Vector< double > &result)
Pointer to body force function.
virtual unsigned u_index_axi_nst(const unsigned &i) const
Return the index at which the i-th unknown velocity component.
virtual void get_dresidual_dnodal_coordinates(RankThreeTensor< double > &dresidual_dnodal_coordinates)
Compute derivatives of elemental residual vector with respect to nodal coordinates. This function computes these terms analytically and overwrites the default implementation in the FiniteElement base class. dresidual_dnodal_coordinates(l,i,j) = d res(l) / dX_{ij}.
double geometric_jacobian(const Vector< double > &x)
Fill in the geometric Jacobian, which in this case is r.
virtual unsigned npres_axi_nst() const =0
Function to return number of pressure degrees of freedom.
virtual void pin_elemental_redundant_nodal_pressure_dofs()
Pin unused nodal pressure dofs (empty by default, because.
virtual unsigned nvertex_node() const
double * Re_pt
Pointer to global Reynolds number.
void set_value(const unsigned &i, const double &value_)
Set the i-th stored data value to specified value. The only reason that we require an explicit set fu...
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number...
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
RefineableAxisymmetricNavierStokesEquations()
Empty Constructor.
void rebuild_from_sons(Mesh *&mesh_pt)
Rebuild from sons: Reconstruct pressure from the (merged) sons.
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain rate tensor. ...
double(*&)(const double &time, const Vector< double > &x) source_fct_pt()
Access function for the source-function pointer.
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
static const double Node_location_tolerance
Default value for the tolerance to be used when locating nodes via local coordinates.
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
Class that contains data for hanging nodes.
void unpin_elemental_pressure_dofs()
Unpin all pressure dofs.
void interpolated_u_axi_nst(const Vector< double > &s, Vector< double > &veloc) const
Compute vector of FE interpolated velocity u at local coordinate s.
double *& density_ratio_pt()
Pointer to Density ratio.
double *& viscosity_ratio_pt()
Pointer to Viscosity Ratio.
double *& re_pt()
Pointer to Reynolds number.
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overloa...
double * ReInvFr_pt
Pointer to global Reynolds number x inverse Froude number (= Bond number / Capillary number) ...
virtual void unpin_elemental_pressure_dofs()=0
Unpin all pressure dofs in the element.
Refineable version of the Axisymmetric Navier–Stokes equations.
void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Get the function value u in Vector. Note: Given the generality of the interface (this function is usu...
double interpolated_p_axi_nst(const Vector< double > &s) const
Return FE interpolated pressure at local coordinate s.
void further_setup_hanging_nodes()
Perform additional hanging node procedures for variables that are not interpolated by all nodes...
void interpolating_basis(const Vector< double > &s, Shape &psi, const int &n_value) const
The basis interpolating the pressure is given by pshape(). / The basis interpolating the velocity is ...
virtual Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element. Broken virtual function in "pure" finite elements...
Vector< double > * G_pt
Pointer to global gravity Vector.
double * ReSt_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
void further_setup_hanging_nodes()
Perform additional hanging node procedures for variables that are not interpolated by all nodes...
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
unsigned ncont_interpolated_values() const
Number of continuously interpolated values: 4 (3 velocities + 1 pressure)
void get_interpolated_values(const unsigned &t, const Vector< double > &s, Vector< double > &values)
Get the function value u in Vector. Note: Given the generality of the interface (this function is usu...
void rebuild_from_sons(Mesh *&mesh_pt)
Rebuild from sons: empty.
unsigned ninterpolating_node(const int &n_value)
The number of pressure nodes is 4. The number of velocity nodes is the same as the number of geometri...
virtual double local_one_d_fraction_of_node(const unsigned &n1d, const unsigned &i)
Get the local fraction of any node in the n-th position in a one dimensional expansion along the i-th...
virtual int p_nodal_index_axi_nst() const
Which nodal value represents the pressure?
unsigned nnode() const
Return the number of nodes.
void get_interpolated_values(const unsigned &t, const Vector< double > &s, Vector< double > &values)
Get all function values [u,v..,p] at previous timestep t (t=0: present; t>0: previous timestep)...
void fill_in_generic_residual_contribution_axi_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Add element's contribution to the elemental residual vector and/or Jacobian matrix and mass matrix fl...
double local_one_d_fraction_of_interpolating_node(const unsigned &n1d, const unsigned &i, const int &n_value)
The pressure nodes are the corner nodes, so when n_value==DIM, the fraction is the same as the 1d nod...
virtual void shape(const Vector< double > &s, Shape &psi) const =0
Calculate the geometric shape functions at local coordinate s. This function must be overloaded for e...
void dinterpolated_u_axi_nst_ddata(const Vector< double > &s, const unsigned &i, Vector< double > &du_ddata, Vector< unsigned > &global_eqn_number)
Compute the derivatives of the i-th component of velocity at point s with respect to all data that ca...
double * Density_Ratio_pt
Pointer to the density ratio (relative to the density used in the definition of the Reynolds number) ...
void pin_elemental_redundant_nodal_pressure_dofs()
Unpin the proper nodal pressure dofs.