two_layer_soluble_surfactant/double_buoyant_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 #ifndef DOUBLE_BUOYANT_NAVIER_STOKES_ELEMENTS_HEADER
27 #define DOUBLE_BUOYANT_NAVIER_STOKES_ELEMENTS_HEADER
28 
29 //Oomph-lib headers, we require the generic, advection-diffusion-reaction,
30 //navier-stokes elements and fluid interface elements
31 #include "generic.h"
33 #include "navier_stokes.h"
34 
35 namespace oomph
36 {
37 
38 //======================class definition==============================
57 //=========================================================================
58 template<unsigned DIM>
59 class DoubleBuoyantQCrouzeixRaviartElement :
60  public virtual QAdvectionDiffusionReactionElement<2,DIM,3>,
61  public virtual QCrouzeixRaviartElement<DIM>
62 {
63 
64 private:
65 
67  double *Km_pt;
68 
69  //Pointer to private data. The value of N
70  double *N_pt;
71 
73  static double Default_Physical_Constant_Value;
74 
75 public:
76 
83  {
86  }
87 
89  void unfix_pressure(const unsigned &p_dof)
90  {
91  this->internal_data_pt(this->P_nst_internal_index)->unpin(p_dof);
92  }
93 
94 
98  unsigned required_nvalue(const unsigned &n) const
101 
102 
104  const double &km() const {return *Km_pt;}
105 
107  double* &km_pt() {return Km_pt;}
108 
110  const double &n() const {return *N_pt;}
111 
113  double* &n_pt() {return N_pt;}
114 
116  void disable_ALE()
117  {
118  //Disable ALE in both sets of equations
121  }
122 
124  void enable_ALE()
125  {
126  //Enable ALE in both sets of equations
129  }
130 
133  void get_reaction_adv_diff_react(const unsigned &ipt,
134  const Vector<double> &C,
135  Vector<double> &R) const
136  {
137  //Compute the flux between equations (equation (2.22))
138  const double J_m = this->km()*(pow(C[0],this->n()) - C[1]);
139  //Return the reaction terms
140  R[0] = J_m;
141  R[1] = -J_m;
142  }
143 
144  //Fill in the derivatives of the reaction terms
145  void get_reaction_deriv_adv_diff_react(const unsigned& ipt,
146  const Vector<double> &C,
147  DenseMatrix<double> &dRdC)
148  const
149  {
150  const double Km = this->km(); const double N = this->n();
151  //Fill in the derivative terms
152  dRdC(0,0) = Km*N*pow(C[0],N-1); dRdC(0,1) = -Km;
153  dRdC(1,0) = -dRdC(0,0); dRdC(1,1) = -dRdC(0,1);
154  }
155 
156 
157  //Compute norm overload to NS version
158  void compute_norm(double &norm)
160 
162  void output(std::ostream &outfile) {FiniteElement::output(outfile);}
163 
166  // Start of output function
167  void output(std::ostream &outfile, const unsigned &nplot)
168  {
169  //vector of local coordinates
171 
172  // Tecplot header info
173  outfile << this->tecplot_zone_string(nplot);
174 
175  // Loop over plot points
176  unsigned num_plot_points=this->nplot_points(nplot);
177  for (unsigned iplot=0;iplot<num_plot_points;iplot++)
178  {
179  // Get local coordinates of plot point
180  this->get_s_plot(iplot,nplot,s);
181 
182  // Output the position of the plot point
183  for(unsigned i=0;i<DIM;i++)
184  {outfile << this->interpolated_x(s,i) << " ";}
185 
186  // Output the fluid velocities at the plot point
187  for(unsigned i=0;i<DIM;i++)
188  {outfile << this->interpolated_u_nst(s,i) << " ";}
189 
190  // Output the fluid pressure at the plot point
191  outfile << this->interpolated_p_nst(s) << " ";
192 
193  //Output the temperature and the solute concentration
194  for(unsigned i=0;i<2;i++)
195  {
196  outfile << this->interpolated_c_adv_diff_react(s,i) << " ";
197  }
198  outfile << "\n";
199  }
200  outfile << std::endl;
201 
202  // Write tecplot footer (e.g. FE connectivity lists)
203  this->write_tecplot_zone_footer(outfile,nplot);
204  } //End of output function
205 
206 
208  void output(FILE* file_pt)
209  {FiniteElement::output(file_pt);}
210 
212  void output(FILE* file_pt, const unsigned &n_plot)
213  {FiniteElement::output(file_pt,n_plot);}
214 
216  void output_fct(std::ostream &outfile, const unsigned &Nplot,
218  exact_soln_pt)
219  {FiniteElement::output_fct(outfile,Nplot,exact_soln_pt);}
220 
221 
224  void output_fct(std::ostream &outfile, const unsigned &Nplot,
225  const double& time,
227  exact_soln_pt)
228  {
230  output_fct(outfile,Nplot,time,exact_soln_pt);
231  }
232 
235  // We choose to store them after the fluid velocities.
236  inline unsigned c_index_adv_diff_react(const unsigned &i) const
237  {return DIM+i;}
238 
244  void compute_error(std::ostream &outfile,
246  const double& time,
247  double& error, double& norm)
248  {FiniteElement::compute_error(outfile,exact_soln_pt,
249  time,error,norm);}
250 
256  void compute_error(std::ostream &outfile,
258  double& error, double& norm)
259  {FiniteElement::compute_error(outfile,exact_soln_pt,error,norm);}
260 
264  void get_wind_adv_diff_react(const unsigned& ipt,
265  const Vector<double> &s, const Vector<double>& x,
266  Vector<double>& wind) const
267  {
268  //The wind function is simply the velocity at the points
269  this->interpolated_u_nst(s,wind);
270  }
271 
272 
279  {
280  //Fill in the residuals of the Navier-Stokes equations
282 
283  //Fill in the residuals of the advection-diffusion eqautions
286  }
287 
288 
289 #ifdef USE_FD_JACOBIAN_FOR_BUOYANT_Q_CROZIER_RAVIART_ELEMENT
290 
291 
295  DenseMatrix<double> &jacobian)
296  {
297  // This function computes the Jacobian by finite-differencing
299  }
300 
301 #else
302 
306  DenseMatrix<double> &jacobian)
307  {
308  //Local storage for the index in the nodes at which the
309  //Navier-Stokes velocities are stored (we know that this should be 0,1,2)
310  unsigned u_nodal_nst[DIM];
311  for(unsigned i=0;i<DIM;i++)
312  {u_nodal_nst[i] = this->u_index_nst(i);}
313 
314  //Local storage for the index at which the temperature and
315  //solute are stored
316  unsigned C_nodal_adv_diff_react[2];
317  for(unsigned r=0;r<2;r++)
318  {C_nodal_adv_diff_react[r] = this->c_index_adv_diff_react(r);}
319 
320 
321  //Find the total number of unknowns in the elements
322  unsigned n_dof = this->ndof();
323 
324  //Temporary storage for residuals
325  Vector<double> newres(n_dof);
326 
327  //Storage for local unknown and local equation
328  int local_unknown =0, local_eqn = 0;
329 
330  //Set the finite difference step
332 
333  //Find the number of nodes
334  unsigned n_node = this->nnode();
335 
336  //Calculate the contribution of the Navier--Stokes velocities to the
337  //advection-diffusion equations
338 
339  //Loop over the nodes
340  for(unsigned n=0;n<n_node;n++)
341  {
342  //There are DIM values of the velocities
343  for(unsigned i=0;i<DIM;i++)
344  {
345  //Get the local velocity equation number
346  local_unknown = this->nodal_local_eqn(n,u_nodal_nst[i]);
347 
348  //If it's not pinned
349  if(local_unknown >= 0)
350  {
351  //Get a pointer to the velocity value
352  double *value_pt = this->node_pt(n)->value_pt(u_nodal_nst[i]);
353 
354  //Save the old value
355  double old_var = *value_pt;
356 
357  //Increment the value
358  *value_pt += fd_step;
359 
360  //Get the altered advection-diffusion residuals.
361  //Do this using fill_in because get_residuals has never been
362  //overloaded, and will actually compute all residuals which
363  //is slightly inefficient.
364  for(unsigned m=0;m<n_dof;m++) {newres[m] = 0.0;}
367 
368  //Now fill in the Advection-Diffusion-Reaction sub-block
369  //of the jacobian
370  for(unsigned m=0;m<n_node;m++)
371  {
372  for(unsigned r=0;r<2;r++)
373  {
374  //Local equation for temperature or solute
375  local_eqn = this->nodal_local_eqn(m,C_nodal_adv_diff_react[r]);
376 
377  //If it's not a boundary condition
378  if(local_eqn >= 0)
379  {
380  double sum = (newres[local_eqn] - residuals[local_eqn])/fd_step;
381  jacobian(local_eqn,local_unknown) = sum;
382  }
383  }
384  }
385 
386  //Reset the nodal data
387  *value_pt = old_var;
388  }
389  }
390 
391 
392  //Calculate the contribution of the temperature to the Navier--Stokes
393  //equations
394  for(unsigned r=0;r<2;r++)
395  {
396  //Get the local equation number
397  local_unknown = this->nodal_local_eqn(n,C_nodal_adv_diff_react[r]);
398 
399  //If it's not pinned
400  if(local_unknown >= 0)
401  {
402  //Get a pointer to the concentration value
403  double *value_pt =
404  this->node_pt(n)->value_pt(C_nodal_adv_diff_react[r]);
405 
406  //Save the old value
407  double old_var = *value_pt;
408 
409  //Increment the value (Really need access)
410  *value_pt += fd_step;
411 
412  //Get the altered Navier--Stokes residuals
413  //Do this using fill_in because get_residuals has never been
414  //overloaded, and will actually compute all residuals which
415  //is slightly inefficient.
416  for(unsigned m=0;m<n_dof;m++) {newres[m] = 0.0;}
418 
419  //Now fill in the Navier-Stokes sub-block
420  for(unsigned m=0;m<n_node;m++)
421  {
422  //Loop over the fluid velocities
423  for(unsigned j=0;j<DIM;j++)
424  {
425  //Local fluid equation
426  local_eqn = this->nodal_local_eqn(m,u_nodal_nst[j]);
427  if(local_eqn >= 0)
428  {
429  double sum = (newres[local_eqn] - residuals[local_eqn])/fd_step;
430  jacobian(local_eqn,local_unknown) = sum;
431  }
432  }
433  }
434 
435  //Reset the nodal data
436  *value_pt = old_var;
437  }
438  } //End of loop over reagents
439 
440  } //End of loop over nodes
441  }
442 
446  DenseMatrix<double> &jacobian)
447  {
448  //Calculate the Navier-Stokes contributions (diagonal block and residuals)
450  fill_in_contribution_to_jacobian(residuals,jacobian);
451 
452  //Calculate the advection-diffusion contributions
453  //(diagonal block and residuals)
455  fill_in_contribution_to_jacobian(residuals,jacobian);
456 
457  //Add in the off-diagonal blocks
458  fill_in_off_diagonal_jacobian_blocks_by_fd(residuals,jacobian);
459  } //End of jacobian calculation
460 
461 #endif
462 
463 
467  Vector<double> &residuals, DenseMatrix<double> &jacobian,
468  DenseMatrix<double> &mass_matrix)
469  {
472  residuals,jacobian,mass_matrix);
473 
476  residuals,jacobian,mass_matrix);
477 
478  fill_in_off_diagonal_jacobian_blocks_by_fd(residuals,jacobian);
479  }
480 
481  void integrated_C_and_M(double &int_C, double &int_M)
482  {
483  //Vector to store the integrals
484  Vector<double> sum(2,0.0);
485 
486  //Find the number of nodes
487  const unsigned n_node = this->nnode();
488  //Storage for the shape functions
489  Shape psi(n_node);
490 
491  unsigned C_index[2];
492  for(unsigned r=0;r<2;++r)
493  {C_index[r] = this->c_index_adv_diff_react(r);}
494 
495  //Loop over the integration points
496  const unsigned n_intpt = this->integral_pt()->nweight();
497  for(unsigned ipt=0;ipt<n_intpt;ipt++)
498  {
499  //Get the integral weight
500  double w = this->integral_pt()->weight(ipt);
501  //Get the value of the Jacobian of the mapping to global coordinates
502  double J = this->J_eulerian_at_knot(ipt);
503  double W = w*J;
504  //Get the shape function at the know
505  this->shape_at_knot(ipt,psi);
506 
507  //Get the interpolated values
508  Vector<double> interpolated_C(2,0.0);
509  for(unsigned l=0;l<n_node;++l)
510  {
511  const double psi_ = psi(l);
512  for(unsigned r=0;r<2;++r)
513  {
514  interpolated_C[r] += this->nodal_value(l,C_index[r])*psi_;
515  }
516  }
517 
518  for(unsigned r=0;r<2;++r)
519  {
520  sum[r] += interpolated_C[r]*W;
521  }
522  } //End of integration loop
523 
524  //Return the values
525  int_C = sum[0]; int_M = sum[1];
526  }
527 
528 };
529 
530 //=========================================================================
532 //=========================================================================
533 template<>
535 
536 
537 //=======================================================================
539 //=======================================================================
540 template<unsigned int DIM>
542 public virtual QElement<DIM-1,3>
543 {
544  public:
545  FaceGeometry() : QElement<DIM-1,3>() {}
546 };
547 
548 //=======================================================================
550 //=======================================================================
551 template<>
552 class FaceGeometry<FaceGeometry<DoubleBuoyantQCrouzeixRaviartElement<2> > >:
553 public virtual PointElement
554 {
555  public:
557 };
558 
559 
560 
561 //======================class definition==============================
580 //=========================================================================
581 template<unsigned DIM>
583  public virtual RefineableQAdvectionDiffusionReactionElement<2,DIM,3>,
584  public virtual RefineableQCrouzeixRaviartElement<DIM>
585 {
586 
587 private:
588 
590  double *Km_pt;
591 
592  //Pointer to private data. The value of N
593  double *N_pt;
594 
597 
598 public:
599 
606  {
609  }
610 
612  void unfix_pressure(const unsigned &p_dof)
613  {
614  this->internal_data_pt(this->P_nst_internal_index)->unpin(p_dof);
615  }
616 
617 
621  unsigned required_nvalue(const unsigned &n) const
622  {return (
625 
626 
628  const double &km() const {return *Km_pt;}
629 
631  double* &km_pt() {return Km_pt;}
632 
634  const double &n() const {return *N_pt;}
635 
637  double* &n_pt() {return N_pt;}
638 
640  void disable_ALE()
641  {
642  //Disable ALE in both sets of equations
645  }
646 
648  void enable_ALE()
649  {
650  //Enable ALE in both sets of equations
653  }
654 
657  void get_reaction_adv_diff_react(const unsigned &ipt,
658  const Vector<double> &C,
659  Vector<double> &R) const
660  {
661  //Compute the flux between equations (equation (2.22))
662  const double J_m = this->km()*(pow(C[0],this->n()) - C[1]);
663  //Return the reaction terms
664  R[0] = J_m;
665  R[1] = -J_m;
666  }
667 
668  //Fill in the derivatives of the reaction terms
669  void get_reaction_deriv_adv_diff_react(const unsigned& ipt,
670  const Vector<double> &C,
671  DenseMatrix<double> &dRdC)
672  const
673  {
674  const double Km = this->km(); const double N = this->n();
675  //Fill in the derivative terms
676  dRdC(0,0) = Km*N*pow(C[0],N-1); dRdC(0,1) = -Km;
677  dRdC(1,0) = -dRdC(0,0); dRdC(1,1) = -dRdC(0,1);
678  }
679 
680 //Compute norm overload to NS version
681  void compute_norm(double &norm)
683 
684 
686  void output(std::ostream &outfile) {FiniteElement::output(outfile);}
687 
690  // Start of output function
691  void output(std::ostream &outfile, const unsigned &nplot)
692  {
693  //vector of local coordinates
695 
696  // Tecplot header info
697  outfile << this->tecplot_zone_string(nplot);
698 
699  // Loop over plot points
700  unsigned num_plot_points=this->nplot_points(nplot);
701  for (unsigned iplot=0;iplot<num_plot_points;iplot++)
702  {
703  // Get local coordinates of plot point
704  this->get_s_plot(iplot,nplot,s);
705 
706  // Output the position of the plot point
707  for(unsigned i=0;i<DIM;i++)
708  {outfile << this->interpolated_x(s,i) << " ";}
709 
710  // Output the fluid velocities at the plot point
711  for(unsigned i=0;i<DIM;i++)
712  {outfile << this->interpolated_u_nst(s,i) << " ";}
713 
714  // Output the fluid pressure at the plot point
715  outfile << this->interpolated_p_nst(s) << " ";
716 
717  //Output the temperature and the solute concentration
718  for(unsigned i=0;i<2;i++)
719  {
720  outfile << this->interpolated_c_adv_diff_react(s,i) << " ";
721  }
722  outfile << "\n";
723  }
724  outfile << std::endl;
725 
726  // Write tecplot footer (e.g. FE connectivity lists)
727  this->write_tecplot_zone_footer(outfile,nplot);
728  } //End of output function
729 
730 
731 
732 
734  void output(FILE* file_pt)
735  {FiniteElement::output(file_pt);}
736 
738  void output(FILE* file_pt, const unsigned &n_plot)
739  {FiniteElement::output(file_pt,n_plot);}
740 
742  void output_fct(std::ostream &outfile, const unsigned &Nplot,
744  exact_soln_pt)
745  {FiniteElement::output_fct(outfile,Nplot,exact_soln_pt);}
746 
747 
750  void output_fct(std::ostream &outfile, const unsigned &Nplot,
751  const double& time,
753  exact_soln_pt)
754  {
756  output_fct(outfile,Nplot,time,exact_soln_pt);
757  }
758 
761  // We choose to store them after the fluid velocities.
762  inline unsigned c_index_adv_diff_react(const unsigned &i) const
763  {return DIM+i;}
764 
765 
768  unsigned nvertex_node() const
770 
773  Node* vertex_node_pt(const unsigned& j) const
775 
778  unsigned ncont_interpolated_values() const
779  {return DIM+2;}
780 
781 
786  {
787  //Storage for the fluid velocities
788  Vector<double> nst_values;
789 
790  //Get the fluid velocities from the fluid element
792  get_interpolated_values(s,nst_values);
793 
794  //Storage for the temperature
795  Vector<double> advection_values;
796 
797  //Get the temperature from the advection-diffusion element
799  get_interpolated_values(s,advection_values);
800 
801  //Add the fluid velocities to the values vector
802  for(unsigned i=0;i<DIM;i++) {values.push_back(nst_values[i]);}
803 
804  //Add the concentration values to the end
805  for(unsigned i=0;i<2;i++) {values.push_back(advection_values[i]);}
806  }
807 
808 
809 
814  void get_interpolated_values(const unsigned& t, const Vector<double>&s,
815  Vector<double>& values)
816  {
817  //Storage for the fluid velocities
818  Vector<double> nst_values;
819 
820  //Get the fluid velocities from the fluid element
822  get_interpolated_values(t,s,nst_values);
823 
824  //Storage for the temperature
825  Vector<double> advection_values;
826 
827  //Get the temperature from the advection-diffusion element
829  get_interpolated_values(s,advection_values);
830 
831  //Add the fluid velocities to the values vector
832  for(unsigned i=0;i<DIM;i++) {values.push_back(nst_values[i]);}
833 
834  //Add the concentration to the end
835  for(unsigned i=0;i<DIM;i++) {values.push_back(advection_values[i]);}
836 
837  } // end of get_interpolated_values
838 
839 
843  {
847  }
848 
849 
850 
853  void rebuild_from_sons(Mesh* &mesh_pt)
854  {
856  rebuild_from_sons(mesh_pt);
858  }
859 
860 
861 
866  {
869 
870  //Cast the pointer to the father element to the specific
871  //element type
874  this->father_element_pt());
875 
876  //Set the pointer to the physical variables to be the same as
877  //the father
878  this->Km_pt = cast_father_element_pt->km_pt();
879  this->N_pt = cast_father_element_pt->n_pt();
880  } //end of further build
881 
882 
883 
885  unsigned nrecovery_order()
887 
890  unsigned num_Z2_flux_terms()
891  {
894  }
895 
896 
900  {
901  //Find the number of fluid fluxes
902  unsigned n_fluid_flux =
904 
905  //Fill in the first flux entries as the velocity entries
907 
908  //Find the number of concentration fluxes
909  unsigned n_conc_flux =
911  Vector<double> conc_flux(n_conc_flux);
912 
913  //Get the temperature flux
915  get_Z2_flux(s,conc_flux);
916 
917  //Add the concentration flux to the end of the flux vector
918  for(unsigned i=0;i<n_conc_flux;i++)
919  {
920  flux[n_fluid_flux+i] = conc_flux[i];
921  }
922 
923  } //end of get_Z2_flux
924 
928  unsigned ncompound_fluxes() {return 2;}
929 
933  {
934  //Find the number of fluid fluxes
935  unsigned n_fluid_flux =
937  //Find the number of concentration fluxes
938  unsigned n_conc_flux =
940 
941  //The fluid fluxes are first
942  //The values of the flux_index vector are zero on entry, so we
943  //could omit this line
944  for(unsigned i=0;i<n_fluid_flux;i++) {flux_index[i] = 0;}
945 
946  //Set the concentration fluxes (the last set of fluxes
947  for(unsigned i=0;i<n_conc_flux;i++) {flux_index[n_fluid_flux + i] = 1;}
948 
949  } //end of get_Z2_compound_flux_indices
950 
951 
957  void compute_error(std::ostream &outfile,
959  const double& time,
960  double& error, double& norm)
961  {FiniteElement::compute_error(outfile,exact_soln_pt,
962  time,error,norm);}
963 
969  void compute_error(std::ostream &outfile,
971  double& error, double& norm)
972  {FiniteElement::compute_error(outfile,exact_soln_pt,error,norm);}
973 
977  void get_wind_adv_diff_react(const unsigned& ipt,
978  const Vector<double> &s, const Vector<double>& x,
979  Vector<double>& wind) const
980  {
981  //The wind function is simply the velocity at the points
982  this->interpolated_u_nst(s,wind);
983  }
984 
985 
992  {
993  //Fill in the residuals of the Navier-Stokes equations
996 
997  //Fill in the residuals of the advection-diffusion eqautions
1000  }
1001 
1002 
1003 #ifdef USE_FD_JACOBIAN_FOR_BUOYANT_Q_CROZIER_RAVIART_ELEMENT
1004 
1005 
1009  DenseMatrix<double> &jacobian)
1010  {
1011  // This function computes the Jacobian by finite-differencing
1013  }
1014 
1015 #else
1016 
1020  DenseMatrix<double> &jacobian)
1021  {
1022  //Local storage for the index in the nodes at which the
1023  //Navier-Stokes velocities are stored (we know that this should be 0,1,2)
1024  unsigned u_nodal_nst[DIM];
1025  for(unsigned i=0;i<DIM;i++)
1026  {u_nodal_nst[i] = this->u_index_nst(i);}
1027 
1028  //Local storage for the index at which the temperature and
1029  //solute are stored
1030  unsigned C_nodal_adv_diff_react[2];
1031  for(unsigned r=0;r<2;r++)
1032  {C_nodal_adv_diff_react[r] = this->c_index_adv_diff_react(r);}
1033 
1034  //Find the total number of unknowns in the elements
1035  unsigned n_dof = this->ndof();
1036 
1037  //Temporary storage for residuals
1038  Vector<double> newres(n_dof);
1039 
1040  //Storage for local unknown and local equation
1041  int local_unknown =0, local_eqn = 0;
1042 
1043  //Set the finite difference step
1044  double fd_step = FiniteElement::Default_fd_jacobian_step;
1045 
1046  //Find the number of nodes
1047  unsigned n_node = this->nnode();
1048 
1049  //Calculate the contribution of the Navier--Stokes velocities to the
1050  //advection-diffusion equations
1051 
1052  //Loop over the nodes
1053  for(unsigned n=0;n<n_node;n++)
1054  {
1055  //Cache a local pointer to the node
1056  Node* const local_node_pt = this->node_pt(n);
1057 
1058  //There are DIM values of the velocities
1059  for(unsigned i=0;i<DIM;i++)
1060  {
1061  //Need to check for hanging nodes (if not hanging do the usual)
1062  if(local_node_pt->is_hanging(u_nodal_nst[i]) == false)
1063  {
1064  //Get the local velocity equation number
1065  local_unknown = this->nodal_local_eqn(n,u_nodal_nst[i]);
1066 
1067  //If it's not pinned
1068  if(local_unknown >= 0)
1069  {
1070  //Get a pointer to the velocity value
1071  double *value_pt = local_node_pt->value_pt(u_nodal_nst[i]);
1072 
1073  //Save the old value
1074  double old_var = *value_pt;
1075 
1076  //Increment the value
1077  *value_pt += fd_step;
1078 
1079  //Get the altered advection-diffusion residuals.
1080  //Do this using fill_in because get_residuals has never been
1081  //overloaded, and will actually compute all residuals which
1082  //is slightly inefficient.
1083  for(unsigned l=0;l<n_dof;l++) {newres[l] = 0.0;}
1086 
1087  //Now fill in the Advection-Diffusion-Reaction sub-block
1088  //of the jacobian
1089  for(unsigned l=0;l<n_node;l++)
1090  {
1091  for(unsigned r=0;r<2;r++)
1092  {
1093  //Local equation for temperature or solute
1094  local_eqn = this->nodal_local_eqn(l,C_nodal_adv_diff_react[r]);
1095 
1096  //If it's not a boundary condition
1097  if(local_eqn >= 0)
1098  {
1099  double sum = (newres[local_eqn] - residuals[local_eqn])/fd_step;
1100  jacobian(local_eqn,local_unknown) = sum;
1101  }
1102  }
1103  }
1104 
1105  //Reset the nodal data
1106  *value_pt = old_var;
1107  }
1108  }
1109  //Otherwise the value is hanging
1110  else
1111  {
1112  //Get the local hanging infor
1113  HangInfo *hang_info_pt = local_node_pt->hanging_pt(u_nodal_nst[i]);
1114  //Loop over the master nodes
1115  const unsigned n_master = hang_info_pt->nmaster();
1116  for(unsigned m=0;m<n_master;m++)
1117  {
1118  //Get the pointer to the master node
1119  Node* const master_node_pt = hang_info_pt->master_node_pt(m);
1120 
1121  //Get the number of the unknown
1122  local_unknown = this->local_hang_eqn(master_node_pt,u_nodal_nst[i]);
1123  //If the variable is free
1124  if(local_unknown >= 0)
1125  {
1126  //Get a pointer to the nodal value stored at the master node
1127  double* const value_pt = master_node_pt->value_pt(u_nodal_nst[i]);
1128  //Save the old value
1129  double old_var = *value_pt;
1130 
1131  //Increment the value
1132  *value_pt += fd_step;
1133 
1134  //Get the altered advection-diffusion residuals.
1135  //Do this using fill_in because get_residuals has never been
1136  //overloaded, and will actually compute all residuals which
1137  //is slightly inefficient.
1138  for(unsigned l=0;l<n_dof;l++) {newres[l] = 0.0;}
1141 
1142  //Now fill in the Advection-Diffusion-Reaction sub-block
1143  //of the jacobian
1144  for(unsigned l=0;l<n_node;l++)
1145  {
1146  for(unsigned r=0;r<2;r++)
1147  {
1148  //Local equation for temperature or solute
1149  local_eqn = this->nodal_local_eqn(l,C_nodal_adv_diff_react[r]);
1150 
1151  //If it's not a boundary condition
1152  if(local_eqn >= 0)
1153  {
1154  double sum = (newres[local_eqn] - residuals[local_eqn])/fd_step;
1155  jacobian(local_eqn,local_unknown) = sum;
1156  }
1157  }
1158  }
1159 
1160  //Reset the nodal data
1161  *value_pt = old_var;
1162  }
1163  } //End of loop over master nodes
1164  } //End of hanging case
1165  }
1166 
1167  //Calculate the contribution of the temperature to the Navier--Stokes
1168  //equations
1169  for(unsigned r=0;r<2;r++)
1170  {
1171  //Need to check for hanging nodes (if not hanging do the usual)
1172  if(local_node_pt->is_hanging(C_nodal_adv_diff_react[r]) == false)
1173  {
1174  //Get the local equation number
1175  local_unknown = this->nodal_local_eqn(n,C_nodal_adv_diff_react[r]);
1176 
1177  //If it's not pinned
1178  if(local_unknown >= 0)
1179  {
1180  //Get a pointer to the concentration value
1181  double *value_pt =
1182  local_node_pt->value_pt(C_nodal_adv_diff_react[r]);
1183 
1184  //Save the old value
1185  double old_var = *value_pt;
1186 
1187  //Increment the value (Really need access)
1188  *value_pt += fd_step;
1189 
1190  //Get the altered Navier--Stokes residuals
1191  //Do this using fill_in because get_residuals has never been
1192  //overloaded, and will actually compute all residuals which
1193  //is slightly inefficient.
1194  for(unsigned l=0;l<n_dof;l++) {newres[l] = 0.0;}
1196 
1197  //Now fill in the Navier-Stokes sub-block
1198  for(unsigned l=0;l<n_node;l++)
1199  {
1200  //Loop over the fluid velocities
1201  for(unsigned j=0;j<DIM;j++)
1202  {
1203  //Local fluid equation
1204  local_eqn = this->nodal_local_eqn(l,u_nodal_nst[j]);
1205  if(local_eqn >= 0)
1206  {
1207  double sum = (newres[local_eqn] - residuals[local_eqn])/fd_step;
1208  jacobian(local_eqn,local_unknown) = sum;
1209  }
1210  }
1211  }
1212 
1213  //Reset the nodal data
1214  *value_pt = old_var;
1215  }
1216  } //End of not hanging case
1217  else
1218  {
1219  //Get the local hanging infor
1220  HangInfo *hang_info_pt = local_node_pt->hanging_pt(C_nodal_adv_diff_react[r]);
1221  //Loop over the master nodes
1222  const unsigned n_master = hang_info_pt->nmaster();
1223  for(unsigned m=0;m<n_master;m++)
1224  {
1225  //Get the pointer to the master node
1226  Node* const master_node_pt = hang_info_pt->master_node_pt(m);
1227 
1228  //Get the number of the unknown
1229  local_unknown = this->local_hang_eqn(master_node_pt,C_nodal_adv_diff_react[r]);
1230  //If the variable is free
1231  if(local_unknown >= 0)
1232  {
1233  //Get a pointer to the nodal value stored at the master node
1234  double* const value_pt = master_node_pt->value_pt(C_nodal_adv_diff_react[r]);
1235 
1236  //Save the old value
1237  double old_var = *value_pt;
1238 
1239  //Increment the value (Really need access)
1240  *value_pt += fd_step;
1241 
1242  //Get the altered Navier--Stokes residuals
1243  //Do this using fill_in because get_residuals has never been
1244  //overloaded, and will actually compute all residuals which
1245  //is slightly inefficient.
1246  for(unsigned l=0;l<n_dof;l++) {newres[l] = 0.0;}
1248 
1249  //Now fill in the Navier-Stokes sub-block
1250  for(unsigned l=0;l<n_node;l++)
1251  {
1252  //Loop over the fluid velocities
1253  for(unsigned j=0;j<DIM;j++)
1254  {
1255  //Local fluid equation
1256  local_eqn = this->nodal_local_eqn(l,u_nodal_nst[j]);
1257  if(local_eqn >= 0)
1258  {
1259  double sum = (newres[local_eqn] - residuals[local_eqn])/fd_step;
1260  jacobian(local_eqn,local_unknown) = sum;
1261  }
1262  }
1263  }
1264 
1265  //Reset the nodal data
1266  *value_pt = old_var;
1267  }
1268  } //End of loop over master nodes
1269  } //End of hanging case
1270  } //End of loop over reagents
1271 
1272  }//End of loop over nodes
1273  }
1274 
1278  DenseMatrix<double> &jacobian)
1279  {
1280  //Calculate the Navier-Stokes contributions (diagonal block and residuals)
1282  fill_in_contribution_to_jacobian(residuals,jacobian);
1283 
1284  //Calculate the advection-diffusion contributions
1285  //(diagonal block and residuals)
1287  fill_in_contribution_to_jacobian(residuals,jacobian);
1288 
1289  //Add in the off-diagonal blocks
1290  fill_in_off_diagonal_jacobian_blocks_by_fd(residuals,jacobian);
1291 
1292  } //End of jacobian calculation
1293 
1294 #endif
1295 
1296 
1300  Vector<double> &residuals, DenseMatrix<double> &jacobian,
1301  DenseMatrix<double> &mass_matrix)
1302  {
1305  residuals,jacobian,mass_matrix);
1306 
1309  residuals,jacobian,mass_matrix);
1310 
1311  fill_in_off_diagonal_jacobian_blocks_by_fd(residuals,jacobian);
1312  }
1313 
1314  void integrated_C_and_M(double &int_C, double &int_M)
1315  {
1316  //Vector to store the integrals
1317  Vector<double> sum(2,0.0);
1318 
1319  //Find the number of nodes
1320  const unsigned n_node = this->nnode();
1321  //Storage for the shape functions
1322  Shape psi(n_node);
1323 
1324  unsigned C_index[2];
1325  for(unsigned r=0;r<2;++r)
1326  {C_index[r] = this->c_index_adv_diff_react(r);}
1327 
1328  //Loop over the integration points
1329  const unsigned n_intpt = this->integral_pt()->nweight();
1330  for(unsigned ipt=0;ipt<n_intpt;ipt++)
1331  {
1332  //Get the integral weight
1333  double w = this->integral_pt()->weight(ipt);
1334  //Get the value of the Jacobian of the mapping to global coordinates
1335  double J = this->J_eulerian_at_knot(ipt);
1336  double W = w*J;
1337  //Get the shape function at the know
1338  this->shape_at_knot(ipt,psi);
1339 
1340  //Get the interpolated values
1341  Vector<double> interpolated_C(2,0.0);
1342  for(unsigned l=0;l<n_node;++l)
1343  {
1344  const double psi_ = psi(l);
1345  for(unsigned r=0;r<2;++r)
1346  {
1347  interpolated_C[r] += this->nodal_value(l,C_index[r])*psi_;
1348  }
1349  }
1350 
1351  for(unsigned r=0;r<2;++r)
1352  {
1353  sum[r] += interpolated_C[r]*W;
1354  }
1355  } //End of integration loop
1356 
1357  //Return the values
1358  int_C = sum[0]; int_M = sum[1];
1359  }
1360 
1361 };
1362 
1363 //=========================================================================
1365 //=========================================================================
1366 template<>
1368 
1369 
1370 //=======================================================================
1372 //=======================================================================
1373 template<unsigned int DIM>
1375 public virtual QElement<DIM-1,3>
1376 {
1377  public:
1378  FaceGeometry() : QElement<DIM-1,3>() {}
1379 };
1380 
1381 //=======================================================================
1383 //=======================================================================
1384 template<>
1386 public virtual PointElement
1387 {
1388  public:
1390 };
1391 
1392 
1393 
1394 } //End of the oomph namespace
1395 
1396 #endif
int i
Definition: BiCGSTAB_step_by_step.cpp:9
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
RowVector3d w
Definition: Matrix_resize_int.cpp:3
@ R
Definition: StatisticsVector.h:21
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the element's contribution to its residual vector (wrapper)
Definition: advection_diffusion_reaction_elements.h:519
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: advection_diffusion_reaction_elements.h:533
void enable_ALE()
Definition: advection_diffusion_reaction_elements.h:189
double interpolated_c_adv_diff_react(const Vector< double > &s, const unsigned &i) const
Return FE representation of function value c_i(s) at local coordinate s.
Definition: advection_diffusion_reaction_elements.h:556
void disable_ALE()
Definition: advection_diffusion_reaction_elements.h:180
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Definition: advection_diffusion_reaction_elements.h:544
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
Definition: db_navier_st_elements.h:61
void compute_norm(double &norm)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:158
void get_reaction_deriv_adv_diff_react(const unsigned &ipt, const Vector< double > &C, DenseMatrix< double > &dRdC) const
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:145
static double Default_Physical_Constant_Value
The static default value of the Rayleigh number.
Definition: db_navier_st_elements.h:72
void fill_in_off_diagonal_jacobian_blocks_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:305
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: db_navier_st_elements.h:464
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:256
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:244
void get_reaction_adv_diff_react(const unsigned &ipt, const Vector< double > &C, Vector< double > &R) const
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:133
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:466
void integrated_C_and_M(double &int_C, double &int_M)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:481
void output_fct(std::ostream &outfile, const unsigned &Nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output function for an exact solution: Broken default.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:216
void output(std::ostream &outfile)
Overload the standard output function with the broken default.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:162
const double & n() const
Access function for the number of monomers in the micelle.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:110
void unfix_pressure(const unsigned &p_dof)
UnPin p_dof-th pressure dof.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:89
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:278
unsigned c_index_adv_diff_react(const unsigned &i) const
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:236
void output(std::ostream &outfile, const unsigned &nplot)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:167
void output_fct(std::ostream &outfile, const unsigned &Nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:224
double * Km_pt
Pointer to private data. The value of Km.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:67
void enable_ALE()
Final override for enable ALE.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:124
const double & km() const
Access function for the transfer constant.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:104
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function: Broken default.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:212
double *& n_pt()
Access function for the pointer to the number of monomers in the micelle.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:113
DoubleBuoyantQCrouzeixRaviartElement()
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:80
double *& km_pt()
Access function for the pointer to transfer constant.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:107
void disable_ALE()
Final override for disable ALE.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:116
double * N_pt
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:70
void output(FILE *file_pt)
C-style output function: Broken default.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:208
unsigned required_nvalue(const unsigned &n) const
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:98
void get_wind_adv_diff_react(const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &wind) const
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:264
FaceGeometry()
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:545
FaceGeometry()
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:556
FaceGeometry()
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:1389
FaceGeometry()
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:1378
Definition: elements.h:4998
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: elements.h:1735
virtual void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output an exact solution over the element.
Definition: elements.h:3104
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
double nodal_value(const unsigned &n, const unsigned &i) const
Definition: elements.h:2593
virtual void output(std::ostream &outfile)
Definition: elements.h:3050
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Definition: elements.h:3161
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
Definition: elements.cc:3962
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 void compute_error(FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Calculate the norm of the error and that of the exact solution.
Definition: elements.h:3198
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Definition: elements.h:1759
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Definition: elements.h:1963
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Definition: elements.h:3148
virtual unsigned nplot_points(const unsigned &nplot) const
Definition: elements.h:3186
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Definition: elements.h:3174
virtual double J_eulerian_at_knot(const unsigned &ipt) const
Definition: elements.cc:4168
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Definition: elements.cc:3220
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Definition: elements.h:1765
static double Default_fd_jacobian_step
Definition: elements.h:1198
unsigned ndof() const
Return the number of equations/dofs in the element.
Definition: elements.h:835
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:622
Definition: nodes.h:742
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
Definition: nodes.h:791
unsigned nmaster() const
Return the number of master nodes.
Definition: nodes.h:785
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
Definition: matrices.h:74
Definition: mesh.h:67
void disable_ALE()
Definition: navier_stokes_elements.h:909
virtual unsigned u_index_nst(const unsigned &i) const
Definition: navier_stokes_elements.h:866
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Compute the element's residual Vector.
Definition: navier_stokes_elements.h:1260
void interpolated_u_nst(const Vector< double > &s, Vector< double > &veloc) const
Compute vector of FE interpolated velocity u at local coordinate s.
Definition: navier_stokes_elements.h:1505
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Definition: navier_stokes_elements.h:1283
void enable_ALE()
Definition: navier_stokes_elements.h:918
void compute_norm(double &norm)
Compute norm of solution: square of the L2 norm of the velocities.
Definition: navier_stokes_elements.cc:186
virtual double interpolated_p_nst(const Vector< double > &s) const
Return FE interpolated pressure at local coordinate s.
Definition: navier_stokes_elements.h:1639
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: navier_stokes_elements.h:1273
Definition: nodes.h:906
HangInfo *const & hanging_pt() const
Definition: nodes.h:1228
bool is_hanging() const
Test whether the node is geometrically hanging.
Definition: nodes.h:1285
Definition: elements.h:3439
Definition: advection_diffusion_reaction_elements.h:664
Definition: navier_stokes_elements.h:1749
unsigned P_nst_internal_index
Definition: navier_stokes_elements.h:1757
Definition: Qelements.h:459
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
Definition: refineable_advection_diffusion_reaction_elements.h:80
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Definition: refineable_advection_diffusion_reaction_elements.h:87
void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Definition: refineable_advection_diffusion_reaction_elements.h:97
void further_build()
Definition: refineable_advection_diffusion_reaction_elements.h:166
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:585
void fill_in_off_diagonal_jacobian_blocks_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:1019
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function: Broken default.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:738
static double Default_Physical_Constant_Value
The static default value of the Rayleigh number.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:596
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:991
void get_interpolated_values(const unsigned &t, const Vector< double > &s, Vector< double > &values)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:814
void output(std::ostream &outfile)
Overload the standard output function with the broken default.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:686
void output(FILE *file_pt)
C-style output function: Broken default.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:734
void get_reaction_adv_diff_react(const unsigned &ipt, const Vector< double > &C, Vector< double > &R) const
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:657
Node * vertex_node_pt(const unsigned &j) const
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:773
void further_build()
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:865
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:1299
RefineableDoubleBuoyantQCrouzeixRaviartElement()
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:603
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:969
unsigned nrecovery_order()
The recovery order is that of the NavierStokes elements.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:885
void output_fct(std::ostream &outfile, const unsigned &Nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:750
double *& km_pt()
Access function for the pointer to transfer constant.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:631
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:899
unsigned num_Z2_flux_terms()
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:890
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:957
double *& n_pt()
Access function for the pointer to the number of monomers in the micelle.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:637
void get_reaction_deriv_adv_diff_react(const unsigned &ipt, const Vector< double > &C, DenseMatrix< double > &dRdC) const
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:669
const double & n() const
Access function for the number of monomers in the micelle.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:634
void unfix_pressure(const unsigned &p_dof)
UnPin p_dof-th pressure dof.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:612
void enable_ALE()
Final override for enable ALE.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:648
unsigned ncont_interpolated_values() const
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:778
void further_setup_hanging_nodes()
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:842
void disable_ALE()
Final override for disable ALE.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:640
void get_Z2_compound_flux_indices(Vector< unsigned > &flux_index)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:932
void rebuild_from_sons(Mesh *&mesh_pt)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:853
void compute_norm(double &norm)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:681
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:1277
unsigned nvertex_node() const
geometric element.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:768
void output(std::ostream &outfile, const unsigned &nplot)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:691
void output_fct(std::ostream &outfile, const unsigned &Nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output function for an exact solution: Broken default.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:742
unsigned required_nvalue(const unsigned &n) const
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:621
double * N_pt
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:593
unsigned c_index_adv_diff_react(const unsigned &i) const
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:762
void get_wind_adv_diff_react(const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &wind) const
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:977
void integrated_C_and_M(double &int_C, double &int_M)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:1314
double * Km_pt
Pointer to private data. The value of Km.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:590
unsigned ncompound_fluxes()
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:928
void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:785
const double & km() const
Access function for the transfer constant.
Definition: two_layer_soluble_surfactant/double_buoyant_navier_stokes_elements.h:628
virtual RefineableElement * father_element_pt() const
Return a pointer to the father element.
Definition: refineable_elements.h:539
int local_hang_eqn(Node *const &node_pt, const unsigned &i)
Definition: refineable_elements.h:278
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
Definition: refineable_navier_stokes_elements.h:395
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Definition: refineable_navier_stokes_elements.h:403
Definition: refineable_advection_diffusion_reaction_elements.h:211
void further_setup_hanging_nodes()
Definition: refineable_advection_diffusion_reaction_elements.h:268
void rebuild_from_sons(Mesh *&mesh_pt)
Rebuild from sons: empty.
Definition: refineable_advection_diffusion_reaction_elements.h:257
Refineable version of Crouzeix Raviart elements. Generic class definitions.
Definition: refineable_navier_stokes_elements.h:1109
void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Definition: refineable_navier_stokes_elements.h:1178
unsigned nrecovery_order()
Definition: refineable_navier_stokes_elements.h:1157
void further_setup_hanging_nodes()
Definition: refineable_navier_stokes_elements.h:1234
Definition: shape.h:76
@ N
Definition: constructor.cpp:22
RealScalar s
Definition: level1_cplx_impl.h:130
int * m
Definition: level2_cplx_impl.h:294
#define DIM
Definition: linearised_navier_stokes_elements.h:44
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625
void flux(const double &time, const Vector< double > &x, double &flux)
Get flux applied along boundary x=0.
Definition: pretend_melt.cc:59
r
Definition: UniformPSDSelfTest.py:20
int error
Definition: calibrate.py:297
@ W
Definition: quadtree.h:63
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
list x
Definition: plotDoE.py:28
t
Definition: plotPSD.py:36
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2