29 #ifndef OOMPH_WOMERSLEY_ELEMENTS_HEADER
30 #define OOMPH_WOMERSLEY_ELEMENTS_HEADER
34 #include <oomph-lib-config.h>
39 #include "../generic/nodes.h"
40 #include "../generic/Qelements.h"
41 #include "../generic/mesh.h"
42 #include "../generic/problem.h"
43 #include "../generic/oomph_utilities.h"
44 #include "../navier_stokes/navier_stokes_flux_control_elements.h"
114 std::map<unsigned, double>* aux_integral_pt) = 0;
120 std::map<unsigned, double>* aux_integral_pt) = 0;
136 Mesh* navier_stokes_outflow_mesh_pt_mesh_pt) = 0;
184 template<
unsigned DIM>
205 if (pressure_gradient_data_pt->
nvalue() != 1)
208 "Pressure gradient Data must only contain a single value!\n",
271 for (
unsigned t = 0;
t < n_time;
t++)
291 const unsigned& n_plot,
292 const double& z_out);
296 void output(std::ostream& outfile,
const unsigned& nplot);
309 void output(FILE* file_pt,
const unsigned& n_plot);
314 const unsigned& nplot,
321 std::ostream& outfile,
322 const unsigned& nplot,
345 unsigned n_node =
nnode();
358 for (
unsigned j = 0;
j <
DIM;
j++)
364 for (
unsigned l = 0; l < n_node; l++)
367 for (
unsigned j = 0;
j <
DIM;
j++)
398 unsigned n_node =
nnode();
410 double interpolated_u = 0.0;
413 for (
unsigned l = 0; l < n_node; l++)
415 interpolated_u +=
nodal_value(l, u_nodal_index) * psi[l];
418 return (interpolated_u);
435 DShape& dtestdx)
const = 0;
445 DShape& dtestdx)
const = 0;
462 template<
unsigned DIMM>
479 Data* pressure_gradient_data_pt)
502 template<
unsigned DIM>
511 double* prescribed_flux_pt)
526 unsigned n_element = womersley_mesh_pt->
nelement();
531 for (
unsigned e = 0;
e < n_element;
e++)
560 for (
unsigned e = 0;
e < nelem;
e++)
595 unsigned n_dof =
ndof();
596 for (
unsigned i = 0;
i < n_dof;
i++)
598 for (
unsigned j = 0;
j < n_dof;
j++)
600 jacobian(
i,
j) = 0.0;
629 template<
unsigned DIM,
unsigned NNODE_1D>
668 void output(std::ostream& outfile,
const unsigned& n_plot)
684 void output(FILE* file_pt,
const unsigned& n_plot)
693 const unsigned& n_plot,
704 const unsigned& n_plot,
741 template<
class ELEMENT,
unsigned DIM>
759 double* prescribed_volume_flux_pt,
761 Mesh* womersley_mesh_pt);
774 Mesh* womersley_mesh_pt);
801 std::ofstream& trace_file,
802 const double& z_out = 0.0);
807 std::ofstream trace_file;
846 template<
class ELEMENT,
unsigned DIM>
849 PrescribedPressureGradientFctPt pressure_gradient_fct_pt,
851 Mesh* womersley_mesh_pt)
852 : Prescribed_volume_flux_pt(0),
854 Prescribed_pressure_gradient_fct_pt(pressure_gradient_fct_pt)
873 for (
unsigned i = 0;
i < n_element;
i++)
879 el_pt->re_st_pt() = re_st_pt;
888 for (
unsigned e = 0;
e < nelem;
e++)
899 oomph_info <<
"Number of equations in WomersleyProblem: "
914 template<
class ELEMENT,
unsigned DIM>
917 double* prescribed_volume_flux_pt,
919 Mesh* womersley_mesh_pt)
920 : Prescribed_volume_flux_pt(prescribed_volume_flux_pt),
922 Prescribed_pressure_gradient_fct_pt(0)
942 for (
unsigned i = 0;
i < n_element;
i++)
948 el_pt->re_st_pt() = re_st_pt;
967 oomph_info <<
"Number of equations in WomersleyProblem: "
976 template<
class ELEMENT,
unsigned DIM>
989 template<
class ELEMENT,
unsigned DIM>
991 std::ofstream& trace_file,
994 std::ofstream some_file;
995 std::ofstream some_file1;
1010 some_file1.open(
filename.str().c_str());
1014 << doc_info.
number() <<
".dat";
1015 some_file.open(
filename.str().c_str());
1018 unsigned nelem = mesh_pt()->nelement();
1019 for (
unsigned e = 0;
e < nelem;
e++)
1021 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(
e));
1024 flux += el_pt->get_volume_flux();
1025 el_pt->output_3d(some_file, npts, z_out);
1026 el_pt->output(some_file1, npts);
1032 double prescribed_g = 0.0;
1033 if (Prescribed_pressure_gradient_fct_pt != 0)
1035 prescribed_g = Prescribed_pressure_gradient_fct_pt(time_pt()->time());
1039 double prescribed_q = 0.0;
1040 if (Prescribed_volume_flux_pt != 0)
1042 prescribed_q = *Prescribed_volume_flux_pt;
1045 if (trace_file.is_open())
1047 trace_file << time_pt()->time() <<
" "
1048 << pressure_gradient_data_pt()->value(0) <<
" " <<
flux <<
" "
1049 << prescribed_g <<
" " << prescribed_q <<
" " << std::endl;
1068 template<
class ELEMENT,
unsigned DIM>
1081 const double& length,
1104 Mesh* navier_stokes_outflow_mesh_pt)
1119 navier_stokes_outflow_mesh_pt->
element_pt(0)))
1132 unsigned nelem = navier_stokes_outflow_mesh_pt->
nelement();
1133 for (
unsigned e = 0;
e < nelem;
e++)
1145 navier_stokes_outflow_mesh_pt);
1153 navier_stokes_outflow_mesh_pt->
element_pt(0)))
1155 std::ostringstream error_message;
1157 <<
"WomersleyImpedanceTubeBase requires a Navier-Stokes\n"
1158 <<
"outflow mesh of elements which inherit from either\n"
1159 <<
"TemplateFreeNavierStokesFluxControlElementBase or\n"
1160 <<
"NavierStokesImpedanceTractionElementBase.\n";
1190 double* re_st_pt = &
Zero;
1192 double q_initial = 0;
1194 setup(re_st_pt, dt, q_initial, time_stepper_pt);
1209 const double& q_initial,
1213 if (time_stepper_pt == 0)
1215 time_stepper_pt =
new BDF<2>;
1229 oomph_info <<
"NOTE: We're suppressing timings etc from \n"
1230 <<
" Newton solver in WomersleyImpedanceTubeBase. "
1324 for (
unsigned i = 0;
i < n_time_steppers;
i++)
1349 for (
unsigned e = 0;
e < nelem;
e++)
1354 ->get_volume_flux();
1359 for (
unsigned e = 0;
e < nelem;
e++)
1363 ->get_volume_flux();
1404 for (
unsigned e = 0;
e < nelem;
e++)
1419 for (
unsigned e = 0;
e < nelem;
e++)
1483 template<
unsigned DIM,
unsigned NNODE_1D>
1492 double J = this->dshape_eulerian(
s, psi, dpsidx);
1496 for (
unsigned i = 0;
i < NNODE_1D;
i++)
1499 for (
unsigned j = 0;
j <
DIM;
j++)
1501 dtestdx(
i,
j) = dpsidx(
i,
j);
1516 template<
unsigned DIM,
unsigned NNODE_1D>
1525 double J = this->dshape_eulerian_at_knot(ipt, psi, dpsidx);
1547 template<
unsigned DIM,
unsigned NNODE_1D>
1549 :
public virtual QElement<DIM - 1, NNODE_1D>
1566 template<
unsigned NNODE_1D>
1603 template<
class WOMERSLEY_ELEMENT>
1618 const unsigned& fixed_coordinate,
1619 const unsigned& w_index)
1622 unsigned nelem = n_st_outflow_mesh_pt->
nelement();
1628 std::set<Node*> n_st_nodes;
1629 for (
unsigned e = 0;
e < nelem;
e++)
1632 unsigned nnod_el = el_pt->
nnode();
1633 for (
unsigned j = 0;
j < nnod_el;
j++)
1635 n_st_nodes.insert(el_pt->
node_pt(
j));
1641 "Cannot build WomersleyMesh from mesh with hanging nodes!",
1649 unsigned nnode_n_st = n_st_nodes.size();
1656 for (
unsigned e = 0;
e < nelem;
e++)
1664 "Number of nodes in existing and new elements don't match",
1673 std::map<Node*, bool> n_st_node_done;
1677 std::map<Node*, Node*> equivalent_womersley_node_pt;
1680 unsigned node_count = 0;
1690 unsigned n_pinned_nodes = 0;
1694 for (
unsigned e = 0;
e < nelem;
e++)
1697 unsigned nnod_el = n_st_el_pt->
nnode();
1698 for (
unsigned j = 0;
j < nnod_el;
j++)
1704 if (!n_st_node_done[n_st_node_pt])
1711 Node_pt[node_count] = new_node_pt;
1716 unsigned dim = n_st_node_pt->
ndim();
1717 unsigned icount = 0;
1718 for (
unsigned i = 0;
i < dim;
i++)
1720 if (
i != fixed_coordinate)
1722 new_node_pt->
x(icount) = n_st_node_pt->
x(
i);
1730 new_node_pt->
pin(0);
1736 new_node_pt->
unpin(0);
1741 equivalent_womersley_node_pt[n_st_node_pt] = new_node_pt;
1744 n_st_node_done[n_st_node_pt] =
true;
1751 equivalent_womersley_node_pt[n_st_node_pt];
1762 for (
unsigned j = 0;
j < nnod;
j++)
1766 for (
unsigned j = 0;
j < nnod;
j++)
1774 throw OomphLibError(
"Element remains inverted even after reversing "
1775 "the local node numbers",
1786 if (n_pinned_nodes == 0)
1788 std::stringstream bla;
1789 bla <<
"Boundary conditions must be applied in Navier-Stokes\n"
1790 <<
"problem before attaching impedance elements.\n"
1791 <<
"Note: This warning can be suppressed by setting the\n"
1792 <<
"global static boolean\n\n"
1794 "TemplateFreeWomersleyMeshBase::Suppress_warning_about_"
1795 "unpinned_nst_dofs\n\n"
1804 if (
nnode() != nnode_n_st)
1807 "Number of nodes in the new mesh don't match that in the old one",
1825 template<
class ELEMENT,
unsigned DIM>
1840 Mesh* navier_stokes_outflow_mesh_pt,
1841 const unsigned& fixed_coordinate,
1842 const unsigned& w_index)
1844 navier_stokes_outflow_mesh_pt),
1865 return womersley_mesh_pt;
1972 template<
class BULK_NAVIER_STOKES_ELEMENT,
1973 class WOMERSLEY_ELEMENT,
1976 :
public virtual FaceGeometry<BULK_NAVIER_STOKES_ELEMENT>,
2009 unsigned n_node =
nnode();
2015 for (
unsigned i = 0;
i < n_node;
i++)
2061 BULK_NAVIER_STOKES_ELEMENT* elem_pt =
2062 dynamic_cast<BULK_NAVIER_STOKES_ELEMENT*
>(element_pt);
2064 if (elem_pt->dim() == 3)
2073 throw OomphLibError(
"This flux element will not work correctly "
2074 "if nodes are hanging\n",
2100 double volume_flux_integral = 0.0;
2115 BULK_NAVIER_STOKES_ELEMENT* bulk_el_pt =
2119 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
2123 for (
unsigned i = 0;
i <
DIM;
i++)
2148 bulk_el_pt->interpolated_x(s_bulk, x_bulk);
2150 double max_legal_error = 1.0e-12;
2152 for (
unsigned i = 0;
i <
DIM + 1;
i++)
2156 if (
error > max_legal_error)
2158 std::ostringstream error_stream;
2159 error_stream <<
"difference in Eulerian posn from bulk and face: "
2160 <<
error <<
" exceeds threshold " << max_legal_error
2174 bulk_el_pt->interpolated_u_nst(s_bulk, veloc);
2177 double volume_flux = 0.0;
2178 for (
unsigned i = 0;
i <
DIM + 1;
i++)
2180 volume_flux +=
normal[
i] * veloc[
i];
2184 volume_flux_integral += volume_flux *
W;
2187 return volume_flux_integral;
2205 std::set<Data*> external_data_set;
2207 for (
unsigned e = 0;
e < nelem;
e++)
2211 unsigned nnod = el_pt->
nnode();
2212 for (
unsigned j = 0;
j < nnod;
j++)
2214 external_data_set.insert(el_pt->
node_pt(
j));
2219 unsigned nnod =
nnode();
2220 for (
unsigned j = 0;
j < nnod;
j++)
2222 external_data_set.erase(
node_pt(
j));
2226 for (std::set<Data*>::iterator it = external_data_set.begin();
2227 it != external_data_set.end();
2255 "Navier_stokes_outflow_mesh_pt==0 -- set it with \n "
2256 "set_external_data_from_navier_stokes_outflow_mesh() before calling "
2264 double total_flux = 0.0;
2266 for (
unsigned e = 0;
e < nelem;
e++)
2276 total_flux += el_pt->get_volume_flux();
2298 std::map<unsigned, double>* aux_integral_pt)
2307 unsigned nnod =
nnode();
2314 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
2318 for (
unsigned i = 0;
i <
DIM;
i++)
2340 for (
unsigned j = 0;
j < nnod;
j++)
2346 for (
unsigned i = 0;
i < (
DIM + 1);
i++)
2354 (*aux_integral_pt)[i_global] += psi[
j] *
normal[
i] *
W;
2379 residuals, jacobian, 1);
2390 const unsigned&
i)
const
2403 void output(std::ostream& outfile,
const unsigned& nplot)
2419 template<
class BULK_NAVIER_STOKES_ELEMENT,
2420 class WOMERSLEY_ELEMENT,
2422 void NavierStokesImpedanceTractionElement<BULK_NAVIER_STOKES_ELEMENT,
2425 fill_in_generic_residual_contribution_fluid_traction(
2429 unsigned n_node = nnode();
2432 Shape psif(n_node), testf(n_node);
2435 unsigned n_intpt = integral_pt()->nweight();
2439 int local_unknown = 0;
2442 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
2445 double w = integral_pt()->weight(ipt);
2449 double J = shape_and_test_at_knot(ipt, psif, testf);
2459 double dp_in_dq = 0.0;
2463 if (Navier_stokes_outflow_mesh_pt != 0)
2466 Impedance_tube_pt->get_response(p_in, dp_in_dq);
2471 outer_unit_normal(ipt, unit_normal);
2474 for (
unsigned i = 0;
i <
DIM + 1;
i++)
2476 traction[
i] = -unit_normal[
i] * p_in;
2481 for (
unsigned l = 0; l < n_node; l++)
2484 for (
unsigned i = 0;
i <
DIM + 1;
i++)
2486 local_eqn = u_local_eqn(l,
i);
2491 residuals[local_eqn] += traction[
i] * testf[l] *
W;
2494 if (flag && (Navier_stokes_outflow_mesh_pt != 0))
2497 for (
unsigned j = 0;
j < n_node;
j++)
2500 Node* nod_pt = node_pt(
j);
2503 for (
unsigned ii = 0; ii <
DIM + 1; ii++)
2505 local_unknown = u_local_eqn(
j, ii);
2508 if (local_unknown >= 0)
2511 unsigned global_unknown = nod_pt->
eqn_number(ii);
2514 jacobian(local_eqn, local_unknown) -=
2515 (*Aux_integral_pt)[global_unknown] * psif[l] *
2516 unit_normal[
i] * dp_in_dq *
W;
2523 unsigned n_ext = nexternal_data();
2524 for (
unsigned j = 0;
j < n_ext;
j++)
2527 Data* ext_data_pt = external_data_pt(
j);
2530 for (
unsigned ii = 0; ii <
DIM + 1; ii++)
2533 int local_unknown = external_local_eqn(
j, ii);
2536 if (local_unknown >= 0)
2539 unsigned global_unknown = ext_data_pt->
eqn_number(ii);
2542 jacobian(local_eqn, local_unknown) -=
2543 (*Aux_integral_pt)[global_unknown] * psif[l] *
2544 unit_normal[
i] * dp_in_dq *
W;
2613 residuals, jacobian, 1);
2644 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list)
const
2647 std::pair<unsigned, unsigned> dof_lookup;
2650 dof_lookup.second = 0;
2653 dof_lookup_list.push_front(dof_lookup);
2664 const unsigned& flag)
2667 double womersley_pressure = 0.0;
2668 double d_womersley_pressure_d_q = 0.0;
2672 d_womersley_pressure_d_q);
2681 residuals[local_eq] += pressure - womersley_pressure;
2690 jacobian(local_eq, local_eq) -= d_womersley_pressure_d_q;
2691 jacobian(local_eq, local_unknown) += 1.0;
2692 jacobian(local_unknown, local_eq) += 1.0;
2741 Mesh* flux_control_mesh_pt,
2744 flux_control_mesh_pt,
2745 pressure_control_element_pt->volume_flux_data_pt()->value_pt(0))
2784 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list)
const
2787 std::pair<unsigned, unsigned> dof_lookup;
2790 dof_lookup.second = 0;
2793 dof_lookup_list.push_front(dof_lookup);
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
RowVector3d w
Definition: Matrix_resize_int.cpp:3
long & eqn_number(const unsigned &i)
Return the equation number of the i-th stored variable.
Definition: nodes.h:367
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:385
void unpin(const unsigned &i)
Unpin the i-th stored variable.
Definition: nodes.h:391
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
double value(const unsigned &i) const
Definition: nodes.h:293
bool is_pinned(const unsigned &i) const
Test whether the i-th variable is pinned (1: true; 0: false).
Definition: nodes.h:417
Definition: oomph_utilities.h:499
std::string directory() const
Output directory.
Definition: oomph_utilities.h:524
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
Definition: double_vector.h:58
Definition: elements.h:4338
int & face_index()
Definition: elements.h:4626
void outer_unit_normal(const Vector< double > &s, Vector< double > &unit_normal) const
Compute outer unit normal at the specified local coordinate.
Definition: elements.cc:6006
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:4497
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
Definition: elements.h:4735
double interpolated_x(const Vector< double > &s, const unsigned &i) const
Definition: elements.h:4528
double J_eulerian(const Vector< double > &s) const
Definition: elements.cc:5242
double J_eulerian_at_knot(const unsigned &ipt) const
Definition: elements.cc:5328
void get_local_coordinate_in_bulk(const Vector< double > &s, Vector< double > &s_bulk) const
Definition: elements.cc:6384
FaceGeometry()
Definition: womersley_elements.h:1573
FaceGeometry()
Definition: womersley_elements.h:1554
Definition: elements.h:4998
Definition: elements.h:1313
virtual Node * construct_node(const unsigned &n)
Definition: elements.h:2509
void check_J_eulerian_at_knots(bool &passed) const
Definition: elements.cc:4237
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
double nodal_value(const unsigned &n, const unsigned &i) const
Definition: elements.h:2593
virtual void output(std::ostream &outfile)
Definition: elements.h:3050
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Definition: elements.cc:5132
virtual void shape(const Vector< double > &s, Shape &psi) const =0
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Definition: elements.h:1432
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Definition: elements.h:1759
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Definition: elements.h:1963
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Definition: elements.cc:3220
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Definition: elements.h:1765
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Definition: elements.cc:3298
bool has_hanging_nodes() const
Definition: elements.h:2470
Definition: elements.h:73
unsigned ndof() const
Return the number of equations/dofs in the element.
Definition: elements.h:835
unsigned long eqn_number(const unsigned &ieqn_local) const
Definition: elements.h:704
Data *& external_data_pt(const unsigned &i)
Return a pointer to i-th external data object.
Definition: elements.h:659
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:307
int internal_local_eqn(const unsigned &i, const unsigned &j) const
Definition: elements.h:267
static DenseMatrix< double > Dummy_matrix
Definition: elements.h:227
int external_local_eqn(const unsigned &i, const unsigned &j)
Definition: elements.h:311
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:62
TimeStepper *& time_stepper_pt()
Definition: geom_objects.h:192
Definition: womersley_elements.h:504
double * Prescribed_flux_pt
Pointer to current value of prescribed flux.
Definition: womersley_elements.h:616
Data * Pressure_gradient_data_pt
Definition: womersley_elements.h:613
void get_residuals(Vector< double > &residuals)
Definition: womersley_elements.h:575
Data * pressure_gradient_data_pt()
Definition: womersley_elements.h:546
void get_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: womersley_elements.h:592
double total_volume_flux()
Get volume flux through all Womersley elements.
Definition: womersley_elements.h:553
Mesh * Womersley_mesh_pt
Pointer to mesh that contains the Womersley elements.
Definition: womersley_elements.h:609
ImposeFluxForWomersleyElement(Mesh *womersley_mesh_pt, double *prescribed_flux_pt)
Definition: womersley_elements.h:510
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.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
Definition: linear_algebra_distribution.h:64
Vector< Node * > Node_pt
Vector of pointers to nodes.
Definition: mesh.h:183
static Steady< 0 > Default_TimeStepper
The Steady Timestepper.
Definition: mesh.h:75
FiniteElement * finite_element_pt(const unsigned &e) const
Definition: mesh.h:473
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Definition: mesh.h:448
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:596
void add_element_pt(GeneralisedElement *const &element_pt)
Add a (pointer to) an element to the mesh.
Definition: mesh.h:617
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:590
Definition: womersley_elements.h:96
virtual ~NavierStokesImpedanceTractionElementBase()
Empty vitual destructor.
Definition: womersley_elements.h:102
Mesh * Navier_stokes_outflow_mesh_pt
Definition: womersley_elements.h:143
virtual void add_element_contribution_to_aux_integral(std::map< unsigned, double > *aux_integral_pt)=0
NavierStokesImpedanceTractionElementBase()
Definition: womersley_elements.h:99
virtual void set_external_data_from_navier_stokes_outflow_mesh(Mesh *navier_stokes_outflow_mesh_pt_mesh_pt)=0
virtual double get_volume_flux()=0
virtual void set_aux_integral_pt(std::map< unsigned, double > *aux_integral_pt)=0
virtual void set_impedance_tube_pt(TemplateFreeWomersleyImpedanceTubeBase *impedance_tube_pt)=0
Definition: womersley_elements.h:1979
void fill_in_generic_residual_contribution_fluid_traction(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Definition: womersley_elements.h:2425
void output(std::ostream &outfile, const unsigned &nplot)
Output function: x,y,[z],u,v,[w],p in tecplot format.
Definition: womersley_elements.h:2403
~NavierStokesImpedanceTractionElement()
Destructor should not delete anything.
Definition: womersley_elements.h:2086
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: womersley_elements.h:2388
void output(std::ostream &outfile)
Overload the output function.
Definition: womersley_elements.h:2397
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the element's contribution to the element's residual vector.
Definition: womersley_elements.h:2363
WomersleyImpedanceTubeBase< WOMERSLEY_ELEMENT, DIM > * Impedance_tube_pt
Pointer to ImpedanceTubeProblem that computes the flow resistance.
Definition: womersley_elements.h:1988
NavierStokesImpedanceTractionElement(FiniteElement *const &element_pt, const int &face_index)
Definition: womersley_elements.h:2035
Mesh *& navier_stokes_outflow_mesh_pt()
Definition: womersley_elements.h:2091
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: womersley_elements.h:2374
std::map< unsigned, double > * Aux_integral_pt
Definition: womersley_elements.h:1985
double get_volume_flux()
Get integral of volume flux through element.
Definition: womersley_elements.h:2097
double shape_and_test_at_knot(const unsigned &ipt, Shape &psi, Shape &test) const
Definition: womersley_elements.h:2004
void set_impedance_tube_pt(TemplateFreeWomersleyImpedanceTubeBase *impedance_tube_pt)
Definition: womersley_elements.h:2284
void set_aux_integral_pt(std::map< unsigned, double > *aux_integral_pt)
Definition: womersley_elements.h:2239
virtual int u_local_eqn(const unsigned &n, const unsigned &i)
Definition: womersley_elements.h:1997
void add_element_contribution_to_aux_integral(std::map< unsigned, double > *aux_integral_pt)
Definition: womersley_elements.h:2297
double total_volume_flux_into_downstream_tube()
Definition: womersley_elements.h:2249
void set_external_data_from_navier_stokes_outflow_mesh(Mesh *navier_stokes_outflow_mesh_pt)
Definition: womersley_elements.h:2196
Definition: womersley_elements.h:2578
Data * volume_flux_data_pt() const
Definition: womersley_elements.h:2618
void fill_in_contribution_to_residuals(Vector< double > &residuals)
This function returns the residuals.
Definition: womersley_elements.h:2597
void fill_in_generic_residual_contribution_pressure_control(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Definition: womersley_elements.h:2661
unsigned ndof_types() const
Definition: womersley_elements.h:2632
void add_pressure_data(Data *pressure_data_pt)
Definition: womersley_elements.h:2625
TemplateFreeWomersleyImpedanceTubeBase * Womersley_tube_pt
Pointer to the Womersley impedance tube.
Definition: womersley_elements.h:2702
unsigned Volume_flux_data_id
Definition: womersley_elements.h:2709
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: womersley_elements.h:2608
~NavierStokesWomersleyPressureControlElement()
Destructor should not delete anything.
Definition: womersley_elements.h:2594
Data * Volume_flux_data_pt
Definition: womersley_elements.h:2699
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Definition: womersley_elements.h:2643
unsigned Pressure_data_id
Id of external Data object whose single value is the pressure.
Definition: womersley_elements.h:2705
NavierStokesWomersleyPressureControlElement(TemplateFreeWomersleyImpedanceTubeBase *womersley_tube_pt)
Definition: womersley_elements.h:2582
Definition: womersley_elements.h:2733
void operator=(const NetFluxControlElementForWomersleyPressureControl &)=delete
Broken assignment operator.
NetFluxControlElementForWomersleyPressureControl(const NetFluxControlElementForWomersleyPressureControl &dummy)=delete
Broken copy constructor.
NetFluxControlElementForWomersleyPressureControl(Mesh *flux_control_mesh_pt, NavierStokesWomersleyPressureControlElement *pressure_control_element_pt)
Definition: womersley_elements.h:2740
unsigned ndof_types() const
Definition: womersley_elements.h:2772
~NetFluxControlElementForWomersleyPressureControl()
Empty Destructor - Data gets deleted automatically.
Definition: womersley_elements.h:2758
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Definition: womersley_elements.h:2783
Definition: flux_control_elements_bk.h:54
Data * pressure_data_pt() const
Definition: flux_control_elements_bk.h:104
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054
bool is_hanging() const
Test whether the node is geometrically hanging.
Definition: nodes.h:1285
Definition: oomph_definitions.h:222
Definition: oomph_definitions.h:267
Definition: elements.h:3439
Definition: problem.h:151
void add_time_stepper_pt(TimeStepper *const &time_stepper_pt)
Definition: problem.cc:1545
Time *& time_pt()
Return a pointer to the global time object.
Definition: problem.h:1504
Mesh *& mesh_pt()
Return a pointer to the global mesh.
Definition: problem.h:1280
unsigned long assign_eqn_numbers(const bool &assign_local_eqn_numbers=true)
Definition: problem.cc:1989
TimeStepper *& time_stepper_pt()
Definition: problem.h:1524
bool Problem_is_nonlinear
Definition: problem.h:628
double & time()
Return the current value of continuous time.
Definition: problem.cc:11531
Definition: Qelements.h:459
Definition: womersley_elements.h:632
void operator=(const QWomersleyElement< DIM, NNODE_1D > &)=delete
Broken assignment operator.
void output_fct(std::ostream &outfile, const unsigned &n_plot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Definition: womersley_elements.h:703
void output(FILE *file_pt)
Definition: womersley_elements.h:676
unsigned required_nvalue(const unsigned &n) const
Definition: womersley_elements.h:653
QWomersleyElement()
Definition: womersley_elements.h:641
void output(std::ostream &outfile)
Definition: womersley_elements.h:660
double dshape_and_dtest_eulerian_at_knot_womersley(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Definition: womersley_elements.h:1518
void output(std::ostream &outfile, const unsigned &n_plot)
Definition: womersley_elements.h:668
QWomersleyElement(const QWomersleyElement< DIM, NNODE_1D > &dummy)=delete
Broken copy constructor.
void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Definition: womersley_elements.h:692
static const unsigned Initial_Nvalue
Definition: womersley_elements.h:636
void output(FILE *file_pt, const unsigned &n_plot)
Definition: womersley_elements.h:684
double dshape_and_dtest_eulerian_womersley(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Definition: womersley_elements.h:1484
Definition: refineable_elements.h:97
Definition: navier_stokes_flux_control_elements.h:55
Definition: womersley_elements.h:60
static double Zero
Zero!
Definition: womersley_elements.h:80
TemplateFreeWomersleyImpedanceTubeBase()
Empty constructor.
Definition: womersley_elements.h:63
virtual ~TemplateFreeWomersleyImpedanceTubeBase()
Empty virtual destructor.
Definition: womersley_elements.h:66
virtual void get_response(double &p_in, double &dp_in_dq)=0
Template-free base class.
Definition: womersley_elements.h:1586
static bool Suppress_warning_about_unpinned_nst_dofs
Static bool to suppress warning.
Definition: womersley_elements.h:1589
Definition: timesteppers.h:231
unsigned ntstorage() const
Definition: timesteppers.h:601
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
Definition: timesteppers.h:594
bool is_steady() const
Definition: timesteppers.h:389
Definition: womersley_elements.h:186
void operator=(const WomersleyEquations &)=delete
Broken assignment operator.
WomersleyEquations()
Constructor: Initialises the Pressure_gradient_data_pt to null.
Definition: womersley_elements.h:189
virtual double dshape_and_dtest_eulerian_womersley(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Get error against and norm of exact solution.
Definition: womersley_elements.cc:524
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute element residual Vector and element Jacobian matrix (wrapper)
Definition: womersley_elements.h:386
const double & re_st() const
Product of Reynolds and Strouhal number (=Womersley number)
Definition: womersley_elements.h:225
virtual void fill_in_generic_residual_contribution_womersley(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Definition: womersley_elements.cc:67
void get_flux(const Vector< double > &s, Vector< double > &flux) const
Get flux: flux[i] = du/dx_i.
Definition: womersley_elements.h:342
virtual double dshape_and_dtest_eulerian_at_knot_womersley(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
double du_dt_womersley(const unsigned &n) const
Definition: womersley_elements.h:253
double interpolated_u_womersley(const Vector< double > &s) const
Return FE representation of function value u(s) at local coordinate s.
Definition: womersley_elements.h:395
Data * set_pressure_gradient_pt() const
Read-only access to pointer to pressure gradient.
Definition: womersley_elements.h:218
void output(std::ostream &outfile)
Output with default number of plot points.
Definition: womersley_elements.h:282
static double Default_ReSt_value
Static default value for the Womersley number.
Definition: womersley_elements.h:459
double get_volume_flux()
Compute total volume flux through element.
Definition: womersley_elements.cc:219
void output(FILE *file_pt)
C_style output with default number of plot points.
Definition: womersley_elements.h:300
unsigned self_test()
Self-test: Return 0 for OK.
Definition: womersley_elements.cc:281
Data * Pressure_gradient_data_pt
Pointer to pressure gradient Data (single value Data item)
Definition: womersley_elements.h:453
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Compute element residual Vector (wrapper)
Definition: womersley_elements.h:376
void set_pressure_gradient_pt(Data *&pressure_gradient_data_pt)
Set pointer to pressure gradient (single-valued Data)
Definition: womersley_elements.h:202
void set_pressure_gradient_and_add_as_external_data(Data *pressure_gradient_data_pt)
Definition: womersley_elements.h:478
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact soln: x,y,u_exact or x,y,z,u_exact at nplot^DIM plot points.
Definition: womersley_elements.cc:418
double *& re_st_pt()
Pointer to product of Reynolds and Strouhal number (=Womersley number)
Definition: womersley_elements.h:232
double * ReSt_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
Definition: womersley_elements.h:456
WomersleyEquations(const WomersleyEquations &dummy)=delete
Broken copy constructor.
void output_3d(std::ostream &outfile, const unsigned &n_plot, const double &z_out)
Definition: womersley_elements.cc:308
virtual unsigned u_index_womersley() const
Definition: womersley_elements.h:245
Definition: womersley_elements.h:1071
bool Using_flux_control_elements
Definition: womersley_elements.h:1467
WomersleyProblem< ELEMENT, DIM > * womersley_problem_pt()
Access to underlying Womersley problem.
Definition: womersley_elements.h:1302
double(* PrescribedVolumeFluxFctPt)(const double &time)
Definition: womersley_elements.h:1075
double Length
Length of the tube.
Definition: womersley_elements.h:1431
double Dp_in_dq
Definition: womersley_elements.h:1435
WomersleyImpedanceTubeBase(const double &length, PrescribedVolumeFluxFctPt prescribed_volume_flux_fct_pt)
Definition: womersley_elements.h:1080
Mesh * Navier_stokes_outflow_mesh_pt
Definition: womersley_elements.h:1456
void get_response(double &p_in, double &dp_in_dq)
Definition: womersley_elements.h:1375
void precompute_aux_integrals()
Definition: womersley_elements.h:1400
double * Current_volume_flux_pt
Definition: womersley_elements.h:1441
WomersleyImpedanceTubeBase(const double &length, Mesh *navier_stokes_outflow_mesh_pt)
Definition: womersley_elements.h:1103
void setup()
Definition: womersley_elements.h:1187
void setup(double *re_st_pt, const double &dt, const double &q_initial, TimeStepper *time_stepper_pt=0)
Definition: womersley_elements.h:1207
double total_volume_flux_into_impedance_tube()
Definition: womersley_elements.h:1336
WomersleyProblem< ELEMENT, DIM > * Womersley_problem_pt
Definition: womersley_elements.h:1445
double & p_out()
Access fct to outlet pressure.
Definition: womersley_elements.h:1170
std::map< unsigned, double > * Aux_integral_pt
Definition: womersley_elements.h:1462
void shift_time_values(const double &dt)
Definition: womersley_elements.h:1311
PrescribedVolumeFluxFctPt Prescribed_volume_flux_fct_pt
Pointer to function that specifies the prescribed volume flux.
Definition: womersley_elements.h:1451
double P_out
Outlet pressure.
Definition: womersley_elements.h:1448
virtual Mesh * build_mesh_and_apply_boundary_conditions(TimeStepper *time_stepper_pt)=0
Definition: womersley_elements.h:1606
WomersleyMesh(Mesh *n_st_outflow_mesh_pt, TimeStepper *time_stepper_pt, const unsigned &fixed_coordinate, const unsigned &w_index)
Definition: womersley_elements.h:1616
Definition: womersley_elements.h:1828
Mesh * build_mesh_and_apply_boundary_conditions(TimeStepper *time_stepper_pt)
Definition: womersley_elements.h:1854
WomersleyOutflowImpedanceTube(const double &length, Mesh *navier_stokes_outflow_mesh_pt, const unsigned &fixed_coordinate, const unsigned &w_index)
Definition: womersley_elements.h:1839
unsigned Fixed_coordinate
Definition: womersley_elements.h:1871
unsigned W_index
Definition: womersley_elements.h:1877
Womersley problem.
Definition: womersley_elements.h:743
void actions_after_newton_solve()
Update the problem specs after solve (empty)
Definition: womersley_elements.h:780
void doc_solution(DocInfo &doc_info, const double &z_out=0.0)
Doc the solution.
Definition: womersley_elements.h:805
ImposeFluxForWomersleyElement< DIM > * Flux_el_pt
Definition: womersley_elements.h:825
PrescribedPressureGradientFctPt Prescribed_pressure_gradient_fct_pt
Fct pointer to fct that prescribes pressure gradient.
Definition: womersley_elements.h:828
Data * pressure_gradient_data_pt()
Definition: womersley_elements.h:813
void doc_solution(DocInfo &doc_info, std::ofstream &trace_file, const double &z_out=0.0)
Doc the solution.
Definition: womersley_elements.h:990
void actions_before_newton_solve()
Update the problem specs before solve (empty)
Definition: womersley_elements.h:783
double * Prescribed_volume_flux_pt
Pointer to currently prescribed volume flux.
Definition: womersley_elements.h:821
~WomersleyProblem()
Destructor to clean up memory.
Definition: womersley_elements.h:977
WomersleyProblem(double *re_st_pt, double *prescribed_volume_flux_pt, TimeStepper *time_stepper_pt, Mesh *womersley_mesh_pt)
Definition: womersley_elements.h:915
double(* PrescribedPressureGradientFctPt)(const double &time)
Definition: womersley_elements.h:747
Data * Pressure_gradient_data_pt
Pointer to single-valued Data item that stores pressure gradient.
Definition: womersley_elements.h:831
void actions_before_implicit_timestep()
Definition: womersley_elements.h:788
RealScalar s
Definition: level1_cplx_impl.h:130
char char char int int * k
Definition: level2_impl.h:374
#define DIM
Definition: linearised_navier_stokes_elements.h:44
string filename
Definition: MergeRestartFiles.py:39
void flux(const double &time, const Vector< double > &x, double &flux)
Get flux applied along boundary x=0.
Definition: pretend_melt.cc:59
void normal(const Vector< double > &x, Vector< double > &normal)
Definition: free_surface_rotation.cc:65
Real fabs(const Real &a)
Definition: boostmultiprec.cpp:117
int error
Definition: calibrate.py:297
@ W
Definition: quadtree.h:63
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
list x
Definition: plotDoE.py:28
t
Definition: plotPSD.py:36
Definition: indexed_view.cpp:20
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2