28 #ifndef OOMPH_REFINEABLE_LINEARISED_AXISYM_NAVIER_STOKES_ELEMENTS_HEADER
29 #define OOMPH_REFINEABLE_LINEARISED_AXISYM_NAVIER_STOKES_ELEMENTS_HEADER
33 #include <oomph-lib-config.h>
37 #include "../generic/refineable_quad_element.h"
38 #include "../generic/error_estimator.h"
91 unsigned num_entries = DIM + ((DIM * DIM) - DIM) / 2;
92 if (flux.size() != num_entries)
94 std::ostringstream error_message;
95 error_message <<
"The flux vector has the wrong number of entries, "
96 << flux.size() <<
", whereas it should be " << num_entries
99 "RefineableLinearisedAxisymmetricNavierStokesEquati"
100 "ons::get_Z2_flux()",
101 OOMPH_EXCEPTION_LOCATION);
113 for (
unsigned i = 0;
i < DIM;
i++)
115 flux[icount] = strainrate(
i,
i);
120 for (
unsigned i = 0;
i < DIM;
i++)
122 for (
unsigned j =
i + 1; j < DIM; j++)
124 flux[icount] = strainrate(
i, j);
141 cast_father_element_pt =
152 this->
Re_pt = cast_father_element_pt->
re_pt();
180 const unsigned n_element = element_pt.size();
181 for (
unsigned e = 0;
e < n_element;
e++)
195 const unsigned n_element = element_pt.size();
196 for (
unsigned e = 0;
e < n_element;
e++)
239 for (
unsigned l = 0; l < n_pres; l++)
242 for (
unsigned i = 0;
i < 2;
i++)
269 using namespace QuadTreeNames;
281 for (
unsigned ison = 0; ison < 4; ison++)
284 for (
unsigned i = 0;
i < 2;
i++)
297 for (
unsigned i = 0;
i < 2;
i++)
306 for (
unsigned i = 0;
i < 2;
i++)
405 const unsigned DIM = 3;
408 const unsigned n_values = 2 * DIM;
411 values.resize(n_values, 0.0);
414 for (
unsigned i = 0;
i < n_values;
i++)
433 const unsigned DIM = 3;
436 values.resize(2 * DIM);
439 for (
unsigned i = 0;
i < 2 * DIM;
i++)
445 const unsigned n_node =
nnode();
452 for (
unsigned i = 0;
i < (2 * DIM);
i++)
456 for (
unsigned l = 0; l < n_node; l++)
476 using namespace QuadTreeNames;
495 else if (son_type ==
SE)
501 else if (son_type ==
NE)
508 else if (son_type ==
NW)
519 cast_father_el_pt =
dynamic_cast<
527 for (
unsigned i = 0;
i < 2;
i++)
541 0.5 * cast_father_el_pt
548 0.5 * cast_father_el_pt
568 :
public virtual FaceGeometry<LinearisedAxisymmetricQCrouzeixRaviartElement>
586 FaceGeometry<LinearisedAxisymmetricQCrouzeixRaviartElement>>
615 return this->
node_pt(this->Pconv[n_p]);
622 const unsigned n_node = this->
nnode();
626 for (
unsigned i = 0;
i < 2;
i++)
632 for (
unsigned n = 0; n < n_node; n++)
634 for (
unsigned i = 0;
i < 2;
i++)
645 const unsigned n_node = this->
nnode();
649 for (
unsigned i = 0;
i < 2;
i++)
655 for (
unsigned n = 0; n < n_node; n++)
657 for (
unsigned i = 0;
i < 2;
i++)
665 for (
unsigned l = 0; l < n_pres; l++)
668 for (
unsigned i = 0;
i < 2;
i++)
672 nod_pt->
unpin(p_index[
i]);
733 const unsigned DIM = 3;
737 const unsigned n_values = 2 * (DIM + 1);
740 values.resize(n_values, 0.0);
743 for (
unsigned i = 0;
i < (2 * DIM);
i++)
749 for (
unsigned i = 0;
i < 2;
i++)
764 const unsigned DIM = 3;
767 values.resize(2 * (DIM + 1));
770 for (
unsigned i = 0;
i < 2 * (DIM + 1);
i++)
776 const unsigned n_node =
nnode();
783 for (
unsigned i = 0;
i < (2 * DIM);
i++)
787 for (
unsigned l = 0; l < n_node; l++)
795 for (
unsigned i = 0;
i < 2;
i++)
806 const unsigned DIM = 3;
807 for (
unsigned i = 0;
i < 2;
i++)
823 if (n_value == (2 * DIM) || n_value == ((2 * DIM) + 1))
825 return this->
node_pt(this->Pconv[n]);
842 if (n_value == (2 * DIM) || n_value == ((2 * DIM) + 1))
864 if (n_value ==
static_cast<int>(2 * DIM) ||
865 n_value ==
static_cast<int>((2 * DIM) + 1))
868 unsigned total_index = 0;
870 const unsigned NNODE_1D = 2;
875 for (
unsigned i = 0;
i < 2;
i++)
885 else if (
s[
i] == 1.0)
887 index[
i] = NNODE_1D - 1;
894 double float_index = 0.5 * (1.0 +
s[
i]) * (NNODE_1D - 1);
895 index[
i] = int(float_index);
898 double excess = float_index - index[
i];
909 index[
i] *
static_cast<unsigned>(pow(
static_cast<float>(NNODE_1D),
910 static_cast<int>(
i)));
913 return this->
node_pt(this->Pconv[total_index]);
928 if (n_value == (2 * DIM) || n_value == ((2 * DIM) + 1))
943 if (n_value == (2 * DIM) || n_value == ((2 * DIM) + 1))
949 return this->
nnode();
957 const int& n_value)
const
960 if (n_value == (2 * DIM) || n_value == ((2 * DIM) + 1))
966 return this->
shape(s, psi);
984 :
public virtual FaceGeometry<LinearisedAxisymmetricQTaylorHoodElement>
999 FaceGeometry<LinearisedAxisymmetricQTaylorHoodElement>>
void pin(const unsigned &i)
Pin the i-th stored variable.
void unpin(const unsigned &i)
Unpin the i-th stored variable.
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...
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 ...
Base class for finite elements that can compute the quantities that are required for the Z2 error est...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
virtual 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.
virtual unsigned nvertex_node() const
Return the number of vertex nodes in this element. Broken virtual function in "pure" finite elements.
static const double Node_location_tolerance
Default value for the tolerance to be used when locating nodes via local coordinates.
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...
unsigned nnode() const
Return the number of nodes.
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.
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overload...
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...
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
A class for elements that solve the linearised version of the unsteady Navier–Stokes equations in cyl...
int *& azimuthal_mode_number_pt()
Pointer to azimuthal mode number k in e^ik(theta) decomposition.
double *& density_ratio_pt()
Pointer to the density ratio.
double *& re_pt()
Pointer to Reynolds number.
double * Density_Ratio_pt
Pointer to the density ratio (relative to the density used in the definition of the Reynolds number)
int * Azimuthal_Mode_Number_pt
Pointer to azimuthal mode number k in e^ik(theta) decomposition.
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when the time-derivatives are computed....
double *& re_st_pt()
Pointer to product of Reynolds and Strouhal number (=Womersley number)
double * ReSt_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
double interpolated_u_linearised_axi_nst(const Vector< double > &s, const unsigned &i) const
Return the i-th component of the FE interpolated velocity u[i] at local coordinate s.
double * Re_pt
Pointer to global Reynolds number.
double *& viscosity_ratio_pt()
Pointer to the viscosity ratio.
double interpolated_p_linearised_axi_nst(const Vector< double > &s, const unsigned &i) const
Return the i-th component of the FE interpolated pressure p[i] at local coordinate s.
double * Viscosity_Ratio_pt
Pointer to the viscosity ratio (relative to the viscosity used in the definition of the Reynolds numb...
virtual unsigned u_index_linearised_axi_nst(const unsigned &i) const
Return the index at which the i-th unknown velocity component is stored. The default value,...
virtual int p_index_linearised_axi_nst(const unsigned &i) const
Which nodal value represents the pressure?
void strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Strain-rate tensor: where (in that order)
/////////////////////////////////////////////////////////////////////////// /////////////////////////...
Vector< unsigned > P_linearised_axi_nst_internal_index
Internal indices that indicate at which internal data the pressure values are stored....
void pshape_linearised_axi_nst(const Vector< double > &s, Shape &psi) const
Compute the pressure shape functions at local coordinate s.
unsigned npres_linearised_axi_nst() const
Return number of pressure values corresponding to a single pressure component.
/////////////////////////////////////////////////////////////////////////// /////////////////////////...
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
bool is_hanging() const
Test whether the node is geometrically hanging.
An OomphLibError object which should be thrown when an run-time error is encountered....
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
virtual RefineableElement * father_element_pt() const
Return a pointer to the father element.
Refineable version of the linearised axisymmetric Navier–Stokes equations.
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...
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
RefineableLinearisedAxisymmetricNavierStokesEquations()
Empty Constructor.
void fill_in_generic_residual_contribution_linearised_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 flag=1: compute bo...
double geometric_jacobian(const Vector< double > &x)
Fill in the geometric Jacobian, which in this case is r.
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 ...
virtual void unpin_elemental_pressure_dofs()=0
Unpin all pressure dofs in the element.
static void unpin_all_pressure_dofs(const Vector< GeneralisedElement * > &element_pt)
Unpin all pressure dofs in elements listed in Vector.
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain rate tensor.
virtual void pin_elemental_redundant_nodal_pressure_dofs()
Pin unused nodal pressure dofs (empty by default, because by default pressure dofs are not associated...
void further_build()
Further build: pass the pointers down to the sons.
/////////////////////////////////////////////////////////////////////////// /////////////////////////...
void further_build()
Further build for Crouzeix_Raviart interpolates the internal pressure dofs from father element: Make ...
RefineableLinearisedAxisymmetricQCrouzeixRaviartElement()
Constructor.
void get_interpolated_values(const unsigned &t, const Vector< double > &s, Vector< double > &values)
Get all function values [U^C,U^S,...,P^S] at previous timestep t (t=0: present; t>0: previous timeste...
unsigned nvertex_node() const
Number of vertex nodes in the element.
void unpin_elemental_pressure_dofs()
Unpin all the internal pressure freedoms.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
void further_setup_hanging_nodes()
Perform additional hanging node procedures for variables that are not interpolated by all nodes....
void rebuild_from_sons(Mesh *&mesh_pt)
Rebuild from sons: Reconstruct pressure from the (merged) sons.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
unsigned ncont_interpolated_values() const
Number of continuously interpolated values: 6 (velocities)
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...
/////////////////////////////////////////////////////////////////////////// /////////////////////////...
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...
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
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 ...
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 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 further_setup_hanging_nodes()
Perform additional hanging node procedures for variables that are not interpolated by all nodes....
unsigned required_nvalue(const unsigned &n) const
Number of values (pinned or dofs) required at node n. Bumped up to 8 so we don't have to worry if a h...
Node * pressure_node_pt(const unsigned &n_p)
Pointer to n_p-th pressure node.
void unpin_elemental_pressure_dofs()
Unpin all pressure dofs.
void rebuild_from_sons(Mesh *&mesh_pt)
Rebuild from sons: empty.
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...
unsigned ncont_interpolated_values() const
Number of continuously interpolated values: 8 (6 velocities + 2 pressures)
unsigned nvertex_node() const
Number of vertex nodes in the element.
void pin_elemental_redundant_nodal_pressure_dofs()
Unpin the proper nodal pressure dofs.
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...
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...
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==6 or 7, the fraction is the same as the 1d ...
RefineableLinearisedAxisymmetricQTaylorHoodElement()
Constructor:
QuadTree * quadtree_pt()
Pointer to quadtree representation of this element.
void setup_hang_for_value(const int &value_id)
Internal helper function that is used to construct the hanging node schemes for the value_id-th inter...
A class that is used to template the refineable Q elements by dimension. It's really nothing more tha...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
RefineableElement * object_pt() const
Return the pointer to the object (RefineableElement) represented by the tree.
Tree * father_pt() const
Return pointer to father: NULL if it's a root node.
int son_type() const
Return son type.
Tree * son_pt(const int &son_index) const
Return pointer to the son for a given index. Note that to aid code readability specific enums have be...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...