42 template<
unsigned DIM>
52 unsigned n_node = nnode();
55 unsigned u_nodal_index = this->u_index_adv_diff();
58 Shape psi(n_node), test(n_node);
59 DShape dpsidx(n_node,DIM), dtestdx(n_node,DIM);
62 unsigned n_intpt = integral_pt()->nweight();
68 double peclet = this->
pe();
71 double peclet_st = this->
pe_st();
75 int local_eqn=0, local_unknown=0;
78 HangInfo *hang_info_pt=0, *hang_info2_pt=0;
84 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
88 for(
unsigned i=0;
i<DIM;
i++) s[
i] = integral_pt()->knot(ipt,
i);
91 double w = integral_pt()->weight(ipt);
95 this->dshape_and_dtest_eulerian_at_knot_adv_diff(ipt,psi,dpsidx,
103 double interpolated_u=0.0;
114 for(
unsigned l=0;l<n_node;l++)
117 double u_value = this->nodal_value(l,u_nodal_index);
118 interpolated_u += u_value*psi(l);
119 dudt += this->du_dt_adv_diff(l)*psi(l);
121 for(
unsigned j=0;j<DIM;j++)
123 interpolated_x[j] += nodal_position(l,j)*psi(l);
124 interpolated_dudx[j] += u_value*dpsidx(l,j);
129 if (!ALE_is_disabled_flag)
131 for(
unsigned l=0;l<n_node;l++)
134 for(
unsigned j=0;j<DIM;j++)
136 mesh_velocity[j] += dnodal_position_dt(l,j)*psi(l);
144 this->get_source_adv_diff(ipt,interpolated_x,source);
150 this->get_wind_adv_diff(ipt,s,interpolated_x,wind);
156 for(
unsigned l=0;l<n_node;l++)
160 unsigned n_master=1;
double hang_weight=1.0;
162 bool is_node_hanging = this->node_pt(l)->is_hanging();
167 hang_info_pt = this->node_pt(l)->hanging_pt();
168 n_master = hang_info_pt->
nmaster();
177 for(
unsigned m=0;m<n_master;m++)
193 local_eqn = this->nodal_local_eqn(l,u_nodal_index);
202 residuals[local_eqn] -=
203 (peclet_st*dudt + source)*test(l)*W*hang_weight;
206 for(
unsigned k=0;k<DIM;k++)
209 double tmp = peclet*wind[k];
211 if(!ALE_is_disabled_flag) tmp -= peclet_st*mesh_velocity[k];
213 residuals[local_eqn] -= interpolated_dudx[k]*
214 (tmp*test(l) + dtestdx(l,k))*W*hang_weight;
222 unsigned n_master2=1;
double hang_weight2=1.0;
224 for(
unsigned l2=0;l2<n_node;l2++)
227 bool is_node2_hanging = this->node_pt(l2)->is_hanging();
231 hang_info2_pt = this->node_pt(l2)->hanging_pt();
232 n_master2 = hang_info2_pt->nmaster();
241 for(
unsigned m2=0;m2<n_master2;m2++)
249 this->local_hang_eqn(hang_info2_pt->master_node_pt(m2),
252 hang_weight2 = hang_info2_pt->master_weight(m2);
258 local_unknown = this->nodal_local_eqn(l2,u_nodal_index);
264 if(local_unknown >= 0)
268 jacobian(local_eqn,local_unknown)
269 -= peclet_st*test(l)*psi(l2)*
270 this->node_pt(l2)->time_stepper_pt()->weight(1,0)
271 *W*hang_weight*hang_weight2;
276 mass_matrix(local_eqn,local_unknown) +=
277 peclet_st*test(l)*psi(l2)*W*hang_weight*hang_weight2;
281 for(
unsigned k=0;k<DIM;k++)
284 double tmp = peclet*wind[k];
286 if(!ALE_is_disabled_flag)
287 {tmp -= peclet_st*mesh_velocity[k];}
289 jacobian(local_eqn,local_unknown) -=
290 dpsidx(l2,k)*(tmp*test(l) + dtestdx(l,k))*W*
291 hang_weight*hang_weight2;
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when time-derivatives are computed...
const double & pe() const
Peclet number.
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
unsigned nmaster() const
Return the number of master nodes.
void fill_in_generic_residual_contribution_adv_diff(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Add the element's contribution to the elemental residual vector and/or Jacobian matrix flag=1: comput...
const double & pe_st() const
Peclet number multiplied by Strouhal number.
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
Class that contains data for hanging nodes.
Refineable version of QAdvectionDiffusionElement. Inherit from the standard QAdvectionDiffusionElemen...