32 #ifndef OOMPH_TNAVIER_STOKES_ELEMENTS_HEADER 33 #define OOMPH_TNAVIER_STOKES_ELEMENTS_HEADER 37 #include <oomph-lib-config.h> 42 #include "../generic/Telements.h" 44 #include "../generic/error_estimator.h" 64 template <
unsigned DIM>
173 double p_nst(
const unsigned &
t,
const unsigned &
i)
const 213 std::set<std::pair<Data*,unsigned> > &paired_pressure_data);
220 void output(std::ostream &outfile,
const unsigned &nplot)
227 void output(FILE* file_pt,
const unsigned &n_plot)
247 return DIM + (DIM*(DIM-1))/2;
255 unsigned num_entries=DIM+(DIM*(DIM-1))/2;
256 if (flux.size() < num_entries)
258 std::ostringstream error_message;
259 error_message <<
"The flux vector has the wrong number of entries, " 260 << flux.size() <<
", whereas it should be at least " 261 << num_entries << std::endl;
263 OOMPH_CURRENT_FUNCTION,
264 OOMPH_EXCEPTION_LOCATION);
276 for(
unsigned i=0;
i<DIM;
i++)
278 flux[icount]=strainrate(
i,
i);
283 for(
unsigned i=0;
i<DIM;
i++)
285 for(
unsigned j=
i+1;j<DIM;j++)
287 flux[icount]=strainrate(
i,j);
321 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
const;
333 template<
unsigned DIM>
354 template<
unsigned DIM>
357 const unsigned &ipt,
Shape &psi,
380 template<
unsigned DIM>
396 for(
unsigned i=0;
i<9;
i++)
400 for(
unsigned k=0;k<2;k++)
402 dtestdx(
i,k) = dpsidx(
i,k);
404 for(
unsigned p=0;p<2;p++)
406 for(
unsigned q=0;q<9;q++)
408 d_dtestdx_dX(p,q,
i,k) = d_dpsidx_dX(p,q,
i,k);
648 template<
unsigned DIM>
650 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
const 653 unsigned n_node = this->
nnode();
659 std::pair<unsigned,unsigned> dof_lookup;
662 unsigned pressure_dof_number = DIM;
665 for (
unsigned n = 0; n < n_press; n++)
673 if (local_eqn_number >= 0)
677 dof_lookup.first = this->
eqn_number(local_eqn_number);
678 dof_lookup.second = pressure_dof_number;
681 dof_lookup_list.push_front(dof_lookup);
686 for (
unsigned n = 0; n < n_node; n++)
692 for (
unsigned v = 0; v < nv; v++)
698 if (local_eqn_number >= 0)
702 dof_lookup.first = this->
eqn_number(local_eqn_number);
703 dof_lookup.second = v;
706 dof_lookup_list.push_front(dof_lookup);
724 template <
unsigned DIM>
733 static const unsigned Initial_Nvalue[];
739 static const unsigned Pconv[];
781 void unpin_all_nodal_pressure_dofs();
784 void pin_all_nodal_pressure_dofs();
787 void unpin_proper_nodal_pressure_dofs();
811 {
return Initial_Nvalue[n];}
838 double p_nst(
const unsigned &n_p)
const 843 double p_nst(
const unsigned &
t,
const unsigned &n_p)
const 879 std::set<std::pair<Data*,unsigned> > &paired_load_data);
890 std::set<std::pair<Data*,unsigned> > &paired_pressure_data);
897 void output(std::ostream &outfile,
const unsigned &nplot)
904 void output(FILE* file_pt,
const unsigned &n_plot)
924 return DIM + (DIM*(DIM-1))/2;
932 unsigned num_entries=DIM+(DIM*(DIM-1))/2;
933 if (flux.size() < num_entries)
935 std::ostringstream error_message;
936 error_message <<
"The flux vector has the wrong number of entries, " 937 << flux.size() <<
", whereas it should be at least " 938 << num_entries << std::endl;
940 OOMPH_CURRENT_FUNCTION,
941 OOMPH_EXCEPTION_LOCATION);
953 for(
unsigned i=0;
i<DIM;
i++)
955 flux[icount]=strainrate(
i,
i);
960 for(
unsigned i=0;
i<DIM;
i++)
962 for(
unsigned j=
i+1;j<DIM;j++)
964 flux[icount]=strainrate(
i,j);
984 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
const 987 unsigned n_node = this->
nnode();
990 std::pair<unsigned,unsigned> dof_lookup;
993 for (
unsigned n = 0; n < n_node; n++)
999 for (
unsigned v = 0; v < nv; v++)
1007 if (local_eqn_number >= 0)
1011 dof_lookup.first = this->
eqn_number(local_eqn_number);
1014 dof_lookup.second = v;
1017 dof_lookup_list.push_front(dof_lookup);
1057 template<
unsigned DIM>
1079 template<
unsigned DIM>
1109 ppsi[2] = 1.0-s[0]-s[1];
1163 ppsi[3] = 1.0-s[0]-s[1]-s[2];
1233 for(
unsigned i=0;
i<6;
i++)
1237 for(
unsigned k=0;k<2;k++)
1239 dtestdx(
i,k) = dpsidx(
i,k);
1241 for(
unsigned p=0;p<2;p++)
1243 for(
unsigned q=0;q<6;q++)
1245 d_dtestdx_dX(p,q,
i,k) = d_dpsidx_dX(p,q,
i,k);
1281 for(
unsigned i=0;
i<10;
i++)
1285 for(
unsigned k=0;k<3;k++)
1287 dtestdx(
i,k) = dpsidx(
i,k);
1289 for(
unsigned p=0;p<3;p++)
1291 for(
unsigned q=0;q<10;q++)
1293 d_dtestdx_dX(p,q,
i,k) = d_dpsidx_dX(p,q,
i,k);
1315 psi[2] = 1.0-s[0]-s[1];
1329 psi[3] = 1.0-s[0]-s[1]-s[2];
1336 template<
unsigned DIM>
unsigned nvertex_node() const
Number of vertex nodes in the element.
TTaylorHoodElement(const TTaylorHoodElement< DIM > &dummy)
Broken copy constructor.
double value(const unsigned &i) const
Return i-th stored value. This function is not virtual so that it can be inlined. This means that if ...
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
int p_local_eqn(const unsigned &n) const
Pointer to n_p-th pressure node.
void output(FILE *file_pt, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
void identify_pressure_data(std::set< std::pair< Data *, unsigned > > &paired_pressure_data)
Add to the set paired_pressure_data pairs containing.
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...
Base class for finite elements that can compute the quantities that are required for the Z2 error est...
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
Vector< FpPressureAdvDiffRobinBCElementBase * > Pressure_advection_diffusion_robin_element_pt
Storage for FaceElements that apply Robin BC for pressure adv diff equation used in Fp preconditioner...
FaceGeometry()
Constructor: Call constructor of base.
void output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
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) ...
virtual double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Return the geometric shape functions and also first derivatives w.r.t. global coordinates at the ipt-...
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain rate tensor. ...
FaceGeometry()
Constructor: Call constructor of base.
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element.
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
void output(std::ostream &outfile, const unsigned &nplot)
Redirect output to NavierStokesEquations output.
unsigned P_nst_internal_index
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 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...
unsigned p_index_nst()
Which nodal value represents the pressure?
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
void output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
virtual unsigned required_nvalue(const unsigned &n) const
Broken assignment operator.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
void full_output(std::ostream &outfile, const unsigned &nplot)
Full output function: x,y,[z],u,v,[w],p,du/dt,dv/dt,[dw/dt],dissipation in tecplot format...
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
double p_nst(const unsigned &t, const unsigned &i) const
Return the pressure values at internal dof i_internal (Discontinous pressure interpolation – no need...
void pin(const unsigned &i)
Pin the i-th stored variable.
void dshape_local(const Vector< double > &s, Shape &psi, DShape &dpsids) const
Compute the geometric shape functions and derivatives w.r.t. local coordinates at local coordinate s...
void identify_load_data(std::set< std::pair< Data *, unsigned > > &paired_load_data)
Add to the set paired_load_data pairs of pointers to data objects and unsignedegers that index the va...
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into: Velocity and ...
unsigned nvertex_node() const
Number of vertex nodes in the element.
virtual double local_to_eulerian_mapping(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Calculate the mapping from local to Eulerian coordinates, given the derivatives of the shape function...
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 get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
int p_local_eqn(const unsigned &n) const
Return the local equation numbers for the pressure values.
void output(FILE *file_pt, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
virtual void transform_derivatives(const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
Convert derivative w.r.t.local coordinates to derivatives w.r.t the coordinates used to assemble the ...
double p_nst(const unsigned &i) const
Return the pressure values at internal dof i_internal (Discontinous pressure interpolation – no need...
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.
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...
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
void output(std::ostream &outfile, const unsigned &nplot)
Redirect output to NavierStokesEquations output.
virtual double dpshape_and_dptest_eulerian_nst(const Vector< double > &s, Shape &ppsi, DShape &dppsidx, Shape &ptest, DShape &dptestdx) const
Compute the pressure shape and test functions and derivatives.
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...
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 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.
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...
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number...
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain rate tensor. ...
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as unenriched shape functions...
void pshape_nst(const Vector< double > &s, Shape &psi) const
Test whether the pressure dof p_dof hanging or not?
A class that represents a collection of data; each Data object may contain many different individual ...
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...
unsigned npres_nst() const
Return number of pressure values.
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...
unsigned npres_nst() const
Return number of pressure values.
TCrouzeixRaviartElement(const TCrouzeixRaviartElement< DIM > &dummy)
Broken copy constructor.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
virtual unsigned required_nvalue(const unsigned &n) const
Broken assignment operator.
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...
void output(std::ostream &outfile)
Output function: x,y,[z],u,v,[w],p in tecplot format. Default number of plot points.
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...
double p_nst(const unsigned &n_p) const
Access function for the pressure values at local pressure node n_p (const version) ...
void unpin_all_internal_pressure_dofs()
Unpin all internal pressure dofs.
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
TCrouzeixRaviartElement()
Constructor, there are DIM+1 internal values (for the pressure)
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) internal data object to the element and return the index required to obtain it ...
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)
int local_eqn_number(const unsigned long &ieqn_global) const
Return the local equation number corresponding to the ieqn_global-th global equation number...
unsigned nnode() const
Return the number of nodes.
int p_nodal_index_nst() const
Set the value at which the pressure is stored in the nodes.
void pshape_nst(const Vector< double > &s, Shape &psi) const
Pressure shape functions at local coordinate s.
TTaylorHoodElement()
Constructor, no internal data points.
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...
int internal_local_eqn(const unsigned &i, const unsigned &j) const
Return the local equation number corresponding to the j-th value stored at the i-th internal data...