34 #ifndef OOMPH_BOUSSINESQ_ELEMENTS_HEADER 35 #define OOMPH_BOUSSINESQ_ELEMENTS_HEADER 40 #include "advection_diffusion.h" 41 #include "navier_stokes.h" 70 template<
unsigned DIM>
72 public virtual QAdvectionDiffusionElement<DIM,3>,
73 public virtual QCrouzeixRaviartElement<DIM>
90 QCrouzeixRaviartElement<DIM>()
98 this->internal_data_pt(this->P_nst_internal_index)->unpin(p_dof);
105 {
return (QAdvectionDiffusionElement<DIM,3>::required_nvalue(n) +
106 QCrouzeixRaviartElement<DIM>::required_nvalue(n));}
118 NavierStokesEquations<DIM>::disable_ALE();
119 AdvectionDiffusionEquations<DIM>::disable_ALE();
126 NavierStokesEquations<DIM>::enable_ALE();
127 AdvectionDiffusionEquations<DIM>::enable_ALE();
136 "This function hasn't been implemented for this element",
137 OOMPH_CURRENT_FUNCTION,
138 OOMPH_EXCEPTION_LOCATION);
149 const unsigned& nplot)
const 152 "This function hasn't been implemented for this element",
153 OOMPH_CURRENT_FUNCTION,
154 OOMPH_EXCEPTION_LOCATION);
163 return "V"+StringConversion::to_string(i);
168 void output(std::ostream &outfile) {FiniteElement::output(outfile);}
173 void output(std::ostream &outfile,
const unsigned &nplot)
176 Vector<double> s(DIM);
179 outfile << this->tecplot_zone_string(nplot);
182 unsigned num_plot_points=this->nplot_points(nplot);
183 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
186 this->get_s_plot(iplot,nplot,s);
189 for(
unsigned i=0;i<DIM;i++)
190 {outfile << this->interpolated_x(s,i) <<
" ";}
193 for(
unsigned i=0;i<DIM;i++)
194 {outfile << this->interpolated_u_nst(s,i) <<
" ";}
197 outfile << this->interpolated_p_nst(s) <<
" ";
200 outfile << this->interpolated_u_adv_diff(s) << std::endl;
202 outfile << std::endl;
205 this->write_tecplot_zone_footer(outfile,nplot);
211 {FiniteElement::output(file_pt);}
214 void output(FILE* file_pt,
const unsigned &n_plot)
215 {FiniteElement::output(file_pt,n_plot);}
218 void output_fct(std::ostream &outfile,
const unsigned &Nplot,
219 FiniteElement::SteadyExactSolutionFctPt
221 {FiniteElement::output_fct(outfile,Nplot,exact_soln_pt);}
226 void output_fct(std::ostream &outfile,
const unsigned &Nplot,
228 FiniteElement::UnsteadyExactSolutionFctPt
232 output_fct(outfile,Nplot,time,exact_soln_pt);
245 FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt,
247 double& error,
double& norm)
248 {FiniteElement::compute_error(outfile,exact_soln_pt,
257 FiniteElement::SteadyExactSolutionFctPt exact_soln_pt,
258 double& error,
double& norm)
259 {FiniteElement::compute_error(outfile,exact_soln_pt,error,norm);}
265 const Vector<double> &s,
const Vector<double>& x,
266 Vector<double>& wind)
const 269 this->interpolated_u_nst(s,wind);
279 const Vector<double> &s,
const Vector<double> &x,
280 Vector<double> &result)
283 const double interpolated_t = this->interpolated_u_adv_diff(s);
287 Vector<double> gravity(NavierStokesEquations<DIM>::g());
290 for (
unsigned i=0;i<DIM;i++)
292 result[i] = -gravity[i]*interpolated_t*
ra();
304 NavierStokesEquations<DIM>::fill_in_contribution_to_residuals(residuals);
307 AdvectionDiffusionEquations<DIM>::fill_in_contribution_to_residuals(
314 #ifdef USE_FD_JACOBIAN_FOR_BUOYANT_Q_ELEMENT 320 DenseMatrix<double> &jacobian)
323 FiniteElement::fill_in_contribution_to_jacobian(residuals,jacobian);
329 Vector<double> &residuals, DenseMatrix<double> &jacobian,
330 DenseMatrix<double> &mass_matrix)
335 FiniteElement::fill_in_contribution_to_jacobian_and_mass_matrix(
336 residuals,jacobian,mass_matrix);
342 #ifdef USE_OFF_DIAGONAL_FD_JACOBIAN_FOR_BUOYANT_Q_ELEMENT 347 DenseMatrix<double> &jacobian)
351 unsigned u_nodal_nst[DIM];
352 for(
unsigned i=0;i<DIM;i++)
353 {u_nodal_nst[i] = this->u_index_nst(i);}
359 unsigned n_dof = this->ndof();
362 Vector<double> newres(n_dof);
365 int local_unknown =0, local_eqn = 0;
368 double fd_step = FiniteElement::Default_fd_jacobian_step;
371 unsigned n_node = this->nnode();
377 for(
unsigned n=0;n<n_node;n++)
380 for(
unsigned i=0;i<DIM;i++)
383 local_unknown = this->nodal_local_eqn(n,u_nodal_nst[i]);
386 if(local_unknown >= 0)
389 double *value_pt = this->node_pt(n)->value_pt(u_nodal_nst[i]);
392 double old_var = *value_pt;
395 *value_pt += fd_step;
401 for(
unsigned m=0;m<n_dof;m++) {newres[m] = 0.0;}
402 AdvectionDiffusionEquations<DIM>::
403 fill_in_contribution_to_residuals(newres);
409 for(
unsigned m=0;m<n_node;m++)
412 local_eqn = this->nodal_local_eqn(m,u_nodal_adv_diff);
417 double sum = (newres[local_eqn] - residuals[local_eqn])/fd_step;
418 jacobian(local_eqn,local_unknown) = sum;
432 local_unknown = this->nodal_local_eqn(n,u_nodal_adv_diff);
435 if(local_unknown >= 0)
438 double *value_pt = this->node_pt(n)->value_pt(u_nodal_adv_diff);
441 double old_var = *value_pt;
444 *value_pt += fd_step;
450 for(
unsigned m=0;m<n_dof;m++) {newres[m] = 0.0;}
451 NavierStokesEquations<DIM>::
452 fill_in_contribution_to_residuals(newres);
457 for(
unsigned m=0;m<n_node;m++)
460 for(
unsigned j=0;j<DIM;j++)
463 local_eqn = this->nodal_local_eqn(m,u_nodal_nst[j]);
466 double sum = (newres[local_eqn] - residuals[local_eqn])/fd_step;
467 jacobian(local_eqn,local_unknown) = sum;
484 DenseMatrix<double> &jacobian)
488 NavierStokesEquations<DIM>::
489 fill_in_contribution_to_jacobian(residuals,jacobian);
493 AdvectionDiffusionEquations<DIM>::
494 fill_in_contribution_to_jacobian(residuals,jacobian);
505 Vector<double> &residuals, DenseMatrix<double> &jacobian,
506 DenseMatrix<double> &mass_matrix)
509 NavierStokesEquations<DIM>::
510 fill_in_contribution_to_jacobian_and_mass_matrix(
511 residuals,jacobian,mass_matrix);
513 AdvectionDiffusionEquations<DIM>::
514 fill_in_contribution_to_jacobian_and_mass_matrix(
515 residuals,jacobian,mass_matrix);
529 Vector<double> &residuals, DenseMatrix<double> &jacobian)
538 unsigned u_nodal_nst[DIM];
539 for(
unsigned i=0;i<DIM;i++) {u_nodal_nst[i] = this->u_index_nst(i);}
545 const unsigned n_node = this->nnode();
548 Shape psif(n_node), testf(n_node);
549 DShape dpsifdx(n_node,DIM), dtestfdx(n_node,DIM);
552 const unsigned n_intpt = this->integral_pt()->nweight();
555 double Ra = this->
ra();
556 double Pe = this->pe();
557 Vector<double> gravity = this->g();
560 int local_eqn=0, local_unknown=0;
563 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
566 double w = this->integral_pt()->weight(ipt);
570 this->dshape_and_dtest_eulerian_at_knot_nst(ipt,psif,dpsifdx,
578 Vector<double> interpolated_du_adv_diff_dx(DIM,0.0);
581 for(
unsigned l=0;l<n_node;l++)
584 double u_value = this->raw_nodal_value(l,u_nodal_adv_diff);
586 for(
unsigned j=0;j<DIM;j++)
588 interpolated_du_adv_diff_dx[j] += u_value*dpsifdx(l,j);
595 for(
unsigned l=0;l<n_node;l++)
602 for(
unsigned i=0;i<DIM;i++)
605 local_eqn = this->nodal_local_eqn(l,u_nodal_nst[i]);
609 for(
unsigned l2=0;l2<n_node;l2++)
613 local_unknown = this->nodal_local_eqn(l2,u_nodal_adv_diff);
614 if(local_unknown >= 0)
617 jacobian(local_eqn,local_unknown)
618 += -gravity[i]*psif(l2)*Ra*testf(l)*W;
627 local_eqn = this->nodal_local_eqn(l,u_nodal_adv_diff);
632 for(
unsigned l2=0;l2<n_node;l2++)
635 for(
unsigned i2=0;i2<DIM;i2++)
638 local_unknown = this->nodal_local_eqn(l2,u_nodal_nst[i2]);
640 if(local_unknown >= 0)
643 jacobian(local_eqn,local_unknown)
644 -= Pe*psif(l2)*interpolated_du_adv_diff_dx[i2]*testf(l)*W;
659 DenseMatrix<double> &jacobian)
663 NavierStokesEquations<DIM>::
664 fill_in_contribution_to_jacobian(residuals,jacobian);
668 AdvectionDiffusionEquations<DIM>::
669 fill_in_contribution_to_jacobian(residuals,jacobian);
679 Vector<double> &residuals, DenseMatrix<double> &jacobian,
680 DenseMatrix<double> &mass_matrix)
683 NavierStokesEquations<DIM>::
684 fill_in_contribution_to_jacobian_and_mass_matrix(
685 residuals,jacobian,mass_matrix);
687 AdvectionDiffusionEquations<DIM>::
688 fill_in_contribution_to_jacobian_and_mass_matrix(
689 residuals,jacobian,mass_matrix);
712 template<
unsigned int DIM>
714 public virtual QElement<DIM-1,3>
725 public virtual PointElement
758 template<
unsigned DIM>
760 public virtual RefineableQAdvectionDiffusionElement<DIM,3>,
761 public virtual RefineableQCrouzeixRaviartElement<DIM>
777 RefineableQAdvectionDiffusionElement<DIM,3>(),
778 RefineableQCrouzeixRaviartElement<DIM>()
787 {
return (RefineableQAdvectionDiffusionElement<DIM,3>::required_nvalue(n) +
788 RefineableQCrouzeixRaviartElement<DIM>::required_nvalue(n));}
801 RefineableNavierStokesEquations<DIM>::disable_ALE();
802 RefineableAdvectionDiffusionEquations<DIM>::disable_ALE();
809 RefineableNavierStokesEquations<DIM>::enable_ALE();
810 RefineableAdvectionDiffusionEquations<DIM>::enable_ALE();
820 "This function hasn't been implemented for this element",
821 OOMPH_CURRENT_FUNCTION,
822 OOMPH_EXCEPTION_LOCATION);
833 const unsigned& nplot)
const 836 "This function hasn't been implemented for this element",
837 OOMPH_CURRENT_FUNCTION,
838 OOMPH_EXCEPTION_LOCATION);
847 return "V"+StringConversion::to_string(i);
852 {FiniteElement::output(outfile);}
856 void output(std::ostream &outfile,
const unsigned &nplot)
859 Vector<double> s(DIM);
862 outfile << this->tecplot_zone_string(nplot);
865 unsigned num_plot_points=this->nplot_points(nplot);
866 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
869 this->get_s_plot(iplot,nplot,s);
872 for(
unsigned i=0;i<DIM;i++)
873 {outfile << this->interpolated_x(s,i) <<
" ";}
876 for(
unsigned i=0;i<DIM;i++)
877 {outfile << this->interpolated_u_nst(s,i) <<
" ";}
880 outfile << this->interpolated_p_nst(s) <<
" ";
883 outfile << this->interpolated_u_adv_diff(s) <<
" " << std::endl;
885 outfile << std::endl;
888 this->write_tecplot_zone_footer(outfile,nplot);
894 {FiniteElement::output(file_pt);}
897 void output(FILE* file_pt,
const unsigned &n_plot)
898 {FiniteElement::output(file_pt,n_plot);}
901 void output_fct(std::ostream &outfile,
const unsigned &Nplot,
902 FiniteElement::SteadyExactSolutionFctPt
904 {FiniteElement::output_fct(outfile,Nplot,exact_soln_pt);}
909 void output_fct(std::ostream &outfile,
const unsigned &Nplot,
911 FiniteElement::UnsteadyExactSolutionFctPt
915 output_fct(outfile,Nplot,time,exact_soln_pt);
926 {
return QElement<DIM,3>::nvertex_node();}
931 {
return QElement<DIM,3>::vertex_node_pt(j);}
945 Vector<double> nst_values;
948 RefineableQCrouzeixRaviartElement<DIM>::
949 get_interpolated_values(s,nst_values);
952 Vector<double> advection_values;
955 RefineableQAdvectionDiffusionElement<DIM,3>::
956 get_interpolated_values(s,advection_values);
959 for(
unsigned i=0;i<DIM;i++) {values.push_back(nst_values[i]);}
962 values.push_back(advection_values[0]);
972 Vector<double>& values)
975 Vector<double> nst_values;
978 RefineableQCrouzeixRaviartElement<DIM>::
979 get_interpolated_values(t,s,nst_values);
982 Vector<double> advection_values;
985 RefineableQAdvectionDiffusionElement<DIM,3>::
986 get_interpolated_values(s,advection_values);
989 for(
unsigned i=0;i<DIM;i++) {values.push_back(nst_values[i]);}
992 values.push_back(advection_values[0]);
1002 RefineableQCrouzeixRaviartElement<DIM>::further_setup_hanging_nodes();
1003 RefineableQAdvectionDiffusionElement<DIM,3>::further_setup_hanging_nodes();
1012 RefineableQAdvectionDiffusionElement<DIM,3>::rebuild_from_sons(mesh_pt);
1013 RefineableQCrouzeixRaviartElement<DIM>::rebuild_from_sons(mesh_pt);
1023 RefineableQCrouzeixRaviartElement<DIM>::further_build();
1024 RefineableQAdvectionDiffusionElement<DIM,3>::further_build();
1030 this->father_element_pt());
1034 this->Ra_pt = cast_father_element_pt->
ra_pt();
1041 {
return RefineableQCrouzeixRaviartElement<DIM>::nrecovery_order();}
1047 return (RefineableQCrouzeixRaviartElement<DIM>::num_Z2_flux_terms() +
1048 RefineableQAdvectionDiffusionElement<DIM,3>::num_Z2_flux_terms());
1057 unsigned n_fluid_flux =
1058 RefineableQCrouzeixRaviartElement<DIM>::num_Z2_flux_terms();
1061 RefineableQCrouzeixRaviartElement<DIM>::get_Z2_flux(s,flux);
1064 unsigned n_temp_flux =
1065 RefineableQAdvectionDiffusionElement<DIM,3>::num_Z2_flux_terms();
1066 Vector<double> temp_flux(n_temp_flux);
1069 RefineableQAdvectionDiffusionElement<DIM,3>::get_Z2_flux(s,temp_flux);
1072 for(
unsigned i=0;i<n_temp_flux;i++)
1074 flux[n_fluid_flux+i] = temp_flux[i];
1088 unsigned n_fluid_flux =
1089 RefineableQCrouzeixRaviartElement<DIM>::num_Z2_flux_terms();
1091 unsigned n_temp_flux =
1092 RefineableQAdvectionDiffusionElement<DIM,3>::num_Z2_flux_terms();
1097 for(
unsigned i=0;i<n_fluid_flux;i++) {flux_index[i] = 0;}
1100 for(
unsigned i=0;i<n_temp_flux;i++) {flux_index[n_fluid_flux + i] = 1;}
1111 FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt,
1113 double& error,
double& norm)
1114 {FiniteElement::compute_error(outfile,exact_soln_pt,
1123 FiniteElement::SteadyExactSolutionFctPt exact_soln_pt,
1124 double& error,
double& norm)
1126 compute_error(outfile,exact_soln_pt,error,norm);}
1132 const Vector<double> &s,
const Vector<double>& x,
1133 Vector<double>& wind)
const 1136 this->interpolated_u_nst(s,wind);
1146 const Vector<double> &s,
const Vector<double> &x,
1147 Vector<double> &result)
1150 const double interpolated_t = this->interpolated_u_adv_diff(s);
1154 Vector<double> gravity(NavierStokesEquations<DIM>::g());
1157 for (
unsigned i=0;i<DIM;i++)
1159 result[i] = -gravity[i]*interpolated_t*
ra();
1167 RefineableNavierStokesEquations<DIM>::fill_in_contribution_to_residuals(
1171 RefineableAdvectionDiffusionEquations<DIM>::
1172 fill_in_contribution_to_residuals(residuals);
1179 DenseMatrix<double> &jacobian)
1181 #ifdef USE_FD_JACOBIAN_FOR_REFINEABLE_BUOYANT_Q_ELEMENT 1182 FiniteElement::fill_in_contribution_to_jacobian(residuals,jacobian);
1185 RefineableNavierStokesEquations<DIM>::
1186 fill_in_contribution_to_jacobian(residuals,jacobian);
1190 RefineableAdvectionDiffusionEquations<DIM>::
1191 fill_in_contribution_to_jacobian(residuals,jacobian);
1201 Vector<double> &residuals, DenseMatrix<double> &jacobian,
1202 DenseMatrix<double> &mass_matrix)
1205 FiniteElement::fill_in_contribution_to_jacobian_and_mass_matrix(
1206 residuals,jacobian,mass_matrix);
1212 Vector<double> &residuals, DenseMatrix<double> &jacobian)
1219 HangInfo *hang_info_pt=0, *hang_info2_pt=0;
1223 unsigned u_nodal_nst[DIM];
1224 for(
unsigned i=0;i<DIM;i++) {u_nodal_nst[i] = this->u_index_nst(i);}
1230 const unsigned n_node = this->nnode();
1233 Shape psif(n_node), testf(n_node);
1234 DShape dpsifdx(n_node,DIM), dtestfdx(n_node,DIM);
1237 const unsigned n_intpt = this->integral_pt()->nweight();
1240 double Ra = this->
ra();
1241 double Pe = this->pe();
1242 Vector<double> gravity = this->g();
1245 int local_eqn=0, local_unknown=0;
1248 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
1251 double w = this->integral_pt()->weight(ipt);
1255 this->dshape_and_dtest_eulerian_at_knot_nst(ipt,psif,dpsifdx,
1263 Vector<double> interpolated_du_adv_diff_dx(DIM,0.0);
1266 for(
unsigned l=0;l<n_node;l++)
1269 double u_value = this->nodal_value(l,u_nodal_adv_diff);
1271 for(
unsigned j=0;j<DIM;j++)
1273 interpolated_du_adv_diff_dx[j] += u_value*dpsifdx(l,j);
1281 for(
unsigned l=0;l<n_node;l++)
1285 unsigned n_master=1;
1286 double hang_weight=1.0;
1289 bool is_node_hanging = this->node_pt(l)->is_hanging();
1294 hang_info_pt = this->node_pt(l)->hanging_pt();
1295 n_master = hang_info_pt->nmaster();
1304 for(
unsigned m=0;m<n_master;m++)
1310 hang_weight = hang_info_pt->master_weight(m);
1323 for(
unsigned i=0;i<DIM;i++)
1330 local_eqn = this->local_hang_eqn(hang_info_pt->master_node_pt(m),
1336 local_eqn = this->nodal_local_eqn(l,u_nodal_nst[i]);
1343 unsigned n_master2=1;
1344 double hang_weight2=1.0;
1347 for(
unsigned l2=0;l2<n_node;l2++)
1350 bool is_node2_hanging = this->node_pt(l2)->is_hanging();
1353 if(is_node2_hanging)
1355 hang_info2_pt = this->node_pt(l2)->hanging_pt();
1356 n_master2 = hang_info2_pt->nmaster();
1365 for(
unsigned m2=0;m2<n_master2;m2++)
1367 if(is_node2_hanging)
1371 this->local_hang_eqn(hang_info2_pt->master_node_pt(m2),
1374 hang_weight2 = hang_info2_pt->master_weight(m2);
1379 local_unknown = this->nodal_local_eqn(l2,u_nodal_adv_diff);
1384 if(local_unknown >= 0)
1387 jacobian(local_eqn,local_unknown)
1388 += -gravity[i]*psif(l2)*Ra*testf(l)*
1389 W*hang_weight*hang_weight2;
1404 local_eqn = this->local_hang_eqn(hang_info_pt->master_node_pt(m),
1410 local_eqn = this->nodal_local_eqn(l,u_nodal_adv_diff);
1418 unsigned n_master2=1;
1419 double hang_weight2=1.0;
1422 for(
unsigned l2=0;l2<n_node;l2++)
1425 bool is_node2_hanging = this->node_pt(l2)->is_hanging();
1428 if(is_node2_hanging)
1430 hang_info2_pt = this->node_pt(l2)->hanging_pt();
1431 n_master2 = hang_info2_pt->nmaster();
1440 for(
unsigned m2=0;m2<n_master2;m2++)
1443 if(is_node2_hanging)
1446 hang_weight2 = hang_info2_pt->master_weight(m2);
1456 for(
unsigned i2=0;i2<DIM;i2++)
1459 if(is_node2_hanging)
1463 this->local_hang_eqn(hang_info2_pt->master_node_pt(m2),
1469 local_unknown=this->nodal_local_eqn(l2, u_nodal_nst[i2]);
1473 if(local_unknown >= 0)
1476 jacobian(local_eqn,local_unknown)
1477 -= Pe*psif(l2)*interpolated_du_adv_diff_dx[i2]*testf(l)
1478 *W*hang_weight*hang_weight2;
void output_fct(std::ostream &outfile, const unsigned &Nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output function for an exact solution: Broken default.
RefineableBuoyantQCrouzeixRaviartElement()
Constructor: call the underlying constructors and initialise the pointer to the Rayleigh number to ad...
void disable_ALE()
Final override for disable ALE.
void output(std::ostream &outfile)
Overload the standard output function with the broken default.
const double & ra() const
Access function for the Rayleigh number (const version)
void output(std::ostream &outfile)
Overload the standard output function with the broken default.
unsigned u_index_adv_diff() const
Overload the index at which the temperature variable is stored. We choose to store it after the fluid...
void output(FILE *file_pt)
C-style output function: Broken default.
const double & ra() const
Access function for the Rayleigh number (const version)
void further_build()
Call the underlying single-physics element's further_build() functions and make sure that the pointer...
unsigned num_Z2_flux_terms()
The number of Z2 flux terms is the same as that in the fluid element plus that in the advection-diffu...
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Validate against exact solution at given time Solution is provided via function pointer. Plot at a given number of plot points and compute L2 error and L2 norm of velocity solution over element Overload to broken default.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the constituent elements' contribution to the residual vector.
unsigned nvertex_node() const
Number of vertex nodes in the element is obtained from the geometric element.
static double Default_Physical_Constant_Value
The static default value of the Rayleigh number.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function: Broken default.
void get_wind_adv_diff(const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &wind) const
Overload the wind function in the advection-diffusion equations. This provides the coupling from the ...
void output_fct(std::ostream &outfile, const unsigned &Nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Output function for a time-dependent exact solution. Broken default.
unsigned required_nvalue(const unsigned &n) const
The required number of values stored at the nodes is the sum of the required values of the two single...
void get_body_force_nst(const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &result)
Overload the body force in the navier-stokes equations This provides the coupling from the advection-...
std::string scalar_name_paraview(const unsigned &i) const
Name of the i-th scalar field. Default implementation returns V1 for the first one, V2 for the second etc. Can (should!) be overloaded with more meaningful names.
void unfix_pressure(const unsigned &p_dof)
Unpin p_dof-th pressure dof.
void output_fct(std::ostream &outfile, const unsigned &Nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output function for an exact solution: Broken default.
double Default_Physical_Constant_Value
Set the default physical value to be zero.
void enable_ALE()
Final override for enable ALE.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the element's residual vector and the Jacobian matrix. Jacobian is computed by finite-differe...
void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Get the continuously interpolated values at the local coordinate s. We choose to put the fluid veloci...
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Validate against exact solution. Solution is provided via function pointer. Plot at a given number of...
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
void get_body_force_nst(const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &result)
Overload the body force in the Navier-Stokes equations This provides the coupling from the advection-...
void get_interpolated_values(const unsigned &t, const Vector< double > &s, Vector< double > &values)
Get all continuously interpolated values at the local coordinate s at time level t (t=0: present; t>0...
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function: Broken default.
void disable_ALE()
Final override for disable ALE.
void fill_in_off_diagonal_jacobian_blocks_analytic(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the contribution of the off-diagonal blocks analytically.
void output(FILE *file_pt)
C-style output function: Broken default.
unsigned nrecovery_order()
The recovery order is that of the NavierStokes elements.
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Validate against exact solution. Solution is provided via function pointer. Plot at a given number of...
double *& ra_pt()
Access function for the pointer to the Rayleigh number.
void get_wind_adv_diff(const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &wind) const
Overload the wind function in the advection-diffusion equations. This provides the coupling from the ...
void further_setup_hanging_nodes()
The additional hanging node information must be set up for both single-physics elements.
void scalar_value_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
Write values of the i-th scalar field at the plot points. Broken virtual. Needs to be implemented for...
std::string scalar_name_paraview(const unsigned &i) const
Name of the i-th scalar field. Default implementation returns V1 for the first one, V2 for the second etc. Can (should!) be overloaded with more meaningful names.
void rebuild_from_sons(Mesh *&mesh_pt)
Call the rebuild_from_sons functions for each of the constituent multi-physics elements.
void enable_ALE()
Final override for enable ALE.
double * Ra_pt
Pointer to a new physical variable, the Rayleigh number.
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Validate against exact solution at given time Solution is provided via function pointer. Plot at a given number of plot points and compute L2 error and L2 norm of velocity solution over element Call the broken default.
unsigned required_nvalue(const unsigned &n) const
The required number of values stored at the nodes is the sum of the required values of the two single...
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element, Call the geometric element's function.
void fill_in_off_diagonal_jacobian_blocks_analytic(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Helper function to get the off-diagonal blocks of the Jacobian matrix analytically.
double *& ra_pt()
Access function for the pointer to the Rayleigh number.
void output(std::ostream &outfile, const unsigned &nplot)
Output function: x,y,u or x,y,z,u at Nplot^DIM plot points.
BuoyantQCrouzeixRaviartElement()
Constructor: call the underlying constructors and initialise the pointer to the Rayleigh number to po...
void output(std::ostream &outfile, const unsigned &nplot)
Output function: Output x, y, u, v, p, theta at Nplot^DIM plot points.
unsigned nscalar_paraview() const
Number of scalars/fields output by this element. Broken virtual. Needs to be implemented for each new...
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
unsigned nscalar_paraview() const
Number of scalars/fields output by this element. Broken virtual. Needs to be implemented for each new...
void get_Z2_compound_flux_indices(Vector< unsigned > &flux_index)
Fill in which flux components are associated with the fluid measure and which are associated with the...
void scalar_value_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
Write values of the i-th scalar field at the plot points. Broken virtual. Needs to be implemented for...
static double Default_Physical_Constant_Value
The static default value of the Rayleigh number.
unsigned ncompound_fluxes()
The number of compound fluxes is two (one for the fluid and one for the temperature) ...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Calculate the element's contribution to the residual vector. Recall that fill_in_* functions MUST NOT...
void fill_in_off_diagonal_jacobian_blocks_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Helper function to get the off-diagonal blocks of the Jacobian matrix by finite differences.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the element's residual Vector and the jacobian matrix using full finite differences, the default implementation.
void output_fct(std::ostream &outfile, const unsigned &Nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Output function for a time-dependent exact solution: Broken default.
unsigned u_index_adv_diff() const
Overload the index at which the temperature variable is stored. We choose to store is after the fluid...
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get the Z2 flux by concatenating the fluxes from the fluid and the advection diffusion elements...
unsigned ncont_interpolated_values() const
The total number of continously interpolated values is DIM+1 (DIM fluid velocities and one temperatur...
double * Ra_pt
Pointer to a private data member, the Rayleigh number.