36 using namespace oomph;
45 template<
unsigned DIM>
76 this->set_ninteraction(2);
80 this->ignore_external_geometric_data();
84 const double &
ra_t()
const {
return *Ra_T_pt;}
91 const double &
ra_s()
const {
return *Ra_S_pt;}
106 cast_father_element_pt
109 this->father_element_pt());
113 this->Ra_T_pt = cast_father_element_pt->
ra_t_pt();
115 this->Ra_S_pt = cast_father_element_pt->
ra_s_pt();
120 void get_body_force_nst(
const double& time,
const unsigned& ipt,
126 void get_dbody_force_nst_dexternal_element_data(
144 #ifdef USE_FD_JACOBIAN_FOR_MY_NAVIER_STOKES_ELEMENT
152 this->fill_in_off_diagonal_block_analytic(residuals,jacobian);
167 residuals,jacobian,mass_matrix);
177 unsigned u_nodal_nst[
DIM];
178 for(
unsigned i=0;
i<
DIM;
i++)
179 {u_nodal_nst[
i] = this->u_index_nst(
i);}
182 const unsigned n_node = this->nnode();
185 Shape psif(n_node), testf(n_node);
189 const unsigned n_intpt = this->integral_pt()->nweight();
192 int local_eqn=0, local_unknown=0;
198 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
201 double w = this->integral_pt()->weight(ipt);
205 this->dshape_and_dtest_eulerian_at_knot_nst(ipt,psif,dpsifdx,
220 this->get_dbody_force_nst_dexternal_element_data(
221 ipt,dbody_dexternal_element_data,
222 global_eqn_number_of_external_element_data);
224 const unsigned n_external_element_data =
225 global_eqn_number_of_external_element_data.size();
228 for(
unsigned l=0;l<n_node;l++)
233 unsigned n_master = 1;
234 double hang_weight = 1.0;
237 bool is_node_hanging = this->node_pt(l)->is_hanging();
242 hang_info_pt = this->node_pt(l)->hanging_pt();
243 n_master = hang_info_pt->
nmaster();
252 for(
unsigned m=0;
m<n_master;
m++)
268 for(
unsigned i=0;
i<
DIM;
i++)
280 local_eqn = this->nodal_local_eqn(l,u_nodal_nst[
i]);
286 for(
unsigned l2=0;l2<n_external_element_data;l2++)
291 this->local_eqn_number(
292 global_eqn_number_of_external_element_data[l2]);
293 if(local_unknown >= 0)
296 jacobian(local_eqn,local_unknown)
297 += dbody_dexternal_element_data(
i,l2)*testf(l)*hang_weight*
W;
314 template<
unsigned DIM>
327 this->set_ninteraction(1);
331 this->ignore_external_geometric_data();
344 const unsigned& ipt,
const unsigned &
i,
360 #ifdef USE_FD_JACOBIAN_FOR_MY_ADVECTION_DIFFUSION_ELEMENT
368 this->fill_in_off_diagonal_block_analytic(residuals,jacobian);
382 residuals,jacobian,mass_matrix);
393 const unsigned u_nodal_adv_diff = this->u_index_adv_diff();
396 const unsigned n_node = this->nnode();
403 const unsigned n_intpt = this->integral_pt()->nweight();
406 int local_eqn=0, local_unknown=0;
412 const double peclet = this->
pe();
415 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
418 double w = this->integral_pt()->weight(ipt);
422 this->dshape_and_dtest_eulerian_at_knot_adv_diff(ipt,psi,dpsidx,
431 for(
unsigned l=0;l<n_node;l++)
434 for(
unsigned j=0;
j<
DIM;
j++)
436 interpolated_dudx[
j] +=
437 this->nodal_value(l,u_nodal_adv_diff)*dpsidx(l,
j);
449 for(
unsigned i2=0;i2<
DIM;i2++)
452 this->get_dwind_adv_diff_dexternal_element_data(
453 ipt,i2,dwind_dexternal_element_data,
454 global_eqn_number_of_external_element_data);
458 const unsigned n_external_element_data =
459 global_eqn_number_of_external_element_data.size();
462 for(
unsigned l=0;l<n_node;l++)
466 unsigned n_master = 1;
467 double hang_weight = 1.0;
470 bool is_node_hanging = this->node_pt(l)->is_hanging();
475 hang_info_pt = this->node_pt(l)->hanging_pt();
476 n_master = hang_info_pt->
nmaster();
485 for(
unsigned m=0;
m<n_master;
m++)
509 local_eqn = this->nodal_local_eqn(l,u_nodal_adv_diff);
515 for(
unsigned l2=0;l2<n_external_element_data;l2++)
520 this->local_eqn_number(
521 global_eqn_number_of_external_element_data[l2]);
522 if(local_unknown >= 0)
525 jacobian(local_eqn,local_unknown)
526 -= peclet*dwind_dexternal_element_data[l2]*
527 interpolated_dudx[i2]*
test(l)*hang_weight*
W;
543 template<
unsigned DIM>
550 const unsigned t_interaction=0;
552 const unsigned c_interaction=1;
555 const double interpolated_t =
557 (external_element_pt(t_interaction,ipt))->
558 interpolated_u_adv_diff(external_element_local_coord(t_interaction,ipt));
563 (external_element_pt(c_interaction,ipt))->
564 interpolated_u_adv_diff(external_element_local_coord(c_interaction,ipt));
567 const double buoyancy = interpolated_t*ra_t() + interpolated_c*ra_s();
575 for (
unsigned i=0;
i<
DIM;
i++)
586 template<
unsigned DIM>
593 unsigned t_interaction=0;
595 unsigned c_interaction = 1;
603 (external_element_pt(t_interaction,ipt))->
604 dinterpolated_u_adv_diff_ddata(
605 external_element_local_coord(t_interaction,ipt),du_temp_ddata,
606 global_eqn_number_temp);
614 (external_element_pt(c_interaction,ipt))->
615 dinterpolated_u_adv_diff_ddata(
616 external_element_local_coord(c_interaction,ipt),du_conc_ddata,
617 global_eqn_number_conc);
626 unsigned n_external_temp_data = du_temp_ddata.size();
627 unsigned n_external_conc_data = du_conc_ddata.
size();
630 result.
resize(
DIM,n_external_temp_data+n_external_conc_data);
633 for (
unsigned i=0;
i<
DIM;
i++)
636 for(
unsigned n=0;
n<n_external_temp_data;
n++)
643 for(
unsigned n=0;
n<n_external_conc_data;
n++)
645 result(
i,n_external_temp_data+
n) = -
gravity[
i]*du_conc_ddata[
n]*ra_s();
650 global_eqn_number.resize(n_external_temp_data+n_external_conc_data);
652 for(
unsigned n=0;
n<n_external_temp_data;
n++)
654 global_eqn_number[
n] = global_eqn_number_temp[
n];
657 for(
unsigned n=0;
n<n_external_conc_data;
n++)
659 global_eqn_number[n_external_temp_data+
n] = global_eqn_number_conc[
n];
673 template<
unsigned DIM>
680 unsigned interaction=0;
685 (external_element_pt(interaction,ipt));
689 (external_element_local_coord(interaction,ipt),wind);
698 template<
unsigned DIM>
706 unsigned interaction=0;
711 (external_element_pt(interaction,ipt));
717 external_element_local_coord(interaction,ipt),
i,result,
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 get_wind_adv_diff(const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &wind) const
void get_dwind_adv_diff_dexternal_element_data(const unsigned &ipt, const unsigned &i, Vector< double > &result, Vector< unsigned > &global_eqn_number)
RefineableQAdvectionDiffusionElementWithExternalElement()
Constructor: call the underlying constructors.
Definition: db_nst_external_elements.h:323
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Definition: db_nst_external_elements.h:374
void fill_in_off_diagonal_block_analytic(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: db_nst_external_elements.h:388
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: db_nst_external_elements.h:357
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Just call the fill_in_residuals for AdvDiff.
Definition: db_nst_external_elements.h:349
Definition: db_nst_external_elements.h:49
void get_body_force_nst(const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &result)
Definition: db_nst_external_elements.h:546
double *& ra_t_pt()
Access function for the pointer to the Rayleigh number.
Definition: db_nst_external_elements.h:87
void fill_in_off_diagonal_block_analytic(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: db_nst_external_elements.h:172
double *& ra_s_pt()
Access function for the pointer to the solutal Rayleigh number.
Definition: db_nst_external_elements.h:94
double * Ra_T_pt
Pointer to a private data member, the thermal Rayleigh number.
Definition: db_nst_external_elements.h:54
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: db_nst_external_elements.h:141
void get_dbody_force_nst_dexternal_element_data(const unsigned &ipt, DenseMatrix< double > &result, Vector< unsigned > &global_eqn_number)
external unknowns
Definition: db_nst_external_elements.h:588
const double & ra_t() const
Access function for the Rayleigh number (const version)
Definition: db_nst_external_elements.h:84
RefineableQCrouzeixRaviartElementWithTwoExternalElement()
Definition: db_nst_external_elements.h:67
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Definition: db_nst_external_elements.h:159
double * Ra_S_pt
Pointer to the private data member, the solutal Rayleigh number.
Definition: db_nst_external_elements.h:57
static double Default_Physical_Constant_Value
The static default value of the Rayleigh number.
Definition: db_nst_external_elements.h:60
const double & ra_s() const
Access function for the solutal Rayleigh number (const version)
Definition: db_nst_external_elements.h:91
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the constituent elements' contribution to the residual vector.
Definition: db_nst_external_elements.h:132
void further_build()
Definition: db_nst_external_elements.h:99
Definition: advection_diffusion_elements.h:52
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
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
double size() const
Definition: elements.cc:4290
virtual void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Definition: elements.cc:1322
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
virtual void dinterpolated_u_nst_ddata(const Vector< double > &s, const unsigned &i, Vector< double > &du_ddata, Vector< unsigned > &global_eqn_number)
Definition: navier_stokes_elements.h:1587
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: navier_stokes_elements.h:1273
Definition: refineable_advection_diffusion_elements.h:355
Refineable version of Crouzeix Raviart elements. Generic class definitions.
Definition: refineable_navier_stokes_elements.h:1109
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
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