my_boussinesq_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 for a multi-physics problem that couples a Navier--Stokes
27 //mesh to an advection diffusion mesh, giving Boussinesq convection
28 
29 //Oomph-lib headers, we require the generic, advection-diffusion
30 //and navier-stokes elements.
31 #include "generic.h"
32 #include "advection_diffusion.h"
33 #include "navier_stokes.h"
34 
35 // Use the oomph and std namespaces
36 using namespace oomph;
37 using namespace std;
38 
39 //======================class definitions==============================
44 //=====================================================================
45 template<unsigned DIM>
47  public virtual RefineableQCrouzeixRaviartElement<DIM>,
48  public virtual ElementWithExternalElement
49 {
50 
51 private:
52 
54  double* Ra_pt;
55 
58 
59 public:
60 
67  {
69 
70  //There is one interaction
71  this->set_ninteraction(1);
72 
73  //We do not need to add any external geometric data because the
74  //element is fixed
75  this->ignore_external_geometric_data();
76  }
77 
80  unsigned required_nvalue(const unsigned &n) const
82 
84  const double &ra() const {return *Ra_pt;}
85 
87  double* &ra_pt() {return Ra_pt;}
88 
90  void output(ostream &outfile) {FiniteElement::output(outfile);}
91 
94  // Start of output function
95  void output(ostream &outfile, const unsigned &nplot)
96  {
97  //vector of local coordinates
99 
100  // Tecplot header info
101  outfile << this->tecplot_zone_string(nplot);
102 
103  // Loop over plot points
104  unsigned num_plot_points=this->nplot_points(nplot);
105  for (unsigned iplot=0;iplot<num_plot_points;iplot++)
106  {
107  // Get local coordinates of plot point
108  this->get_s_plot(iplot,nplot,s);
109 
110  // Output the position of the plot point
111  for(unsigned i=0;i<DIM;i++)
112  {outfile << this->interpolated_x(s,i) << " ";}
113 
114  // Output the fluid velocities at the plot point
115  for(unsigned i=0;i<DIM;i++)
116  {outfile << this->interpolated_u_nst(s,i) << " ";}
117 
118  // Output the fluid pressure at the plot point
119  outfile << this->interpolated_p_nst(s) << " " << std::endl;;
120  }
121  outfile << std::endl;
122 
123  // Write tecplot footer (e.g. FE connectivity lists)
124  this->write_tecplot_zone_footer(outfile,nplot);
125  } //End of output function
126 
127 
129  void output(FILE* file_pt)
130  {FiniteElement::output(file_pt);}
131 
133  void output(FILE* file_pt, const unsigned &n_plot)
134  {FiniteElement::output(file_pt,n_plot);}
135 
137  void output_fct(ostream &outfile, const unsigned &Nplot,
139  exact_soln_pt)
140  {FiniteElement::output_fct(outfile,Nplot,exact_soln_pt);}
141 
142 
145  void output_fct(ostream &outfile, const unsigned &Nplot,
146  const double& time,
148  exact_soln_pt)
149  {
151  output_fct(outfile,Nplot,time,exact_soln_pt);
152  }
153 
158  {
160 
161  //Cast the pointer to the father element to the specific
162  //element type
164  cast_father_element_pt
166  this->father_element_pt());
167 
168  //Set the pointer to the Rayleigh number to be the same as that in
169  //the father
170  this->Ra_pt = cast_father_element_pt->ra_pt();
171  }
172 
177 
183  void compute_error(ostream &outfile,
185  const double& time,
186  double& error, double& norm)
187  {FiniteElement::compute_error(outfile,exact_soln_pt,
188  time,error,norm);}
189 
195  void compute_error(ostream &outfile,
197  double& error, double& norm)
198  {FiniteElement::compute_error(outfile,exact_soln_pt,error,norm);}
199 
200  // Overload get_body_force_nst to get the temperature "body force"
201  // from the "source" AdvectionDiffusion element via current integration point
202  void get_body_force_nst(const double& time, const unsigned& ipt,
203  const Vector<double> &s, const Vector<double> &x,
204  Vector<double> &result);
205 
208  void get_dbody_force_nst_dexternal_element_data(
209  const unsigned& ipt,
210  DenseMatrix<double> &result, Vector<unsigned> &global_eqn_number);
211 
212 
215  {
216  //Call the residuals of the Navier-Stokes equations
218  residuals);
219  }
220 
224  DenseMatrix<double> &jacobian)
225  {
226 #ifdef USE_FD_JACOBIAN_FOR_MY_NAVIER_STOKES_ELEMENT
227  // This function computes the Jacobian by finite-differencing
229 #else
230  //Get the contribution from the basic Navier--Stokes element
232  fill_in_contribution_to_jacobian(residuals,jacobian);
233  //Get the off-diagonal terms analytically
234  this->fill_in_off_diagonal_block_analytic(residuals,jacobian);
235 #endif
236 
237  }
238 
242  Vector<double> &residuals, DenseMatrix<double> &jacobian,
243  DenseMatrix<double> &mass_matrix)
244  {
245  //Call the standard (Broken) function
246  //which will prevent these elements from being used
247  //in eigenproblems until replaced.
249  residuals,jacobian,mass_matrix);
250  }
251 
255  DenseMatrix<double> &jacobian)
256  {
257  //Local storage for the index in the nodes at which the
258  //Navier-Stokes velocities are stored (we know that this should be 0,1,2)
259  unsigned u_nodal_nst[DIM];
260  for(unsigned i=0;i<DIM;i++)
261  {u_nodal_nst[i] = this->u_index_nst(i);}
262 
263  //Find out how many nodes there are
264  const unsigned n_node = this->nnode();
265 
266  //Set up memory for the shape and test functions and their derivatives
267  Shape psif(n_node), testf(n_node);
268  DShape dpsifdx(n_node,DIM), dtestfdx(n_node,DIM);
269 
270  //Number of integration points
271  const unsigned n_intpt = this->integral_pt()->nweight();
272 
273  //Integers to store the local equations and unknowns
274  int local_eqn=0, local_unknown=0;
275 
276  // Local storage for pointers to hang_info objects
277  HangInfo *hang_info_pt=0;
278 
279  //Loop over the integration points
280  for(unsigned ipt=0;ipt<n_intpt;ipt++)
281  {
282  //Get the integral weight
283  double w = this->integral_pt()->weight(ipt);
284 
285  //Call the derivatives of the shape and test functions
286  double J =
287  this->dshape_and_dtest_eulerian_at_knot_nst(ipt,psif,dpsifdx,
288  testf,dtestfdx);
289 
290  //Premultiply the weights and the Jacobian
291  double W = w*J;
292 
293  //Assemble the jacobian terms
294 
295  //Get the derivatives of the body force wrt the unknowns
296  //of the external element
297  DenseMatrix<double> dbody_dexternal_element_data;
298  //Vector of global equation number corresponding to the external
299  //element's data
300  Vector<unsigned> global_eqn_number_of_external_element_data;
301  //Get the appropriate derivatives
302  this->get_dbody_force_nst_dexternal_element_data(
303  ipt,dbody_dexternal_element_data,
304  global_eqn_number_of_external_element_data);
305  //Find out how many external data there are
306  const unsigned n_external_element_data =
307  global_eqn_number_of_external_element_data.size();
308 
309  //Loop over the test functions
310  for(unsigned l=0;l<n_node;l++)
311  {
312  //Assemble the contributions of the temperature to
313  //the Navier--Stokes equations (which arise through the buoyancy
314  //body-force term)
315  unsigned n_master = 1;
316  double hang_weight = 1.0;
317 
318  //Local bool (is the node hanging)
319  bool is_node_hanging = this->node_pt(l)->is_hanging();
320 
321  //If the node is hanging, get the number of master nodes
322  if(is_node_hanging)
323  {
324  hang_info_pt = this->node_pt(l)->hanging_pt();
325  n_master = hang_info_pt->nmaster();
326  }
327  //Otherwise there is just one master node, the node itself
328  else
329  {
330  n_master = 1;
331  }
332 
333  //Loop over the master nodes
334  for(unsigned m=0;m<n_master;m++)
335  {
336  //If the node is hanging get weight from master node
337  if(is_node_hanging)
338  {
339  //Get the hang weight from the master node
340  hang_weight = hang_info_pt->master_weight(m);
341  }
342  else
343  {
344  // Node contributes with full weight
345  hang_weight = 1.0;
346  }
347 
348 
349  //Loop over the velocity components in the Navier--Stokes equtions
350  for(unsigned i=0;i<DIM;i++)
351  {
352  //Get the equation number
353  if(is_node_hanging)
354  {
355  //Get the equation number from the master node
356  local_eqn = this->local_hang_eqn(hang_info_pt->master_node_pt(m),
357  u_nodal_nst[i]);
358  }
359  else
360  {
361  // Local equation number
362  local_eqn = this->nodal_local_eqn(l,u_nodal_nst[i]);
363  }
364 
365  if(local_eqn >= 0)
366  {
367  //Loop over the external data
368  for(unsigned l2=0;l2<n_external_element_data;l2++)
369  {
370  //Find the local equation number corresponding to the global
371  //unknown
372  local_unknown =
373  this->local_eqn_number(
374  global_eqn_number_of_external_element_data[l2]);
375  if(local_unknown >= 0)
376  {
377  //Add contribution to jacobian matrix
378  jacobian(local_eqn,local_unknown)
379  += dbody_dexternal_element_data(i,l2)*testf(l)*hang_weight*W;
380  }
381  }
382  }
383  }
384  }
385  }
386  }
387  }
388 
389  // Preconditioner overloads required
391  (std::list<std::pair<unsigned long, unsigned> >& dof_lookup_list) const
392  {
393  // Call the underlying CrouzeixRaviart function
395  (dof_lookup_list);
396  }
397 
398  unsigned ndof_types() const
399  {
401  }
402 
403 
404 };
405 
406 //======================class definitions==============================
410 //=====================================================================
411 template<unsigned DIM> // second templated argument?
413  public virtual RefineableQAdvectionDiffusionElement<DIM,3>,
414  public virtual ElementWithExternalElement
415 {
416 
417 public:
418 
422  {
423  //There is one interaction
424  this->set_ninteraction(1);
425 
426  //We do not need to add any external geometric data because the
427  //element is fixed
428  this->ignore_external_geometric_data();
429  }
430 
433  unsigned required_nvalue(const unsigned &n) const
435 
437  void output(ostream &outfile) {FiniteElement::output(outfile);}
438 
441  // Start of output function
442  void output(ostream &outfile, const unsigned &nplot)
443  {
444  //vector of local coordinates
446 
447  // Tecplot header info
448  outfile << this->tecplot_zone_string(nplot);
449 
450  // Loop over plot points
451  unsigned num_plot_points=this->nplot_points(nplot);
452  for (unsigned iplot=0;iplot<num_plot_points;iplot++)
453  {
454  // Get local coordinates of plot point
455  this->get_s_plot(iplot,nplot,s);
456 
457  // Output the position of the plot point
458  for(unsigned i=0;i<DIM;i++)
459  {outfile << this->interpolated_x(s,i) << " ";}
460 
461  // Output the temperature (the advected variable) at the plot point
462  outfile << this->interpolated_u_adv_diff(s) << std::endl;
463  }
464  outfile << std::endl;
465 
466  // Write tecplot footer (e.g. FE connectivity lists)
467  this->write_tecplot_zone_footer(outfile,nplot);
468  } //End of output function
469 
470 
472  void output(FILE* file_pt)
473  {FiniteElement::output(file_pt);}
474 
476  void output(FILE* file_pt, const unsigned &n_plot)
477  {FiniteElement::output(file_pt,n_plot);}
478 
480  void output_fct(ostream &outfile, const unsigned &Nplot,
482  exact_soln_pt)
483  {FiniteElement::output_fct(outfile,Nplot,exact_soln_pt);}
484 
485 
488  void output_fct(ostream &outfile, const unsigned &Nplot,
489  const double& time,
491  exact_soln_pt)
492  {
494  output_fct(outfile,Nplot,time,exact_soln_pt);
495  }
496 
500 
501 // /// The recovery order is that of the NavierStokes elements.
502 // unsigned nrecovery_order()
503 // {return RefineableQCrouzeixRaviartElement<DIM>::nrecovery_order();}
504 
505 // /// The number of Z2 flux terms is the same as that in
506 // /// the NavierStokes (fluid) element.
507 // unsigned num_Z2_flux_terms()
508 // {
509 // return RefineableQCrouzeixRaviartElement<DIM>::num_Z2_flux_terms();
510 // }
511 
512 // /// Get the Z2 flux from the fluid element
513 // void get_Z2_flux(const Vector<double>& s, Vector<double>& flux)
514 // {
515 // RefineableQCrouzeixRaviartElement<DIM>::get_Z2_flux(s,flux);
516 // } //end of get_Z2_flux
517 
523  void compute_error(ostream &outfile,
525  const double& time,
526  double& error, double& norm)
527  {FiniteElement::compute_error(outfile,exact_soln_pt,
528  time,error,norm);}
529 
535  void compute_error(ostream &outfile,
537  double& error, double& norm)
538  {FiniteElement::compute_error(outfile,exact_soln_pt,error,norm);}
539 
544  void get_wind_adv_diff(const unsigned& ipt, const Vector<double> &s,
545  const Vector<double>& x, Vector<double>& wind) const;
546 
549  void get_dwind_adv_diff_dexternal_element_data(
550  const unsigned& ipt, const unsigned &i,
551  Vector<double> &result, Vector<unsigned> &global_eqn_number);
552 
553 
556  {
559  }
560 
564  DenseMatrix<double> &jacobian)
565  {
566 #ifdef USE_FD_JACOBIAN_FOR_MY_ADVECTION_DIFFUSION_ELEMENT
567  // This function computes the Jacobian by finite-differencing
569 #else
570  //Get the contribution from the basic Navier--Stokes element
572  fill_in_contribution_to_jacobian(residuals,jacobian);
573  //Get the off-diagonal terms analytically
574  this->fill_in_off_diagonal_block_analytic(residuals,jacobian);
575 #endif
576  }
577 
581  Vector<double> &residuals, DenseMatrix<double> &jacobian,
582  DenseMatrix<double> &mass_matrix)
583  {
584  //Call the standard (Broken) function
585  //which will prevent these elements from being used
586  //in eigenproblems until replaced.
588  residuals,jacobian,mass_matrix);
589  }
590 
591 
595  DenseMatrix<double> &jacobian)
596  {
597  //Local storage for the index in the nodes at which the temperature
598  //is stored
599  const unsigned u_nodal_adv_diff = this->u_index_adv_diff();
600 
601  //Find out how many nodes there are
602  const unsigned n_node = this->nnode();
603 
604  //Set up memory for the shape and test functions and their derivatives
605  Shape psi(n_node), test(n_node);
606  DShape dpsidx(n_node,DIM), dtestdx(n_node,DIM);
607 
608  //Number of integration points
609  const unsigned n_intpt = this->integral_pt()->nweight();
610 
611  //Integers to store the local equations and unknowns
612  int local_eqn=0, local_unknown=0;
613 
614  // Local storage for pointers to hang_info objects
615  HangInfo *hang_info_pt=0;
616 
617  //Get the peclet number
618  const double peclet = this->pe();
619 
620  //Loop over the integration points
621  for(unsigned ipt=0;ipt<n_intpt;ipt++)
622  {
623  //Get the integral weight
624  double w = this->integral_pt()->weight(ipt);
625 
626  //Call the derivatives of the shape and test functions
627  double J =
628  this->dshape_and_dtest_eulerian_at_knot_adv_diff(ipt,psi,dpsidx,
629  test,dtestdx);
630 
631  //Premultiply the weights and the Jacobian
632  double W = w*J;
633 
634  //Calculate local values of the derivatives of the solution
635  Vector<double> interpolated_dudx(DIM,0.0);
636  // Loop over nodes
637  for(unsigned l=0;l<n_node;l++)
638  {
639  // Loop over directions
640  for(unsigned j=0;j<DIM;j++)
641  {
642  interpolated_dudx[j] +=
643  this->nodal_value(l,u_nodal_adv_diff)*dpsidx(l,j);
644  }
645  }
646 
647  //Get the derivatives of the wind wrt the unknowns
648  //of the external element
649  Vector<double> dwind_dexternal_element_data;
650  //Vector of global equation number corresponding to the external
651  //element's data
652  Vector<unsigned> global_eqn_number_of_external_element_data;
653 
654  //Loop over the wind directions
655  for(unsigned i2=0;i2<DIM;i2++)
656  {
657  //Get the appropriate derivatives
658  this->get_dwind_adv_diff_dexternal_element_data(
659  ipt,i2,dwind_dexternal_element_data,
660  global_eqn_number_of_external_element_data);
661 
662 
663  //Find out how many external data there are
664  const unsigned n_external_element_data =
665  global_eqn_number_of_external_element_data.size();
666 
667  //Loop over the test functions
668  for(unsigned l=0;l<n_node;l++)
669  {
670  //Assemble the contributions of the velocities to
671  //the advection-diffusion equations
672  unsigned n_master = 1;
673  double hang_weight = 1.0;
674 
675  //Local bool (is the node hanging)
676  bool is_node_hanging = this->node_pt(l)->is_hanging();
677 
678  //If the node is hanging, get the number of master nodes
679  if(is_node_hanging)
680  {
681  hang_info_pt = this->node_pt(l)->hanging_pt();
682  n_master = hang_info_pt->nmaster();
683  }
684  //Otherwise there is just one master node, the node itself
685  else
686  {
687  n_master = 1;
688  }
689 
690  //Loop over the master nodes
691  for(unsigned m=0;m<n_master;m++)
692  {
693  //If the node is hanging get weight from master node
694  if(is_node_hanging)
695  {
696  //Get the hang weight from the master node
697  hang_weight = hang_info_pt->master_weight(m);
698  }
699  else
700  {
701  // Node contributes with full weight
702  hang_weight = 1.0;
703  }
704 
705  //Get the equation number
706  if(is_node_hanging)
707  {
708  //Get the equation number from the master node
709  local_eqn = this->local_hang_eqn(hang_info_pt->master_node_pt(m),
710  u_nodal_adv_diff);
711  }
712  else
713  {
714  // Local equation number
715  local_eqn = this->nodal_local_eqn(l,u_nodal_adv_diff);
716  }
717 
718  if(local_eqn >= 0)
719  {
720  //Loop over the external data
721  for(unsigned l2=0;l2<n_external_element_data;l2++)
722  {
723  //Find the local equation number corresponding to the global
724  //unknown
725  local_unknown =
726  this->local_eqn_number(
727  global_eqn_number_of_external_element_data[l2]);
728  if(local_unknown >= 0)
729  {
730  //Add contribution to jacobian matrix
731  jacobian(local_eqn,local_unknown)
732  -= peclet*dwind_dexternal_element_data[l2]*
733  interpolated_dudx[i2]*test(l)*hang_weight*W;
734  }
735  }
736  }
737  }
738  }
739  }
740  }
741  }
742 
743 
745  (std::list<std::pair<unsigned long, unsigned> >& dof_lookup_list) const
746  {
747  // There isn't an underlying AdvectionDiffusion example as yet, so
748  // write one... !
749 
750  // number of nodes
751  unsigned n_node = this->nnode();
752 
753  // temporary pair (used to store dof lookup prior to being added to list)
754  std::pair<unsigned,unsigned> dof_lookup;
755 
756  // loop over the nodes
757  for (unsigned n = 0; n < n_node; n++)
758  {
759  // find the number of values at this node
760  unsigned nv = this->node_pt(n)->nvalue();
761 
762  //loop over these values
763  for (unsigned v = 0; v < nv; v++)
764  {
765  // determine local eqn number
766  int local_eqn_number = this->nodal_local_eqn(n, v);
767 
768  // ignore pinned values - far away degrees of freedom resulting
769  // from hanging nodes can be ignored since these are be dealt
770  // with by the element containing their master nodes
771  if (local_eqn_number >= 0)
772  {
773  // store dof lookup in temporary pair: Global equation number
774  // is the first entry in pair
775  dof_lookup.first = this->eqn_number(local_eqn_number);
776 
777  // set DOF numbers: DOF number is the second entry in pair
778  dof_lookup.second = 0;
779 
780  // add to list
781  dof_lookup_list.push_front(dof_lookup);
782  }
783  }
784  }
785  }
786 
788  unsigned ndof_types() const
789  {
790  return 1;
791  }
792 
793 
794 
795 };
796 
797 //============================================================
798 // Overload get_body_force_nst to get the temperature "body force"
799 // from the "source" AdvectionDiffusion element via current integration point
800 //========================================================
801 template<unsigned DIM>
804 (const double& time,const unsigned& ipt,const Vector<double> &s,
805  const Vector<double> &x,Vector<double> &result)
806 {
807  // The interaction is stored at index 0 of the AD element
808  unsigned interaction=0;
809 
810  // Dynamic cast the source element at this integration point to correct type
813  (external_element_pt(interaction,ipt));
814 
815  // Get vector that indicates the direction of gravity from
816  // the Navier-Stokes equations
818 
819  // Temperature-dependent body force:
820  for (unsigned i=0;i<DIM;i++)
821  {
822  result[i] = -gravity[i]*source_el_pt->interpolated_u_adv_diff
823  (external_element_local_coord(interaction,ipt))*ra();
824  }
825 }
826 
827 //=========================================================================
830 //=========================================================================
831 template<unsigned DIM>
834  DenseMatrix<double> &result,
835  Vector<unsigned> &global_eqn_number)
836 {
837  // The interaction index is 0 in this case
838  unsigned interaction=0;
839 
840  // Dynamic cast "other" element to correct type
843  (external_element_pt(interaction,ipt));
844 
845  // Get vector that indicates the direction of gravity from
846  // the Navier-Stokes equations
848 
849  // Get the external element's derivatives
850  Vector<double> du_adv_diff_ddata;
851  source_el_pt->dinterpolated_u_adv_diff_ddata(
852  external_element_local_coord(interaction,ipt),du_adv_diff_ddata,
853  global_eqn_number);
854 
855  //Find the number of external data
856  unsigned n_external_element_data = du_adv_diff_ddata.size();
857  //Set the size of the matrix to be returned
858  result.resize(DIM,n_external_element_data);
859 
860  // Temperature-dependent body force:
861  for (unsigned i=0;i<DIM;i++)
862  {
863  //Loop over the external data
864  for(unsigned n=0;n<n_external_element_data;n++)
865  {
866  result(i,n) = -gravity[i]*du_adv_diff_ddata[n]*ra();
867  }
868  }
869 }
870 
871 
872 
873 //==========================================================================
878 //==========================================================================
879 template<unsigned DIM>
882 (const unsigned& ipt,const Vector<double> &s,const Vector<double>& x,
883  Vector<double>& wind) const
884 {
885  // The interatction is stored at index 0 of the NST element
886  unsigned interaction=0;
887 
888  // Dynamic cast "other" element to correct type
891  (external_element_pt(interaction,ipt));
892 
893  //The wind function is simply the velocity at the points of the source element
894  source_el_pt->interpolated_u_nst
895  (external_element_local_coord(interaction,ipt),wind);
896 }
897 
898 
899 
900 //=========================================================================
903 //=========================================================================
904 template<unsigned DIM>
907  const unsigned &i,
908  Vector<double> &result,
909  Vector<unsigned> &global_eqn_number)
910 {
911  // The interaction index is 0 in this case
912  unsigned interaction=0;
913 
914  // Dynamic cast "other" element to correct type
917  (external_element_pt(interaction,ipt));
918 
919  // Get the external element's derivatives of the velocity with respect
920  // to the data. The wind is just the Navier--Stokes velocity, so this
921  // is all that's required
922  source_el_pt->dinterpolated_u_nst_ddata(
923  external_element_local_coord(interaction,ipt),i,result,
924  global_eqn_number);
925 }
926 
927 
928 
929 //=========================================================================
931 //=========================================================================
932 template<>
934 
935 template<>
937 
941 
942 
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
RowVector3d w
Definition: Matrix_resize_int.cpp:3
Definition: my_boussinesq_elements.h:415
void output(ostream &outfile, const unsigned &nplot)
Definition: my_boussinesq_elements.h:442
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Definition: my_boussinesq_elements.h:745
void get_wind_adv_diff(const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &wind) const
Definition: my_boussinesq_elements.h:882
void get_dwind_adv_diff_dexternal_element_data(const unsigned &ipt, const unsigned &i, Vector< double > &result, Vector< unsigned > &global_eqn_number)
Definition: my_boussinesq_elements.h:906
void compute_error(ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Definition: my_boussinesq_elements.h:535
void output_fct(ostream &outfile, const unsigned &Nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Definition: my_boussinesq_elements.h:488
void output_fct(ostream &outfile, const unsigned &Nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output function for an exact solution: Broken default.
Definition: my_boussinesq_elements.h:480
unsigned ndof_types() const
Number of dof types in this element.
Definition: my_boussinesq_elements.h:788
void output(ostream &outfile)
Overload the standard output function with the broken default.
Definition: my_boussinesq_elements.h:437
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function: Broken default.
Definition: my_boussinesq_elements.h:476
void output(FILE *file_pt)
C-style output function: Broken default.
Definition: my_boussinesq_elements.h:472
void compute_error(ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Definition: my_boussinesq_elements.h:523
RefineableQAdvectionDiffusionElementWithExternalElement()
Constructor: call the underlying constructors.
Definition: my_boussinesq_elements.h:420
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Definition: my_boussinesq_elements.h:580
void fill_in_off_diagonal_block_analytic(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: my_boussinesq_elements.h:594
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: my_boussinesq_elements.h:563
unsigned required_nvalue(const unsigned &n) const
Definition: my_boussinesq_elements.h:433
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Just call the fill_in_residuals for AdvDiff.
Definition: my_boussinesq_elements.h:555
Definition: my_boussinesq_elements.h:49
void compute_error(ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Definition: my_boussinesq_elements.h:195
void get_dbody_force_nst_dexternal_element_data(const unsigned &ipt, DenseMatrix< double > &result, Vector< unsigned > &global_eqn_number)
external unknowns
Definition: my_boussinesq_elements.h:833
void output_fct(ostream &outfile, const unsigned &Nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Definition: my_boussinesq_elements.h:145
void fill_in_off_diagonal_block_analytic(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: my_boussinesq_elements.h:254
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Definition: my_boussinesq_elements.h:391
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the constituent elements' contribution to the residual vector.
Definition: my_boussinesq_elements.h:214
void output_fct(ostream &outfile, const unsigned &Nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output function for an exact solution: Broken default.
Definition: my_boussinesq_elements.h:137
unsigned ndof_types() const
Definition: my_boussinesq_elements.h:398
unsigned required_nvalue(const unsigned &n) const
Definition: my_boussinesq_elements.h:80
void output(FILE *file_pt)
C-style output function: Broken default.
Definition: my_boussinesq_elements.h:129
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function: Broken default.
Definition: my_boussinesq_elements.h:133
void output(ostream &outfile)
Overload the standard output function with the broken default.
Definition: my_boussinesq_elements.h:90
double *& ra_pt()
Access function for the pointer to the Rayleigh number.
Definition: my_boussinesq_elements.h:87
RefineableQCrouzeixRaviartElementWithExternalElement()
Definition: my_boussinesq_elements.h:64
void get_body_force_nst(const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &result)
Definition: my_boussinesq_elements.h:804
const double & ra() const
Access function for the Rayleigh number (const version)
Definition: my_boussinesq_elements.h:84
void output(ostream &outfile, const unsigned &nplot)
Definition: my_boussinesq_elements.h:95
void further_build()
Definition: my_boussinesq_elements.h:157
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Definition: my_boussinesq_elements.h:241
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: my_boussinesq_elements.h:223
void compute_error(ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Definition: my_boussinesq_elements.h:183
static double Default_Physical_Constant_Value
The static default value of the Rayleigh number.
Definition: my_boussinesq_elements.h:57
double * Ra_pt
Pointer to a private data member, the Rayleigh number.
Definition: my_boussinesq_elements.h:54
double interpolated_u_adv_diff(const Vector< double > &s) const
Return FE representation of function value u(s) at local coordinate s.
Definition: advection_diffusion_elements.h:458
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: advection_diffusion_elements.h:435
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the element's contribution to its residual vector (wrapper)
Definition: advection_diffusion_elements.h:421
Definition: shape.h:278
void resize(const unsigned long &n)
Definition: matrices.h:498
Definition: element_with_external_element.h:56
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
virtual void output(std::ostream &outfile)
Definition: elements.h:3050
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
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Definition: elements.h:1765
virtual void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Definition: elements.cc:1322
Definition: nodes.h:742
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
Definition: nodes.h:808
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
Definition: navier_stokes_elements.h:395
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(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: navier_stokes_elements.h:1273
unsigned required_nvalue(const unsigned &n) const
Definition: advection_diffusion_elements.h:633
virtual unsigned required_nvalue(const unsigned &n) const
Number of values (pinned or dofs) required at local node n.
Definition: navier_stokes_elements.cc:2581
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Definition: navier_stokes_elements.cc:2662
unsigned ndof_types() const
Definition: navier_stokes_elements.h:1935
Definition: refineable_advection_diffusion_elements.h:58
void dinterpolated_u_adv_diff_ddata(const Vector< double > &s, Vector< double > &du_ddata, Vector< unsigned > &global_eqn_number)
Definition: refineable_advection_diffusion_elements.h:199
Definition: refineable_navier_stokes_elements.h:322
void dinterpolated_u_nst_ddata(const Vector< double > &s, const unsigned &i, Vector< double > &du_ddata, Vector< unsigned > &global_eqn_number)
Definition: refineable_navier_stokes_elements.h:482
Definition: refineable_advection_diffusion_elements.h:355
Refineable version of Crouzeix Raviart elements. Generic class definitions.
Definition: refineable_navier_stokes_elements.h:1109
Definition: shape.h:76
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
squared absolute sa ArrayBase::abs2 DOXCOMMA MatrixBase::cwiseAbs2 sa Eigen::abs2 DOXCOMMA Eigen::pow DOXCOMMA ArrayBase::square nearest sa Eigen::floor DOXCOMMA Eigen::ceil DOXCOMMA ArrayBase::round nearest integer not less than the given sa Eigen::floor DOXCOMMA ArrayBase::ceil not a number test
Definition: GlobalFunctions.h:109
void gravity(const double &t, const Vector< double > &xi, Vector< double > &b)
Definition: ConstraintElementsUnitTest.cpp:20
int error
Definition: calibrate.py:297
Definition: MortaringCantileverCompareToNonMortaring.cpp:176
double Default_Physical_Constant_Value
Default value for physical constants.
Definition: multi_domain_boussinesq_elements.h:48
@ W
Definition: quadtree.h:63
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
const double & pe() const
Peclet number.
Definition: gen_axisym_advection_diffusion_elements.h:284
list x
Definition: plotDoE.py:28
Definition: indexed_view.cpp:20
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2