28 #ifndef OOMPH_REFINEABLE_NAVIER_STOKES_ELEMENTS_HEADER
29 #define OOMPH_REFINEABLE_NAVIER_STOKES_ELEMENTS_HEADER
33 #include <oomph-lib-config.h>
37 #include "../generic/refineable_quad_element.h"
38 #include "../generic/refineable_brick_element.h"
39 #include "../generic/hp_refineable_elements.h"
40 #include "../generic/error_estimator.h"
58 template<
class ELEMENT>
85 template<
class ELEMENT>
91 HangInfo *hang_info_pt = 0, *hang_info2_pt = 0;
94 unsigned my_dim = this->dim();
105 unsigned n_intpt = this->integral_pt()->nweight();
109 int local_unknown = 0;
112 ELEMENT* bulk_el_pt =
dynamic_cast<ELEMENT*
>(this->bulk_element_pt());
115 unsigned n_pres = bulk_el_pt->npres_nst();
120 int p_index = bulk_el_pt->p_nodal_index_nst();
124 bool pressure_dof_is_hanging[n_pres];
129 for (
unsigned l = 0; l < n_pres; ++l)
131 pressure_dof_is_hanging[l] =
132 bulk_el_pt->pressure_node_pt(l)->is_hanging(p_index);
140 "Pressure advection diffusion does not work in this case\n",
141 OOMPH_CURRENT_FUNCTION,
142 OOMPH_EXCEPTION_LOCATION);
144 for (
unsigned l = 0; l < n_pres; ++l)
146 pressure_dof_is_hanging[l] =
false;
151 double re = bulk_el_pt->re();
154 Shape psip(n_pres), testp(n_pres);
157 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
160 double w = this->integral_pt()->weight(ipt);
163 for (
unsigned i = 0;
i < my_dim;
i++)
164 s[
i] = this->integral_pt()->knot(ipt,
i);
167 s_bulk = this->local_coordinate_in_bulk(
s);
170 this->outer_unit_normal(ipt, unit_normal);
173 bulk_el_pt->interpolated_u_nst(s_bulk, veloc);
177 for (
unsigned i = 0;
i < my_dim + 1;
i++)
179 flux += veloc[
i] * unit_normal[
i];
183 if (flux > 0.0) flux = 0.0;
186 double interpolated_press = bulk_el_pt->interpolated_p_nst(s_bulk);
189 bulk_el_pt->pshape_nst(s_bulk, psip, testp);
192 double J = this->J_eulerian(
s);
199 unsigned n_master = 1;
200 double hang_weight = 1.0;
203 for (
unsigned l = 0; l < n_pres; l++)
206 if (pressure_dof_is_hanging[l])
210 hang_info_pt = bulk_el_pt->pressure_node_pt(l)->hanging_pt(p_index);
213 n_master = hang_info_pt->
nmaster();
222 for (
unsigned m = 0; m < n_master; m++)
226 if (pressure_dof_is_hanging[l])
229 local_eqn = bulk_el_pt->local_hang_eqn(
236 local_eqn = bulk_el_pt->p_local_eqn(l);
243 residuals[local_eqn] -=
244 re * flux * interpolated_press * testp[l] *
W * hang_weight;
250 unsigned n_master2 = 1;
251 double hang_weight2 = 1.0;
254 for (
unsigned l2 = 0; l2 < n_pres; l2++)
257 if (pressure_dof_is_hanging[l2])
260 bulk_el_pt->pressure_node_pt(l2)->hanging_pt(p_index);
263 n_master2 = hang_info2_pt->nmaster();
272 for (
unsigned m2 = 0; m2 < n_master2; m2++)
276 if (pressure_dof_is_hanging[l2])
279 local_unknown = bulk_el_pt->local_hang_eqn(
280 hang_info2_pt->master_node_pt(m2), p_index);
282 hang_weight2 = hang_info2_pt->master_weight(m2);
286 local_unknown = bulk_el_pt->p_local_eqn(l2);
291 if (local_unknown >= 0)
293 jacobian(local_eqn, local_unknown) -=
294 re * flux * psip[l2] * testp[l] *
W * hang_weight *
317 template<
unsigned DIM>
356 unsigned n_element = element_pt.size();
357 for (
unsigned e = 0;
e < n_element;
e++)
369 unsigned n_element = element_pt.size();
370 for (
unsigned e = 0;
e < n_element;
e++)
391 const unsigned& which_one = 0);
398 return DIM + (DIM * (DIM - 1)) / 2;
406 unsigned num_entries = DIM + (DIM * (DIM - 1)) / 2;
407 if (flux.size() < num_entries)
409 std::ostringstream error_message;
410 error_message <<
"The flux vector has the wrong number of entries, "
411 << flux.size() <<
", whereas it should be at least "
412 << num_entries << std::endl;
414 OOMPH_CURRENT_FUNCTION,
415 OOMPH_EXCEPTION_LOCATION);
427 for (
unsigned i = 0;
i < DIM;
i++)
429 flux[icount] = strainrate(
i,
i);
434 for (
unsigned i = 0;
i < DIM;
i++)
436 for (
unsigned j =
i + 1; j < DIM; j++)
438 flux[icount] = strainrate(
i, j);
457 this->
Re_pt = cast_father_element_pt->
re_pt();
463 this->
G_pt = cast_father_element_pt->
g_pt();
488 unsigned n_node = this->
nnode();
495 const unsigned u_nodal_index = this->
u_index_nst(i);
503 unsigned n_u_dof = 0;
504 for (
unsigned l = 0; l < n_node; l++)
506 unsigned n_master = 1;
515 n_master = hang_info_pt->
nmaster();
524 for (
unsigned m = 0; m < n_master; m++)
548 du_ddata.resize(n_u_dof, 0.0);
549 global_eqn_number.resize(n_u_dof, 0);
554 for (
unsigned l = 0; l < n_node; l++)
556 unsigned n_master = 1;
557 double hang_weight = 1.0;
566 n_master = hang_info_pt->
nmaster();
575 for (
unsigned m = 0; m < n_master; m++)
605 global_eqn_number[count] = global_eqn;
607 du_ddata[count] = psi[l] * hang_weight;
647 template<
unsigned DIM>
659 unsigned n_node = this->
nnode();
661 for (
unsigned n = 0; n < n_node; n++)
673 unsigned n_node = this->
nnode();
675 for (
unsigned n = 0; n < n_node; n++)
682 for (
unsigned l = 0; l < n_pres; l++)
687 nod_pt->
unpin(p_index);
747 values.resize(DIM + 1, 0.0);
750 for (
unsigned i = 0;
i < DIM;
i++)
768 values.resize(DIM + 1);
771 for (
unsigned i = 0;
i < DIM + 1;
i++)
777 unsigned n_node = this->
nnode();
781 this->
shape(s, psif);
784 for (
unsigned i = 0;
i < DIM;
i++)
788 for (
unsigned l = 0; l < n_node; l++)
790 values[
i] += this->
nodal_value(t, l, u_nodal_index) * psif[l];
862 unsigned total_index = 0;
864 unsigned NNODE_1D = 2;
868 for (
unsigned i = 0;
i < DIM;
i++)
877 else if (
s[
i] == 1.0)
879 index[
i] = NNODE_1D - 1;
885 double float_index = 0.5 * (1.0 +
s[
i]) * (NNODE_1D - 1);
886 index[
i] = int(float_index);
889 double excess = float_index - index[
i];
900 index[
i] *
static_cast<unsigned>(pow(
static_cast<float>(NNODE_1D),
901 static_cast<int>(
i)));
934 return static_cast<unsigned>(pow(2.0,
static_cast<int>(DIM)));
938 return this->
nnode();
946 const int& value_id)
const
954 return this->
shape(s, psi);
980 std::set<std::pair<Data*, unsigned>>& paired_load_data)
983 unsigned u_index[DIM];
984 for (
unsigned i = 0;
i < DIM;
i++)
990 unsigned n_node = this->
nnode();
991 for (
unsigned n = 0; n < n_node; n++)
1003 for (
unsigned j = 0; j < nmaster; j++)
1009 for (
unsigned i = 0;
i < DIM;
i++)
1011 paired_load_data.insert(
1012 std::make_pair(master_nod_pt, u_index[
i]));
1021 for (
unsigned i = 0;
i < DIM;
i++)
1023 paired_load_data.insert(
1024 std::make_pair(this->
node_pt(n), u_index[
i]));
1034 for (
unsigned l = 0; l < n_pres; l++)
1046 unsigned nmaster = hang_info_pt->
nmaster();
1049 for (
unsigned m = 0; m < nmaster; m++)
1053 paired_load_data.insert(
1062 paired_load_data.insert(std::make_pair(pres_node_pt, p_index));
1073 template<
unsigned DIM>
1087 template<
unsigned DIM>
1089 :
public virtual FaceGeometry<FaceGeometry<QTaylorHoodElement<DIM>>>
1104 template<
unsigned DIM>
1116 for (
unsigned l = 0; l < n_pres; l++)
1182 values.resize(DIM, 0.0);
1185 for (
unsigned i = 0;
i < DIM;
i++)
1208 for (
unsigned i = 0;
i < DIM;
i++)
1214 unsigned n_node = this->
nnode();
1218 this->
shape(s, psif);
1221 for (
unsigned i = 0;
i < DIM;
i++)
1225 for (
unsigned l = 0; l < n_node; l++)
1227 values[
i] += this->
nodal_value(t, l, u_nodal_index) * psif[l];
1264 std::set<std::pair<Data*, unsigned>>& paired_load_data)
1267 unsigned u_index[DIM];
1268 for (
unsigned i = 0;
i < DIM;
i++)
1274 unsigned n_node = this->
nnode();
1275 for (
unsigned n = 0; n < n_node; n++)
1287 for (
unsigned j = 0; j < nmaster; j++)
1293 for (
unsigned i = 0;
i < DIM;
i++)
1295 paired_load_data.insert(
1296 std::make_pair(master_nod_pt, u_index[
i]));
1305 for (
unsigned i = 0;
i < DIM;
i++)
1307 paired_load_data.insert(
1308 std::make_pair(this->
node_pt(n), u_index[
i]));
1316 for (
unsigned l = 0; l < n_pres; l++)
1320 paired_load_data.insert(std::make_pair(
1331 template<
unsigned DIM>
1344 for (
unsigned l = 0; l < n_pres; l++)
1359 this->p_order() = 3;
1405 double p_nst(
const unsigned&
t,
const unsigned&
i)
const
1413 return (this->p_order() - 2) * (this->p_order() - 2);
1443 for (
unsigned p = 0; p <
npres_nst(); p++)
1510 values.resize(DIM, 0.0);
1513 for (
unsigned i = 0;
i < DIM;
i++)
1536 for (
unsigned i = 0;
i < DIM;
i++)
1542 unsigned n_node = this->
nnode();
1546 this->
shape(s, psif);
1549 for (
unsigned i = 0;
i < DIM;
i++)
1553 for (
unsigned l = 0; l < n_node; l++)
1555 values[
i] += this->
nodal_value(t, l, u_nodal_index) * psif[l];
1575 template<
unsigned DIM>
1577 :
public virtual FaceGeometry<QCrouzeixRaviartElement<DIM>>
1589 template<
unsigned DIM>
1591 :
public virtual FaceGeometry<FaceGeometry<QCrouzeixRaviartElement<DIM>>>
1609 using namespace QuadTreeNames;
1618 double av_press = 0.0;
1621 for (
unsigned ison = 0; ison < 4; ison++)
1626 av_press += quadtree_pt()
1629 ->internal_data_pt(this->P_nst_internal_index)
1634 internal_data_pt(this->P_nst_internal_index)->set_value(0, 0.25 * av_press);
1645 double slope1 = quadtree_pt()
1648 ->internal_data_pt(this->P_nst_internal_index)
1653 ->internal_data_pt(this->P_nst_internal_index)
1656 double slope2 = quadtree_pt()
1659 ->internal_data_pt(this->P_nst_internal_index)
1664 ->internal_data_pt(this->P_nst_internal_index)
1669 internal_data_pt(this->P_nst_internal_index)
1670 ->set_value(1, 0.5 * (slope1 + slope2));
1681 slope1 = quadtree_pt()
1684 ->internal_data_pt(this->P_nst_internal_index)
1689 ->internal_data_pt(this->P_nst_internal_index)
1692 slope2 = quadtree_pt()
1695 ->internal_data_pt(this->P_nst_internal_index)
1700 ->internal_data_pt(this->P_nst_internal_index)
1705 internal_data_pt(this->P_nst_internal_index)
1706 ->set_value(2, 0.5 * (slope1 + slope2));
1717 using namespace OcTreeNames;
1726 double av_press = 0.0;
1729 for (
unsigned ison = 0; ison < 8; ison++)
1732 av_press += octree_pt()
1735 ->internal_data_pt(this->P_nst_internal_index)
1740 internal_data_pt(this->P_nst_internal_index)
1741 ->set_value(0, 0.125 * av_press);
1752 double slope1 = octree_pt()
1755 ->internal_data_pt(this->P_nst_internal_index)
1760 ->internal_data_pt(this->P_nst_internal_index)
1763 double slope2 = octree_pt()
1766 ->internal_data_pt(this->P_nst_internal_index)
1771 ->internal_data_pt(this->P_nst_internal_index)
1774 double slope3 = octree_pt()
1777 ->internal_data_pt(this->P_nst_internal_index)
1782 ->internal_data_pt(this->P_nst_internal_index)
1785 double slope4 = octree_pt()
1788 ->internal_data_pt(this->P_nst_internal_index)
1793 ->internal_data_pt(this->P_nst_internal_index)
1798 internal_data_pt(this->P_nst_internal_index)
1799 ->set_value(1, 0.25 * (slope1 + slope2 + slope3 + slope4));
1810 slope1 = octree_pt()
1813 ->internal_data_pt(this->P_nst_internal_index)
1818 ->internal_data_pt(this->P_nst_internal_index)
1821 slope2 = octree_pt()
1824 ->internal_data_pt(this->P_nst_internal_index)
1829 ->internal_data_pt(this->P_nst_internal_index)
1832 slope3 = octree_pt()
1835 ->internal_data_pt(this->P_nst_internal_index)
1840 ->internal_data_pt(this->P_nst_internal_index)
1843 slope4 = octree_pt()
1846 ->internal_data_pt(this->P_nst_internal_index)
1851 ->internal_data_pt(this->P_nst_internal_index)
1856 internal_data_pt(this->P_nst_internal_index)
1857 ->set_value(2, 0.25 * (slope1 + slope2 + slope3 + slope4));
1868 slope1 = octree_pt()
1871 ->internal_data_pt(this->P_nst_internal_index)
1876 ->internal_data_pt(this->P_nst_internal_index)
1879 slope2 = octree_pt()
1882 ->internal_data_pt(this->P_nst_internal_index)
1887 ->internal_data_pt(this->P_nst_internal_index)
1890 slope3 = octree_pt()
1893 ->internal_data_pt(this->P_nst_internal_index)
1898 ->internal_data_pt(this->P_nst_internal_index)
1901 slope4 = octree_pt()
1904 ->internal_data_pt(this->P_nst_internal_index)
1909 ->internal_data_pt(this->P_nst_internal_index)
1913 internal_data_pt(this->P_nst_internal_index)
1914 ->set_value(3, 0.25 * (slope1 + slope2 + slope3 + slope4));
1930 using namespace QuadTreeNames;
1933 int son_type = quadtree_pt()->son_type();
1949 else if (son_type ==
SE)
1955 else if (son_type ==
NE)
1962 else if (son_type ==
NW)
1975 internal_data_pt(this->P_nst_internal_index)->set_value(0, press);
1978 for (
unsigned i = 1;
i < 3;
i++)
1980 double half_father_slope =
1985 internal_data_pt(this->P_nst_internal_index)
1986 ->set_value(
i, half_father_slope);
2002 using namespace OcTreeNames;
2005 int son_type = octree_pt()->son_type();
2009 octree_pt()->father_pt()->object_pt());
2014 for (
unsigned i = 0;
i < 3;
i++)
2026 internal_data_pt(this->P_nst_internal_index)->set_value(0, press);
2029 for (
unsigned i = 1;
i < 4;
i++)
2031 double half_father_slope =
2036 internal_data_pt(this->P_nst_internal_index)
2037 ->set_value(
i, half_father_slope);
2056 double J = this->dshape_eulerian(
s, psi, dpsidx);
2060 for (
unsigned i = 0;
i < nnode_1d() * nnode_1d();
i++)
2063 dtestdx(
i, 0) = dpsidx(
i, 0);
2064 dtestdx(
i, 1) = dpsidx(
i, 1);
2079 2>::dshape_and_dtest_eulerian_at_knot_nst(
const unsigned& ipt,
2086 double J = this->dshape_eulerian_at_knot(ipt, psi, dpsidx);
2090 for (
unsigned i = 0;
i < nnode_1d() * nnode_1d();
i++)
2093 dtestdx(
i, 0) = dpsidx(
i, 0);
2094 dtestdx(
i, 1) = dpsidx(
i, 1);
2116 double J = this->dshape_eulerian(
s, psi, dpsidx);
2120 for (
unsigned i = 0;
i < nnode_1d() * nnode_1d() * nnode_1d();
i++)
2123 dtestdx(
i, 0) = dpsidx(
i, 0);
2124 dtestdx(
i, 1) = dpsidx(
i, 1);
2125 dtestdx(
i, 2) = dpsidx(
i, 2);
2140 3>::dshape_and_dtest_eulerian_at_knot_nst(
const unsigned& ipt,
2147 double J = this->dshape_eulerian_at_knot(ipt, psi, dpsidx);
2151 for (
unsigned i = 0;
i < nnode_1d() * nnode_1d() * nnode_1d();
i++)
2154 dtestdx(
i, 0) = dpsidx(
i, 0);
2155 dtestdx(
i, 1) = dpsidx(
i, 1);
2156 dtestdx(
i, 2) = dpsidx(
i, 2);
2171 unsigned npres = this->npres_nst();
2179 unsigned npres_1d = (int)std::sqrt((
double)npres);
2188 for (
unsigned i = 0;
i < npres_1d;
i++)
2190 for (
unsigned j = 0; j < npres_1d; j++)
2193 psi[
i * npres_1d + j] = psi2[
i] * psi1[j];
2208 if (this->npres_nst() == 1)
2214 for (
unsigned i = 0;
i < this->npres_nst();
i++) test[
i] = psi[
i];
2226 unsigned npres = this->npres_nst();
2234 unsigned npres_1d = (int)std::sqrt((
double)npres);
2244 for (
unsigned i = 0;
i < npres_1d;
i++)
2246 for (
unsigned j = 0; j < npres_1d; j++)
2248 for (
unsigned k = 0; k < npres_1d; k++)
2251 psi[
i * npres_1d * npres_1d + j * npres_1d + k] =
2252 psi3[
i] * psi2[j] * psi1[k];
2268 if (this->npres_nst() == 1)
2274 for (
unsigned i = 0;
i < this->npres_nst();
i++) test[
i] = psi[
i];
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
A class that represents a collection of data; each Data object may contain many different individual ...
long & eqn_number(const unsigned &i)
Return the equation number of the i-th stored variable.
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...
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
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 ...
virtual void resize(const unsigned &n_value)
Change (increase) the number of values that may be stored.
Base class for finite elements that can compute the quantities that are required for the Z2 error est...
FaceElements are elements that coincide with the faces of higher-dimensional "bulk" elements....
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A general Finite Element class.
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.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
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 void set_integration_scheme(Integral *const &integral_pt)
Set the spatial integration scheme.
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...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Class for multidimensional Gauss Lobatto Legendre integration rules empty - just establishes template...
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Class that contains data for hanging nodes.
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
unsigned nmaster() const
Return the number of master nodes.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
double * Viscosity_Ratio_pt
Pointer to the viscosity ratio (relative to the viscosity used in the definition of the Reynolds numb...
NavierStokesSourceFctPt Source_fct_pt
Pointer to volumetric source function.
virtual unsigned u_index_nst(const unsigned &i) const
Return the index at which the i-th unknown velocity component is stored. The default value,...
double * Re_pt
Pointer to global Reynolds number.
NavierStokesSourceFctPt & source_fct_pt()
Access function for the source-function pointer.
double *& density_ratio_pt()
Pointer to Density ratio.
void interpolated_u_nst(const Vector< double > &s, Vector< double > &veloc) const
Compute vector of FE interpolated velocity u at local coordinate s.
double *& viscosity_ratio_pt()
Pointer to Viscosity Ratio.
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 *& re_st_pt()
Pointer to product of Reynolds and Strouhal number (=Womersley number)
NavierStokesBodyForceFctPt & body_force_fct_pt()
Access function for the body-force pointer.
Vector< double > * G_pt
Pointer to global gravity Vector.
virtual double interpolated_p_nst(const Vector< double > &s) const
Return FE interpolated pressure at local coordinate s.
double * ReInvFr_pt
Pointer to global Reynolds number x inverse Froude number (= Bond number / Capillary number)
Vector< double > *& g_pt()
Pointer to Vector of gravitational components.
double *& re_invfr_pt()
Pointer to global inverse Froude number.
double * Density_Ratio_pt
Pointer to the density ratio (relative to the density used in the definition of the Reynolds number)
double *& re_pt()
Pointer to Reynolds number.
NavierStokesBodyForceFctPt Body_force_fct_pt
Pointer to body force function.
double * ReSt_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when time-derivatives are computed....
Vector< FpPressureAdvDiffRobinBCElementBase * > Pressure_advection_diffusion_robin_element_pt
Storage for FaceElements that apply Robin BC for pressure adv diff equation used in Fp preconditioner...
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
bool is_hanging() const
Test whether the node is geometrically hanging.
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...
Non-templated class that returns modal hierachical shape functions based on Legendre polynomials.
An OomphLibError object which should be thrown when an run-time error is encountered....
p-refineable version of Crouzeix Raviart elements. Generic class definitions
void rebuild_from_sons(Mesh *&mesh_pt)
Rebuild from sons: Reconstruct pressure from the (merged) sons This must be specialised for each dime...
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
void pshape_nst(const Vector< double > &s, Shape &psi) const
Pressure shape functions at local coordinate s.
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 no...
~PRefineableQCrouzeixRaviartElement()
Destructor.
double p_nst(const unsigned &i) const
Broken assignment operator.
void further_build()
Further build for Crouzeix_Raviart interpolates the internal pressure dofs from father element: Make ...
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.
PRefineableQCrouzeixRaviartElement(const PRefineableQCrouzeixRaviartElement< DIM > &dummy)=delete
Broken copy constructor.
unsigned required_nvalue(const unsigned &n) const
Number of values (pinned or dofs) required at local node n.
void pshape_nst(const Vector< double > &s, Shape &psi, Shape &test) const
Pressure shape and test functions at local coordinte s.
unsigned npres_nst() const
// Return number of pressure values
void unpin_elemental_pressure_dofs()
Unpin all internal pressure dofs.
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 further_setup_hanging_nodes()
Perform additional hanging node procedures for variables that are not interpolated by all nodes....
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation:
unsigned ncont_interpolated_values() const
Number of continuously interpolated values: DIM (velocities)
PRefineableQCrouzeixRaviartElement()
Constructor.
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 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 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).
A class that is used to template the p-refineable Q elements by dimension. It's really nothing more t...
/////////////////////////////////////////////////////////////////////////// /////////////////////////...
unsigned npres_nst() const
Return number of pressure values.
unsigned P_nst_internal_index
Internal index that indicates at which internal data the pressure is stored.
/////////////////////////////////////////////////////////////////////////
void pshape_nst(const Vector< double > &s, Shape &psi) const
Pressure shape functions at local coordinate s.
virtual int p_nodal_index_nst() const
Set the value at which the pressure is stored in the nodes.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
unsigned npres_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.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
RefineableFpPressureAdvDiffRobinBCElement(FiniteElement *const &element_pt, const int &face_index)
Constructor, which takes a "bulk" element and the value of the index and its limit.
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...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
static void unpin_all_pressure_dofs(const Vector< GeneralisedElement * > &element_pt)
Unpin all pressure dofs in elements listed in vector.
RefineableNavierStokesEquations()
Constructor.
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 fill_in_generic_residual_contribution_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Add element's contribution to elemental residual vector and/or Jacobian matrix flag=1: compute both f...
void further_build()
Further build, pass the pointers down to the sons.
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...
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
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 get_pressure_and_velocity_mass_matrix_diagonal(Vector< double > &press_mass_diag, Vector< double > &veloc_mass_diag, const unsigned &which_one=0)
Compute the diagonal of the velocity/pressure mass matrices. If which one=0, both are computed,...
void fill_in_generic_pressure_advection_diffusion_contribution_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Compute the residuals for the associated pressure advection diffusion problem. Used by the Fp precond...
virtual void get_dresidual_dnodal_coordinates(RankThreeTensor< double > &dresidual_dnodal_coordinates)
Compute derivatives of elemental residual vector with respect to nodal coordinates....
virtual void unpin_elemental_pressure_dofs()=0
Unpin all pressure dofs in the element.
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...
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain rate tensor.
//////////////////////////////////////////////////////////////////////// ////////////////////////////...
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).
unsigned ncont_interpolated_values() const
Broken assignment operator.
void unpin_elemental_pressure_dofs()
Unpin all internal 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 nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
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...
RefineableQCrouzeixRaviartElement()
Constructor.
void further_build()
Further build for Crouzeix_Raviart interpolates the internal pressure dofs from father element: Make ...
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 This must be specialised for each dime...
unsigned nvertex_node() const
Number of vertex nodes in the element.
RefineableQCrouzeixRaviartElement(const RefineableQCrouzeixRaviartElement< DIM > &dummy)=delete
Broken copy constructor.
void identify_load_data(std::set< std::pair< Data *, unsigned >> &paired_load_data)
Add to the set paired_load_data pairs containing.
Refineable version of QElement<3,NNODE_1D>.
A class that is used to template the refineable Q elements by dimension. It's really nothing more tha...
Refineable version of Taylor Hood elements. These classes can be written in total generality.
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...
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...
Node * pressure_node_pt(const unsigned &n_p)
Pointer to n_p-th pressure node.
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 unpin_elemental_pressure_dofs()
Unpin all pressure dofs.
void rebuild_from_sons(Mesh *&mesh_pt)
Rebuild from sons: empty.
unsigned nvertex_node() const
Number of vertex nodes in the element.
RefineableQTaylorHoodElement()
Constructor.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
void pin_elemental_redundant_nodal_pressure_dofs()
Pin all nodal pressure dofs that are not required.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
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...
void further_setup_hanging_nodes()
Perform additional hanging node procedures for variables that are not interpolated by all nodes....
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...
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 ncont_interpolated_values() const
Number of continuously interpolated values: (DIM 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 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...
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...
void identify_load_data(std::set< std::pair< Data *, unsigned >> &paired_load_data)
Add to the set paired_load_data pairs containing.
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 ...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...