linearised_navier_stokes_elements.h
Go to the documentation of this file.
1 //LIC// ====================================================================
2 //LIC// This file forms part of oomph-lib, the object-oriented,
3 //LIC// multi-physics finite-element library, available
4 //LIC// at http://www.oomph-lib.org.
5 //LIC//
6 //LIC// Version 1.0; svn revision $LastChangedRevision: 1097 $
7 //LIC//
8 //LIC// $LastChangedDate: 2015-12-17 11:53:17 +0000 (Thu, 17 Dec 2015) $
9 //LIC//
10 //LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11 //LIC//
12 //LIC// This library is free software; you can redistribute it and/or
13 //LIC// modify it under the terms of the GNU Lesser General Public
14 //LIC// License as published by the Free Software Foundation; either
15 //LIC// version 2.1 of the License, or (at your option) any later version.
16 //LIC//
17 //LIC// This library is distributed in the hope that it will be useful,
18 //LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 //LIC// Lesser General Public License for more details.
21 //LIC//
22 //LIC// You should have received a copy of the GNU Lesser General Public
23 //LIC// License along with this library; if not, write to the Free Software
24 //LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 //LIC// 02110-1301 USA.
26 //LIC//
27 //LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28 //LIC//
29 //LIC//====================================================================
30 // Header file for linearised axisymmetric Navier-Stokes elements
31 
32 #ifndef OOMPH_LINEARISED_NAVIER_STOKES_ELEMENTS_HEADER
33 #define OOMPH_LINEARISED_NAVIER_STOKES_ELEMENTS_HEADER
34 
35 // Config header generated by autoconfig
36 #ifdef HAVE_CONFIG_H
37 #include <oomph-lib-config.h>
38 #endif
39 
40 // oomph-lib includes
41 #include "../generic/Qelements.h"
42 #include "../generic/fsi.h"
43 
45 
46 namespace oomph
47 {
48 
49 #define DIM 2
50 
51 
52  //=======================================================================
53  /// \short A class for elements that solve the linearised version of the
54  /// unsteady Navier--Stokes equations in cylindrical polar coordinates,
55  /// where we have Fourier-decomposed in the azimuthal direction so that
56  /// the theta-dependance is replaced by an azimuthal mode number.
57  //=======================================================================
59  : public virtual FiniteElement
60  {
61  private:
62 
63  /// Static "magic" number that indicates that the pressure is not
64  /// stored at a node
66 
67  /// Static default value for the physical constants
68  /// (all initialised to zero)
70 
71  /// Static default value for the physical ratios (all initialised to one)
73 
74  protected:
75 
76  // Physical constants
77  // ------------------
78 
79  /// \short Pointer to the viscosity ratio (relative to the
80  /// viscosity used in the definition of the Reynolds number)
82 
83  /// \short Pointer to the density ratio (relative to the
84  /// density used in the definition of the Reynolds number)
86 
87  /// Pointer to global Reynolds number
88  double *Re_pt;
89 
90  /// Pointer to global Reynolds number x Strouhal number (=Womersley)
91  double *ReSt_pt;
92 
93  /// Pointer to eigenvalue
94  double *Lambda_pt;
95 
96  /// Pointer to frequency
97  double *Omega_pt;
98 
99  ///Pointer to the normalisation element
102 
103 
104  /// Index of datum where eigenvalue is stored
106 
108 
109  /// Pointer to base flow solution (velocity components) function
110  void (*Base_flow_u_fct_pt)(const double& time,
111  const Vector<double> &x,
112  Vector<double> &result);
113 
114  /// \short Pointer to derivatives of base flow solution velocity
115  /// components w.r.t. global coordinates (r and z) function
116  void (*Base_flow_dudx_fct_pt)(const double& time,
117  const Vector<double> &x,
118  DenseMatrix<double> &result);
119 
120  /// \short Boolean flag to indicate if ALE formulation is disabled when
121  /// the time-derivatives are computed. Only set to true if you're sure
122  /// that the mesh is stationary.
124 
125  /// \short Access function for the local equation number
126  /// information for the i-th component of the pressure.
127  /// p_local_eqn[n,i] = local equation number or < 0 if pinned.
128  virtual int p_local_eqn(const unsigned &n, const unsigned &i)=0;
129 
130  /// \short Compute the shape functions and their derivatives
131  /// w.r.t. global coordinates at local coordinate s.
132  /// Return Jacobian of mapping between local and global coordinates.
134  const Vector<double> &s,
135  Shape &psi, DShape &dpsidx,
136  Shape &test, DShape &dtestdx) const=0;
137 
138  /// \short Compute the shape functions and their derivatives
139  /// w.r.t. global coordinates at the ipt-th integration point.
140  /// Return Jacobian of mapping between local and global coordinates.
142  const unsigned &ipt,
143  Shape &psi, DShape &dpsidx,
144  Shape &test, DShape &dtestdx) const=0;
145 
146  /// Compute the pressure shape functions at local coordinate s
147  virtual void pshape_linearised_nst(const Vector<double> &s,
148  Shape &psi) const=0;
149 
150  /// Compute the pressure shape and test functions at local coordinate s
151  virtual void pshape_linearised_nst(const Vector<double> &s,
152  Shape &psi, Shape &test) const=0;
153 
154  /// \short Calculate the velocity components of the base flow solution
155  /// at a given time and Eulerian position
156  virtual void get_base_flow_u(const double& time,
157  const unsigned& ipt,
158  const Vector<double>& x,
159  Vector<double>& result) const
160  {
161  // If the function pointer is zero return zero
162  if(Base_flow_u_fct_pt==0)
163  {
164  // Loop over velocity components and set base flow solution to zero
165  for(unsigned i=0;i<DIM;i++) { result[i] = 0.0; }
166  }
167  // Otherwise call the function
168  else
169  {
170  (*Base_flow_u_fct_pt)(time,x,result);
171  }
172  }
173 
174  /// \short Calculate the derivatives of the velocity components of the
175  /// base flow solution w.r.t. global coordinates (r and z) at a given
176  /// time and Eulerian position
177  virtual void get_base_flow_dudx(const double& time,
178  const unsigned& ipt,
179  const Vector<double>& x,
180  DenseMatrix<double>& result) const
181  {
182  // If the function pointer is zero return zero
183  if(Base_flow_dudx_fct_pt==0)
184  {
185  // Loop over velocity components
186  for(unsigned i=0;i<DIM;i++)
187  {
188  // Loop over coordinate directions and set to zero
189  for(unsigned j=0;j<DIM;j++) { result(i,j) = 0.0; }
190  }
191  }
192  // Otherwise call the function
193  else
194  {
195  (*Base_flow_dudx_fct_pt)(time,x,result);
196  }
197  }
198 
199 
200  inline int eigenvalue_local_eqn(const unsigned &i)
201  {
202  return this->external_local_eqn(this->Data_number_of_eigenvalue,
203  this->Index_of_eigenvalue+i);
204  }
205 
206 
207 
208  /// \short Compute the residuals for the Navier-Stokes equations;
209  /// flag=1(or 0): do (or don't) compute the Jacobian as well.
211  Vector<double> &residuals,
212  DenseMatrix<double> &jacobian,
213  DenseMatrix<double> &mass_matrix,
214  unsigned flag);
215 
216  public:
217 
218  /// \short Constructor: NULL the base flow solution and the
219  /// derivatives of the base flow function
221  : Base_flow_u_fct_pt(0), Base_flow_dudx_fct_pt(0), ALE_is_disabled(false)
222  {
223  // Set all the physical parameter pointers to the default value of zero
226 
227  Lambda_pt = &Default_Physical_Constant_Value;
229 
230  //Set to sensible defaults
231  Data_number_of_eigenvalue=0;
232  Index_of_eigenvalue=0;
233 
234  // Set the physical ratios to the default value of one
235  Viscosity_Ratio_pt = &Default_Physical_Ratio_Value;
236  Density_Ratio_pt = &Default_Physical_Ratio_Value;
237 
238  //Null out normalisation
240  }
241 
242  /// Vector to decide whether the stress-divergence form is used or not.
243  // N.B. This needs to be public so that the intel compiler gets things
244  // correct. Somehow the access function messes things up when going to
245  // refineable navier--stokes
247 
248  // Access functions for the physical constants
249  // -------------------------------------------
250 
251  /// Reynolds number
252  const double &re() const { return *Re_pt; }
253 
254  /// Product of Reynolds and Strouhal number (=Womersley number)
255  const double &re_st() const { return *ReSt_pt; }
256 
257  const double &lambda() const {return *Lambda_pt;}
258 
259  const double &omega() const {return *Omega_pt;}
260 
261  /// Pointer to Reynolds number
262  double* &re_pt() { return Re_pt; }
263 
264  /// Pointer to product of Reynolds and Strouhal number (=Womersley number)
265  double* &re_st_pt() { return ReSt_pt; }
266 
267  /// Pointer to lambda
268  double* &lambda_pt() { return Lambda_pt; }
269 
270  /// Pointer to frequency
271  double* &omega_pt() { return Omega_pt; }
272 
273  ///Pointer to normalisation element
276 
277  /// the boolean flag check_nodal_data is set to false.
280  &normalisation_el_pt)
281  {
282  //Set the normalisation element
283  Normalisation_element_pt = normalisation_el_pt;
284 
285  // Add eigenvalue unknown as external data to this element
286  Data_number_of_eigenvalue=
287  this->add_external_data(normalisation_el_pt->eigenvalue_data_pt());
288 
289  // Which value corresponds to the eigenvalue
290  Index_of_eigenvalue=normalisation_el_pt->index_of_eigenvalue();
291 
292  //Now set the pointers to the eigenvalues
293  Lambda_pt = normalisation_el_pt->eigenvalue_data_pt()
294  ->value_pt(Index_of_eigenvalue);
295  Omega_pt = normalisation_el_pt->eigenvalue_data_pt()
296  ->value_pt(Index_of_eigenvalue+1);
297  }
298 
299 
300  /// \short Viscosity ratio for element: element's viscosity relative
301  /// to the viscosity used in the definition of the Reynolds number
302  const double &viscosity_ratio() const { return *Viscosity_Ratio_pt; }
303 
304  /// Pointer to the viscosity ratio
305  double* &viscosity_ratio_pt() { return Viscosity_Ratio_pt; }
306 
307  /// \short Density ratio for element: element's density relative
308  /// to the viscosity used in the definition of the Reynolds number
309  const double &density_ratio() const { return *Density_Ratio_pt; }
310 
311  /// Pointer to the density ratio
312  double* &density_ratio_pt() { return Density_Ratio_pt; }
313 
314  /// Access function for the base flow solution pointer
315  void (* &base_flow_u_fct_pt())(const double& time,
316  const Vector<double>& x,
317  Vector<double>& f)
318  {
319  return Base_flow_u_fct_pt;
320  }
321 
322  /// \short Access function for the derivatives of the base flow
323  /// w.r.t. global coordinates solution pointer
324  void (* &base_flow_dudx_fct_pt())(const double& time,
325  const Vector<double>& x,
327  {
328  return Base_flow_dudx_fct_pt;
329  }
330 
331  /// \short Return the number of pressure degrees of freedom
332  /// associated with a single pressure component in the element
333  virtual unsigned npres_linearised_nst() const=0;
334 
335  /// \short Return the index at which the i-th unknown velocity
336  /// component is stored. The default value, i, is appropriate for
337  /// single-physics problems. In derived multi-physics elements, this
338  /// function should be overloaded to reflect the chosen storage scheme.
339  /// Note that these equations require that the unknowns are always
340  /// stored at the same indices at each node.
341  virtual inline unsigned u_index_linearised_nst(const unsigned &i)
342  const { return i; }
343 
344  /// \short Return the i-th component of du/dt at local node n.
345  /// Uses suitably interpolated value for hanging nodes.
346  double du_dt_linearised_nst(const unsigned &n, const unsigned &i) const
347  {
348  // Get the data's timestepper
350 
351  // Initialise dudt
352  double dudt = 0.0;
353 
354  // Loop over the timesteps, if there is a non-steady timestepper
355  if (!time_stepper_pt->is_steady())
356  {
357  // Get the index at which the velocity is stored
358  const unsigned u_nodal_index = u_index_linearised_nst(i);
359 
360  // Determine number of timsteps (past & present)
361  const unsigned n_time = time_stepper_pt->ntstorage();
362 
363  // Add the contributions to the time derivative
364  for(unsigned t=0;t<n_time;t++)
365  {
366  dudt += time_stepper_pt->weight(1,t)*nodal_value(t,n,u_nodal_index);
367  }
368  }
369 
370  return dudt;
371  }
372 
373  /// \short Disable ALE, i.e. assert the mesh is not moving -- you do this
374  /// at your own risk!
375  void disable_ALE() { ALE_is_disabled = true; }
376 
377  /// \short (Re-)enable ALE, i.e. take possible mesh motion into account
378  /// when evaluating the time-derivative. Note: By default, ALE is
379  /// enabled, at the expense of possibly creating unnecessary work
380  /// in problems where the mesh is, in fact, stationary.
381  void enable_ALE() { ALE_is_disabled = false; }
382 
383  /// \short Return the i-th pressure value at local pressure "node" n_p.
384  /// Uses suitably interpolated value for hanging nodes.
385  virtual double p_linearised_nst(const unsigned &n_p,
386  const unsigned &i) const=0;
387 
388  /// \short Pin the real or imaginary part of the problem
389  /// Input integer 0 for real 1 for imaginary
390  virtual void pin_real_or_imag(const unsigned &real)=0;
391  virtual void unpin_real_or_imag(const unsigned &real)=0;
392 
393  ///Pin the normalisation dofs
394  virtual void pin_pressure_normalisation_dofs()=0;
395 
396  /// Which nodal value represents the pressure?
397  // N.B. This function has return type "int" (rather than "unsigned"
398  // as in the u_index case) so that we can return the "magic" number
399  // "Pressure_not_stored_at_node" ( = -100 )
400  virtual inline int p_index_linearised_nst(const unsigned &i)
401  const { return Pressure_not_stored_at_node; }
402 
403  /// \short Strain-rate tensor: \f$ e_{ij} \f$
404  /// where \f$ i,j = r,z,\theta \f$ (in that order)
405  void strain_rate(const Vector<double>& s,
406  DenseMatrix<double>& strain_rate, const unsigned &real)
407  const;
408 
409  /// \short Output function: r, z, U^C, U^S, V^C, V^S, W^C, W^S, P^C, P^S
410  /// in tecplot format. Default number of plot points
411  void output(std::ostream &outfile)
412  {
413  const unsigned nplot = 5;
414  output(outfile,nplot);
415  }
416 
417  /// \short Output function: r, z, U^C, U^S, V^C, V^S, W^C, W^S, P^C, P^S
418  /// in tecplot format. nplot points in each coordinate direction
419  void output(std::ostream &outfile, const unsigned &nplot);
420 
421  /// \short Output function: r, z, U^C, U^S, V^C, V^S, W^C, W^S, P^C, P^S
422  /// in tecplot format. Default number of plot points
423  void output(FILE* file_pt)
424  {
425  const unsigned nplot = 5;
426  output(file_pt,nplot);
427  }
428 
429  /// \short Output function: r, z, U^C, U^S, V^C, V^S, W^C, W^S, P^C, P^S
430  /// in tecplot format. nplot points in each coordinate direction
431  void output(FILE* file_pt, const unsigned &nplot);
432 
433  /// \short Output function: r, z, U^C, U^S, V^C, V^S, W^C, W^S,
434  /// in tecplot format. nplot points in each coordinate direction
435  /// at timestep t (t=0: present; t>0: previous timestep)
436  void output_veloc(std::ostream &outfile, const unsigned &nplot,
437  const unsigned& t);
438 
439  /// Compute the element's residual Vector
441  {
442  // Call the generic residuals function with flag set to 0
443  // and using a dummy matrix argument
445  residuals,
448  }
449 
450  /// \short Compute the element's residual Vector and the jacobian matrix.
451  /// Virtual function can be overloaded by hanging-node version.
452  /*void fill_in_contribution_to_jacobian(Vector<double> &residuals,
453  DenseMatrix<double> &jacobian)
454  {
455  // Call the generic routine with the flag set to 1
456  fill_in_generic_residual_contribution_linearised_nst(
457  residuals,jacobian,GeneralisedElement::Dummy_matrix,1);
458  }*/
459 
460  /// \short Add the element's contribution to its residuals vector,
461  /// jacobian matrix and mass matrix
462  /*void fill_in_contribution_to_jacobian_and_mass_matrix(
463  Vector<double> &residuals, DenseMatrix<double> &jacobian,
464  DenseMatrix<double> &mass_matrix)
465  {
466  // Call the generic routine with the flag set to 2
467  fill_in_generic_residual_contribution_linearised_nst(
468  residuals,jacobian,mass_matrix,2);
469  }*/
470 
471  /// \short Return the i-th component of the FE interpolated velocity
472  /// u[i] at local coordinate s
474  const unsigned &i) const
475  {
476  // Determine number of nodes in the element
477  const unsigned n_node = nnode();
478 
479  // Provide storage for local shape functions
480  Shape psi(n_node);
481 
482  // Find values of shape functions
483  shape(s,psi);
484 
485  // Get the index at which the velocity is stored
486  const unsigned u_nodal_index = u_index_linearised_nst(i);
487 
488  // Initialise value of u
489  double interpolated_u = 0.0;
490 
491  // Loop over the local nodes and sum
492  for(unsigned l=0;l<n_node;l++)
493  {
494  interpolated_u += nodal_value(l,u_nodal_index)*psi[l];
495  }
496 
497  return(interpolated_u);
498  }
499 
500  /// \short Return the i-th component of the FE interpolated pressure
501  /// p[i] at local coordinate s
503  const unsigned &i) const
504  {
505  // Determine number of pressure nodes in the element
506  const unsigned n_pressure_nodes = npres_linearised_nst();
507 
508  // Provide storage for local shape functions
509  Shape psi(n_pressure_nodes);
510 
511  // Find values of shape functions
512  pshape_linearised_nst(s,psi);
513 
514  // Initialise value of p
515  double interpolated_p = 0.0;
516 
517  // Loop over the local nodes and sum
518  for(unsigned l=0;l<n_pressure_nodes;l++)
519  {
520  // N.B. The pure virtual function p_linearised_nst(...)
521  // automatically calculates the index at which the pressure value
522  // is stored, so we don't need to worry about this here
523  interpolated_p += p_linearised_nst(l,i)*psi[l];
524  }
525 
526  return(interpolated_p);
527  }
528 
529  }; // End of LinearisedNavierStokesEquations class definition
530 
531 
532 
533 //////////////////////////////////////////////////////////////////////////////
534 //////////////////////////////////////////////////////////////////////////////
535 //////////////////////////////////////////////////////////////////////////////
536 
537 
538 
539  //=======================================================================
540  /// Crouzeix-Raviart elements are Navier-Stokes elements with quadratic
541  /// interpolation for velocities and positions, but a discontinuous
542  /// linear pressure interpolation
543  //=======================================================================
545  : public virtual QElement<2,3>,
546  public virtual LinearisedNavierStokesEquations
547  {
548  private:
549 
550  /// Static array of ints to hold required number of variables at nodes
551  static const unsigned Initial_Nvalue[];
552 
553  protected:
554 
555  /// \short Internal indices that indicate at which internal data the
556  /// pressure values are stored. We note that there are two pressure
557  /// values, corresponding to the functions P^C(r,z,t) and P^S(r,z,t)
558  /// which multiply the cosine and sine terms respectively.
560 
561  /// \short Velocity shape and test functions and their derivatives
562  /// w.r.t. global coordinates at local coordinate s (taken from geometry).
563  /// Return Jacobian of mapping between local and global coordinates.
565  const Vector<double> &s,
566  Shape &psi, DShape &dpsidx,
567  Shape &test, DShape &dtestdx) const;
568 
569  /// \short Velocity shape and test functions and their derivatives
570  /// w.r.t. global coordinates at the ipt-th integation point
571  /// (taken from geometry).
572  /// Return Jacobian of mapping between local and global coordinates.
574  const unsigned &ipt,
575  Shape &psi, DShape &dpsidx,
576  Shape &test, DShape &dtestdx) const;
577 
578  /// Compute the pressure shape functions at local coordinate s
579  inline void pshape_linearised_nst(const Vector<double> &s,
580  Shape &psi) const;
581 
582  /// Compute the pressure shape and test functions at local coordinate s
583  inline void pshape_linearised_nst(const Vector<double> &s,
584  Shape &psi, Shape &test) const;
585 
586  public:
587 
588  /// \short Constructor: there are three internal values for each
589  /// of the two pressure components
592  P_linearised_nst_internal_index(2)
593  {
594  // Loop over the two pressure components
595  // and two normalisation constraints
596  for(unsigned i=0;i<4;i++)
597  {
598  // Allocate and add one internal data object for each of the two
599  // pressure components that store the three pressure values
600  P_linearised_nst_internal_index[i]
601  = this->add_internal_data(new Data(3));
602  }
603  }
604 
605  /// Return number of values (pinned or dofs) required at local node n
606  virtual unsigned required_nvalue(const unsigned &n) const;
607 
608  /// \short Return the pressure value i at internal dof i_internal
609  /// (Discontinous pressure interpolation -- no need to cater for
610  /// hanging nodes)
611  double p_linearised_nst(const unsigned &i_internal,
612  const unsigned &i) const
613  {
614  return internal_data_pt(P_linearised_nst_internal_index[i])
615  ->value(i_internal);
616  }
617 
618  //Pin the normalisation dofs
620  {
621  for(unsigned i=2;i<4;i++)
622  {
623  this->internal_data_pt(P_linearised_nst_internal_index[i])->pin_all();
624  }
625  }
626 
627  void pin_real_or_imag(const unsigned &real_index)
628  {
629  unsigned n_node=this->nnode();
630  for(unsigned n=0;n<n_node;n++)
631  {
632  Node* nod_pt = this->node_pt(n);
633 
634  for(unsigned i=0;i<DIM;++i)
635  {
636  //Provided it's not constrained then pin it
637  if(!nod_pt->is_constrained(i))
638  {
639  this->node_pt(n)->pin(2*i +real_index);
640  }
641  }
642  }
643 
644  //Similarly for the pressure
645  this->internal_data_pt(P_linearised_nst_internal_index[real_index])
646  ->pin_all();
647  }
648 
649  void unpin_real_or_imag(const unsigned &real_index)
650  {
651  unsigned n_node=this->nnode();
652  for(unsigned n=0;n<n_node;n++)
653  {
654  Node* nod_pt = this->node_pt(n);
655 
656  for(unsigned i=0;i<DIM;++i)
657  {
658  //Provided it's not constrained then unpin it
659  if(!nod_pt->is_constrained(i))
660  {
661  nod_pt->unpin(2*i +real_index);
662  }
663  }
664  }
665 
666  //Similarly for the pressure
667  this->internal_data_pt(P_linearised_nst_internal_index[real_index])
668  ->unpin_all();
669  }
670 
672  {
673  unsigned n_node = this->nnode();
674  for(unsigned n=0;n<n_node;n++)
675  {
676  Node* nod_pt = this->node_pt(n);
677 
678  //Transfer the eigenfunctions to the normalisation constraints
679  for(unsigned i=0;i<DIM;++i)
680  {
681  for(unsigned j=0;j<2;++j)
682  {
683  nod_pt->set_value(2*(DIM+i) + j,nod_pt->value(2*i + j));
684  }
685  }
686  }
687 
688  //Similarly for the pressure
689  for(unsigned i=0;i<2;++i)
690  {
691  Data* local_data_pt =
692  this->internal_data_pt(P_linearised_nst_internal_index[i]);
693  Data* norm_local_data_pt =
694  this->internal_data_pt(P_linearised_nst_internal_index[2+i]);
695  for(unsigned j=0;j<3;j++)
696  {
697  norm_local_data_pt->set_value(j,local_data_pt->value(j));
698  }
699  }
700  }
701 
702 
703  /// \short Return number of pressure values corresponding to a
704  /// single pressure component
705  unsigned npres_linearised_nst() const { return 3; }
706 
707  /// \short Fix both components of the internal pressure degrees
708  /// of freedom p_dof to pvalue
709  void fix_pressure(const unsigned &p_dof, const double &pvalue)
710  {
711  // Loop over the two pressure components
712  for(unsigned i=0;i<2;i++)
713  {
714  this->internal_data_pt(P_linearised_nst_internal_index[i])
715  ->pin(p_dof);
716  internal_data_pt(P_linearised_nst_internal_index[i])
717  ->set_value(p_dof,pvalue);
718  }
719  }
720 
721  /// \short Overload the access function for the i-th component of the
722  /// pressure's local equation numbers
723  inline int p_local_eqn(const unsigned &n, const unsigned &i)
724  {
725  return internal_local_eqn(P_linearised_nst_internal_index[i],n);
726  }
727 
728  /// Redirect output to NavierStokesEquations output
729  void output(std::ostream &outfile)
731 
732  /// Redirect output to NavierStokesEquations output
733  void output(std::ostream &outfile, const unsigned &n_plot)
734  { LinearisedNavierStokesEquations::output(outfile,n_plot); }
735 
736  /// Redirect output to NavierStokesEquations output
737  void output(FILE* file_pt)
739 
740  /// Redirect output to NavierStokesEquations output
741  void output(FILE* file_pt, const unsigned &n_plot)
742  { LinearisedNavierStokesEquations::output(file_pt,n_plot); }
743 
744  /// \short The number of "dof-blocks" that degrees of freedom in this
745  /// element are sub-divided into: Velocity and pressure.
746  unsigned ndof_types() const { return 2*(DIM+1); }
747 
748  }; // End of LinearisedQCrouzeixRaviartElement class definition
749 
750 
751  // Inline functions
752  // ----------------
753 
754  //=======================================================================
755  /// \short Derivatives of the shape functions and test functions w.r.t.
756  /// global (Eulerian) coordinates at local coordinate s.
757  /// Return Jacobian of mapping between local and global coordinates.
758  //=======================================================================
761  const Vector<double> &s,
762  Shape &psi, DShape &dpsidx,
763  Shape &test, DShape &dtestdx) const
764  {
765  // Call the geometrical shape functions and derivatives
766  const double J = this->dshape_eulerian(s,psi,dpsidx);
767  //The test functions are equal to the shape functions
768  test = psi;
769  dtestdx = dpsidx;
770  // Return the Jacobian
771  return J;
772  }
773 
774  //=======================================================================
775  /// \short Derivatives of the shape functions and test functions w.r.t.
776  /// global (Eulerian) coordinates at the ipt-th integration point.
777  /// Return Jacobian of mapping between local and global coordinates.
778  //=======================================================================
781  const unsigned &ipt, Shape &psi,
782  DShape &dpsidx, Shape &test,
783  DShape &dtestdx) const
784  {
785 
786  // Call the geometrical shape functions and derivatives
787  const double J = this->dshape_eulerian_at_knot(ipt,psi,dpsidx);
788 
789  // Loop over the test functions and derivatives and set them
790  // equal to the shape functions
791  test = psi;
792  dtestdx = dpsidx;
793  // Return the Jacobian
794  return J;
795  }
796 
797  //=======================================================================
798  /// Pressure shape functions
799  //=======================================================================
802  {
803  psi[0] = 1.0;
804  psi[1] = s[0];
805  psi[2] = s[1];
806  }
807 
808  //=======================================================================
809  /// Define the pressure shape and test functions
810  //=======================================================================
813  Shape &psi, Shape &test) const
814  {
815  // Call the pressure shape functions
816  pshape_linearised_nst(s,psi);
817 
818  // Loop over the test functions and set them equal to the shape functions
819  for(unsigned i=0;i<3;i++) { test[i] = psi[i]; }
820  }
821 
822  //=======================================================================
823  /// Face geometry of the linearised axisym Crouzeix-Raviart elements
824  //=======================================================================
825  template<>
827  : public virtual QElement<1,3>
828  {
829  public:
830  FaceGeometry() : QElement<1,3>() {}
831  };
832 
833  //=======================================================================
834  /// \short Face geometry of face geometry of the linearised axisymmetric
835  /// Crouzeix Raviart elements
836  //=======================================================================
837  template<>
840  : public virtual PointElement
841  {
842  public:
844  };
845 
846 
847 
848 //////////////////////////////////////////////////////////////////////////////
849 //////////////////////////////////////////////////////////////////////////////
850 //////////////////////////////////////////////////////////////////////////////
851 
852 
853 
854  //=======================================================================
855  /// Taylor--Hood elements are Navier--Stokes elements with quadratic
856  /// interpolation for velocities and positions and continuous linear
857  /// pressure interpolation
858  //=======================================================================
860  : public virtual QElement<2,3>,
861  public virtual LinearisedNavierStokesEquations
862  {
863  private:
864 
865  /// Static array of ints to hold number of variables at node
866  static const unsigned Initial_Nvalue[];
867 
868  protected:
869 
870  /// \short Static array of ints to hold conversion from pressure
871  /// node numbers to actual node numbers
872  static const unsigned Pconv[];
873 
874  /// \short Velocity shape and test functions and their derivatives
875  /// w.r.t. global coordinates at local coordinate s (taken from geometry).
876  /// Return Jacobian of mapping between local and global coordinates.
878  const Vector<double> &s,
879  Shape &psi, DShape &dpsidx,
880  Shape &test, DShape &dtestdx) const;
881 
882  /// \short Velocity shape and test functions and their derivatives
883  /// w.r.t. global coordinates the ipt-th integation point
884  /// (taken from geometry).
885  /// Return Jacobian of mapping between local and global coordinates.
887  const unsigned &ipt,
888  Shape &psi, DShape &dpsidx,
889  Shape &test, DShape &dtestdx) const;
890 
891  /// Compute the pressure shape functions at local coordinate s
892  inline void pshape_linearised_nst(const Vector<double> &s,
893  Shape &psi) const;
894 
895  /// Compute the pressure shape and test functions at local coordinte s
896  inline void pshape_linearised_nst(const Vector<double> &s,
897  Shape &psi, Shape &test) const;
898 
899  public:
900 
901  /// Constructor, no internal data points
904 
905  /// \short Number of values (pinned or dofs) required at node n. Can
906  /// be overwritten for hanging node version
907  inline virtual unsigned required_nvalue(const unsigned &n) const
908  { return Initial_Nvalue[n]; }
909 
910  /// \short Which nodal value represents the pressure? Overload version
911  /// in base class which returns static int "Pressure_not_stored_at_node"
912  virtual int p_index_linearised_nst(const unsigned &i) const
913  {
914  return (2*DIM+i);
915  }
916 
917  /// \short Access function for the i-th component of pressure
918  /// at local pressure node n_p (const version).
919  double p_linearised_nst(const unsigned &n_p,
920  const unsigned &i) const
921  {
922  return nodal_value(Pconv[n_p],p_index_linearised_nst(i));
923  }
924 
925  //Pin the normalisation dofs
927  {
928  throw OomphLibError("This is not implemented yet\n",
929  OOMPH_CURRENT_FUNCTION,
930  OOMPH_EXCEPTION_LOCATION);
931  }
932 
933 
934  virtual void pin_real_or_imag(const unsigned &real)
935  {
936  throw OomphLibError("This is not implemented yet\n",
937  OOMPH_CURRENT_FUNCTION,
938  OOMPH_EXCEPTION_LOCATION);
939  }
940 
941  virtual void unpin_real_or_imag(const unsigned &real)
942  {
943  throw OomphLibError("This is not implemented yet\n",
944  OOMPH_CURRENT_FUNCTION,
945  OOMPH_EXCEPTION_LOCATION);
946  }
947 
948 
949  /// \short Return number of pressure values corresponding to a
950  /// single pressure component
951  unsigned npres_linearised_nst() const { return 4; }
952 
953  /// \short Fix both components of the pressure at local pressure
954  /// node n_p to pvalue
955  void fix_pressure(const unsigned &n_p, const double &pvalue)
956  {
957  // Loop over the two pressure components
958  for(unsigned i=0;i<2;i++)
959  {
960  this->node_pt(Pconv[n_p])->pin(p_index_linearised_nst(i));
961  this->node_pt(Pconv[n_p])
963  }
964  }
965 
966  /// \short Overload the access function for the i-th component of the
967  /// pressure's local equation numbers
968  inline int p_local_eqn(const unsigned &n, const unsigned &i)
969  {
970  return nodal_local_eqn(Pconv[n],p_index_linearised_nst(i));
971  }
972 
973  /// Redirect output to NavierStokesEquations output
974  void output(std::ostream &outfile)
976 
977  /// Redirect output to NavierStokesEquations output
978  void output(std::ostream &outfile, const unsigned &n_plot)
979  { LinearisedNavierStokesEquations::output(outfile,n_plot); }
980 
981  /// Redirect output to NavierStokesEquations output
982  void output(FILE* file_pt)
984 
985  /// Redirect output to NavierStokesEquations output
986  void output(FILE* file_pt, const unsigned &n_plot)
987  { LinearisedNavierStokesEquations::output(file_pt,n_plot); }
988 
989  /// \short Returns the number of "dof-blocks" that degrees of freedom
990  /// in this element are sub-divided into: Velocity and pressure.
991  unsigned ndof_types() const { return 8; }
992 
993  }; // End of LinearisedQTaylorHoodElement class definition
994 
995 
996  // Inline functions
997  // ----------------
998 
999  //=======================================================================
1000  /// \short Derivatives of the shape functions and test functions w.r.t
1001  /// global (Eulerian) coordinates at local coordinate s.
1002  /// Return Jacobian of mapping between local and global coordinates.
1003  //=======================================================================
1004  inline double LinearisedQTaylorHoodElement::
1006  const Vector<double> &s,
1007  Shape &psi, DShape &dpsidx,
1008  Shape &test, DShape &dtestdx) const
1009  {
1010  // Call the geometrical shape functions and derivatives
1011  const double J = this->dshape_eulerian(s,psi,dpsidx);
1012 
1013  test = psi;
1014  dtestdx = dpsidx;
1015 
1016  // Return the Jacobian
1017  return J;
1018  }
1019 
1020  //=======================================================================
1021  /// \short Derivatives of the shape functions and test functions w.r.t
1022  /// global (Eulerian) coordinates at the ipt-th integration point.
1023  /// Return Jacobian of mapping between local and global coordinates.
1024  //=======================================================================
1025  inline double LinearisedQTaylorHoodElement::
1027  const unsigned &ipt,
1028  Shape &psi, DShape &dpsidx,
1029  Shape &test, DShape &dtestdx) const
1030  {
1031  // Call the geometrical shape functions and derivatives
1032  const double J = this->dshape_eulerian_at_knot(ipt,psi,dpsidx);
1033 
1034  test=psi;
1035  dtestdx = dpsidx;
1036 
1037  // Return the Jacobian
1038  return J;
1039  }
1040 
1041  //=======================================================================
1042  /// Pressure shape functions
1043  //=======================================================================
1044  inline void LinearisedQTaylorHoodElement::
1046  {
1047  // Allocate local storage for the pressure shape functions
1048  double psi1[2], psi2[2];
1049 
1050  // Call the one-dimensional shape functions
1051  OneDimLagrange::shape<2>(s[0],psi1);
1052  OneDimLagrange::shape<2>(s[1],psi2);
1053 
1054  // Now let's loop over the nodal points in the element
1055  // s1 is the "r" coordinate, s2 the "z"
1056  for(unsigned i=0;i<2;i++)
1057  {
1058  for(unsigned j=0;j<2;j++)
1059  {
1060  // Multiply the two 1D functions together to get the 2D function
1061  psi[2*i + j] = psi2[i]*psi1[j];
1062  }
1063  }
1064  }
1065 
1066  //=======================================================================
1067  /// Pressure shape and test functions
1068  //=======================================================================
1069  inline void LinearisedQTaylorHoodElement::
1071  Shape &psi, Shape &test) const
1072  {
1073  // Call the pressure shape functions
1074  pshape_linearised_nst(s,psi);
1075 
1076  // Loop over the test functions and set them equal to the shape functions
1077  for(unsigned i=0;i<4;i++) { test[i] = psi[i]; }
1078  }
1079 
1080  //=======================================================================
1081  /// Face geometry of the linearised axisymmetric Taylor Hood elements
1082  //=======================================================================
1083  template<>
1085  : public virtual QElement<1,3>
1086  {
1087  public:
1088  FaceGeometry() : QElement<1,3>() {}
1089  };
1090 
1091  //=======================================================================
1092  /// \short Face geometry of the face geometry of the linearised
1093  /// axisymmetric Taylor Hood elements
1094  //=======================================================================
1095  template<>
1098  : public virtual PointElement
1099  {
1100  public:
1102  };
1103 
1104 
1105 } // End of oomph namespace
1106 
1107 #endif
virtual double dshape_and_dtest_eulerian_linearised_nst(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Compute the shape functions and their derivatives w.r.t. global coordinates at local coordinate s...
void unpin(const unsigned &i)
Unpin the i-th stored variable.
Definition: nodes.h:386
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 ...
Definition: nodes.h:291
double dshape_and_dtest_eulerian_linearised_nst(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Velocity shape and test functions and their derivatives w.r.t. global coordinates at local coordinate...
int p_local_eqn(const unsigned &n, const unsigned &i)
Overload the access function for the i-th component of the pressure&#39;s local equation numbers...
Data * eigenvalue_data_pt()
Access to Data that contains the traded pressure.
void set_eigenfunction_normalisation_element(LinearisedNavierStokesEigenfunctionNormalisationElement *const &normalisation_el_pt)
the boolean flag check_nodal_data is set to false.
void output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
void pin_pressure_normalisation_dofs()
Pin the normalisation dofs.
LinearisedQTaylorHoodElement()
Constructor, no internal data points.
void pin_all()
Pin all the stored variables.
Definition: nodes.h:389
virtual unsigned required_nvalue(const unsigned &n) const
Number of values that must be stored at local node n by the element. The default is 0...
Definition: elements.h:2346
virtual double dshape_and_dtest_eulerian_at_knot_linearised_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Compute the shape functions and their derivatives w.r.t. global coordinates at the ipt-th integration...
void disable_ALE()
Disable ALE, i.e. assert the mesh is not moving – you do this at your own risk!
unsigned npres_linearised_nst() const
Return number of pressure values corresponding to a single pressure component.
double dshape_and_dtest_eulerian_at_knot_linearised_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Velocity shape and test functions and their derivatives w.r.t. global coordinates the ipt-th integati...
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-...
Definition: elements.cc:3254
unsigned Data_number_of_eigenvalue
Index of datum where eigenvalue is stored.
double p_linearised_nst(const unsigned &n_p, const unsigned &i) const
Access function for the i-th component of pressure at local pressure node n_p (const version)...
double * Density_Ratio_pt
Pointer to the density ratio (relative to the density used in the definition of the Reynolds number) ...
cstr elem_len * i
Definition: cfortran.h:607
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...
Definition: nodes.h:322
LinearisedQCrouzeixRaviartElement()
Constructor: there are three internal values for each of the two pressure components.
void pshape_linearised_nst(const Vector< double > &s, Shape &psi) const
Compute the pressure shape functions at local coordinate s.
const double & re_st() const
Product of Reynolds and Strouhal number (=Womersley number)
void unpin_all()
Unpin all the stored variables.
Definition: nodes.h:396
virtual void pin_real_or_imag(const unsigned &real)=0
Pin the real or imaginary part of the problem Input integer 0 for real 1 for imaginary.
const double & density_ratio() const
Density ratio for element: element&#39;s density relative to the viscosity used in the definition of the ...
virtual void pin_real_or_imag(const unsigned &real)
Pin the real or imaginary part of the problem Input integer 0 for real 1 for imaginary.
A general Finite Element class.
Definition: elements.h:1274
void pshape_linearised_nst(const Vector< double > &s, Shape &psi) const
Compute the pressure shape functions at local coordinate s.
double *& viscosity_ratio_pt()
Pointer to the viscosity ratio.
void enable_ALE()
(Re-)enable ALE, i.e. take possible mesh motion into account when evaluating the time-derivative. Note: By default, ALE is enabled, at the expense of possibly creating unnecessary work in problems where the mesh is, in fact, stationary.
char t
Definition: cfortran.h:572
virtual double p_linearised_nst(const unsigned &n_p, const unsigned &i) const =0
Return the i-th pressure value at local pressure "node" n_p. Uses suitably interpolated value for han...
void pin_real_or_imag(const unsigned &real_index)
Pin the real or imaginary part of the problem Input integer 0 for real 1 for imaginary.
void output(std::ostream &outfile, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
Definition: nodes.h:852
virtual void pin_pressure_normalisation_dofs()=0
Pin the normalisation dofs.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Compute the element&#39;s residual Vector.
double * Re_pt
Pointer to global Reynolds number.
void pin_pressure_normalisation_dofs()
Pin the normalisation dofs.
Vector< unsigned > P_linearised_nst_internal_index
Internal indices that indicate at which internal data the pressure values are stored. We note that there are two pressure values, corresponding to the functions P^C(r,z,t) and P^S(r,z,t) which multiply the cosine and sine terms respectively.
double *& re_pt()
Pointer to Reynolds number.
double interpolated_p_linearised_nst(const Vector< double > &s, const unsigned &i) const
Return the i-th component of the FE interpolated pressure p[i] at local coordinate s...
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:383
double *& re_st_pt()
Pointer to product of Reynolds and Strouhal number (=Womersley number)
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:293
unsigned index_of_eigenvalue()
Return the index of Data object at which the traded pressure is stored.
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
Definition: geom_objects.h:197
unsigned npres_linearised_nst() const
Return number of pressure values corresponding to a single pressure component.
static double Default_Physical_Ratio_Value
Static default value for the physical ratios (all initialised to one)
void(*&)(const double &time, const Vector< double > &x, Vector< double > &f) base_flow_u_fct_pt()
Access function for the base flow solution pointer.
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...
Definition: elements.cc:3227
virtual unsigned u_index_linearised_nst(const unsigned &i) const
Return the index at which the i-th unknown velocity component is stored. The default value...
virtual void get_base_flow_dudx(const double &time, const unsigned &ipt, const Vector< double > &x, DenseMatrix< double > &result) const
Calculate the derivatives of the velocity components of the base flow solution w.r.t. global coordinates (r and z) at a given time and Eulerian position.
static char t char * s
Definition: cfortran.h:572
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...
Definition: nodes.h:267
double p_linearised_nst(const unsigned &i_internal, const unsigned &i) const
Return the pressure value i at internal dof i_internal (Discontinous pressure interpolation – no nee...
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:623
double dshape_and_dtest_eulerian_at_knot_linearised_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Velocity shape and test functions and their derivatives w.r.t. global coordinates at the ipt-th integ...
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not.
unsigned ndof_types() const
Returns the number of "dof-blocks" that degrees of freedom in this element are sub-divided into: Velo...
virtual int p_index_linearised_nst(const unsigned &i) const
Which nodal value represents the pressure? Overload version in base class which returns static int "P...
virtual void fill_in_generic_residual_contribution_linearised_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Compute the residuals for the Navier-Stokes equations; flag=1(or 0): do (or don&#39;t) compute the Jacobi...
A class that represents a collection of data; each Data object may contain many different individual ...
Definition: nodes.h:89
void output(std::ostream &outfile)
Output function: r, z, U^C, U^S, V^C, V^S, W^C, W^S, P^C, P^S in tecplot format. Default number of pl...
virtual unsigned npres_linearised_nst() const =0
Return the number of pressure degrees of freedom associated with a single pressure component in the e...
void strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate, const unsigned &real) const
Strain-rate tensor: where (in that order)
void output(FILE *file_pt, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
bool is_constrained(const unsigned &i)
Test whether the i-th variable is constrained (1: true; 0: false).
Definition: nodes.h:439
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...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2109
void output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
void(*&)(const double &time, const Vector< double > &x, DenseMatrix< double > &f) base_flow_dudx_fct_pt()
Access function for the derivatives of the base flow w.r.t. global coordinates solution pointer...
double * Viscosity_Ratio_pt
Pointer to the viscosity ratio (relative to the viscosity used in the definition of the Reynolds numb...
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...
Definition: elements.h:2470
double *& density_ratio_pt()
Pointer to the density ratio.
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
Definition: timesteppers.h:562
void(* Base_flow_dudx_fct_pt)(const double &time, const Vector< double > &x, DenseMatrix< double > &result)
Pointer to derivatives of base flow solution velocity components w.r.t. global coordinates (r and z) ...
virtual void pshape_linearised_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
unsigned ndof_types() const
The number of "dof-blocks" that degrees of freedom in this element are sub-divided into: Velocity and...
double interpolated_u_linearised_nst(const Vector< double > &s, const unsigned &i) const
Compute the element&#39;s residual Vector and the jacobian matrix. Virtual function can be overloaded by ...
int p_local_eqn(const unsigned &n, const unsigned &i)
Overload the access function for the i-th component of the pressure&#39;s local equation numbers...
virtual void unpin_real_or_imag(const unsigned &real)
LinearisedNavierStokesEquations()
Constructor: NULL the base flow solution and the derivatives of the base flow function.
void(* Base_flow_u_fct_pt)(const double &time, const Vector< double > &x, Vector< double > &result)
Pointer to base flow solution (velocity components) function.
virtual int p_index_linearised_nst(const unsigned &i) const
Which nodal value represents the pressure?
virtual void unpin_real_or_imag(const unsigned &real)=0
void output_veloc(std::ostream &outfile, const unsigned &nplot, const unsigned &t)
Output function: r, z, U^C, U^S, V^C, V^S, W^C, W^S, in tecplot format. nplot points in each coordina...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:246
void output(FILE *file_pt)
Output function: r, z, U^C, U^S, V^C, V^S, W^C, W^S, P^C, P^S in tecplot format. Default number of pl...
virtual int p_local_eqn(const unsigned &n, const unsigned &i)=0
Access function for the local equation number information for the i-th component of the pressure...
void output(std::ostream &outfile, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
virtual void get_base_flow_u(const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &result) const
Calculate the velocity components of the base flow solution at a given time and Eulerian position...
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
void output(FILE *file_pt, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
const double & re() const
Reynolds number.
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 ...
Definition: elements.cc:66
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
A class for elements that solve the linearised version of the unsteady Navier–Stokes equations in cy...
void fix_pressure(const unsigned &n_p, const double &pvalue)
Fix both components of the pressure at local pressure node n_p to pvalue.
bool is_steady() const
Flag to indicate if a timestepper has been made steady (possibly temporarily to switch off time-depen...
Definition: timesteppers.h:375
const double & viscosity_ratio() const
Viscosity ratio for element: element&#39;s viscosity relative to the viscosity used in the definition of ...
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2146
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Definition: timesteppers.h:219
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
Definition: timesteppers.h:557
LinearisedNavierStokesEigenfunctionNormalisationElement * normalisation_element_pt()
Pointer to normalisation element.
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...
LinearisedNavierStokesEigenfunctionNormalisationElement * Normalisation_element_pt
Pointer to the normalisation element.
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation...
Definition: nodes.cc:2328
int external_local_eqn(const unsigned &i, const unsigned &j)
Return the local equation number corresponding to the j-th value stored at the i-th external data...
Definition: elements.h:313
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
Definition: elements.h:228
void fix_pressure(const unsigned &p_dof, const double &pvalue)
Fix both components of the internal pressure degrees of freedom p_dof to pvalue.
double * ReSt_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when the time-derivatives are computed...
double dshape_and_dtest_eulerian_linearised_nst(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Velocity shape and test functions and their derivatives w.r.t. global coordinates at local coordinate...
double du_dt_linearised_nst(const unsigned &n, const unsigned &i) const
Return the i-th component of du/dt at local node n. Uses suitably interpolated value for hanging node...
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...
Definition: elements.h:1386
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...
Definition: elements.h:268
void shape< 2 >(const double &s, double *Psi)
1D shape functions specialised to linear order (2 Nodes)
Definition: shape.h:596