27 #ifndef OOMPH_REFINEABLE_SPHERICAL_NAVIER_STOKES_ELEMENTS_HEADER
28 #define OOMPH_REFINEABLE_SPHERICAL_NAVIER_STOKES_ELEMENTS_HEADER
32 #include <oomph-lib-config.h>
36 #include "../generic/refineable_quad_element.h"
37 #include "../generic/error_estimator.h"
89 if (
flux.size() < num_entries)
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++)
109 flux[icount] = strainrate(
i,
i);
114 for (
unsigned i = 0;
i <
DIM;
i++)
116 for (
unsigned j =
i + 1;
j <
DIM;
j++)
118 flux[icount] = strainrate(
i,
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();
179 unsigned n_element = element_pt.size();
180 for (
unsigned e = 0;
e < n_element;
e++)
193 unsigned n_element = element_pt.size();
194 for (
unsigned e = 0;
e < n_element;
e++)
234 unsigned n_node = this->
nnode();
237 for (
unsigned n = 0;
n < n_node;
n++)
247 unsigned n_node = this->
nnode();
250 for (
unsigned n = 0;
n < n_node;
n++)
257 for (
unsigned l = 0; l < n_pres; l++)
262 nod_pt->
unpin(p_index);
322 values.resize(4, 0.0);
325 for (
unsigned i = 0;
i < 3;
i++)
346 for (
unsigned i = 0;
i < 4;
i++)
352 unsigned n_node =
nnode();
359 for (
unsigned i = 0;
i < 3;
i++)
363 for (
unsigned l = 0; l < n_node; l++)
430 unsigned total_index = 0;
432 unsigned NNODE_1D = 2;
437 for (
unsigned i = 0;
i < 2;
i++)
446 else if (
s[
i] == 1.0)
448 index[
i] = NNODE_1D - 1;
454 double float_index = 0.5 * (1.0 +
s[
i]) * (NNODE_1D - 1);
455 index[
i] =
int(float_index);
458 double excess = float_index - index[
i];
469 index[
i] *
static_cast<unsigned>(
pow(
static_cast<float>(NNODE_1D),
470 static_cast<int>(
i)));
507 return this->
nnode();
515 const int& n_value)
const
523 return this->
shape(s, psi);
538 :
public virtual FaceGeometry<QSphericalTaylorHoodElement>
550 :
public virtual FaceGeometry<FaceGeometry<QSphericalTaylorHoodElement>>
575 for (
unsigned l = 0; l < n_pres; l++)
600 using namespace QuadTreeNames;
609 double av_press = 0.0;
612 for (
unsigned ison = 0; ison < 4; ison++)
726 values.resize(3, 0.0);
729 for (
unsigned i = 0;
i < 3;
i++)
752 for (
unsigned i = 0;
i < 3;
i++)
758 unsigned n_node =
nnode();
765 for (
unsigned i = 0;
i < 3;
i++)
769 for (
unsigned l = 0; l < n_node; l++)
789 using namespace QuadTreeNames;
808 else if (son_type ==
SE)
814 else if (son_type ==
NE)
821 else if (son_type ==
NW)
839 0.5 * cast_father_el_pt
845 0.5 * cast_father_el_pt
857 :
public virtual FaceGeometry<QSphericalCrouzeixRaviartElement>
870 FaceGeometry<QSphericalCrouzeixRaviartElement>>
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:385
void unpin(const unsigned &i)
Unpin the i-th stored variable.
Definition: nodes.h:391
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271
double value(const unsigned &i) const
Definition: nodes.h:293
Definition: error_estimator.h:79
FaceGeometry()
Definition: refineable_spherical_navier_stokes_elements.h:873
FaceGeometry()
Definition: refineable_spherical_navier_stokes_elements.h:553
FaceGeometry()
Definition: refineable_spherical_navier_stokes_elements.h:860
FaceGeometry()
Definition: refineable_spherical_navier_stokes_elements.h:541
Definition: elements.h:4998
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
double nodal_value(const unsigned &n, const unsigned &i) const
Definition: elements.h:2593
static const double Node_location_tolerance
Definition: elements.h:1374
virtual unsigned nvertex_node() const
Definition: elements.h:2491
virtual void shape(const Vector< double > &s, Shape &psi) const =0
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
virtual Node * get_node_at_local_coordinate(const Vector< double > &s) const
Definition: elements.cc:3882
virtual Node * vertex_node_pt(const unsigned &j) const
Definition: elements.h:2500
virtual unsigned nnode_1d() const
Definition: elements.h:2218
virtual double local_one_d_fraction_of_node(const unsigned &n1d, const unsigned &i)
Definition: elements.h:1858
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:622
bool is_hanging() const
Test whether the node is geometrically hanging.
Definition: nodes.h:1285
Definition: oomph_definitions.h:222
Definition: spherical_navier_stokes_elements.h:815
unsigned npres_spherical_nst() const
Return number of pressure values.
Definition: spherical_navier_stokes_elements.h:886
unsigned P_spherical_nst_internal_index
Definition: spherical_navier_stokes_elements.h:823
Definition: spherical_navier_stokes_elements.h:1092
int p_nodal_index_spherical_nst() const
Definition: spherical_navier_stokes_elements.h:1152
void pshape_spherical_nst(const Vector< double > &s, Shape &psi) const
Pressure shape functions at local coordinate s.
Definition: spherical_navier_stokes_elements.h:1301
static const unsigned Pconv[]
Definition: spherical_navier_stokes_elements.h:1100
unsigned npres_spherical_nst() const
Return number of pressure values.
Definition: spherical_navier_stokes_elements.h:1165
Definition: refineable_elements.h:97
virtual RefineableElement * father_element_pt() const
Return a pointer to the father element.
Definition: refineable_elements.h:539
QuadTree * quadtree_pt()
Pointer to quadtree representation of this element.
Definition: refineable_quad_element.h:152
void setup_hang_for_value(const int &value_id)
Definition: refineable_quad_element.cc:1506
Definition: Qelements.h:2259
Definition: refineable_spherical_navier_stokes_elements.h:568
unsigned nrecovery_order()
Definition: refineable_spherical_navier_stokes_elements.h:701
void get_interpolated_values(const unsigned &t, const Vector< double > &s, Vector< double > &values)
Definition: refineable_spherical_navier_stokes_elements.h:744
RefineableQSphericalCrouzeixRaviartElement()
Constructor:
Definition: refineable_spherical_navier_stokes_elements.h:583
void further_setup_hanging_nodes()
Definition: refineable_spherical_navier_stokes_elements.h:778
void unpin_elemental_pressure_dofs()
Unpin all the internal pressure freedoms.
Definition: refineable_spherical_navier_stokes_elements.h:571
void further_build()
Definition: refineable_spherical_navier_stokes_elements.h:784
void rebuild_from_sons(Mesh *&mesh_pt)
Rebuild from sons: Reconstruct pressure from the (merged) sons.
Definition: refineable_spherical_navier_stokes_elements.h:598
unsigned nvertex_node() const
Number of vertex nodes in the element.
Definition: refineable_spherical_navier_stokes_elements.h:707
unsigned ncont_interpolated_values() const
Number of continuously interpolated values: 3 (velocities)
Definition: refineable_spherical_navier_stokes_elements.h:592
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
Definition: refineable_spherical_navier_stokes_elements.h:713
void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Definition: refineable_spherical_navier_stokes_elements.h:722
Definition: refineable_spherical_navier_stokes_elements.h:223
Node * get_interpolating_node_at_local_coordinate(const Vector< double > &s, const int &n_value)
Definition: refineable_spherical_navier_stokes_elements.h:423
void pin_elemental_redundant_nodal_pressure_dofs()
Unpin the proper nodal pressure dofs.
Definition: refineable_spherical_navier_stokes_elements.h:244
void further_setup_hanging_nodes()
Definition: refineable_spherical_navier_stokes_elements.h:377
void get_interpolated_values(const unsigned &t, const Vector< double > &s, Vector< double > &values)
Definition: refineable_spherical_navier_stokes_elements.h:338
void interpolating_basis(const Vector< double > &s, Shape &psi, const int &n_value) const
Definition: refineable_spherical_navier_stokes_elements.h:513
Node * pressure_node_pt(const unsigned &n_p)
Pointer to n_p-th pressure node.
Definition: refineable_spherical_navier_stokes_elements.h:226
void rebuild_from_sons(Mesh *&mesh_pt)
Rebuild from sons: empty.
Definition: refineable_spherical_navier_stokes_elements.h:293
unsigned ncont_interpolated_values() const
Definition: refineable_spherical_navier_stokes_elements.h:287
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
Definition: refineable_spherical_navier_stokes_elements.h:309
unsigned ninterpolating_node(const int &n_value)
Definition: refineable_spherical_navier_stokes_elements.h:499
void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Definition: refineable_spherical_navier_stokes_elements.h:318
unsigned nvertex_node() const
Number of vertex nodes in the element.
Definition: refineable_spherical_navier_stokes_elements.h:303
Node * interpolating_node_pt(const unsigned &n, const int &n_value)
Definition: refineable_spherical_navier_stokes_elements.h:386
unsigned ninterpolating_node_1d(const int &n_value)
Definition: refineable_spherical_navier_stokes_elements.h:485
double local_one_d_fraction_of_interpolating_node(const unsigned &n1d, const unsigned &i, const int &n_value)
Definition: refineable_spherical_navier_stokes_elements.h:403
unsigned nrecovery_order()
Definition: refineable_spherical_navier_stokes_elements.h:297
RefineableQSphericalTaylorHoodElement()
Constructor:
Definition: refineable_spherical_navier_stokes_elements.h:269
void unpin_elemental_pressure_dofs()
Unpin all pressure dofs.
Definition: refineable_spherical_navier_stokes_elements.h:232
unsigned required_nvalue(const unsigned &n) const
Number of values (pinned or dofs) required at node n.
Definition: refineable_spherical_navier_stokes_elements.h:280
Refineable version of the Spherical Navier–Stokes equations.
Definition: refineable_spherical_navier_stokes_elements.h:49
virtual void pin_elemental_redundant_nodal_pressure_dofs()
Definition: refineable_spherical_navier_stokes_elements.h:63
RefineableSphericalNavierStokesEquations()
Empty Constructor.
Definition: refineable_spherical_navier_stokes_elements.h:67
virtual Node * pressure_node_pt(const unsigned &n_p)
Definition: refineable_spherical_navier_stokes_elements.h:53
double geometric_jacobian(const Vector< double > &x)
Fill in the geometric Jacobian, which in this case is r*r*sin(theta)
Definition: refineable_spherical_navier_stokes_elements.h:125
static void pin_redundant_nodal_pressures(const Vector< GeneralisedElement * > &element_pt)
Definition: refineable_spherical_navier_stokes_elements.h:174
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
Definition: refineable_spherical_navier_stokes_elements.h:75
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.
Definition: refineable_spherical_navier_stokes_elements.h:188
void fill_in_generic_residual_contribution_spherical_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Definition: refineable_spherical_navier_stokes_elements.cc:38
void further_build()
Further build: pass the pointers down to the sons.
Definition: refineable_spherical_navier_stokes_elements.h:132
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Definition: refineable_spherical_navier_stokes_elements.h:83
Definition: spherical_navier_stokes_elements.h:57
SphericalNavierStokesSourceFctPt & source_fct_pt()
Access function for the source-function pointer.
Definition: spherical_navier_stokes_elements.h:347
SphericalNavierStokesSourceFctPt Source_fct_pt
Pointer to volumetric source function.
Definition: spherical_navier_stokes_elements.h:119
virtual unsigned u_index_spherical_nst(const unsigned &i) const
Definition: spherical_navier_stokes_elements.h:387
double * Density_Ratio_pt
Definition: spherical_navier_stokes_elements.h:94
double * ReSt_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
Definition: spherical_navier_stokes_elements.h:102
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: spherical_navier_stokes_elements.cc:1197
double *& viscosity_ratio_pt()
Pointer to Viscosity Ratio.
Definition: spherical_navier_stokes_elements.h:280
double *& re_invfr_pt()
Pointer to global inverse Froude number.
Definition: spherical_navier_stokes_elements.h:305
Vector< double > * G_pt
Pointer to global gravity Vector.
Definition: spherical_navier_stokes_elements.h:113
double * ReInvRo_pt
Definition: spherical_navier_stokes_elements.h:110
double *& re_pt()
Pointer to Reynolds number.
Definition: spherical_navier_stokes_elements.h:261
double * Re_pt
Pointer to global Reynolds number.
Definition: spherical_navier_stokes_elements.h:99
double * Viscosity_Ratio_pt
Definition: spherical_navier_stokes_elements.h:90
double *& re_invro_pt()
Pointer to global inverse Froude number.
Definition: spherical_navier_stokes_elements.h:317
double interpolated_p_spherical_nst(const Vector< double > &s) const
Return FE interpolated pressure at local coordinate s.
Definition: spherical_navier_stokes_elements.h:780
double * ReInvFr_pt
Definition: spherical_navier_stokes_elements.h:106
SphericalNavierStokesBodyForceFctPt Body_force_fct_pt
Pointer to body force function.
Definition: spherical_navier_stokes_elements.h:116
double *& re_st_pt()
Pointer to product of Reynolds and Strouhal number (=Womersley number)
Definition: spherical_navier_stokes_elements.h:267
bool ALE_is_disabled
Definition: spherical_navier_stokes_elements.h:124
void interpolated_u_spherical_nst(const Vector< double > &s, Vector< double > &veloc) const
Compute vector of FE interpolated velocity u at local coordinate s.
Definition: spherical_navier_stokes_elements.h:702
Vector< double > *& g_pt()
Pointer to Vector of gravitational components.
Definition: spherical_navier_stokes_elements.h:329
SphericalNavierStokesBodyForceFctPt & body_force_fct_pt()
Access function for the body-force pointer.
Definition: spherical_navier_stokes_elements.h:335
double *& density_ratio_pt()
Pointer to Density ratio.
Definition: spherical_navier_stokes_elements.h:293
RefineableElement * object_pt() const
Definition: tree.h:88
Tree * father_pt() const
Return pointer to father: NULL if it's a root node.
Definition: tree.h:235
int son_type() const
Return son type.
Definition: tree.h:214
Tree * son_pt(const int &son_index) const
Definition: tree.h:103
RealScalar s
Definition: level1_cplx_impl.h:130
#define DIM
Definition: linearised_navier_stokes_elements.h:44
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625
squared absolute value
Definition: GlobalFunctions.h:87
void flux(const double &time, const Vector< double > &x, double &flux)
Get flux applied along boundary x=0.
Definition: pretend_melt.cc:59
@ SE
Definition: quadtree.h:57
@ NW
Definition: quadtree.h:58
@ NE
Definition: quadtree.h:59
@ SW
Definition: quadtree.h:56
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
list x
Definition: plotDoE.py:28
t
Definition: plotPSD.py:36
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2