32 #ifndef OOMPH_REFINEABLE_NAVIER_STOKES_ELEMENTS_HEADER 33 #define OOMPH_REFINEABLE_NAVIER_STOKES_ELEMENTS_HEADER 37 #include <oomph-lib-config.h> 41 #include "../generic/refineable_quad_element.h" 42 #include "../generic/refineable_brick_element.h" 43 #include "../generic/hp_refineable_elements.h" 44 #include "../generic/error_estimator.h" 63 template <
class ELEMENT>
102 template<
class ELEMENT>
110 HangInfo *hang_info_pt=0, *hang_info2_pt=0;
113 unsigned my_dim=this->
dim();
134 unsigned n_pres = bulk_el_pt->npres_nst();
139 int p_index = bulk_el_pt->p_nodal_index_nst();
143 bool pressure_dof_is_hanging[n_pres];
148 for(
unsigned l=0;l<n_pres;++l)
150 pressure_dof_is_hanging[l] =
151 bulk_el_pt->pressure_node_pt(l)->is_hanging(p_index);
159 "Pressure advection diffusion does not work in this case\n",
160 OOMPH_CURRENT_FUNCTION,
161 OOMPH_EXCEPTION_LOCATION);
163 for(
unsigned l=0;l<n_pres;++l)
164 {pressure_dof_is_hanging[l] =
false;}
168 double re = bulk_el_pt->re();
171 Shape psip(n_pres), testp(n_pres);
174 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
189 bulk_el_pt->interpolated_u_nst(s_bulk,veloc);
193 for (
unsigned i=0;
i<my_dim+1;
i++)
195 flux+=veloc[
i]*unit_normal[
i];
199 if (flux>0.0) flux=0.0;
202 double interpolated_press=bulk_el_pt->interpolated_p_nst(s_bulk);
205 bulk_el_pt->pshape_nst(s_bulk,psip,testp);
215 unsigned n_master=1;
double hang_weight=1.0;
218 for(
unsigned l=0;l<n_pres;l++)
221 if(pressure_dof_is_hanging[l])
225 hang_info_pt = bulk_el_pt->pressure_node_pt(l)->hanging_pt(p_index);
228 n_master = hang_info_pt->
nmaster();
237 for(
unsigned m=0;m<n_master;m++)
241 if(pressure_dof_is_hanging[l])
252 local_eqn = bulk_el_pt->p_local_eqn(l);
259 residuals[local_eqn] -=
260 re*flux*interpolated_press*testp[l]*W*hang_weight;
266 unsigned n_master2=1;
double hang_weight2=1.0;
269 for(
unsigned l2=0;l2<n_pres;l2++)
272 if(pressure_dof_is_hanging[l2])
275 bulk_el_pt->pressure_node_pt(l2)->hanging_pt(p_index);
278 n_master2 = hang_info2_pt->nmaster();
287 for(
unsigned m2=0;m2<n_master2;m2++)
291 if(pressure_dof_is_hanging[l2])
295 bulk_el_pt->local_hang_eqn(
296 hang_info2_pt->master_node_pt(m2),
299 hang_weight2 = hang_info2_pt->master_weight(m2);
303 local_unknown = bulk_el_pt->p_local_eqn(l2);
308 if(local_unknown >= 0)
310 jacobian(local_eqn,local_unknown)-=
311 re*flux*psip[l2]*testp[l]*W*hang_weight*hang_weight2;
339 template<
unsigned DIM>
348 virtual void unpin_elemental_pressure_dofs()=0;
378 unsigned n_element = element_pt.size();
379 for(
unsigned e=0;
e<n_element;
e++)
382 pin_elemental_redundant_nodal_pressure_dofs();
391 unsigned n_element = element_pt.size();
392 for(
unsigned e=0;
e<n_element;
e++)
395 unpin_elemental_pressure_dofs();
407 void get_pressure_and_velocity_mass_matrix_diagonal(
409 const unsigned& which_one=0);
416 return DIM + (DIM*(DIM-1))/2;
424 unsigned num_entries=DIM+(DIM*(DIM-1))/2;
425 if (flux.size() < num_entries)
427 std::ostringstream error_message;
428 error_message <<
"The flux vector has the wrong number of entries, " 429 << flux.size() <<
", whereas it should be at least " 430 << num_entries << std::endl;
432 OOMPH_CURRENT_FUNCTION,
433 OOMPH_EXCEPTION_LOCATION);
439 this->strain_rate(s,strainrate);
445 for(
unsigned i=0;
i<DIM;
i++)
447 flux[icount]=strainrate(
i,
i);
452 for(
unsigned i=0;
i<DIM;
i++)
454 for(
unsigned j=
i+1;j<DIM;j++)
456 flux[icount]=strainrate(
i,j);
468 (this->father_element_pt());
475 this->Re_pt = cast_father_element_pt->
re_pt();
477 this->ReSt_pt = cast_father_element_pt->
re_st_pt();
479 this->ReInvFr_pt = cast_father_element_pt->
re_invfr_pt();
481 this->G_pt = cast_father_element_pt->
g_pt();
506 unsigned n_node = this->
nnode();
513 const unsigned u_nodal_index = this->u_index_nst(i);
522 for(
unsigned l=0;l<n_node;l++)
524 unsigned n_master = 1;
533 n_master = hang_info_pt->
nmaster();
542 for(
unsigned m=0;m<n_master;m++)
558 if(global_eqn >= 0) {++n_u_dof;}
563 du_ddata.resize(n_u_dof,0.0);
564 global_eqn_number.resize(n_u_dof,0);
569 for(
unsigned l=0;l<n_node;l++)
571 unsigned n_master = 1;
572 double hang_weight = 1.0;
581 n_master = hang_info_pt->
nmaster();
590 for(
unsigned m=0;m<n_master;m++)
620 global_eqn_number[count] = global_eqn;
622 du_ddata[count] = psi[l]*hang_weight;
639 void fill_in_generic_residual_contribution_nst(
648 void fill_in_generic_pressure_advection_diffusion_contribution_nst(
657 dresidual_dnodal_coordinates);
666 template<
unsigned DIM>
678 int p_index = this->p_nodal_index_nst();
679 unsigned n_node = this->
nnode();
681 for(
unsigned n=0;n<n_node;n++)
689 int p_index = this->p_nodal_index_nst();
691 unsigned n_node = this->
nnode();
693 for(
unsigned n=0;n<n_node;n++) {this->
node_pt(n)->
pin(p_index);}
696 unsigned n_pres = this->npres_nst();
697 for(
unsigned l=0;l<n_pres;l++)
699 Node* nod_pt = this->pressure_node_pt(l);
743 values.resize(DIM+1,0.0);
746 for(
unsigned i=0;
i<DIM;
i++) {values[
i] = this->interpolated_u_nst(s,
i);}
749 values[DIM] = this->interpolated_p_nst(s);
760 values.resize(DIM+1);
763 for(
unsigned i=0;
i<DIM+1;
i++) {values[
i]=0.0;}
766 unsigned n_node = this->
nnode();
773 for(
unsigned i=0;
i<DIM;
i++)
776 unsigned u_nodal_index = this->u_index_nst(
i);
777 for(
unsigned l=0;l<n_node;l++)
779 values[
i] += this->
nodal_value(t,l,u_nodal_index)*psif[l];
785 values[DIM] = this->interpolated_p_nst(s);
794 this->setup_hang_for_value(this->p_nodal_index_nst());
799 {
return this->
node_pt(this->Pconv[n_p]);}
810 if(value_id==DIM) {
return this->pressure_node_pt(n);}
812 else {
return this->
node_pt(n);}
844 unsigned total_index=0;
846 unsigned NNODE_1D = 2;
850 for(
unsigned i=0;
i<DIM;
i++)
860 index[
i] = NNODE_1D-1;
866 double float_index = 0.5*(1.0 + s[
i])*(NNODE_1D-1);
867 index[
i] = int(float_index);
870 double excess = float_index - index[
i];
880 total_index += index[
i]*
881 static_cast<unsigned>(pow(static_cast<float>(NNODE_1D),
882 static_cast<int>(
i)));
885 return this->pressure_node_pt(total_index);
899 if(value_id==DIM) {
return 2;}
908 {
return static_cast<unsigned>(pow(2.0,static_cast<int>(DIM)));}
909 else {
return this->
nnode();}
916 const int &value_id)
const 918 if(value_id==DIM) {
return this->pshape_nst(s,psi);}
919 else {
return this->
shape(s,psi);}
930 this->Pressure_advection_diffusion_robin_element_pt.push_back(
946 std::set<std::pair<Data*,unsigned> > &paired_load_data)
949 unsigned u_index[DIM];
950 for(
unsigned i=0;
i<DIM;
i++) {u_index[
i] = this->u_index_nst(
i);}
953 unsigned n_node = this->
nnode();
954 for(
unsigned n=0;n<n_node;n++)
966 for (
unsigned j=0;j<nmaster;j++)
972 for(
unsigned i=0;
i<DIM;
i++)
974 paired_load_data.insert(std::make_pair(master_nod_pt,u_index[
i]));
983 for(
unsigned i=0;
i<DIM;
i++)
985 paired_load_data.insert(std::make_pair(this->
node_pt(n),u_index[
i]));
991 int p_index = this->p_nodal_index_nst();
994 unsigned n_pres= this->npres_nst();
995 for(
unsigned l=0;l<n_pres;l++)
998 Node* pres_node_pt = this->pressure_node_pt(l);
1007 unsigned nmaster = hang_info_pt->
nmaster();
1010 for(
unsigned m=0;m<nmaster;m++)
1014 paired_load_data.insert(
1023 paired_load_data.insert(std::make_pair(pres_node_pt,p_index));
1037 template<
unsigned DIM>
1051 template<
unsigned DIM>
1053 public virtual FaceGeometry<FaceGeometry<QTaylorHoodElement<DIM> > >
1069 template<
unsigned DIM>
1080 unsigned n_pres = this->npres_nst();
1082 for(
unsigned l=0;l<n_pres;l++)
1118 inline void rebuild_from_sons(
Mesh* &mesh_pt);
1141 values.resize(DIM,0.0);
1144 for(
unsigned i=0;
i<DIM;
i++) {values[
i] = this->interpolated_u_nst(s,
i);}
1163 for(
unsigned i=0;
i<DIM;
i++) {values[
i]=0.0;}
1166 unsigned n_node = this->
nnode();
1170 this->
shape(s,psif);
1173 for(
unsigned i=0;
i<DIM;
i++)
1176 unsigned u_nodal_index = this->u_index_nst(
i);
1177 for(
unsigned l=0;l<n_node;l++)
1179 values[
i] += this->
nodal_value(t,l,u_nodal_index)*psif[l];
1192 inline void further_build();
1202 this->Pressure_advection_diffusion_robin_element_pt.push_back(
1218 std::set<std::pair<Data*,unsigned> > &paired_load_data)
1221 unsigned u_index[DIM];
1222 for(
unsigned i=0;
i<DIM;
i++) {u_index[
i] = this->u_index_nst(
i);}
1225 unsigned n_node = this->
nnode();
1226 for(
unsigned n=0;n<n_node;n++)
1238 for (
unsigned j=0;j<nmaster;j++)
1244 for(
unsigned i=0;
i<DIM;
i++)
1246 paired_load_data.insert(std::make_pair(master_nod_pt,u_index[
i]));
1255 for(
unsigned i=0;
i<DIM;
i++)
1257 paired_load_data.insert(std::make_pair(this->
node_pt(n),u_index[
i]));
1264 unsigned n_pres = this->npres_nst();
1265 for(
unsigned l=0;l<n_pres;l++)
1269 paired_load_data.insert(
1282 template<
unsigned DIM>
1293 unsigned n_pres = this->npres_nst();
1296 for(
unsigned l=0;l<n_pres;l++)
1320 <= this->npres_nst())
1323 ->
resize(this->npres_nst());
1327 Data* new_data_pt =
new Data(this->npres_nst());
1359 double p_nst(
const unsigned &
t,
const unsigned &
i)
const 1363 unsigned npres_nst()
const {
return (this->p_order()-2)*(this->p_order()-2);}
1386 for(
unsigned p=0; p<npres_nst(); p++)
1426 inline double dshape_and_dtest_eulerian_at_knot_nst(
const unsigned &ipt,
1445 values.resize(DIM,0.0);
1448 for(
unsigned i=0;
i<DIM;
i++) {values[
i] = this->interpolated_u_nst(s,
i);}
1467 for(
unsigned i=0;
i<DIM;
i++) {values[
i]=0.0;}
1470 unsigned n_node = this->
nnode();
1474 this->
shape(s,psif);
1477 for(
unsigned i=0;
i<DIM;
i++)
1480 unsigned u_nodal_index = this->u_index_nst(
i);
1481 for(
unsigned l=0;l<n_node;l++)
1483 values[
i] += this->
nodal_value(t,l,u_nodal_index)*psif[l];
1496 void further_build();
1505 template<
unsigned DIM>
1507 public virtual FaceGeometry<QCrouzeixRaviartElement<DIM> >
1519 template<
unsigned DIM>
1521 public virtual FaceGeometry<FaceGeometry<QCrouzeixRaviartElement<DIM> > >
1538 using namespace QuadTreeNames;
1547 double av_press=0.0;
1550 for (
unsigned ison=0;ison<4;ison++)
1555 av_press += quadtree_pt()->son_pt(ison)->object_pt()->
1572 quadtree_pt()->son_pt(
SE)->object_pt()->
1574 quadtree_pt()->son_pt(
SW)->object_pt()->
1578 quadtree_pt()->son_pt(
NE)->object_pt()->
1580 quadtree_pt()->son_pt(
NW)->object_pt()->
1586 set_value(1,0.5*(slope1+slope2));
1599 quadtree_pt()->son_pt(
NE)->object_pt()
1600 ->internal_data_pt(this->P_nst_internal_index)->value(0) -
1601 quadtree_pt()->son_pt(
SE)->object_pt()
1602 ->internal_data_pt(this->P_nst_internal_index)->value(0);
1605 quadtree_pt()->son_pt(
NW)->object_pt()
1606 ->internal_data_pt(this->P_nst_internal_index)->value(0) -
1607 quadtree_pt()->son_pt(
SW)->object_pt()
1608 ->internal_data_pt(this->P_nst_internal_index)->value(0);
1613 set_value(2,0.5*(slope1+slope2));
1625 using namespace OcTreeNames;
1634 double av_press=0.0;
1637 for (
unsigned ison=0;ison<8;ison++)
1640 av_press += octree_pt()->son_pt(ison)->object_pt()->
1646 set_value(0,0.125*av_press);
1658 octree_pt()->son_pt(
RDF)->object_pt()->
1660 octree_pt()->son_pt(
LDF)->object_pt()->
1664 octree_pt()->son_pt(
RUF)->object_pt()->
1666 octree_pt()->son_pt(
LUF)->object_pt()->
1670 octree_pt()->son_pt(
RDB)->object_pt()->
1672 octree_pt()->son_pt(
LDB)->object_pt()->
1676 octree_pt()->son_pt(
RUB)->object_pt()->
1678 octree_pt()->son_pt(
LUB)->object_pt()->
1684 set_value(1,0.25*(slope1+slope2+slope3+slope4));
1696 octree_pt()->son_pt(
LUB)->object_pt()
1697 ->internal_data_pt(this->P_nst_internal_index)->value(0) -
1698 octree_pt()->son_pt(
LDB)->object_pt()
1699 ->internal_data_pt(this->P_nst_internal_index)->value(0);
1702 octree_pt()->son_pt(
RUB)->object_pt()
1703 ->internal_data_pt(this->P_nst_internal_index)->value(0) -
1704 octree_pt()->son_pt(
RDB)->object_pt()
1705 ->internal_data_pt(this->P_nst_internal_index)->value(0);
1708 octree_pt()->son_pt(
LUF)->object_pt()
1709 ->internal_data_pt(this->P_nst_internal_index)->value(0) -
1710 octree_pt()->son_pt(
LDF)->object_pt()
1711 ->internal_data_pt(this->P_nst_internal_index)->value(0);
1714 octree_pt()->son_pt(
RUF)->object_pt()
1715 ->internal_data_pt(this->P_nst_internal_index)->value(0) -
1716 octree_pt()->son_pt(
RDF)->object_pt()
1717 ->internal_data_pt(this->P_nst_internal_index)->value(0);
1722 set_value(2,0.25*(slope1+slope2+slope3+slope4));
1734 octree_pt()->son_pt(
LUF)->object_pt()
1735 ->internal_data_pt(this->P_nst_internal_index)->value(0) -
1736 octree_pt()->son_pt(
LUB)->object_pt()
1737 ->internal_data_pt(this->P_nst_internal_index)->value(0);
1740 octree_pt()->son_pt(
RUF)->object_pt()
1741 ->internal_data_pt(this->P_nst_internal_index)->value(0) -
1742 octree_pt()->son_pt(
RUB)->object_pt()
1743 ->internal_data_pt(this->P_nst_internal_index)->value(0);
1746 octree_pt()->son_pt(
LDF)->object_pt()
1747 ->internal_data_pt(this->P_nst_internal_index)->value(0) -
1748 octree_pt()->son_pt(
LDB)->object_pt()
1749 ->internal_data_pt(this->P_nst_internal_index)->value(0);
1752 octree_pt()->son_pt(
RDF)->object_pt()
1753 ->internal_data_pt(this->P_nst_internal_index)->value(0) -
1754 octree_pt()->son_pt(
RDB)->object_pt()
1755 ->internal_data_pt(this->P_nst_internal_index)->value(0);
1759 set_value(3,0.25*(slope1+slope2+slope3+slope4));
1776 using namespace QuadTreeNames;
1779 int son_type=quadtree_pt()->son_type();
1795 else if (son_type==
SE)
1801 else if (son_type==
NE)
1808 else if (son_type==
NW)
1824 for(
unsigned i=1;
i<3;
i++)
1826 double half_father_slope = 0.5*cast_father_element_pt->
1830 set_value(
i,half_father_slope);
1846 using namespace OcTreeNames;
1849 int son_type=octree_pt()->son_type();
1854 octree_pt()->father_pt()->object_pt());
1859 for(
unsigned i=0;
i<3;
i++)
1874 for(
unsigned i=1;
i<4;
i++)
1876 double half_father_slope = 0.5*cast_father_element_pt
1904 dtestdx(
i,0) = dpsidx(
i,0);
1905 dtestdx(
i,1) = dpsidx(
i,1);
1932 dtestdx(
i,0) = dpsidx(
i,0);
1933 dtestdx(
i,1) = dpsidx(
i,1);
1960 dtestdx(
i,0) = dpsidx(
i,0);
1961 dtestdx(
i,1) = dpsidx(
i,1);
1962 dtestdx(
i,2) = dpsidx(
i,2);
1989 dtestdx(
i,0) = dpsidx(
i,0);
1990 dtestdx(
i,1) = dpsidx(
i,1);
1991 dtestdx(
i,2) = dpsidx(
i,2);
2006 unsigned npres = this->npres_nst();
2014 unsigned npres_1d = (int) std::sqrt((
double)npres);
2023 for(
unsigned i=0;
i<npres_1d;
i++)
2025 for(
unsigned j=0;j<npres_1d;j++)
2028 psi[
i*npres_1d + j] = psi2[
i]*psi1[j];
2043 if (this->npres_nst()==1)
2049 for(
unsigned i=0;
i<this->npres_nst();
i++) test[
i] = psi[
i];
2061 unsigned npres = this->npres_nst();
2069 unsigned npres_1d = (int) std::sqrt((
double)npres);
2079 for(
unsigned i=0;
i<npres_1d;
i++)
2081 for(
unsigned j=0;j<npres_1d;j++)
2083 for(
unsigned k=0;k<npres_1d;k++)
2086 psi[
i*npres_1d*npres_1d + j*npres_1d + k] = psi3[
i]*psi2[j]*psi1[k];
2102 if (this->npres_nst()==1)
2108 for(
unsigned i=0;
i<this->npres_nst();
i++) test[
i] = psi[
i];
void further_setup_hanging_nodes()
Perform additional hanging node procedures for variables that are not interpolated by all nodes...
virtual void pin_elemental_redundant_nodal_pressure_dofs()
Pin unused nodal pressure dofs (empty by default, because by default pressure dofs are not associated...
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when time-derivatives are computed...
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 ...
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain rate tensor. ...
GeneralisedAxisymAdvectionDiffusionSourceFctPt Source_fct_pt
Pointer to source function:
Base class for finite elements that can compute the quantities that are required for the Z2 error est...
void build_fp_press_adv_diff_robin_bc_element(const unsigned &face_index)
Build FaceElements that apply the Robin boundary condition to the pressure advection diffusion proble...
static void unpin_all_pressure_dofs(const Vector< GeneralisedElement *> &element_pt)
Unpin all pressure dofs in elements listed in vector.
virtual double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Return the geometric shape functions and also first derivatives w.r.t. global coordinates at the ipt-...
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
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.
void rebuild_from_sons(Mesh *&mesh_pt)
Rebuild from sons: empty.
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
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 local node n.
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
void dinterpolated_u_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...
void rebuild_from_sons(Mesh *&mesh_pt)
Rebuild from sons: Reconstruct pressure from the (merged) sons This must be specialised for each dime...
virtual void set_integration_scheme(Integral *const &integral_pt)
Set the spatial integration scheme.
RefineableNavierStokesEquations()
Constructor.
void unpin_elemental_pressure_dofs()
Unpin all internal pressure dofs.
NavierStokesSourceFctPt & source_fct_pt()
Access function for the source-function pointer.
void outer_unit_normal(const Vector< double > &s, Vector< double > &unit_normal) const
Compute outer unit normal at the specified local coordinate.
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 ...
void pshape_nst(const Vector< double > &s, Shape &psi) const
Pressure shape functions at local coordinate s.
unsigned npres_nst() const
Return number of pressure values.
A general Finite Element class.
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 ncont_interpolated_values() const
Number of continuously interpolated values: (DIM velocities + 1 pressure)
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
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.
double *& re_pt()
Pointer to Reynolds number.
double dshape_and_dtest_eulerian_nst(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Velocity shape and test functions and their derivs w.r.t. to global coords at local coordinate s (tak...
void unpin_elemental_pressure_dofs()
Unpin all pressure dofs.
bool is_hanging() const
Test whether the node is geometrically hanging.
virtual void fill_in_generic_residual_contribution_fp_press_adv_diff_robin_bc(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
This function returns the residuals for the traction function. flag=1 (or 0): do (or don't) compute t...
long & eqn_number(const unsigned &i)
Return the equation number of the i-th stored variable.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
RefineableQCrouzeixRaviartElement()
Constructor.
double p_nst(const unsigned &i) const
Broken assignment operator.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
double p_nst(const unsigned &t, const unsigned &i) const
Return the i-th pressure value (Discontinous pressure interpolation – no need to cater for hanging n...
double dshape_and_dtest_eulerian_at_knot_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Velocity shape and test functions and their derivs w.r.t. to global coords at ipt-th integation point...
void pin(const unsigned &i)
Pin the i-th stored variable.
double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s...
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
void unpin_elemental_pressure_dofs()
Unpin all internal pressure dofs.
Vector< double > *& g_pt()
Pointer to Vector of gravitational components.
double *& re_st_pt()
Pointer to product of Reynolds and Strouhal number (=Womersley number)
unsigned ncont_interpolated_values() const
Number of continuously interpolated values: DIM (velocities)
Node * interpolating_node_pt(const unsigned &n, const int &value_id)
The velocities are isoparametric and so the "nodes" interpolating the velocities are the geometric no...
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when time-derivatives are computed...
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
void identify_load_data(std::set< std::pair< Data *, unsigned > > &paired_load_data)
Add to the set paired_load_data pairs containing.
~PRefineableQCrouzeixRaviartElement()
Destructor.
void pin_elemental_redundant_nodal_pressure_dofs()
Pin all nodal pressure dofs that are not required.
void further_build()
Further build, pass the pointers down to the sons.
Node * pressure_node_pt(const unsigned &n_p)
Pointer to n_p-th pressure node.
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Compute the geometric shape functions and also first derivatives w.r.t. global coordinates at local c...
double *& viscosity_ratio_pt()
Pointer to Viscosity Ratio.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
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)...
virtual unsigned nvertex_node() const
static Vector< Vector< int > > Direction_to_vector
For each direction, i.e. a son_type (vertex), a face or an edge, this defines a vector that indicates...
RefineableFpPressureAdvDiffRobinBCElement(FiniteElement *const &element_pt, const int &face_index)
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
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 *& re_invfr_pt()
Pointer to global inverse Froude number.
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...
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 further_setup_hanging_nodes()
Perform additional hanging node procedures for variables that are not interpolated by all nodes...
Refineable version of Crouzeix Raviart elements. Generic class definitions.
A class that represents a collection of data; each Data object may contain many different individual ...
unsigned nvertex_node() const
Number of vertex nodes in the element.
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...
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 * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
double *& density_ratio_pt()
Pointer to Density ratio.
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...
unsigned nvertex_node() const
Number of vertex nodes in the element.
Class that contains data for hanging nodes.
unsigned ninterpolating_node(const int &value_id)
The number of pressure nodes is 2^DIM. The number of velocity nodes is the same as the number of geom...
double local_one_d_fraction_of_interpolating_node(const unsigned &n1d, const unsigned &i, const int &value_id)
The pressure nodes are the corner nodes, so when n_value==DIM, the fraction is the same as the 1d nod...
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overloa...
void fix_pressure(const unsigned &p_dof, const double &p_value)
Pin p_dof-th pressure dof and set it to value specified by p_value.
unsigned nvertex_node() const
Number of vertex nodes in the element.
void interpolating_basis(const Vector< double > &s, Shape &psi, const int &value_id) const
The basis interpolating the pressure is given by pshape(). / The basis interpolating the velocity is ...
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
NavierStokesBodyForceFctPt & body_force_fct_pt()
Access function for the body-force pointer.
Node * get_interpolating_node_at_local_coordinate(const Vector< double > &s, const int &value_id)
The velocity nodes are the same as the geometric nodes. The pressure nodes must be calculated by usin...
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
RefineableQTaylorHoodElement()
Constructor.
PRefineableQCrouzeixRaviartElement()
Constructor.
virtual void resize(const unsigned &n_value)
Change (increase) the number of values that may be stored.
unsigned required_nvalue(const unsigned &n) const
Number of values required at local node n. In order to simplify matters, we allocate storage for pres...
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...
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
unsigned ncont_interpolated_values() const
Broken assignment operator.
void build_fp_press_adv_diff_robin_bc_element(const unsigned &face_index)
Build FaceElements that apply the Robin boundary condition to the pressure advection diffusion proble...
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...
void rebuild_from_sons(Mesh *&mesh_pt)
Rebuild from sons: Reconstruct pressure from the (merged) sons This must be specialised for each dime...
virtual double interpolated_p_nst(const Vector< double > &s) const
Return FE interpolated pressure at local coordinate s.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation:
unsigned nnode() const
Return the number of nodes.
Vector< double > local_coordinate_in_bulk(const Vector< double > &s) const
Return vector of local coordinates in bulk element, given the local coordinates in this FaceElement...
void identify_load_data(std::set< std::pair< Data *, unsigned > > &paired_load_data)
Add to the set paired_load_data pairs containing.
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...
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 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...
unsigned ninterpolating_node_1d(const int &value_id)
The number of 1d pressure nodes is 2, the number of 1d velocity nodes is the same as the number of 1d...
virtual void get_dresidual_dnodal_coordinates(RankThreeTensor< double > &dresidual_dnodal_coordinates)
Compute derivatives of elemental residual vector with respect to nodal coordinates. Default implementation by FD can be overwritten for specific elements. dresidual_dnodal_coordinates(l,i,j) = d res(l) / dX_{ij}.