27#ifndef OOMPH_REFINEABLE_SPHERICAL_NAVIER_STOKES_ELEMENTS_HEADER
28#define OOMPH_REFINEABLE_SPHERICAL_NAVIER_STOKES_ELEMENTS_HEADER
32#include <oomph-lib-config.h>
91 std::ostringstream error_message;
92 error_message <<
"The flux vector is too small, size " << flux.
size()
93 <<
", whereas it should be " <<
num_entries << std::endl;
107 for (
unsigned i = 0;
i <
DIM;
i++)
114 for (
unsigned i = 0;
i <
DIM;
i++)
116 for (
unsigned j =
i + 1;
j <
DIM;
j++)
127 return x[0] * x[0] *
sin(x[1]);
144 this->
Re_pt = cast_father_element_pt->
re_pt();
152 this->
G_pt = cast_father_element_pt->
g_pt();
322 values.resize(4, 0.0);
325 for (
unsigned i = 0;
i < 3;
i++)
346 for (
unsigned i = 0;
i < 4;
i++)
359 for (
unsigned i = 0;
i < 3;
i++)
437 for (
unsigned i = 0;
i < 2;
i++)
446 else if (
s[
i] == 1.0)
469 index[
i] *
static_cast<unsigned>(
pow(
static_cast<float>(
NNODE_1D),
470 static_cast<int>(
i)));
507 return this->
nnode();
538 :
public virtual FaceGeometry<QSphericalTaylorHoodElement>
550 :
public virtual FaceGeometry<FaceGeometry<QSphericalTaylorHoodElement>>
600 using namespace QuadTreeNames;
726 values.resize(3, 0.0);
729 for (
unsigned i = 0;
i < 3;
i++)
752 for (
unsigned i = 0;
i < 3;
i++)
765 for (
unsigned i = 0;
i < 3;
i++)
789 using namespace QuadTreeNames;
808 else if (son_type == SE)
814 else if (son_type == NE)
821 else if (son_type == NW)
857 :
public virtual FaceGeometry<QSphericalCrouzeixRaviartElement>
870 FaceGeometry<QSphericalCrouzeixRaviartElement>>
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...
FaceGeometry class definition: This policy class is used to allow construction of face elements that ...
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.
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
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.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
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 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 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.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
An OomphLibError object which should be thrown when an run-time error is encountered....
Crouzeix_Raviart elements are Navier–Stokes elements with quadratic interpolation for velocities and ...
unsigned npres_spherical_nst() const
Return number of pressure values.
unsigned P_spherical_nst_internal_index
Internal index that indicates at which internal data the pressure is stored.
Taylor–Hood elements are Navier–Stokes elements with quadratic interpolation for velocities and posit...
int p_nodal_index_spherical_nst() const
Set the value at which the pressure is stored in the nodes In this case the third index because there...
void pshape_spherical_nst(const Vector< double > &s, Shape &psi) const
Pressure shape functions at local coordinate s.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
unsigned npres_spherical_nst() const
Return number of pressure values.
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.
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...
QuadTree * quadtree_pt()
Pointer to quadtree representation of this element.
A class that is used to template the refineable Q elements by dimension. It's really nothing more tha...
Refineable version of Spherical Quad Crouzeix Raviart elements (note that unlike the cartesian versio...
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
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)....
RefineableQSphericalCrouzeixRaviartElement()
Constructor:
void further_setup_hanging_nodes()
Perform additional hanging node procedures for variables that are not interpolated by all nodes....
void unpin_elemental_pressure_dofs()
Unpin all the internal pressure freedoms.
void further_build()
Further build for Crouzeix_Raviart interpolates the internal pressure dofs from father element: Make ...
void rebuild_from_sons(Mesh *&mesh_pt)
Rebuild from sons: Reconstruct pressure from the (merged) sons.
unsigned nvertex_node() const
Number of vertex nodes in the element.
unsigned ncont_interpolated_values() const
Number of continuously interpolated values: 3 (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...
Refineable version of Spherical Quad Taylor Hood elements. (note that unlike the cartesian version th...
void pin_elemental_redundant_nodal_pressure_dofs()
Unpin the proper nodal pressure dofs.
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 further_setup_hanging_nodes()
Perform additional hanging node procedures for variables that are not interpolated by all nodes....
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 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 ...
void rebuild_from_sons(Mesh *&mesh_pt)
Rebuild from sons: empty.
unsigned ncont_interpolated_values() const
Number of continuously interpolated values: 4 (3 velocities + 1 pressure)
Node * pressure_node_pt(const unsigned &n_p)
Pointer to n_p-th pressure 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...
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...
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 nvertex_node() const
Number of vertex nodes in the element.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
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 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...
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
RefineableQSphericalTaylorHoodElement()
Constructor:
void unpin_elemental_pressure_dofs()
Unpin all pressure dofs.
unsigned required_nvalue(const unsigned &n) const
Number of values (pinned or dofs) required at node n.
Refineable version of the Spherical Navier–Stokes equations.
virtual void pin_elemental_redundant_nodal_pressure_dofs()
Pin unused nodal pressure dofs (empty by default, because by default pressure dofs are not associated...
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...
RefineableSphericalNavierStokesEquations()
Empty Constructor.
double geometric_jacobian(const Vector< double > &x)
Fill in the geometric Jacobian, which in this case is r*r*sin(theta)
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 num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
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 fill_in_generic_residual_contribution_spherical_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...
void further_build()
Further build: pass the pointers down to the 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.
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
A class for elements that solve the Navier–Stokes equations, in axisymmetric spherical polar coordina...
Vector< double > *& g_pt()
Pointer to Vector of gravitational components.
SphericalNavierStokesSourceFctPt Source_fct_pt
Pointer to volumetric source function.
double *& re_invro_pt()
Pointer to global inverse Froude number.
virtual unsigned u_index_spherical_nst(const unsigned &i) const
Return the index at which the i-th unknown velocity component is stored. The default value,...
double * Density_Ratio_pt
Pointer to the density ratio (relative to the density used in the definition of the Reynolds number)
double * ReSt_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
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)
double *& viscosity_ratio_pt()
Pointer to Viscosity Ratio.
double *& re_invfr_pt()
Pointer to global inverse Froude number.
Vector< double > * G_pt
Pointer to global gravity Vector.
double * ReInvRo_pt
Pointer to global Reynolds number x inverse Rossby number (used when in a rotating frame)
double * Re_pt
Pointer to global Reynolds number.
double * Viscosity_Ratio_pt
Pointer to the viscosity ratio (relative to the viscosity used in the definition of the Reynolds numb...
double *& re_st_pt()
Pointer to product of Reynolds and Strouhal number (=Womersley number)
SphericalNavierStokesSourceFctPt & source_fct_pt()
Access function for the source-function pointer.
double interpolated_p_spherical_nst(const Vector< double > &s) const
Return FE interpolated pressure at local coordinate s.
double *& re_pt()
Pointer to Reynolds number.
double * ReInvFr_pt
Pointer to global Reynolds number x inverse Froude number (= Bond number / Capillary number)
SphericalNavierStokesBodyForceFctPt & body_force_fct_pt()
Access function for the body-force pointer.
SphericalNavierStokesBodyForceFctPt Body_force_fct_pt
Pointer to body force function.
double *& density_ratio_pt()
Pointer to Density ratio.
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when time-derivatives are computed....
void interpolated_u_spherical_nst(const Vector< double > &s, Vector< double > &veloc) const
Compute vector of FE interpolated velocity u at local coordinate s.
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
int son_type() const
Return son type.
RefineableElement * object_pt() const
Return the pointer to the object (RefineableElement) represented by the tree.
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...
Tree * father_pt() const
Return pointer to father: NULL if it's a root node.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).