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// Copyright (C) 2006-2022 Matthias Heil and Andrew Hazel
7 // LIC//
8 // LIC// This library is free software; you can redistribute it and/or
9 // LIC// modify it under the terms of the GNU Lesser General Public
10 // LIC// License as published by the Free Software Foundation; either
11 // LIC// version 2.1 of the License, or (at your option) any later version.
12 // LIC//
13 // LIC// This library is distributed in the hope that it will be useful,
14 // LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // LIC// Lesser General Public License for more details.
17 // LIC//
18 // LIC// You should have received a copy of the GNU Lesser General Public
19 // LIC// License along with this library; if not, write to the Free Software
20 // LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 // LIC// 02110-1301 USA.
22 // LIC//
23 // LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24 // LIC//
25 // LIC//====================================================================
26 // Header file for linearised axisymmetric Navier-Stokes elements
27 
28 #ifndef OOMPH_LINEARISED_NAVIER_STOKES_ELEMENTS_HEADER
29 #define OOMPH_LINEARISED_NAVIER_STOKES_ELEMENTS_HEADER
30 
31 // Config header generated by autoconfig
32 #ifdef HAVE_CONFIG_H
33 #include <oomph-lib-config.h>
34 #endif
35 
36 // oomph-lib includes
37 #include "../generic/Qelements.h"
38 #include "../generic/fsi.h"
39 
41 
42 namespace oomph
43 {
44 #define DIM 2
45 
46 
47  //=======================================================================
52  //=======================================================================
54  {
55  private:
59 
63 
66 
67  protected:
68  // Physical constants
69  // ------------------
70 
74 
78 
80  double* Re_pt;
81 
83  double* ReSt_pt;
84 
86  double* Lambda_pt;
87 
89  double* Omega_pt;
90 
94 
95 
98 
100 
102  void (*Base_flow_u_fct_pt)(const double& time,
103  const Vector<double>& x,
104  Vector<double>& result);
105 
108  void (*Base_flow_dudx_fct_pt)(const double& time,
109  const Vector<double>& x,
110  DenseMatrix<double>& result);
111 
116 
120  virtual int p_local_eqn(const unsigned& n, const unsigned& i) = 0;
121 
126  const Vector<double>& s,
127  Shape& psi,
128  DShape& dpsidx,
129  Shape& test,
130  DShape& dtestdx) const = 0;
131 
136  const unsigned& ipt,
137  Shape& psi,
138  DShape& dpsidx,
139  Shape& test,
140  DShape& dtestdx) const = 0;
141 
144  Shape& psi) const = 0;
145 
148  Shape& psi,
149  Shape& test) const = 0;
150 
153  virtual void get_base_flow_u(const double& time,
154  const unsigned& ipt,
155  const Vector<double>& x,
156  Vector<double>& result) const
157  {
158  // If the function pointer is zero return zero
159  if (Base_flow_u_fct_pt == 0)
160  {
161  // Loop over velocity components and set base flow solution to zero
162  for (unsigned i = 0; i < DIM; i++)
163  {
164  result[i] = 0.0;
165  }
166  }
167  // Otherwise call the function
168  else
169  {
170  (*Base_flow_u_fct_pt)(time, x, result);
171  }
172  }
173 
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++)
190  {
191  result(i, j) = 0.0;
192  }
193  }
194  }
195  // Otherwise call the function
196  else
197  {
198  (*Base_flow_dudx_fct_pt)(time, x, result);
199  }
200  }
201 
202 
203  inline int eigenvalue_local_eqn(const unsigned& i)
204  {
205  return this->external_local_eqn(this->Data_number_of_eigenvalue,
206  this->Index_of_eigenvalue + i);
207  }
208 
209 
213  Vector<double>& residuals,
214  DenseMatrix<double>& jacobian,
215  DenseMatrix<double>& mass_matrix,
216  unsigned flag);
217 
218  public:
223  {
224  // Set all the physical parameter pointers to the default value of zero
227 
230 
231  // Set to sensible defaults
234 
235  // Set the physical ratios to the default value of one
238 
239  // Null out normalisation
241  }
242 
244  // N.B. This needs to be public so that the intel compiler gets things
245  // correct. Somehow the access function messes things up when going to
246  // refineable navier--stokes
248 
249  // Access functions for the physical constants
250  // -------------------------------------------
251 
253  const double& re() const
254  {
255  return *Re_pt;
256  }
257 
259  const double& re_st() const
260  {
261  return *ReSt_pt;
262  }
263 
264  const double& lambda() const
265  {
266  return *Lambda_pt;
267  }
268 
269  const double& omega() const
270  {
271  return *Omega_pt;
272  }
273 
275  double*& re_pt()
276  {
277  return Re_pt;
278  }
279 
281  double*& re_st_pt()
282  {
283  return ReSt_pt;
284  }
285 
287  double*& lambda_pt()
288  {
289  return Lambda_pt;
290  }
291 
293  double*& omega_pt()
294  {
295  return Omega_pt;
296  }
297 
300  {
302  }
303 
307  normalisation_el_pt)
308  {
309  // Set the normalisation element
310  Normalisation_element_pt = normalisation_el_pt;
311 
312  // Add eigenvalue unknown as external data to this element
314  this->add_external_data(normalisation_el_pt->eigenvalue_data_pt());
315 
316  // Which value corresponds to the eigenvalue
317  Index_of_eigenvalue = normalisation_el_pt->index_of_eigenvalue();
318 
319  // Now set the pointers to the eigenvalues
320  Lambda_pt = normalisation_el_pt->eigenvalue_data_pt()->value_pt(
322  Omega_pt = normalisation_el_pt->eigenvalue_data_pt()->value_pt(
323  Index_of_eigenvalue + 1);
324  }
325 
326 
329  const double& viscosity_ratio() const
330  {
331  return *Viscosity_Ratio_pt;
332  }
333 
336  {
337  return Viscosity_Ratio_pt;
338  }
339 
342  const double& density_ratio() const
343  {
344  return *Density_Ratio_pt;
345  }
346 
348  double*& density_ratio_pt()
349  {
350  return Density_Ratio_pt;
351  }
352 
354  void (*&base_flow_u_fct_pt())(const double& time,
355  const Vector<double>& x,
356  Vector<double>& f)
357  {
358  return Base_flow_u_fct_pt;
359  }
360 
363  void (*&base_flow_dudx_fct_pt())(const double& time,
364  const Vector<double>& x,
366  {
367  return Base_flow_dudx_fct_pt;
368  }
369 
372  virtual unsigned npres_linearised_nst() const = 0;
373 
380  virtual inline unsigned u_index_linearised_nst(const unsigned& i) const
381  {
382  return i;
383  }
384 
387  double du_dt_linearised_nst(const unsigned& n, const unsigned& i) const
388  {
389  // Get the data's timestepper
391 
392  // Initialise dudt
393  double dudt = 0.0;
394 
395  // Loop over the timesteps, if there is a non-steady timestepper
396  if (!time_stepper_pt->is_steady())
397  {
398  // Get the index at which the velocity is stored
399  const unsigned u_nodal_index = u_index_linearised_nst(i);
400 
401  // Determine number of timsteps (past & present)
402  const unsigned n_time = time_stepper_pt->ntstorage();
403 
404  // Add the contributions to the time derivative
405  for (unsigned t = 0; t < n_time; t++)
406  {
407  dudt +=
408  time_stepper_pt->weight(1, t) * nodal_value(t, n, u_nodal_index);
409  }
410  }
411 
412  return dudt;
413  }
414 
417  void disable_ALE()
418  {
419  ALE_is_disabled = true;
420  }
421 
426  void enable_ALE()
427  {
428  ALE_is_disabled = false;
429  }
430 
433  virtual double p_linearised_nst(const unsigned& n_p,
434  const unsigned& i) const = 0;
435 
438  virtual void pin_real_or_imag(const unsigned& real) = 0;
439  virtual void unpin_real_or_imag(const unsigned& real) = 0;
440 
443 
445  // N.B. This function has return type "int" (rather than "unsigned"
446  // as in the u_index case) so that we can return the "magic" number
447  // "Pressure_not_stored_at_node" ( = -100 )
448  virtual inline int p_index_linearised_nst(const unsigned& i) const
449  {
451  }
452 
455  void strain_rate(const Vector<double>& s,
457  const unsigned& real) const;
458 
461  void output(std::ostream& outfile)
462  {
463  const unsigned nplot = 5;
464  output(outfile, nplot);
465  }
466 
469  void output(std::ostream& outfile, const unsigned& nplot);
470 
473  void output(FILE* file_pt)
474  {
475  const unsigned nplot = 5;
476  output(file_pt, nplot);
477  }
478 
481  void output(FILE* file_pt, const unsigned& nplot);
482 
486  void output_veloc(std::ostream& outfile,
487  const unsigned& nplot,
488  const unsigned& t);
489 
492  {
493  // Call the generic residuals function with flag set to 0
494  // and using a dummy matrix argument
496  residuals,
499  0);
500  }
501 
504  /*void fill_in_contribution_to_jacobian(Vector<double> &residuals,
505  DenseMatrix<double> &jacobian)
506  {
507  // Call the generic routine with the flag set to 1
508  fill_in_generic_residual_contribution_linearised_nst(
509  residuals,jacobian,GeneralisedElement::Dummy_matrix,1);
510  }*/
511 
514  /*void fill_in_contribution_to_jacobian_and_mass_matrix(
515  Vector<double> &residuals, DenseMatrix<double> &jacobian,
516  DenseMatrix<double> &mass_matrix)
517  {
518  // Call the generic routine with the flag set to 2
519  fill_in_generic_residual_contribution_linearised_nst(
520  residuals,jacobian,mass_matrix,2);
521  }*/
522 
526  const unsigned& i) const
527  {
528  // Determine number of nodes in the element
529  const unsigned n_node = nnode();
530 
531  // Provide storage for local shape functions
532  Shape psi(n_node);
533 
534  // Find values of shape functions
535  shape(s, psi);
536 
537  // Get the index at which the velocity is stored
538  const unsigned u_nodal_index = u_index_linearised_nst(i);
539 
540  // Initialise value of u
541  double interpolated_u = 0.0;
542 
543  // Loop over the local nodes and sum
544  for (unsigned l = 0; l < n_node; l++)
545  {
546  interpolated_u += nodal_value(l, u_nodal_index) * psi[l];
547  }
548 
549  return (interpolated_u);
550  }
551 
555  const unsigned& i) const
556  {
557  // Determine number of pressure nodes in the element
558  const unsigned n_pressure_nodes = npres_linearised_nst();
559 
560  // Provide storage for local shape functions
561  Shape psi(n_pressure_nodes);
562 
563  // Find values of shape functions
564  pshape_linearised_nst(s, psi);
565 
566  // Initialise value of p
567  double interpolated_p = 0.0;
568 
569  // Loop over the local nodes and sum
570  for (unsigned l = 0; l < n_pressure_nodes; l++)
571  {
572  // N.B. The pure virtual function p_linearised_nst(...)
573  // automatically calculates the index at which the pressure value
574  // is stored, so we don't need to worry about this here
575  interpolated_p += p_linearised_nst(l, i) * psi[l];
576  }
577 
578  return (interpolated_p);
579  }
580 
581  }; // End of LinearisedNavierStokesEquations class definition
582 
583 
587 
588 
589  //=======================================================================
593  //=======================================================================
595  : public virtual QElement<2, 3>,
596  public virtual LinearisedNavierStokesEquations
597  {
598  private:
600  static const unsigned Initial_Nvalue[];
601 
602  protected:
608 
613  const Vector<double>& s,
614  Shape& psi,
615  DShape& dpsidx,
616  Shape& test,
617  DShape& dtestdx) const;
618 
624  const unsigned& ipt,
625  Shape& psi,
626  DShape& dpsidx,
627  Shape& test,
628  DShape& dtestdx) const;
629 
631  inline void pshape_linearised_nst(const Vector<double>& s,
632  Shape& psi) const;
633 
635  inline void pshape_linearised_nst(const Vector<double>& s,
636  Shape& psi,
637  Shape& test) const;
638 
639  public:
643  : QElement<2, 3>(),
646  {
647  // Loop over the two pressure components
648  // and two normalisation constraints
649  for (unsigned i = 0; i < 4; i++)
650  {
651  // Allocate and add one internal data object for each of the two
652  // pressure components that store the three pressure values
654  this->add_internal_data(new Data(3));
655  }
656  }
657 
659  virtual unsigned required_nvalue(const unsigned& n) const;
660 
664  double p_linearised_nst(const unsigned& i_internal, const unsigned& i) const
665  {
667  ->value(i_internal);
668  }
669 
670  // Pin the normalisation dofs
672  {
673  for (unsigned i = 2; i < 4; i++)
674  {
675  this->internal_data_pt(P_linearised_nst_internal_index[i])->pin_all();
676  }
677  }
678 
679  void pin_real_or_imag(const unsigned& real_index)
680  {
681  unsigned n_node = this->nnode();
682  for (unsigned n = 0; n < n_node; n++)
683  {
684  Node* nod_pt = this->node_pt(n);
685 
686  for (unsigned i = 0; i < DIM; ++i)
687  {
688  // Provided it's not constrained then pin it
689  if (!nod_pt->is_constrained(i))
690  {
691  this->node_pt(n)->pin(2 * i + real_index);
692  }
693  }
694  }
695 
696  // Similarly for the pressure
697  this->internal_data_pt(P_linearised_nst_internal_index[real_index])
698  ->pin_all();
699  }
700 
701  void unpin_real_or_imag(const unsigned& real_index)
702  {
703  unsigned n_node = this->nnode();
704  for (unsigned n = 0; n < n_node; n++)
705  {
706  Node* nod_pt = this->node_pt(n);
707 
708  for (unsigned i = 0; i < DIM; ++i)
709  {
710  // Provided it's not constrained then unpin it
711  if (!nod_pt->is_constrained(i))
712  {
713  nod_pt->unpin(2 * i + real_index);
714  }
715  }
716  }
717 
718  // Similarly for the pressure
719  this->internal_data_pt(P_linearised_nst_internal_index[real_index])
720  ->unpin_all();
721  }
722 
724  {
725  unsigned n_node = this->nnode();
726  for (unsigned n = 0; n < n_node; n++)
727  {
728  Node* nod_pt = this->node_pt(n);
729 
730  // Transfer the eigenfunctions to the normalisation constraints
731  for (unsigned i = 0; i < DIM; ++i)
732  {
733  for (unsigned j = 0; j < 2; ++j)
734  {
735  nod_pt->set_value(2 * (DIM + i) + j, nod_pt->value(2 * i + j));
736  }
737  }
738  }
739 
740  // Similarly for the pressure
741  for (unsigned i = 0; i < 2; ++i)
742  {
743  Data* local_data_pt =
744  this->internal_data_pt(P_linearised_nst_internal_index[i]);
745  Data* norm_local_data_pt =
746  this->internal_data_pt(P_linearised_nst_internal_index[2 + i]);
747  for (unsigned j = 0; j < 3; j++)
748  {
749  norm_local_data_pt->set_value(j, local_data_pt->value(j));
750  }
751  }
752  }
753 
754 
757  unsigned npres_linearised_nst() const
758  {
759  return 3;
760  }
761 
764  void fix_pressure(const unsigned& p_dof, const double& pvalue)
765  {
766  // Loop over the two pressure components
767  for (unsigned i = 0; i < 2; i++)
768  {
769  this->internal_data_pt(P_linearised_nst_internal_index[i])->pin(p_dof);
771  ->set_value(p_dof, pvalue);
772  }
773  }
774 
777  inline int p_local_eqn(const unsigned& n, const unsigned& i)
778  {
780  }
781 
783  void output(std::ostream& outfile)
784  {
786  }
787 
789  void output(std::ostream& outfile, const unsigned& n_plot)
790  {
792  }
793 
795  void output(FILE* file_pt)
796  {
798  }
799 
801  void output(FILE* file_pt, const unsigned& n_plot)
802  {
804  }
805 
808  unsigned ndof_types() const
809  {
810  return 2 * (DIM + 1);
811  }
812 
813  }; // End of LinearisedQCrouzeixRaviartElement class definition
814 
815 
816  // Inline functions
817  // ----------------
818 
819  //=======================================================================
823  //=======================================================================
826  Shape& psi,
827  DShape& dpsidx,
828  Shape& test,
829  DShape& dtestdx) const
830  {
831  // Call the geometrical shape functions and derivatives
832  const double J = this->dshape_eulerian(s, psi, dpsidx);
833  // The test functions are equal to the shape functions
834  test = psi;
835  dtestdx = dpsidx;
836  // Return the Jacobian
837  return J;
838  }
839 
840  //=======================================================================
844  //=======================================================================
847  Shape& psi,
848  DShape& dpsidx,
849  Shape& test,
850  DShape& dtestdx) const
851  {
852  // Call the geometrical shape functions and derivatives
853  const double J = this->dshape_eulerian_at_knot(ipt, psi, dpsidx);
854 
855  // Loop over the test functions and derivatives and set them
856  // equal to the shape functions
857  test = psi;
858  dtestdx = dpsidx;
859  // Return the Jacobian
860  return J;
861  }
862 
863  //=======================================================================
865  //=======================================================================
867  const Vector<double>& s, Shape& psi) const
868  {
869  psi[0] = 1.0;
870  psi[1] = s[0];
871  psi[2] = s[1];
872  }
873 
874  //=======================================================================
876  //=======================================================================
878  const Vector<double>& s, Shape& psi, Shape& test) const
879  {
880  // Call the pressure shape functions
881  pshape_linearised_nst(s, psi);
882 
883  // Loop over the test functions and set them equal to the shape functions
884  for (unsigned i = 0; i < 3; i++)
885  {
886  test[i] = psi[i];
887  }
888  }
889 
890  //=======================================================================
892  //=======================================================================
893  template<>
895  : public virtual QElement<1, 3>
896  {
897  public:
898  FaceGeometry() : QElement<1, 3>() {}
899  };
900 
901  //=======================================================================
904  //=======================================================================
905  template<>
907  : public virtual PointElement
908  {
909  public:
911  };
912 
913 
917 
918 
919  //=======================================================================
923  //=======================================================================
925  : public virtual QElement<2, 3>,
926  public virtual LinearisedNavierStokesEquations
927  {
928  private:
930  static const unsigned Initial_Nvalue[];
931 
932  protected:
935  static const unsigned Pconv[];
936 
941  const Vector<double>& s,
942  Shape& psi,
943  DShape& dpsidx,
944  Shape& test,
945  DShape& dtestdx) const;
946 
952  const unsigned& ipt,
953  Shape& psi,
954  DShape& dpsidx,
955  Shape& test,
956  DShape& dtestdx) const;
957 
959  inline void pshape_linearised_nst(const Vector<double>& s,
960  Shape& psi) const;
961 
963  inline void pshape_linearised_nst(const Vector<double>& s,
964  Shape& psi,
965  Shape& test) const;
966 
967  public:
971  {
972  }
973 
976  inline virtual unsigned required_nvalue(const unsigned& n) const
977  {
978  return Initial_Nvalue[n];
979  }
980 
983  virtual int p_index_linearised_nst(const unsigned& i) const
984  {
985  return (2 * DIM + i);
986  }
987 
990  double p_linearised_nst(const unsigned& n_p, const unsigned& i) const
991  {
992  return nodal_value(Pconv[n_p], p_index_linearised_nst(i));
993  }
994 
995  // Pin the normalisation dofs
997  {
998  throw OomphLibError("This is not implemented yet\n",
1001  }
1002 
1003 
1004  virtual void pin_real_or_imag(const unsigned& real)
1005  {
1006  throw OomphLibError("This is not implemented yet\n",
1009  }
1010 
1011  virtual void unpin_real_or_imag(const unsigned& real)
1012  {
1013  throw OomphLibError("This is not implemented yet\n",
1016  }
1017 
1018 
1021  unsigned npres_linearised_nst() const
1022  {
1023  return 4;
1024  }
1025 
1028  void fix_pressure(const unsigned& n_p, const double& pvalue)
1029  {
1030  // Loop over the two pressure components
1031  for (unsigned i = 0; i < 2; i++)
1032  {
1033  this->node_pt(Pconv[n_p])->pin(p_index_linearised_nst(i));
1034  this->node_pt(Pconv[n_p])->set_value(p_index_linearised_nst(i), pvalue);
1035  }
1036  }
1037 
1040  inline int p_local_eqn(const unsigned& n, const unsigned& i)
1041  {
1043  }
1044 
1046  void output(std::ostream& outfile)
1047  {
1049  }
1050 
1052  void output(std::ostream& outfile, const unsigned& n_plot)
1053  {
1054  LinearisedNavierStokesEquations::output(outfile, n_plot);
1055  }
1056 
1058  void output(FILE* file_pt)
1059  {
1061  }
1062 
1064  void output(FILE* file_pt, const unsigned& n_plot)
1065  {
1066  LinearisedNavierStokesEquations::output(file_pt, n_plot);
1067  }
1068 
1071  unsigned ndof_types() const
1072  {
1073  return 8;
1074  }
1075 
1076  }; // End of LinearisedQTaylorHoodElement class definition
1077 
1078 
1079  // Inline functions
1080  // ----------------
1081 
1082  //=======================================================================
1086  //=======================================================================
1089  Shape& psi,
1090  DShape& dpsidx,
1091  Shape& test,
1092  DShape& dtestdx) const
1093  {
1094  // Call the geometrical shape functions and derivatives
1095  const double J = this->dshape_eulerian(s, psi, dpsidx);
1096 
1097  test = psi;
1098  dtestdx = dpsidx;
1099 
1100  // Return the Jacobian
1101  return J;
1102  }
1103 
1104  //=======================================================================
1108  //=======================================================================
1111  Shape& psi,
1112  DShape& dpsidx,
1113  Shape& test,
1114  DShape& dtestdx) const
1115  {
1116  // Call the geometrical shape functions and derivatives
1117  const double J = this->dshape_eulerian_at_knot(ipt, psi, dpsidx);
1118 
1119  test = psi;
1120  dtestdx = dpsidx;
1121 
1122  // Return the Jacobian
1123  return J;
1124  }
1125 
1126  //=======================================================================
1128  //=======================================================================
1130  const Vector<double>& s, Shape& psi) const
1131  {
1132  // Allocate local storage for the pressure shape functions
1133  double psi1[2], psi2[2];
1134 
1135  // Call the one-dimensional shape functions
1136  OneDimLagrange::shape<2>(s[0], psi1);
1137  OneDimLagrange::shape<2>(s[1], psi2);
1138 
1139  // Now let's loop over the nodal points in the element
1140  // s1 is the "r" coordinate, s2 the "z"
1141  for (unsigned i = 0; i < 2; i++)
1142  {
1143  for (unsigned j = 0; j < 2; j++)
1144  {
1145  // Multiply the two 1D functions together to get the 2D function
1146  psi[2 * i + j] = psi2[i] * psi1[j];
1147  }
1148  }
1149  }
1150 
1151  //=======================================================================
1153  //=======================================================================
1155  const Vector<double>& s, Shape& psi, Shape& test) const
1156  {
1157  // Call the pressure shape functions
1158  pshape_linearised_nst(s, psi);
1159 
1160  // Loop over the test functions and set them equal to the shape functions
1161  for (unsigned i = 0; i < 4; i++)
1162  {
1163  test[i] = psi[i];
1164  }
1165  }
1166 
1167  //=======================================================================
1169  //=======================================================================
1170  template<>
1172  : public virtual QElement<1, 3>
1173  {
1174  public:
1175  FaceGeometry() : QElement<1, 3>() {}
1176  };
1177 
1178  //=======================================================================
1181  //=======================================================================
1182  template<>
1184  : public virtual PointElement
1185  {
1186  public:
1188  };
1189 
1190 
1191 } // namespace oomph
1192 
1193 #endif
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
Definition: shape.h:278
Definition: nodes.h:86
void pin_all()
Pin all the stored variables.
Definition: nodes.h:397
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
double * value_pt(const unsigned &i) const
Definition: nodes.h:324
void unpin_all()
Unpin all the stored variables.
Definition: nodes.h:407
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
double value(const unsigned &i) const
Definition: nodes.h:293
bool is_constrained(const unsigned &i)
Definition: nodes.h:472
FaceGeometry()
Definition: linearised_navier_stokes_elements.h:910
FaceGeometry()
Definition: linearised_navier_stokes_elements.h:1187
FaceGeometry()
Definition: linearised_navier_stokes_elements.h:898
FaceGeometry()
Definition: linearised_navier_stokes_elements.h:1175
Definition: elements.h:4998
Definition: elements.h:1313
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 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
virtual double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Definition: elements.cc:3325
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Definition: elements.cc:3298
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:622
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: linearised_navier_stokes_eigenvalue_elements.h:52
Data * eigenvalue_data_pt()
Access to Data that contains the traded pressure.
Definition: linearised_navier_stokes_eigenvalue_elements.h:94
unsigned index_of_eigenvalue()
Return the index of Data object at which the traded pressure is stored.
Definition: linearised_navier_stokes_eigenvalue_elements.h:106
Definition: linearised_navier_stokes_elements.h:54
LinearisedNavierStokesEquations()
Definition: linearised_navier_stokes_elements.h:221
virtual unsigned u_index_linearised_nst(const unsigned &i) const
Definition: linearised_navier_stokes_elements.h:380
double *& re_pt()
Pointer to Reynolds number.
Definition: linearised_navier_stokes_elements.h:275
virtual void pshape_linearised_nst(const Vector< double > &s, Shape &psi, Shape &test) const =0
Compute the pressure shape and test functions at local coordinate s.
LinearisedNavierStokesEigenfunctionNormalisationElement * normalisation_element_pt()
Pointer to normalisation element.
Definition: linearised_navier_stokes_elements.h:299
virtual void pin_real_or_imag(const unsigned &real)=0
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Compute the element's residual Vector.
Definition: linearised_navier_stokes_elements.h:491
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not.
Definition: linearised_navier_stokes_elements.h:247
virtual unsigned npres_linearised_nst() const =0
void output(FILE *file_pt)
Definition: linearised_navier_stokes_elements.h:473
void(* Base_flow_dudx_fct_pt)(const double &time, const Vector< double > &x, DenseMatrix< double > &result)
Definition: linearised_navier_stokes_elements.h:108
const double & re() const
Reynolds number.
Definition: linearised_navier_stokes_elements.h:253
unsigned Data_number_of_eigenvalue
Index of datum where eigenvalue is stored.
Definition: linearised_navier_stokes_elements.h:97
virtual int p_local_eqn(const unsigned &n, const unsigned &i)=0
LinearisedNavierStokesEigenfunctionNormalisationElement * Normalisation_element_pt
Pointer to the normalisation element.
Definition: linearised_navier_stokes_elements.h:93
const double & re_st() const
Product of Reynolds and Strouhal number (=Womersley number)
Definition: linearised_navier_stokes_elements.h:259
void strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate, const unsigned &real) const
Definition: linearised_navier_stokes_elements.cc:248
void output_veloc(std::ostream &outfile, const unsigned &nplot, const unsigned &t)
Definition: linearised_navier_stokes_elements.cc:56
void(*&)(const double &time, const Vector< double > &x, DenseMatrix< double > &f) base_flow_dudx_fct_pt()
Definition: linearised_navier_stokes_elements.h:363
virtual void pshape_linearised_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
bool ALE_is_disabled
Definition: linearised_navier_stokes_elements.h:115
double du_dt_linearised_nst(const unsigned &n, const unsigned &i) const
Definition: linearised_navier_stokes_elements.h:387
void set_eigenfunction_normalisation_element(LinearisedNavierStokesEigenfunctionNormalisationElement *const &normalisation_el_pt)
the boolean flag check_nodal_data is set to false.
Definition: linearised_navier_stokes_elements.h:305
double * Lambda_pt
Pointer to eigenvalue.
Definition: linearised_navier_stokes_elements.h:86
virtual void get_base_flow_u(const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &result) const
Definition: linearised_navier_stokes_elements.h:153
virtual double p_linearised_nst(const unsigned &n_p, const unsigned &i) const =0
static int Pressure_not_stored_at_node
Definition: linearised_navier_stokes_elements.h:58
virtual void pin_pressure_normalisation_dofs()=0
Pin the normalisation dofs.
double *& lambda_pt()
Pointer to lambda.
Definition: linearised_navier_stokes_elements.h:287
virtual double dshape_and_dtest_eulerian_at_knot_linearised_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
void output(std::ostream &outfile)
Definition: linearised_navier_stokes_elements.h:461
int eigenvalue_local_eqn(const unsigned &i)
Definition: linearised_navier_stokes_elements.h:203
double * Viscosity_Ratio_pt
Definition: linearised_navier_stokes_elements.h:73
void disable_ALE()
Definition: linearised_navier_stokes_elements.h:417
void(*&)(const double &time, const Vector< double > &x, Vector< double > &f) base_flow_u_fct_pt()
Access function for the base flow solution pointer.
Definition: linearised_navier_stokes_elements.h:354
void(* Base_flow_u_fct_pt)(const double &time, const Vector< double > &x, Vector< double > &result)
Pointer to base flow solution (velocity components) function.
Definition: linearised_navier_stokes_elements.h:102
double *& omega_pt()
Pointer to frequency.
Definition: linearised_navier_stokes_elements.h:293
virtual void fill_in_generic_residual_contribution_linearised_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Definition: linearised_navier_stokes_elements.cc:366
void enable_ALE()
Definition: linearised_navier_stokes_elements.h:426
const double & lambda() const
Definition: linearised_navier_stokes_elements.h:264
double interpolated_p_linearised_nst(const Vector< double > &s, const unsigned &i) const
Definition: linearised_navier_stokes_elements.h:554
double * ReSt_pt
Pointer to global Reynolds number x Strouhal number (=Womersley)
Definition: linearised_navier_stokes_elements.h:83
virtual void get_base_flow_dudx(const double &time, const unsigned &ipt, const Vector< double > &x, DenseMatrix< double > &result) const
Definition: linearised_navier_stokes_elements.h:177
double * Re_pt
Pointer to global Reynolds number.
Definition: linearised_navier_stokes_elements.h:80
double *& viscosity_ratio_pt()
Pointer to the viscosity ratio.
Definition: linearised_navier_stokes_elements.h:335
unsigned Index_of_eigenvalue
Definition: linearised_navier_stokes_elements.h:99
double *& re_st_pt()
Pointer to product of Reynolds and Strouhal number (=Womersley number)
Definition: linearised_navier_stokes_elements.h:281
double *& density_ratio_pt()
Pointer to the density ratio.
Definition: linearised_navier_stokes_elements.h:348
double * Density_Ratio_pt
Definition: linearised_navier_stokes_elements.h:77
static double Default_Physical_Constant_Value
Definition: linearised_navier_stokes_elements.h:62
const double & viscosity_ratio() const
Definition: linearised_navier_stokes_elements.h:329
double interpolated_u_linearised_nst(const Vector< double > &s, const unsigned &i) const
Definition: linearised_navier_stokes_elements.h:525
const double & omega() const
Definition: linearised_navier_stokes_elements.h:269
virtual void unpin_real_or_imag(const unsigned &real)=0
virtual int p_index_linearised_nst(const unsigned &i) const
Which nodal value represents the pressure?
Definition: linearised_navier_stokes_elements.h:448
static double Default_Physical_Ratio_Value
Static default value for the physical ratios (all initialised to one)
Definition: linearised_navier_stokes_elements.h:65
const double & density_ratio() const
Definition: linearised_navier_stokes_elements.h:342
double * Omega_pt
Pointer to frequency.
Definition: linearised_navier_stokes_elements.h:89
virtual double dshape_and_dtest_eulerian_linearised_nst(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Definition: linearised_navier_stokes_elements.h:597
void fix_pressure(const unsigned &p_dof, const double &pvalue)
Definition: linearised_navier_stokes_elements.h:764
void output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
Definition: linearised_navier_stokes_elements.h:783
double p_linearised_nst(const unsigned &i_internal, const unsigned &i) const
Definition: linearised_navier_stokes_elements.h:664
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
Definition: linearised_navier_stokes_elements.h:795
LinearisedQCrouzeixRaviartElement()
Definition: linearised_navier_stokes_elements.h:642
void output(FILE *file_pt, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
Definition: linearised_navier_stokes_elements.h:801
void copy_efunction_to_normalisation()
Definition: linearised_navier_stokes_elements.h:723
double dshape_and_dtest_eulerian_linearised_nst(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Definition: linearised_navier_stokes_elements.h:825
static const unsigned Initial_Nvalue[]
Static array of ints to hold required number of variables at nodes.
Definition: linearised_navier_stokes_elements.h:600
void pin_real_or_imag(const unsigned &real_index)
Definition: linearised_navier_stokes_elements.h:679
unsigned npres_linearised_nst() const
Definition: linearised_navier_stokes_elements.h:757
Vector< unsigned > P_linearised_nst_internal_index
Definition: linearised_navier_stokes_elements.h:607
void pshape_linearised_nst(const Vector< double > &s, Shape &psi) const
Compute the pressure shape functions at local coordinate s.
Definition: linearised_navier_stokes_elements.h:866
int p_local_eqn(const unsigned &n, const unsigned &i)
Definition: linearised_navier_stokes_elements.h:777
void output(std::ostream &outfile, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
Definition: linearised_navier_stokes_elements.h:789
void pin_pressure_normalisation_dofs()
Pin the normalisation dofs.
Definition: linearised_navier_stokes_elements.h:671
double dshape_and_dtest_eulerian_at_knot_linearised_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Definition: linearised_navier_stokes_elements.h:846
void unpin_real_or_imag(const unsigned &real_index)
Definition: linearised_navier_stokes_elements.h:701
unsigned ndof_types() const
Definition: linearised_navier_stokes_elements.h:808
virtual unsigned required_nvalue(const unsigned &n) const
Return number of values (pinned or dofs) required at local node n.
Definition: linearised_navier_stokes_elements.cc:792
Definition: linearised_navier_stokes_elements.h:927
double dshape_and_dtest_eulerian_at_knot_linearised_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Definition: linearised_navier_stokes_elements.h:1110
void fix_pressure(const unsigned &n_p, const double &pvalue)
Definition: linearised_navier_stokes_elements.h:1028
void output(std::ostream &outfile)
Redirect output to NavierStokesEquations output.
Definition: linearised_navier_stokes_elements.h:1046
void pin_pressure_normalisation_dofs()
Pin the normalisation dofs.
Definition: linearised_navier_stokes_elements.h:996
void output(FILE *file_pt, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
Definition: linearised_navier_stokes_elements.h:1064
unsigned ndof_types() const
Definition: linearised_navier_stokes_elements.h:1071
void output(std::ostream &outfile, const unsigned &n_plot)
Redirect output to NavierStokesEquations output.
Definition: linearised_navier_stokes_elements.h:1052
unsigned npres_linearised_nst() const
Definition: linearised_navier_stokes_elements.h:1021
static const unsigned Pconv[]
Set the data for the pressure conversion array.
Definition: linearised_navier_stokes_elements.h:935
virtual void pin_real_or_imag(const unsigned &real)
Definition: linearised_navier_stokes_elements.h:1004
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at node.
Definition: linearised_navier_stokes_elements.h:930
void output(FILE *file_pt)
Redirect output to NavierStokesEquations output.
Definition: linearised_navier_stokes_elements.h:1058
void pshape_linearised_nst(const Vector< double > &s, Shape &psi) const
Compute the pressure shape functions at local coordinate s.
Definition: linearised_navier_stokes_elements.h:1129
virtual int p_index_linearised_nst(const unsigned &i) const
Definition: linearised_navier_stokes_elements.h:983
double p_linearised_nst(const unsigned &n_p, const unsigned &i) const
Definition: linearised_navier_stokes_elements.h:990
LinearisedQTaylorHoodElement()
Constructor, no internal data points.
Definition: linearised_navier_stokes_elements.h:969
virtual unsigned required_nvalue(const unsigned &n) const
Definition: linearised_navier_stokes_elements.h:976
int p_local_eqn(const unsigned &n, const unsigned &i)
Definition: linearised_navier_stokes_elements.h:1040
double dshape_and_dtest_eulerian_linearised_nst(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Definition: linearised_navier_stokes_elements.h:1088
virtual void unpin_real_or_imag(const unsigned &real)
Definition: linearised_navier_stokes_elements.h:1011
Definition: nodes.h:906
double value(const unsigned &i) const
Definition: nodes.cc:2408
Definition: oomph_definitions.h:222
Definition: elements.h:3439
Definition: Qelements.h:459
Definition: shape.h:76
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
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237
RealScalar s
Definition: level1_cplx_impl.h:130
#define DIM
Definition: linearised_navier_stokes_elements.h:44
void shape< 2 >(const double &s, double *Psi)
1D shape functions specialised to linear order (2 Nodes)
Definition: shape.h:608
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
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
Definition: main.h:115
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2