27 #ifndef OOMPH_DISCONTINUOUS_GALERKIN_SPACETIME_NAVIER_STOKES_ELEMENTS_HEADER
28 #define OOMPH_DISCONTINUOUS_GALERKIN_SPACETIME_NAVIER_STOKES_ELEMENTS_HEADER
32 #include <oomph-lib-config.h>
45 class FpPressureAdvDiffRobinBCSpaceTimeElementBase
46 :
public virtual FaceElement
61 const unsigned& compute_jacobian_flag) = 0;
76 template<
class ELEMENT>
89 const bool& called_from_refineable_constructor =
false)
98 if (!called_from_refineable_constructor)
101 if (element_pt->
dim() == 3)
114 std::ostringstream error_message_stream;
118 <<
"This flux element will not work correctly "
119 <<
"if nodes are hanging!" << std::endl;
123 OOMPH_CURRENT_FUNCTION,
124 OOMPH_EXCEPTION_LOCATION);
143 const unsigned& flag);
150 std::ostringstream error_message;
153 error_message <<
"fill_in_contribution_to_residuals() must not be "
154 <<
"called directly.\nsince it uses the local equation "
155 <<
"numbering of the bulk element\nwhich calls the "
156 <<
"relevant helper function directly." << std::endl;
160 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
169 std::ostringstream error_message;
172 error_message <<
"fill_in_contribution_to_jacobian() must not be "
173 <<
"called directly.\nsince it uses the local equation "
174 <<
"numbering of the bulk element\nwhich calls the "
175 <<
"relevant helper function directly." << std::endl;
179 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
192 void output(std::ostream& outfile,
const unsigned& nplot)
210 template<
class ELEMENT>
213 Vector<double>& residuals,
214 DenseMatrix<double>& jacobian,
215 const unsigned& flag)
218 throw OomphLibError(
"You shouldn't be using this just yet!",
219 OOMPH_CURRENT_FUNCTION,
220 OOMPH_EXCEPTION_LOCATION);
224 unsigned my_dim = this->dim();
227 Vector<double>
s(my_dim, 0.0);
230 Vector<double> s_bulk(my_dim + 1, 0.0);
234 Vector<double> unit_normal(my_dim + 1, 0.0);
238 Vector<double> velocity(my_dim, 0.0);
241 unsigned n_intpt = this->integral_pt()->nweight();
247 int local_unknown = 0;
250 ELEMENT* bulk_el_pt =
dynamic_cast<ELEMENT*
>(this->bulk_element_pt());
253 unsigned n_pres = bulk_el_pt->npres_nst();
256 double re = bulk_el_pt->re();
265 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
268 double w = this->integral_pt()->weight(ipt);
271 for (
unsigned i = 0;
i < my_dim;
i++)
274 s[
i] = this->integral_pt()->knot(ipt,
i);
278 s_bulk = this->local_coordinate_in_bulk(
s);
284 this->outer_unit_normal(ipt, unit_normal);
287 bulk_el_pt->interpolated_u_nst(s_bulk, velocity);
293 for (
unsigned i = 0;
i < my_dim;
i++)
296 flux += velocity[
i] * unit_normal[
i];
307 double interpolated_press = bulk_el_pt->interpolated_p_nst(s_bulk);
310 bulk_el_pt->pshape_nst(s_bulk, psip, testp);
313 double J = this->J_eulerian(
s);
320 for (
unsigned l = 0; l < n_pres; l++)
323 local_eqn = bulk_el_pt->p_local_eqn(l);
329 residuals[local_eqn] -= re * flux * interpolated_press * testp[l] *
W;
335 for (
unsigned l2 = 0; l2 < n_pres; l2++)
338 local_unknown = bulk_el_pt->p_local_eqn(l2);
341 if (local_unknown >= 0)
344 jacobian(local_eqn, local_unknown) -=
345 re * flux * psip[l2] * testp[l] *
W;
362 class TemplateFreeSpaceTimeNavierStokesEquationsBase
363 :
public virtual NavierStokesElementWithDiagonalMassMatrices,
364 public virtual FiniteElement
406 std::map<
Data*, std::vector<int>>& eqn_number_backup) = 0;
413 const unsigned& face_index) = 0;
429 const unsigned& which_one = 0) = 0;
462 template<
unsigned DIM>
562 DShape& dtestdx)
const = 0;
573 DShape& dtestdx)
const = 0;
595 DShape& dppsidx)
const = 0;
603 DShape& dptestdx)
const = 0;
613 DShape& dptestdx)
const = 0;
636 (*Body_force_fct_pt)(time, x, result);
669 for (
unsigned i = 0;
i < DIM;
i++)
678 for (
unsigned j = 0; j < DIM; j++)
681 d_body_force_dx(j,
i) = (body_force_pls[j] - body_force[j]) / eps_fd;
727 double source_pls = 0.0;
733 for (
unsigned i = 0;
i < DIM;
i++)
742 for (
unsigned j = 0; j < DIM; j++)
745 gradient[
i] = (source_pls - source) / eps_fd;
761 const unsigned& flag);
770 const unsigned& flag);
778 double*
const& parameter_pt,
782 const unsigned& flag);
841 if (strouhal_data_pt == 0)
844 std::ostringstream error_message_stream;
848 <<
"User supplied Strouhal number as external data\n"
849 <<
"but the pointer provided is a null pointer!" << std::endl;
853 OOMPH_CURRENT_FUNCTION,
854 OOMPH_EXCEPTION_LOCATION);
870 const double&
re()
const
894 const double&
st()
const
900 unsigned data_index = 0;
903 unsigned strouhal_index = 0;
924 unsigned data_index = 0;
928 unsigned strouhal_index = 0;
1065 Shape& test)
const = 0;
1072 double u_nst(
const unsigned& n,
const unsigned&
i)
const
1079 double u_nst(
const unsigned&
t,
const unsigned& n,
const unsigned&
i)
const
1086 throw OomphLibError(
"Space-time elements cannot have history values!",
1087 OOMPH_CURRENT_FUNCTION,
1088 OOMPH_EXCEPTION_LOCATION);
1108 std::ostringstream error_message_stream;
1111 error_message_stream <<
"Input index " <<
i <<
" does not correspond "
1112 <<
"to a velocity component when DIM=" << DIM
1113 <<
"!" << std::endl;
1117 OOMPH_CURRENT_FUNCTION,
1118 OOMPH_EXCEPTION_LOCATION);
1165 const unsigned&
i)
const
1168 unsigned n_node =
nnode();
1174 DShape dpsidx(n_node, DIM + 1);
1181 double interpolated_dudt = 0.0;
1187 for (
unsigned l = 0; l < n_node; l++)
1190 interpolated_dudt +=
nodal_value(l, u_nodal_index) * dpsidx(l, DIM);
1194 return interpolated_dudt;
1218 virtual double p_nst(
const unsigned& n_p)
const = 0;
1221 virtual double p_nst(
const unsigned&
t,
const unsigned& n_p)
const = 0;
1224 virtual void fix_pressure(
const unsigned& p_dof,
const double& p_value) = 0;
1303 const unsigned& which_one = 0);
1317 const unsigned& nplot)
const
1326 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
1348 std::stringstream error_stream;
1351 error_stream <<
"These Navier Stokes elements only store " << DIM + 1
1353 <<
"but i is currently " <<
i << std::endl;
1357 OOMPH_CURRENT_FUNCTION,
1358 OOMPH_EXCEPTION_LOCATION);
1368 std::ofstream& file_out,
1370 const unsigned& nplot,
1378 std::stringstream error_stream;
1381 error_stream <<
"These Navier Stokes elements only store " << DIM + 1
1382 <<
" fields, but i is currently " <<
i << std::endl;
1386 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1394 double interpolated_t = 0.0;
1403 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
1409 for (
unsigned i = 0;
i < DIM;
i++)
1425 (*exact_soln_pt)(interpolated_t, spatial_coordinates, exact_soln);
1428 file_out << exact_soln[
i] << std::endl;
1454 std::stringstream error_stream;
1457 error_stream <<
"These Navier Stokes elements only store " << DIM + 1
1458 <<
" fields,\nbut i is currently " <<
i << std::endl;
1462 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1475 unsigned n_plot = 5;
1484 void output(std::ostream& outfile,
const unsigned& n_plot);
1492 unsigned n_plot = 5;
1501 void output(FILE* file_pt,
const unsigned& n_plot);
1510 unsigned n_plot = 5;
1527 const unsigned& nplot,
1540 const unsigned& nplot,
1548 const unsigned& nplot,
1610 unsigned compute_jacobian_flag = 0;
1617 compute_jacobian_flag);
1627 unsigned compute_jacobian_flag = 1;
1634 compute_jacobian_flag);
1646 unsigned compute_matrices_flag = 2;
1650 residuals, jacobian, mass_matrix, compute_matrices_flag);
1660 unsigned compute_jacobian_flag = 0;
1668 compute_jacobian_flag);
1675 double*
const& parameter_pt,
1680 unsigned compute_jacobian_flag = 1;
1688 compute_jacobian_flag);
1695 double*
const& parameter_pt,
1701 unsigned compute_matrices_flag = 2;
1707 dmass_matrix_dparam,
1708 compute_matrices_flag);
1718 unsigned compute_jacobian_flag = 0;
1732 unsigned compute_jacobian_flag = 1;
1736 residuals, jacobian, compute_jacobian_flag);
1742 std::map<
Data*, std::vector<int>>& eqn_number_backup)
1747 for (
unsigned j = 0; j < nint; j++)
1750 if (eqn_number_backup[data_pt].
size() == 0)
1752 unsigned nvalue = data_pt->
nvalue();
1753 eqn_number_backup[data_pt].resize(nvalue);
1754 for (
unsigned i = 0;
i < nvalue;
i++)
1757 eqn_number_backup[data_pt][
i] = data_pt->
eqn_number(
i);
1766 unsigned nnod = this->
nnode();
1767 for (
unsigned j = 0; j < nnod; j++)
1770 if (eqn_number_backup[nod_pt].
size() == 0)
1772 unsigned nvalue = nod_pt->
nvalue();
1773 eqn_number_backup[nod_pt].resize(nvalue);
1774 for (
unsigned i = 0;
i < nvalue;
i++)
1801 if (solid_nod_pt != 0)
1804 if (eqn_number_backup[solid_posn_data_pt].
size() == 0)
1806 unsigned nvalue = solid_posn_data_pt->
nvalue();
1807 eqn_number_backup[solid_posn_data_pt].resize(nvalue);
1808 for (
unsigned i = 0;
i < nvalue;
i++)
1811 eqn_number_backup[solid_posn_data_pt][
i] =
1815 solid_posn_data_pt->
pin(
i);
1828 const unsigned& face_index) = 0;
1835 std::ostream& outfile)
1838 for (
unsigned e = 0;
e < nel;
e++)
1842 outfile <<
"ZONE" << std::endl;
1847 for (
unsigned ipt = 0; ipt < n; ipt++)
1849 for (
unsigned i = 0;
i < DIM;
i++)
1855 for (
unsigned i = 0;
i < DIM + 1;
i++)
1857 outfile << x[
i] <<
" ";
1859 for (
unsigned i = 0;
i < DIM;
i++)
1861 outfile << unit_normal[
i] <<
" ";
1863 outfile << std::endl;
1875 for (
unsigned e = 0;
e < nel;
e++)
1896 unsigned n_node =
nnode();
1905 for (
unsigned i = 0;
i < DIM;
i++)
1914 for (
unsigned l = 0; l < n_node; l++)
1927 unsigned n_node =
nnode();
1939 double interpolated_u = 0.0;
1942 for (
unsigned l = 0; l < n_node; l++)
1945 interpolated_u +=
nodal_value(l, u_nodal_index) * psi[l];
1949 return interpolated_u;
1957 const unsigned&
i)
const
1960 std::ostringstream error_message_stream;
1963 error_message_stream <<
"This interface doesn't make sense in "
1964 <<
"space-time elements!" << std::endl;
1968 OOMPH_CURRENT_FUNCTION,
1969 OOMPH_EXCEPTION_LOCATION);
1984 unsigned n_node =
nnode();
1996 unsigned n_u_dof = 0;
1999 for (
unsigned l = 0; l < n_node; l++)
2005 if (global_eqn >= 0)
2013 du_ddata.resize(n_u_dof, 0.0);
2014 global_eqn_number.resize(n_u_dof, 0);
2019 for (
unsigned l = 0; l < n_node; l++)
2023 if (global_eqn >= 0)
2026 global_eqn_number[count] = global_eqn;
2028 du_ddata[count] = psi[l];
2047 double interpolated_p = 0.0;
2049 for (
unsigned l = 0; l < n_pres; l++)
2051 interpolated_p +=
p_nst(l) * psi[l];
2054 return (interpolated_p);
2069 double interpolated_p = 0.0;
2071 for (
unsigned l = 0; l < n_pres; l++)
2073 interpolated_p +=
p_nst(
t, l) * psi[l];
2076 return (interpolated_p);
2085 data.resize(2 * DIM + 2);
2088 for (
unsigned i = 0;
i < DIM + 1;
i++)
2095 for (
unsigned i = 0;
i < DIM;
i++)
2116 template<
unsigned DIM>
2117 class QTaylorHoodSpaceTimeElement
2118 :
public virtual QElement<DIM + 1, 3>,
2119 public virtual SpaceTimeNavierStokesEquations<DIM>
2128 static const unsigned Pconv[];
2155 const unsigned& ipt,
2231 return static_cast<int>(DIM);
2254 double p_nst(
const unsigned&
t,
const unsigned& n_p)
const
2266 return static_cast<unsigned>(pow(2.0,
static_cast<int>(DIM + 1)));
2302 std::set<std::pair<Data*, unsigned>>& paired_load_data);
2314 std::set<std::pair<Data*, unsigned>>& paired_pressure_data);
2326 void output(std::ostream& outfile,
const unsigned& nplot)
2342 void output(FILE* file_pt,
const unsigned& nplot)
2352 unsigned ndof_types() const
2354 // Return the number of dof types being used in the mesh
2356 } // End of ndof_types
2369 void get_dof_numbers_for_unknowns(
2370 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list) const;
2381 template<
unsigned DIM>
2383 const Vector<double>&
s,
2387 DShape& dtestdx)
const
2393 const unsigned el_dim = this->dim();
2397 this->dshape_local(
s, psi, dpsidx);
2400 DenseMatrix<double> inverse_jacobian(el_dim);
2404 this->local_to_eulerian_mapping(dpsidx, inverse_jacobian);
2407 this->transform_derivatives(inverse_jacobian, dpsidx);
2416 std::ostringstream error_message_stream;
2419 error_message_stream <<
"Need 3D space-time elements for this to work!"
2423 throw OomphLibError(error_message_stream.str(),
2424 OOMPH_CURRENT_FUNCTION,
2425 OOMPH_EXCEPTION_LOCATION);
2430 double test_values[3][3];
2431 double dtest_values[3][3];
2449 for (
unsigned k = 0; k < 3; k++)
2452 for (
unsigned j = 0; j < 3; j++)
2455 for (
unsigned i = 0;
i < 3;
i++)
2459 dtest_values[0][
i] * test_values[1][j] * test_values[2][k];
2463 test_values[0][
i] * dtest_values[1][j] * test_values[2][k];
2467 test_values[0][
i] * test_values[1][j] * dtest_values[2][k];
2471 test_values[0][
i] * test_values[1][j] * test_values[2][k];
2481 this->transform_derivatives(inverse_jacobian, dtestdx);
2492 template<
unsigned DIM>
2493 inline double QTaylorHoodSpaceTimeElement<
2494 DIM>::dshape_and_dtest_eulerian_at_knot_nst(
const unsigned& ipt,
2498 DShape& dtestdx)
const
2501 const unsigned el_dim = DIM + 1;
2504 Vector<double>
s(el_dim, 0.0);
2507 for (
unsigned i = 0;
i < el_dim;
i++)
2510 s[
i] = this->integral_pt()->knot(ipt,
i);
2514 return dshape_and_dtest_eulerian_nst(
s, psi, dpsidx, test, dtestdx);
2569 for (
unsigned i = 0;
i < 2;
i++)
2572 for (
unsigned j = 0; j < 2; j++)
2575 for (
unsigned k = 0; k < 2; k++)
2578 ppsi[4 *
i + 2 * j + k] = psi3[
i] * psi2[j] * psi1[k];
2582 dppsidx(4 *
i + 2 * j + k, 0) = psi3[
i] * psi2[j] * dpsi1[k];
2586 dppsidx(4 *
i + 2 * j + k, 1) = psi3[
i] * dpsi2[j] * psi1[k];
2590 dppsidx(4 *
i + 2 * j + k, 2) = dpsi3[
i] * psi2[j] * psi1[k];
2602 dshape_local(
s, psi, dpsi);
2608 const double det = local_to_eulerian_mapping(dpsi, inverse_jacobian);
2612 transform_derivatives(inverse_jacobian, dppsidx);
2672 for (
unsigned i = 0;
i < 2;
i++)
2675 for (
unsigned j = 0; j < 2; j++)
2678 for (
unsigned k = 0; k < 2; k++)
2681 ptest[4 *
i + 2 * j + k] = test3[
i] * test2[j] * test1[k];
2685 dptestdx(4 *
i + 2 * j + k, 0) = test3[
i] * test2[j] * dtest1[k];
2689 dptestdx(4 *
i + 2 * j + k, 1) = test3[
i] * dtest2[j] * test1[k];
2693 dptestdx(4 *
i + 2 * j + k, 2) = dtest3[
i] * test2[j] * test1[k];
2705 dshape_local(
s, psi, dpsi);
2711 const double det = local_to_eulerian_mapping(dpsi, inverse_jacobian);
2715 transform_derivatives(inverse_jacobian, dptestdx);
2736 dptest_eulerian(
s, ptest, dptestdx);
2739 return this->dpshape_eulerian(
s, ppsi, dppsidx);
2755 const unsigned& ipt,
2765 const double J = this->dshape_eulerian_at_knot(
2766 ipt, psi, dpsidx, djacobian_dX, d_dpsidx_dX);
2769 throw OomphLibError(
"Hasn't been implemented properly yet!",
2770 OOMPH_CURRENT_FUNCTION,
2771 OOMPH_EXCEPTION_LOCATION);
2774 for (
unsigned i = 0;
i < 27;
i++)
2780 for (
unsigned k = 0; k < 3; k++)
2783 dtestdx(
i, k) = dpsidx(
i, k);
2786 for (
unsigned p = 0; p < 3; p++)
2789 for (
unsigned q = 0; q < 27; q++)
2793 d_dtestdx_dX(p, q,
i, k) = d_dpsidx_dX(p, q,
i, k);
2835 for (
unsigned i = 0;
i < 2;
i++)
2838 for (
unsigned j = 0; j < 2; j++)
2841 for (
unsigned k = 0; k < 2; k++)
2844 psi[4 *
i + 2 * j + k] = psi3[
i] * psi2[j] * psi1[k];
2882 for (
unsigned i = 0;
i < 2;
i++)
2885 for (
unsigned j = 0; j < 2; j++)
2888 for (
unsigned k = 0; k < 2; k++)
2891 test[4 *
i + 2 * j + k] = test3[
i] * test2[j] * test1[k];
2901 template<
unsigned DIM>
2917 class FaceGeometry<QTaylorHoodSpaceTimeElement<2>>
2918 :
public virtual QElement<2, 3>
2929 class FaceGeometry<FaceGeometry<QTaylorHoodSpaceTimeElement<2>>>
2930 :
public virtual QElement<1, 3>
2944 template<
class TAYLOR_HOOD_ELEMENT>
2945 class ProjectableTaylorHoodSpaceTimeElement
2946 :
public virtual ProjectableElement<TAYLOR_HOOD_ELEMENT>
2966 if (fld < this->dim() - 1)
2969 unsigned nnod = this->nnode();
2972 for (
unsigned j = 0; j < nnod; j++)
2975 data_values.push_back(std::make_pair(this->node_pt(j), fld));
2983 unsigned Pconv_size = this->dim();
2986 for (
unsigned j = 0; j < Pconv_size; j++)
2989 unsigned vertex_index = this->Pconv[j];
2992 data_values.push_back(
2993 std::make_pair(this->node_pt(vertex_index), fld));
3017 if (fld == this->dim())
3020 return this->node_pt(0)->ntstorage();
3026 return this->node_pt(0)->ntstorage();
3036 return this->node_pt(0)->position_time_stepper_pt()->ntstorage();
3047 unsigned n_dim = this->dim();
3050 unsigned n_node = this->nnode();
3056 this->pshape_nst(
s, psi);
3062 Shape testf(n_node);
3065 DShape dpsifdx(n_node, n_dim);
3068 DShape dtestfdx(n_node, n_dim);
3071 double J = this->dshape_and_dtest_eulerian_nst(
3072 s, psif, dpsifdx, testf, dtestfdx);
3081 Shape testf(n_node);
3084 DShape dpsifdx(n_node, n_dim);
3087 DShape dtestfdx(n_node, n_dim);
3091 this->dshape_and_dtest_eulerian_nst(
s, psi, dpsifdx, testf, dtestfdx);
3102 const unsigned& fld,
3105 unsigned n_dim = this->dim();
3106 unsigned n_node = this->nnode();
3111 return this->interpolated_p_nst(
t,
s);
3117 unsigned u_nodal_index = this->u_index_nst(fld);
3123 this->
shape(s, psi);
3126 double interpolated_u = 0.0;
3129 for (
unsigned l = 0; l < n_node; l++)
3131 interpolated_u += this->nodal_value(
t, l, u_nodal_index) * psi[l];
3133 return interpolated_u;
3141 if (fld == this->dim())
3143 return this->npres_nst();
3147 return this->nnode();
3155 if (fld == this->dim())
3157 return this->p_local_eqn(j);
3161 const unsigned u_nodal_index = this->u_index_nst(fld);
3162 return this->nodal_local_eqn(j, u_nodal_index);
3172 template<
class ELEMENT>
3173 class FaceGeometry<ProjectableTaylorHoodSpaceTimeElement<ELEMENT>>
3174 :
public virtual FaceGeometry<ELEMENT>
3184 template<
class ELEMENT>
3186 FaceGeometry<ProjectableTaylorHoodSpaceTimeElement<ELEMENT>>>
3187 :
public virtual FaceGeometry<FaceGeometry<ELEMENT>>
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.
double * value_pt(const unsigned &i) const
Return the pointer to the i-the stored value. Typically this is required when direct access to the st...
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).
/////////////////////////////////////////////////////////////////////////
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)
void outer_unit_normal(const Vector< double > &s, Vector< double > &unit_normal) const
Compute outer unit normal at the specified local coordinate.
double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s. Overloaded to get information from bulk...
FaceGeometry()
Constructor; empty.
FaceGeometry()
Constructor; empty.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A general Finite Element class.
virtual unsigned nplot_points_paraview(const unsigned &nplot) const
Return the number of actual plot points for paraview plot with parameter nplot. Broken virtual; can b...
virtual void local_coordinate_of_node(const unsigned &j, Vector< double > &s) const
Get local coordinates of node j in the element; vector sets its own size (broken virtual)
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 void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing.
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational 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...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Return the local equation number corresponding to the i-th value at the n-th local node.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
unsigned nnode() const
Return the number of nodes.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
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...
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Function for building a lower dimensional FaceElement on the specified face of the FiniteElement....
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
bool has_hanging_nodes() const
Return boolean to indicate if any of the element's nodes are geometrically hanging.
Helper class for elements that impose Robin boundary conditions on pressure advection diffusion probl...
virtual ~FpPressureAdvDiffRobinBCSpaceTimeElementBase()
Empty virtual destructor.
FpPressureAdvDiffRobinBCSpaceTimeElementBase()
Constructor.
virtual void fill_in_generic_residual_contribution_fp_press_adv_diff_robin_bc(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &compute_jacobian_flag)=0
This function returns the residuals for the traction function. If compute_jacobian_flag=1 (or 0): do ...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
void output(std::ostream &outfile, const unsigned &nplot)
Output function: x,y,[z],u,v,[w],p in tecplot format.
void output(std::ostream &outfile)
Overload the output function.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
This function returns just the residuals.
virtual void fill_in_generic_residual_contribution_fp_press_adv_diff_robin_bc(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
This function returns the residuals for the traction function. flag=1 (or 0): do (or don't) compute t...
FpPressureAdvDiffRobinBCSpaceTimeElement(FiniteElement *const &element_pt, const int &face_index, const bool &called_from_refineable_constructor=false)
Constructor, which takes a "bulk" element and the value of the index and its limit....
~FpPressureAdvDiffRobinBCSpaceTimeElement()
Empty destructor.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
This function returns the residuals and the jacobian.
virtual void fill_in_generic_residual_contribution_fp_press_adv_diff_robin_bc(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
This function returns the residuals for the traction function. flag=1 (or 0): do (or don't) compute t...
static double Default_fd_jacobian_step
Double used for the default finite difference step in elemental jacobian calculations.
Data *& external_data_pt(const unsigned &i)
Return a pointer to i-th external data object.
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
unsigned ninternal_data() const
Return the number of internal data objects.
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) external data object to the element and return its index (i....
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
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....
double get_field(const unsigned &t, const unsigned &fld, const Vector< double > &s)
Return interpolated field fld at local coordinate s, at time level t (t=0: present; t>0: history valu...
unsigned nfields_for_projection()
Number of fields to be projected: dim+1, corresponding to velocity components and pressure.
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld.
unsigned nhistory_values_for_coordinate_projection()
Number of positional history values (Note: count includes current value!)
Vector< std::pair< Data *, unsigned > > data_values_of_field(const unsigned &fld)
Specify the values associated with field fld. The information is returned in a vector of pairs which ...
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of value j in field fld.
double jacobian_and_shape_of_field(const unsigned &fld, const Vector< double > &s, Shape &psi)
Return the Jacobian of the mapping and the shape functions of field fld at local coordinate s.
ProjectableTaylorHoodSpaceTimeElement()
Constructor [this was only required explicitly from gcc 4.5.2 onwards...].
unsigned nhistory_values_for_projection(const unsigned &fld)
Number of history values to be stored for fld-th field. Whatever the timestepper has set up for the v...
/////////////////////////////////////////////////////////////////////// /////////////////////////////...
/////////////////////////////////////////////////////////////////////////// /////////////////////////...
void output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
virtual int p_nodal_index_nst() const
Set the value at which the pressure is stored in the nodes.
void output(FILE *file_pt, const unsigned &nplot)
Redirect output to NavierStokesEquations output.
double dptest_eulerian(const Vector< double > &s, Shape &ptest, DShape &dptestdx) const
Pressure test functions and their derivs w.r.t. to global coords at local coordinate s (taken from ge...
QTaylorHoodSpaceTimeElement()
Constructor, no internal data points.
double p_nst(const unsigned &t, const unsigned &n_p) const
Access function for the pressure values at local pressure node n_p (const version)
double dpshape_eulerian(const Vector< double > &s, Shape &ppsi, DShape &dppsidx) const
Pressure shape functions and their derivs w.r.t. to global coords at local coordinate s (taken from g...
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at node.
void pshape_nst(const Vector< double > &s, Shape &psi) const
Pressure shape functions at local coordinate s.
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.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
void output(std::ostream &outfile, const unsigned &nplot)
Redirect output to NavierStokesEquations output.
virtual unsigned required_nvalue(const unsigned &n) const
Number of values (pinned or dofs) required at node n. Can be overwritten for hanging node version.
int p_local_eqn(const unsigned &n) const
Return the local equation numbers for the pressure values.
double p_nst(const unsigned &n_p) const
Access function for the pressure values at local pressure node n_p (const version)
void pshape_nst(const Vector< double > &s, Shape &psi, Shape &test) const
Pressure shape and test functions at local coordinte s.
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...
void identify_load_data(std::set< std::pair< Data *, unsigned >> &paired_load_data)
Add to the set paired_load_data pairs containing.
void ptest_nst(const Vector< double > &s, Shape &psi) const
Pressure test functions at local coordinate s.
void identify_pressure_data(std::set< std::pair< Data *, unsigned >> &paired_pressure_data)
Add to the set paired_pressure_data pairs containing.
double dpshape_and_dptest_eulerian_nst(const Vector< double > &s, Shape &ppsi, DShape &dppsidx, Shape &ptest, DShape &dptestdx) const
Pressure shape and test functions and their derivs w.r.t. to global coords at local coordinate s (tak...
double dshape_and_dtest_eulerian_at_knot_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, RankFourTensor< double > &d_dpsidx_dX, Shape &test, DShape &dtestdx, RankFourTensor< double > &d_dtestdx_dX, DenseMatrix< double > &djacobian_dX) const
Shape/test functions and derivs w.r.t. to global coords at integration point ipt; return Jacobian of ...
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 local coordinate s (tak...
~QTaylorHoodSpaceTimeElement()
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
unsigned npres_nst() const
Return number of pressure values.
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...
////////////////////////////////////////////////////////////////// //////////////////////////////////...
////////////////////////////////////////////////////////////////// //////////////////////////////////...
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
Data *const & variable_position_pt() const
Pointer to variable_position data (const version)
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
virtual double dpshape_and_dptest_eulerian_nst(const Vector< double > &s, Shape &ppsi, DShape &dppsidx, Shape &ptest, DShape &dptestdx) const =0
Compute the pressure shape and test functions and derivatives w.r.t. global coords at local coordinat...
NavierStokesBodyForceFctPt & body_force_fct_pt()
Access function for the body-force pointer.
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,...
virtual 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 fill_in_pressure_advection_diffusion_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the residuals and Jacobian for the associated pressure advection diffusion problem....
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not N.B. This needs to be public so th...
double *& st_pt()
Pointer to Strouhal number (can only assign to private member data)
double * ReInvFr_pt
Pointer to global Reynolds number x inverse Froude number (= Bond number / Capillary number)
int Pinned_fp_pressure_eqn
Global eqn number of pressure dof that's pinned in pressure advection diffusion problem (defaults to ...
void disable_ALE()
Disable ALE, i.e. assert the mesh is not moving – you do this at your own risk!
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
Validate against exact solution at given time Solution is provided via function pointer....
virtual void fill_in_generic_residual_contribution_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, const unsigned &flag)
Compute the residuals for the Navier-Stokes equations. Flag=1 (or 0): do (or don't) compute the Jacob...
void get_traction(const Vector< double > &s, const Vector< double > &N, Vector< double > &traction)
Compute traction (on the viscous scale) exerted onto the fluid at local coordinate s....
NavierStokesBodyForceFctPt Body_force_fct_pt
Pointer to body force function.
void compute_error(FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Validate against exact solution. Solution is provided via function pointer. Compute L2 error and L2 n...
void full_output(std::ostream &outfile)
Full output function: x,y,[z],u,v,[w],p,du/dt,dv/dt,[dw/dt],dissipation in tecplot format....
const double & st() const
Strouhal parameter (const. version)
double dissipation(const Vector< double > &s) const
Return dissipation at local coordinate s.
virtual double dshape_and_dtest_eulerian_nst(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Compute the shape functions and derivatives w.r.t. global coords at local coordinate s....
NavierStokesPressureAdvDiffSourceFctPt Press_adv_diff_source_fct_pt
Pointer to source function pressure advection diffusion equation (only to be used during validation)
virtual int p_nodal_index_nst() const
Return the index at which the pressure is stored if it is stored at the nodes. If not stored at the n...
void delete_pressure_advection_diffusion_robin_elements()
Delete the FaceElements that apply the Robin boundary condition to the pressure advection diffusion p...
void compute_norm(Vector< double > &norm)
Compute the vector norm of the FEM solution.
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact solution specified via function pointer at a given number of plot points....
virtual double dshape_and_dtest_eulerian_at_knot_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, RankFourTensor< double > &d_dpsidx_dX, Shape &test, DShape &dtestdx, RankFourTensor< double > &d_dtestdx_dX, DenseMatrix< double > &djacobian_dX) const =0
Shape/test functions and derivs w.r.t. to global coords at integration point ipt; return Jacobian of ...
unsigned n_u_nst() const
Return the number of velocity components (used in FluidInterfaceElements)
double * St_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
void compute_error(FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Validate against exact solution. Solution is provided via function pointer. Compute L2 error and L2 n...
void get_vorticity(const Vector< double > &s, double &vorticity) const
Compute the vorticity vector at local coordinate s.
double * Density_Ratio_pt
Pointer to the density ratio (relative to the density used in the definition of the Reynolds number)
Vector< double > * G_pt
Pointer to global gravity Vector.
double du_dt_nst(const unsigned &n, const unsigned &i) const
i-th component of du/dt at local node n. Uses suitably interpolated value for hanging nodes.
NavierStokesBodyForceFctPt body_force_fct_pt() const
Access function for the body-force pointer. Const version.
virtual double interpolated_p_nst(const Vector< double > &s) const
Return FE interpolated pressure at local coordinate s.
static double Default_Physical_Constant_Value
Static default value for the physical constants (all initialised to zero)
void fill_in_contribution_to_hessian_vector_products(Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
Compute the hessian tensor vector products required to perform continuation of bifurcations analytica...
NavierStokesSourceFctPt & source_fct_pt()
Access function for the source-function pointer.
virtual double dshape_and_dtest_eulerian_at_knot_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Compute the shape functions and derivatives w.r.t. global coords at ipt-th integration point Return J...
void output(FILE *file_pt)
C-style output function: x,y,[z],u,v,[w],p in tecplot format. The default number of plot points is fi...
const double & re() const
Reynolds number.
double kin_energy() const
Get integral of kinetic energy over element.
void point_output_data(const Vector< double > &s, Vector< double > &data)
Output solution in data vector at local cordinates s: x,y,z,u,v,p.
void output_fct(std::ostream &outfile, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Output exact solution specified via function pointer at a given time and at a given number of plot po...
const double & density_ratio() const
Density ratio for element: Element's density relative to the viscosity used in the definition of the ...
int & pinned_fp_pressure_eqn()
Global eqn number of pressure dof that's pinned in pressure adv diff problem.
NavierStokesSourceFctPt source_fct_pt() const
Access function for the source-function pointer. Const version.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Compute the element's residual Vector.
void(* NavierStokesBodyForceFctPt)(const double &time, const Vector< double > &x, Vector< double > &body_force)
Function pointer to body force function fct(t,x,f(x)) x is a Vector!
void store_strouhal_as_external_data(Data *strouhal_data_pt)
Function that tells us whether the period is stored as external data.
virtual void fill_in_generic_pressure_advection_diffusion_contribution_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Compute the residuals for the associated pressure advection diffusion problem. Used by the Fp precond...
Vector< FpPressureAdvDiffRobinBCSpaceTimeElementBase * > Pressure_advection_diffusion_robin_element_pt
Storage for FaceElements that apply Robin BC for pressure adv diff equation used in Fp preconditioner...
double * st_pt() const
Pointer to Strouhal parameter (const. version)
virtual double p_nst(const unsigned &n_p) const =0
Pressure at local pressure "node" n_p Uses suitably interpolated value for hanging nodes.
virtual void fill_in_generic_dresidual_contribution_nst(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam, const unsigned &flag)
Compute the derivatives of the residuals for the Navier-Stokes equations with respect to a parameter ...
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Add the element's contribution to its residuals vector, jacobian matrix and mass matrix.
double interpolated_du_dt_nst(const Vector< double > &s, const unsigned &i) const
Return FE representation of function value du_i/dt(s) at local coordinate s.
virtual double p_nst(const unsigned &t, const unsigned &n_p) const =0
Pressure at local pressure "node" n_p at time level t.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function: x,y,[z],u,v,[w],p in tecplot format. Here, we use n_plot plot points in each coordin...
double * Viscosity_Ratio_pt
Pointer to the viscosity ratio (relative to the viscosity used in the definition of the Reynolds numb...
void fill_in_contribution_to_dresiduals_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam)
Compute the element's residual Vector (differentiated w.r.t. a parameter)
bool is_strouhal_stored_as_external_data() const
Are we storing the Strouhal number as external data?
const Vector< double > & g() const
Vector of gravitational components.
NavierStokesPressureAdvDiffSourceFctPt & source_fct_for_pressure_adv_diff()
Access function for the source-function pointer for pressure advection diffusion (used for validation...
static int Pressure_not_stored_at_node
Static "magic" number that indicates that the pressure is not stored at a node.
virtual void get_body_force_nst(const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &result)
Calculate the body force at a given time and local and/or Eulerian position. This function is virtual...
void output(std::ostream &outfile)
Output function: x,y,t,u,v,p in tecplot format. The default number of plot points is five.
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Validate against exact solution. Solution is provided via function pointer. Plot at a given number of...
double d_kin_energy_dt() const
Get integral of time derivative of kinetic energy over element.
double dissipation() const
Return integral of dissipation over element.
double *& re_pt()
Pointer to Reynolds number.
void fill_in_pressure_advection_diffusion_residuals(Vector< double > &residuals)
Compute the residuals for the associated pressure advection diffusion problem. Used by the Fp precond...
double * Re_pt
Pointer to global Reynolds number.
virtual void pshape_nst(const Vector< double > &s, Shape &psi, Shape &test) const =0
Compute the pressure shape and test functions at local coordinate s.
virtual unsigned npres_nst() const =0
Function to return number of pressure degrees of freedom.
virtual void fill_in_generic_pressure_advection_diffusion_contribution_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Compute the residuals for the associated pressure advection diffusion problem. Used by the Fp precond...
double interpolated_u_nst(const Vector< double > &s, const unsigned &i) const
Return FE interpolated velocity u[i] at local coordinate s.
static Vector< double > Default_Gravity_vector
Static default value for the gravity vector.
virtual void fill_in_generic_residual_contribution_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, const unsigned &flag)
Compute the residuals for the Navier-Stokes equations. Flag=1 (or 0): do (or don't) compute the Jacob...
NavierStokesSourceFctPt Source_fct_pt
Pointer to volumetric source function.
double(* NavierStokesSourceFctPt)(const double &time, const Vector< double > &x)
Function pointer to source function fct(t,x) (x is a Vector!)
void scalar_value_fct_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt) const
Write values of the i-th scalar field at the plot points. Needs to be implemented for each new specif...
const double & re_invfr() const
Global inverse Froude number.
void get_load(const Vector< double > &s, const Vector< double > &N, Vector< double > &load)
This implements a pure virtual function defined in the FSIFluidElement class. The function computes t...
double u_nst(const unsigned &t, const unsigned &n, const unsigned &i) const
Velocity i at local node n at timestep t (t=0: present; t>0: previous). Uses suitably interpolated va...
double *& density_ratio_pt()
Pointer to Density ratio.
void fill_in_contribution_to_djacobian_and_dmass_matrix_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
Add the element's contribution to its residuals vector, jacobian matrix and mass matrix.
NavierStokesPressureAdvDiffSourceFctPt source_fct_for_pressure_adv_diff() const
Access function for the source-function pointer for pressure advection diffusion (used for validation...
unsigned nscalar_paraview() const
Number of scalars/fields output by this element. Reimplements broken virtual function in base class.
void get_traction(const Vector< double > &s, const Vector< double > &N, Vector< double > &traction_p, Vector< double > &traction_visc_n, Vector< double > &traction_visc_t)
Compute traction (on the viscous scale) exerted onto the fluid at local coordinate s,...
double re_st() const
Product of Reynolds and Strouhal number (=Womersley number)
void pin_all_non_pressure_dofs(std::map< Data *, std::vector< int >> &eqn_number_backup)
Pin all non-pressure dofs and backup eqn numbers.
void interpolated_u_nst(const Vector< double > &s, Vector< double > &velocity) const
Compute vector of FE interpolated velocity u at local coordinate s.
SpaceTimeNavierStokesEquations()
Constructor: NULL the body force and source function and make sure the ALE terms are included by defa...
virtual double dptest_eulerian(const Vector< double > &s, Shape &ptest, DShape &dptestdx) const =0
Pressure test functions and their derivs w.r.t. to global coords at local coordinate s (taken from ge...
double pressure_integral() const
Integral of pressure over element.
virtual void pshape_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
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,...
virtual double get_source_nst(const double &time, const unsigned &ipt, const Vector< double > &x)
Calculate the source fct at a given time and Eulerian position.
void output_veloc(std::ostream &outfile, const unsigned &nplot, const unsigned &t)
Output function: x,y,t,u,v in tecplot format. Use n_plot points in each coordinate direction at times...
double interpolated_u_nst(const unsigned &t, const Vector< double > &s, const unsigned &i) const
Return FE interpolated velocity u[i] at local coordinate s time level, t. Purposely broken for space-...
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Validate against exact solution at given time Solution is provided via function pointer....
virtual void get_dresidual_dnodal_coordinates(RankThreeTensor< double > &dresidual_dnodal_coordinates)
Compute derivatives of elemental residual vector with respect to nodal coordinates....
virtual void fill_in_generic_dresidual_contribution_nst(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam, const unsigned &flag)
Compute the derivatives of the residuals for the Navier-Stokes equations with respect to a parameter ...
void get_vorticity(const Vector< double > &s, Vector< double > &vorticity) const
Compute the vorticity vector at local coordinate s.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function: x,y,[z],u,v,[w],p in tecplot format. Use n_plot points in each coordinate di...
void fill_in_contribution_to_djacobian_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
Compute the element's residual Vector and the jacobian matrix Virtual function can be overloaded by h...
virtual void get_body_force_gradient_nst(const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, DenseMatrix< double > &d_body_force_dx)
Get gradient of body force term at (Eulerian) position x. This function is virtual to allow overloadi...
double u_nst(const unsigned &n, const unsigned &i) const
Velocity i at local node n. Uses suitably interpolated value for hanging nodes. The use of u_index_ns...
double(* NavierStokesPressureAdvDiffSourceFctPt)(const Vector< double > &x)
Function pointer to source function fct(x) for the pressure advection diffusion equation (only used d...
const double & viscosity_ratio() const
Viscosity ratio for element: Element's viscosity relative to the viscosity used in the definition of ...
virtual void fix_pressure(const unsigned &p_dof, const double &p_value)=0
Pin p_dof-th pressure dof and set it to value specified by p_value.
virtual double dpshape_eulerian(const Vector< double > &s, Shape &ppsi, DShape &dppsidx) const =0
Pressure shape functions and their derivs w.r.t. to global coords at local coordinate s (taken from g...
void output_pressure_advection_diffusion_robin_elements(std::ostream &outfile)
Output the FaceElements that apply the Robin boundary condition to the pressure advection diffusion p...
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_invfr_pt()
Pointer to global inverse Froude number.
virtual void get_source_gradient_nst(const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &gradient)
Get gradient of source term at (Eulerian) position x. This function is virtual to allow overloading i...
static double Default_Physical_Ratio_Value
Static default value for the physical ratios (all are initialised to one)
double *& viscosity_ratio_pt()
Pointer to Viscosity Ratio.
void enable_ALE()
(Re-)enable ALE, i.e. take possible mesh motion into account when evaluating the time-derivative....
virtual void build_fp_press_adv_diff_robin_bc_element(const unsigned &face_index)=0
Build FaceElements that apply the Robin boundary condition to the pressure advection diffusion proble...
bool Strouhal_is_stored_as_external_data
Boolean to indicate whether or not the Strouhal value is stored as external data (if it's also an unk...
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when time-derivatives are computed....
void full_output(std::ostream &outfile, const unsigned &n_plot)
Full output function: x,y,t,u,v,p,du/dt,dv/dt,dissipation in tecplot format. Use n_plot plot points i...
Vector< double > *& g_pt()
Pointer to Vector of gravitational components.
void scalar_value_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
Write values of the i-th scalar field at the plot points. Needs to be implemented for each new specif...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the element's residual Vector and the jacobian matrix Virtual function can be overloaded by h...
double interpolated_p_nst(const unsigned &t, const Vector< double > &s) const
Return FE interpolated pressure at local coordinate s at time level t.
void output_vorticity(std::ostream &outfile, const unsigned &nplot)
Output function: x,y,t,omega in tecplot format. nplot points in each coordinate direction.
std::string scalar_name_paraview(const unsigned &i) const
Name of the i-th scalar field. Default implementation returns V1 for the first one,...
double get_du_dt(const unsigned &n, const unsigned &i) const
i-th component of du/dt at local node n. Uses suitably interpolated value for hanging nodes....
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
virtual void get_pressure_and_velocity_mass_matrix_diagonal(Vector< double > &press_mass_diag, Vector< double > &veloc_mass_diag, const unsigned &which_one=0)=0
Compute the diagonal of the velocity/pressure mass matrices. If which one=0, both are computed,...
virtual void build_fp_press_adv_diff_robin_bc_element(const unsigned &face_index)=0
Build FaceElements that apply the Robin boundary condition to the pressure advection diffusion proble...
virtual void fill_in_pressure_advection_diffusion_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)=0
Compute the residuals and Jacobian for the associated pressure advection diffusion problem....
TemplateFreeSpaceTimeNavierStokesEquationsBase()
Constructor (empty)
virtual ~TemplateFreeSpaceTimeNavierStokesEquationsBase()
Virtual destructor (empty)
virtual int p_nodal_index_nst() const =0
Return the index at which the pressure is stored if it is stored at the nodes. If not stored at the n...
virtual int p_local_eqn(const unsigned &n) const =0
Access function for the local equation number information for the pressure. p_local_eqn[n] = local eq...
virtual void pin_all_non_pressure_dofs(std::map< Data *, std::vector< int >> &eqn_number_backup)=0
Pin all non-pressure dofs and backup eqn numbers of all Data.
virtual void delete_pressure_advection_diffusion_robin_elements()=0
Delete the FaceElements that apply the Robin boundary condition to the pressure advection diffusion p...
virtual void fill_in_pressure_advection_diffusion_residuals(Vector< double > &residuals)=0
Compute the residuals for the associated pressure advection diffusion problem. Used by the Fp precond...
virtual int & pinned_fp_pressure_eqn()=0
Global eqn number of pressure dof that's pinned in pressure adv diff problem.
void initialise(const _Tp &__value)
Iterate over all values and set to the desired value.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
void dshape< 3 >(const double &s, double *DPsi)
Derivatives of 1D shape functions specialised to quadratic order (3 Nodes)
void shape< 3 >(const double &s, double *Psi)
1D shape functions specialised to quadratic order (3 Nodes)
void shape(const double &s, double *Psi)
Definition for 1D Lagrange shape functions. The value of all the shape functions at the local coordin...
void dshape< 3 >(const double &s, double *DPsi)
Derivatives of 1D shape functions specialised to quadratic order (3 Nodes)
void dshape< 2 >(const double &s, double *DPsi)
Derivatives of 1D shape functions specialised to linear order (2 Nodes)
void shape< 3 >(const double &s, double *Psi)
1D shape functions specialised to quadratic order (3 Nodes)
void shape< 2 >(const double &s, double *Psi)
1D shape functions specialised to linear order (2 Nodes)
std::string to_string(T object, unsigned float_precision=8)
Conversion function that should work for anything with operator<< defined (at least all basic types).
//////////////////////////////////////////////////////////////////// ////////////////////////////////...