30 #ifndef OOMPH_BOUSSINESQ_ELEMENTS_HEADER
31 #define OOMPH_BOUSSINESQ_ELEMENTS_HEADER
36 #include "advection_diffusion.h"
37 #include "navier_stokes.h"
64 template<
unsigned DIM>
66 :
public virtual QAdvectionDiffusionElement<DIM, 3>,
67 public virtual QCrouzeixRaviartElement<DIM>
81 : QAdvectionDiffusionElement<DIM, 3>(), QCrouzeixRaviartElement<DIM>()
89 this->internal_data_pt(this->P_nst_internal_index)->unpin(p_dof);
97 return (QAdvectionDiffusionElement<DIM, 3>::required_nvalue(n) +
98 QCrouzeixRaviartElement<DIM>::required_nvalue(n));
102 const double&
ra()
const
117 NavierStokesEquations<DIM>::disable_ALE();
118 AdvectionDiffusionEquations<DIM>::disable_ALE();
125 NavierStokesEquations<DIM>::enable_ALE();
126 AdvectionDiffusionEquations<DIM>::enable_ALE();
135 "This function hasn't been implemented for this element",
136 OOMPH_CURRENT_FUNCTION,
137 OOMPH_EXCEPTION_LOCATION);
148 const unsigned& nplot)
const
151 "This function hasn't been implemented for this element",
152 OOMPH_CURRENT_FUNCTION,
153 OOMPH_EXCEPTION_LOCATION);
162 return "V" + StringConversion::to_string(i);
169 FiniteElement::output(outfile);
175 void output(std::ostream& outfile,
const unsigned& nplot)
178 Vector<double> s(DIM);
181 outfile << this->tecplot_zone_string(nplot);
184 unsigned num_plot_points = this->nplot_points(nplot);
185 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
188 this->get_s_plot(iplot, nplot, s);
191 for (
unsigned i = 0; i < DIM; i++)
193 outfile << this->interpolated_x(s, i) <<
" ";
197 for (
unsigned i = 0; i < DIM; i++)
199 outfile << this->interpolated_u_nst(s, i) <<
" ";
203 outfile << this->interpolated_p_nst(s) <<
" ";
206 outfile << this->interpolated_u_adv_diff(s) << std::endl;
208 outfile << std::endl;
211 this->write_tecplot_zone_footer(outfile, nplot);
218 FiniteElement::output(file_pt);
222 void output(FILE* file_pt,
const unsigned& n_plot)
224 FiniteElement::output(file_pt, n_plot);
229 const unsigned& Nplot,
230 FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
232 FiniteElement::output_fct(outfile, Nplot, exact_soln_pt);
239 const unsigned& Nplot,
241 FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
243 FiniteElement::output_fct(outfile, Nplot, time, exact_soln_pt);
259 FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt,
264 FiniteElement::compute_error(outfile, exact_soln_pt, time, error, norm);
273 FiniteElement::SteadyExactSolutionFctPt exact_soln_pt,
277 FiniteElement::compute_error(outfile, exact_soln_pt, error, norm);
284 const Vector<double>& s,
285 const Vector<double>& x,
286 Vector<double>& wind)
const
289 this->interpolated_u_nst(s, wind);
300 const Vector<double>& s,
301 const Vector<double>& x,
302 Vector<double>& result)
305 const double interpolated_t = this->interpolated_u_adv_diff(s);
309 Vector<double> gravity(NavierStokesEquations<DIM>::g());
312 for (
unsigned i = 0; i < DIM; i++)
314 result[i] = -gravity[i] * interpolated_t *
ra();
326 NavierStokesEquations<DIM>::fill_in_contribution_to_residuals(residuals);
329 AdvectionDiffusionEquations<DIM>::fill_in_contribution_to_residuals(
336 #ifdef USE_FD_JACOBIAN_FOR_BUOYANT_Q_ELEMENT
342 DenseMatrix<double>& jacobian)
345 FiniteElement::fill_in_contribution_to_jacobian(residuals, jacobian);
351 Vector<double>& residuals,
352 DenseMatrix<double>& jacobian,
353 DenseMatrix<double>& mass_matrix)
358 FiniteElement::fill_in_contribution_to_jacobian_and_mass_matrix(
359 residuals, jacobian, mass_matrix);
365 #ifdef USE_OFF_DIAGONAL_FD_JACOBIAN_FOR_BUOYANT_Q_ELEMENT
370 Vector<double>& residuals, DenseMatrix<double>& jacobian)
374 unsigned u_nodal_nst[DIM];
375 for (
unsigned i = 0; i < DIM; i++)
377 u_nodal_nst[i] = this->u_index_nst(i);
384 unsigned n_dof = this->ndof();
387 Vector<double> newres(n_dof);
390 int local_unknown = 0, local_eqn = 0;
393 double fd_step = FiniteElement::Default_fd_jacobian_step;
396 unsigned n_node = this->nnode();
402 for (
unsigned n = 0; n < n_node; n++)
405 for (
unsigned i = 0; i < DIM; i++)
408 local_unknown = this->nodal_local_eqn(n, u_nodal_nst[i]);
411 if (local_unknown >= 0)
414 double* value_pt = this->node_pt(n)->value_pt(u_nodal_nst[i]);
417 double old_var = *value_pt;
420 *value_pt += fd_step;
426 for (
unsigned m = 0; m < n_dof; m++)
430 AdvectionDiffusionEquations<DIM>::fill_in_contribution_to_residuals(
437 for (
unsigned m = 0; m < n_node; m++)
440 local_eqn = this->nodal_local_eqn(m, u_nodal_adv_diff);
446 (newres[local_eqn] - residuals[local_eqn]) / fd_step;
447 jacobian(local_eqn, local_unknown) = sum;
461 local_unknown = this->nodal_local_eqn(n, u_nodal_adv_diff);
464 if (local_unknown >= 0)
467 double* value_pt = this->node_pt(n)->value_pt(u_nodal_adv_diff);
470 double old_var = *value_pt;
473 *value_pt += fd_step;
479 for (
unsigned m = 0; m < n_dof; m++)
483 NavierStokesEquations<DIM>::fill_in_contribution_to_residuals(
489 for (
unsigned m = 0; m < n_node; m++)
492 for (
unsigned j = 0; j < DIM; j++)
495 local_eqn = this->nodal_local_eqn(m, u_nodal_nst[j]);
499 (newres[local_eqn] - residuals[local_eqn]) / fd_step;
500 jacobian(local_eqn, local_unknown) = sum;
517 DenseMatrix<double>& jacobian)
521 NavierStokesEquations<DIM>::fill_in_contribution_to_jacobian(residuals,
526 AdvectionDiffusionEquations<DIM>::fill_in_contribution_to_jacobian(
527 residuals, jacobian);
538 Vector<double>& residuals,
539 DenseMatrix<double>& jacobian,
540 DenseMatrix<double>& mass_matrix)
543 NavierStokesEquations<
548 AdvectionDiffusionEquations<
565 Vector<double>& residuals, DenseMatrix<double>& jacobian)
574 unsigned u_nodal_nst[DIM];
575 for (
unsigned i = 0; i < DIM; i++)
577 u_nodal_nst[i] = this->u_index_nst(i);
584 const unsigned n_node = this->nnode();
587 Shape psif(n_node), testf(n_node);
588 DShape dpsifdx(n_node, DIM), dtestfdx(n_node, DIM);
591 const unsigned n_intpt = this->integral_pt()->nweight();
594 double Ra = this->
ra();
595 double Pe = this->pe();
596 Vector<double> gravity = this->g();
599 int local_eqn = 0, local_unknown = 0;
602 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
605 double w = this->integral_pt()->weight(ipt);
608 double J = this->dshape_and_dtest_eulerian_at_knot_nst(
609 ipt, psif, dpsifdx, testf, dtestfdx);
616 Vector<double> interpolated_du_adv_diff_dx(DIM, 0.0);
619 for (
unsigned l = 0; l < n_node; l++)
622 double u_value = this->raw_nodal_value(l, u_nodal_adv_diff);
624 for (
unsigned j = 0; j < DIM; j++)
626 interpolated_du_adv_diff_dx[j] += u_value * dpsifdx(l, j);
633 for (
unsigned l = 0; l < n_node; l++)
640 for (
unsigned i = 0; i < DIM; i++)
643 local_eqn = this->nodal_local_eqn(l, u_nodal_nst[i]);
647 for (
unsigned l2 = 0; l2 < n_node; l2++)
651 local_unknown = this->nodal_local_eqn(l2, u_nodal_adv_diff);
652 if (local_unknown >= 0)
655 jacobian(local_eqn, local_unknown) +=
656 -gravity[i] * psif(l2) * Ra * testf(l) * W;
665 local_eqn = this->nodal_local_eqn(l, u_nodal_adv_diff);
670 for (
unsigned l2 = 0; l2 < n_node; l2++)
673 for (
unsigned i2 = 0; i2 < DIM; i2++)
676 local_unknown = this->nodal_local_eqn(l2, u_nodal_nst[i2]);
678 if (local_unknown >= 0)
681 jacobian(local_eqn, local_unknown) -=
682 Pe * psif(l2) * interpolated_du_adv_diff_dx[i2] *
697 DenseMatrix<double>& jacobian)
701 NavierStokesEquations<DIM>::fill_in_contribution_to_jacobian(residuals,
706 AdvectionDiffusionEquations<DIM>::fill_in_contribution_to_jacobian(
707 residuals, jacobian);
717 Vector<double>& residuals,
718 DenseMatrix<double>& jacobian,
719 DenseMatrix<double>& mass_matrix)
722 NavierStokesEquations<
727 AdvectionDiffusionEquations<
754 template<
unsigned int DIM>
756 :
public virtual QElement<DIM - 1, 3>
767 :
public virtual PointElement
799 template<
unsigned DIM>
801 :
public virtual RefineableQAdvectionDiffusionElement<DIM, 3>,
802 public virtual RefineableQCrouzeixRaviartElement<DIM>
816 : RefineableQAdvectionDiffusionElement<DIM, 3>(),
817 RefineableQCrouzeixRaviartElement<DIM>()
827 return (RefineableQAdvectionDiffusionElement<DIM, 3>::required_nvalue(n) +
828 RefineableQCrouzeixRaviartElement<DIM>::required_nvalue(n));
832 const double&
ra()
const
848 RefineableNavierStokesEquations<DIM>::disable_ALE();
849 RefineableAdvectionDiffusionEquations<DIM>::disable_ALE();
856 RefineableNavierStokesEquations<DIM>::enable_ALE();
857 RefineableAdvectionDiffusionEquations<DIM>::enable_ALE();
867 "This function hasn't been implemented for this element",
868 OOMPH_CURRENT_FUNCTION,
869 OOMPH_EXCEPTION_LOCATION);
880 const unsigned& nplot)
const
883 "This function hasn't been implemented for this element",
884 OOMPH_CURRENT_FUNCTION,
885 OOMPH_EXCEPTION_LOCATION);
894 return "V" + StringConversion::to_string(i);
900 FiniteElement::output(outfile);
905 void output(std::ostream& outfile,
const unsigned& nplot)
908 Vector<double> s(DIM);
911 outfile << this->tecplot_zone_string(nplot);
914 unsigned num_plot_points = this->nplot_points(nplot);
915 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
918 this->get_s_plot(iplot, nplot, s);
921 for (
unsigned i = 0; i < DIM; i++)
923 outfile << this->interpolated_x(s, i) <<
" ";
927 for (
unsigned i = 0; i < DIM; i++)
929 outfile << this->interpolated_u_nst(s, i) <<
" ";
933 outfile << this->interpolated_p_nst(s) <<
" ";
936 outfile << this->interpolated_u_adv_diff(s) <<
" " << std::endl;
938 outfile << std::endl;
941 this->write_tecplot_zone_footer(outfile, nplot);
947 FiniteElement::output(file_pt);
951 void output(FILE* file_pt,
const unsigned& n_plot)
953 FiniteElement::output(file_pt, n_plot);
958 const unsigned& Nplot,
959 FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
961 FiniteElement::output_fct(outfile, Nplot, exact_soln_pt);
968 const unsigned& Nplot,
970 FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
972 FiniteElement::output_fct(outfile, Nplot, time, exact_soln_pt);
986 return QElement<DIM, 3>::nvertex_node();
993 return QElement<DIM, 3>::vertex_node_pt(j);
1008 Vector<double>& values)
1011 Vector<double> nst_values;
1014 RefineableQCrouzeixRaviartElement<DIM>::get_interpolated_values(
1018 Vector<double> advection_values;
1021 RefineableQAdvectionDiffusionElement<DIM, 3>::get_interpolated_values(
1022 s, advection_values);
1025 for (
unsigned i = 0; i < DIM; i++)
1027 values.push_back(nst_values[i]);
1031 values.push_back(advection_values[0]);
1040 const Vector<double>& s,
1041 Vector<double>& values)
1044 Vector<double> nst_values;
1047 RefineableQCrouzeixRaviartElement<DIM>::get_interpolated_values(
1051 Vector<double> advection_values;
1054 RefineableQAdvectionDiffusionElement<DIM, 3>::get_interpolated_values(
1055 s, advection_values);
1058 for (
unsigned i = 0; i < DIM; i++)
1060 values.push_back(nst_values[i]);
1064 values.push_back(advection_values[0]);
1073 RefineableQCrouzeixRaviartElement<DIM>::further_setup_hanging_nodes();
1074 RefineableQAdvectionDiffusionElement<DIM,
1083 RefineableQAdvectionDiffusionElement<DIM, 3>::rebuild_from_sons(mesh_pt);
1084 RefineableQCrouzeixRaviartElement<DIM>::rebuild_from_sons(mesh_pt);
1093 RefineableQCrouzeixRaviartElement<DIM>::further_build();
1094 RefineableQAdvectionDiffusionElement<DIM, 3>::further_build();
1100 this->father_element_pt());
1104 this->Ra_pt = cast_father_element_pt->
ra_pt();
1111 return RefineableQCrouzeixRaviartElement<DIM>::nrecovery_order();
1119 RefineableQCrouzeixRaviartElement<DIM>::num_Z2_flux_terms() +
1120 RefineableQAdvectionDiffusionElement<DIM, 3>::num_Z2_flux_terms());
1129 unsigned n_fluid_flux =
1130 RefineableQCrouzeixRaviartElement<DIM>::num_Z2_flux_terms();
1133 RefineableQCrouzeixRaviartElement<DIM>::get_Z2_flux(s, flux);
1136 unsigned n_temp_flux =
1137 RefineableQAdvectionDiffusionElement<DIM, 3>::num_Z2_flux_terms();
1138 Vector<double> temp_flux(n_temp_flux);
1141 RefineableQAdvectionDiffusionElement<DIM, 3>::get_Z2_flux(s, temp_flux);
1144 for (
unsigned i = 0; i < n_temp_flux; i++)
1146 flux[n_fluid_flux + i] = temp_flux[i];
1163 unsigned n_fluid_flux =
1164 RefineableQCrouzeixRaviartElement<DIM>::num_Z2_flux_terms();
1166 unsigned n_temp_flux =
1167 RefineableQAdvectionDiffusionElement<DIM, 3>::num_Z2_flux_terms();
1172 for (
unsigned i = 0; i < n_fluid_flux; i++)
1178 for (
unsigned i = 0; i < n_temp_flux; i++)
1180 flux_index[n_fluid_flux + i] = 1;
1192 FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt,
1197 FiniteElement::compute_error(outfile, exact_soln_pt, time, error, norm);
1206 FiniteElement::SteadyExactSolutionFctPt exact_soln_pt,
1210 FiniteElement::compute_error(outfile, exact_soln_pt, error, norm);
1217 const Vector<double>& s,
1218 const Vector<double>& x,
1219 Vector<double>& wind)
const
1222 this->interpolated_u_nst(s, wind);
1232 const unsigned& ipt,
1233 const Vector<double>& s,
1234 const Vector<double>& x,
1235 Vector<double>& result)
1238 const double interpolated_t = this->interpolated_u_adv_diff(s);
1242 Vector<double> gravity(NavierStokesEquations<DIM>::g());
1245 for (
unsigned i = 0; i < DIM; i++)
1247 result[i] = -gravity[i] * interpolated_t *
ra();
1255 RefineableNavierStokesEquations<DIM>::fill_in_contribution_to_residuals(
1259 RefineableAdvectionDiffusionEquations<
1267 DenseMatrix<double>& jacobian)
1269 #ifdef USE_FD_JACOBIAN_FOR_REFINEABLE_BUOYANT_Q_ELEMENT
1270 FiniteElement::fill_in_contribution_to_jacobian(residuals, jacobian);
1274 RefineableNavierStokesEquations<DIM>::fill_in_contribution_to_jacobian(
1275 residuals, jacobian);
1279 RefineableAdvectionDiffusionEquations<
1290 Vector<double>& residuals,
1291 DenseMatrix<double>& jacobian,
1292 DenseMatrix<double>& mass_matrix)
1295 FiniteElement::fill_in_contribution_to_jacobian_and_mass_matrix(
1296 residuals, jacobian, mass_matrix);
1302 Vector<double>& residuals, DenseMatrix<double>& jacobian)
1309 HangInfo *hang_info_pt = 0, *hang_info2_pt = 0;
1313 unsigned u_nodal_nst[DIM];
1314 for (
unsigned i = 0; i < DIM; i++)
1316 u_nodal_nst[i] = this->u_index_nst(i);
1323 const unsigned n_node = this->nnode();
1326 Shape psif(n_node), testf(n_node);
1327 DShape dpsifdx(n_node, DIM), dtestfdx(n_node, DIM);
1330 const unsigned n_intpt = this->integral_pt()->nweight();
1333 double Ra = this->
ra();
1334 double Pe = this->pe();
1335 Vector<double> gravity = this->g();
1338 int local_eqn = 0, local_unknown = 0;
1341 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
1344 double w = this->integral_pt()->weight(ipt);
1347 double J = this->dshape_and_dtest_eulerian_at_knot_nst(
1348 ipt, psif, dpsifdx, testf, dtestfdx);
1355 Vector<double> interpolated_du_adv_diff_dx(DIM, 0.0);
1358 for (
unsigned l = 0; l < n_node; l++)
1361 double u_value = this->nodal_value(l, u_nodal_adv_diff);
1363 for (
unsigned j = 0; j < DIM; j++)
1365 interpolated_du_adv_diff_dx[j] += u_value * dpsifdx(l, j);
1373 for (
unsigned l = 0; l < n_node; l++)
1378 unsigned n_master = 1;
1379 double hang_weight = 1.0;
1382 bool is_node_hanging = this->node_pt(l)->is_hanging();
1385 if (is_node_hanging)
1387 hang_info_pt = this->node_pt(l)->hanging_pt();
1388 n_master = hang_info_pt->nmaster();
1397 for (
unsigned m = 0; m < n_master; m++)
1400 if (is_node_hanging)
1403 hang_weight = hang_info_pt->master_weight(m);
1416 for (
unsigned i = 0; i < DIM; i++)
1419 if (is_node_hanging)
1422 local_eqn = this->local_hang_eqn(
1423 hang_info_pt->master_node_pt(m), u_nodal_nst[i]);
1428 local_eqn = this->nodal_local_eqn(l, u_nodal_nst[i]);
1435 unsigned n_master2 = 1;
1436 double hang_weight2 = 1.0;
1439 for (
unsigned l2 = 0; l2 < n_node; l2++)
1442 bool is_node2_hanging = this->node_pt(l2)->is_hanging();
1445 if (is_node2_hanging)
1447 hang_info2_pt = this->node_pt(l2)->hanging_pt();
1448 n_master2 = hang_info2_pt->nmaster();
1457 for (
unsigned m2 = 0; m2 < n_master2; m2++)
1459 if (is_node2_hanging)
1462 local_unknown = this->local_hang_eqn(
1463 hang_info2_pt->master_node_pt(m2), u_nodal_adv_diff);
1465 hang_weight2 = hang_info2_pt->master_weight(m2);
1471 this->nodal_local_eqn(l2, u_nodal_adv_diff);
1476 if (local_unknown >= 0)
1479 jacobian(local_eqn, local_unknown) +=
1480 -gravity[i] * psif(l2) * Ra * testf(l) * W *
1481 hang_weight * hang_weight2;
1493 if (is_node_hanging)
1496 local_eqn = this->local_hang_eqn(
1497 hang_info_pt->master_node_pt(m), u_nodal_adv_diff);
1502 local_eqn = this->nodal_local_eqn(l, u_nodal_adv_diff);
1510 unsigned n_master2 = 1;
1511 double hang_weight2 = 1.0;
1514 for (
unsigned l2 = 0; l2 < n_node; l2++)
1517 bool is_node2_hanging = this->node_pt(l2)->is_hanging();
1520 if (is_node2_hanging)
1522 hang_info2_pt = this->node_pt(l2)->hanging_pt();
1523 n_master2 = hang_info2_pt->nmaster();
1532 for (
unsigned m2 = 0; m2 < n_master2; m2++)
1535 if (is_node2_hanging)
1538 hang_weight2 = hang_info2_pt->master_weight(m2);
1548 for (
unsigned i2 = 0; i2 < DIM; i2++)
1551 if (is_node2_hanging)
1554 local_unknown = this->local_hang_eqn(
1555 hang_info2_pt->master_node_pt(m2), u_nodal_nst[i2]);
1561 this->nodal_local_eqn(l2, u_nodal_nst[i2]);
1565 if (local_unknown >= 0)
1568 jacobian(local_eqn, local_unknown) -=
1569 Pe * psif(l2) * interpolated_du_adv_diff_dx[i2] *
1570 testf(l) * W * hang_weight * hang_weight2;
1588 double RefineableBuoyantQCrouzeixRaviartElement<
////////////////////////////////////////////////////////////////////// //////////////////////////////...
double * Ra_pt
Pointer to a private data member, the Rayleigh number.
std::string scalar_name_paraview(const unsigned &i) const
Name of the i-th scalar field. Default implementation returns V1 for the first one,...
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...
static double Default_Physical_Constant_Value
The static default value of the Rayleigh number.
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...
void output(std::ostream &outfile)
Overload the standard output function with the broken default.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function: Broken default.
unsigned nscalar_paraview() const
Number of scalars/fields output by this element. Broken virtual. Needs to be implemented for each new...
void disable_ALE()
Final override for disable ALE.
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....
const double & ra() const
Access function for the Rayleigh number (const version)
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.
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...
double *& ra_pt()
Access function for the pointer to the Rayleigh number.
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 fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Add the element's contribution to its residuals vector, jacobian matrix and mass matrix.
void output(std::ostream &outfile, const unsigned &nplot)
Output function: Output x, y, u, v, p, theta at Nplot^DIM plot points.
void unfix_pressure(const unsigned &p_dof)
Unpin p_dof-th pressure dof.
BuoyantQCrouzeixRaviartElement()
Constructor: call the underlying constructors and initialise the pointer to the Rayleigh number to po...
void output(FILE *file_pt)
C-style output function: Broken default.
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.
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...
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_fct(std::ostream &outfile, const unsigned &Nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output function for an exact solution: 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.
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 enable_ALE()
Final override for enable ALE.
////////////////////////////////////////////////////////////////////// //////////////////////////////...
void rebuild_from_sons(Mesh *&mesh_pt)
Call the rebuild_from_sons functions for each of the constituent multi-physics elements.
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Add the element's contribution to its residuals vector, jacobian matrix and mass matrix.
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 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 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,...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the constituent elements' contribution to the residual vector.
RefineableBuoyantQCrouzeixRaviartElement()
Constructor: call the underlying constructors and initialise the pointer to the Rayleigh number to ad...
unsigned nrecovery_order()
The recovery order is that of the NavierStokes elements.
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 nscalar_paraview() const
Number of scalars/fields output by this element. Broken virtual. Needs to be implemented for each new...
static double Default_Physical_Constant_Value
The static default value of 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.
unsigned ncompound_fluxes()
The number of compound fluxes is two (one for the fluid and one for the temperature)
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element, Call the geometric element's function.
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 output(FILE *file_pt, const unsigned &n_plot)
C-style output function: Broken default.
double * Ra_pt
Pointer to a new physical variable, the Rayleigh number.
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-...
void fill_in_off_diagonal_jacobian_blocks_analytic(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the contribution of the off-diagonal blocks analytically.
void enable_ALE()
Final override for enable ALE.
void disable_ALE()
Final override for disable ALE.
double *& ra_pt()
Access function for the pointer to the Rayleigh number.
unsigned nvertex_node() const
Number of vertex nodes in the element is obtained from the geometric element.
void output(FILE *file_pt)
C-style output function: Broken default.
unsigned ncont_interpolated_values() const
The total number of continously interpolated values is DIM+1 (DIM fluid velocities and one temperatur...
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...
void output_fct(std::ostream &outfile, const unsigned &Nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output function for an exact solution: Broken default.
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.
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 further_setup_hanging_nodes()
The additional hanging node information must be set up for both single-physics elements.
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 is after the fluid...
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 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....
std::string scalar_name_paraview(const unsigned &i) const
Name of the i-th scalar field. Default implementation returns V1 for the first one,...
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...
double Default_Physical_Constant_Value
Default value for physical constants.