37 template<
unsigned DIM>
43 unsigned n_node = nnode();
46 double time = node_pt(0)->time_stepper_pt()->time_pt()->time();
49 unsigned u_nodal_index = this->u_index_ust_heat();
52 Shape psi(n_node), test(n_node);
53 DShape dpsidx(n_node, DIM), dtestdx(n_node, DIM);
56 unsigned n_intpt = integral_pt()->nweight();
62 double alpha_local = this->alpha();
63 double beta_local = this->beta();
67 int local_eqn = 0, local_unknown = 0;
70 HangInfo *hang_info_pt = 0, *hang_info2_pt = 0;
73 bool ALE_is_disabled_flag = this->ALE_is_disabled;
76 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
79 for (
unsigned i = 0;
i < DIM;
i++)
s[
i] = integral_pt()->knot(ipt,
i);
82 double w = integral_pt()->weight(ipt);
85 double J = this->dshape_and_dtest_eulerian_at_knot_ust_heat(
86 ipt, psi, dpsidx, test, dtestdx);
93 double interpolated_u = 0.0;
105 for (
unsigned l = 0; l < n_node; l++)
108 double u_value = this->nodal_value(l, u_nodal_index);
109 interpolated_u += u_value * psi(l);
110 dudt += this->du_dt_ust_heat(l) * psi(l);
112 for (
unsigned j = 0; j < DIM; j++)
114 interpolated_x[j] += nodal_position(l, j) * psi(l);
115 interpolated_dudx[j] += u_value * dpsidx(l, j);
119 if (!ALE_is_disabled_flag)
121 for (
unsigned l = 0; l < n_node; l++)
124 for (
unsigned j = 0; j < DIM; j++)
126 mesh_velocity[j] += dnodal_position_dt(l, j) * psi(l);
133 this->get_source_ust_heat(time, ipt, interpolated_x, source);
141 for (
unsigned l = 0; l < n_node; l++)
145 unsigned n_master = 1;
146 double hang_weight = 1.0;
148 bool is_node_hanging = this->node_pt(l)->is_hanging();
154 hang_info_pt = this->node_pt(l)->hanging_pt();
155 n_master = hang_info_pt->
nmaster();
164 for (
unsigned m = 0; m < n_master; m++)
180 local_eqn = this->nodal_local_eqn(l, u_nodal_index);
189 residuals[local_eqn] +=
190 (alpha_local * dudt + source) * test(l) *
W * hang_weight;
193 for (
unsigned k = 0; k < DIM; k++)
195 double tmp = dtestdx(l, k) * beta_local;
196 if (!ALE_is_disabled_flag)
197 tmp -= alpha_local * mesh_velocity[k] * test(l);
198 residuals[local_eqn] +=
199 interpolated_dudx[k] * tmp *
W * hang_weight;
207 unsigned n_master2 = 1;
208 double hang_weight2 = 1.0;
210 for (
unsigned l2 = 0; l2 < n_node; l2++)
213 bool is_node2_hanging = this->node_pt(l2)->is_hanging();
215 if (is_node2_hanging)
217 hang_info2_pt = this->node_pt(l2)->hanging_pt();
218 n_master2 = hang_info2_pt->nmaster();
227 for (
unsigned m2 = 0; m2 < n_master2; m2++)
231 if (is_node2_hanging)
234 local_unknown = this->local_hang_eqn(
235 hang_info2_pt->master_node_pt(m2), u_nodal_index);
237 hang_weight2 = hang_info2_pt->master_weight(m2);
243 local_unknown = this->nodal_local_eqn(l2, u_nodal_index);
249 if (local_unknown >= 0)
253 jacobian(local_eqn, local_unknown) +=
254 alpha_local * test(l) * psi(l2) *
255 this->node_pt(l2)->time_stepper_pt()->weight(1, 0) *
W *
256 hang_weight * hang_weight2;
259 for (
unsigned k = 0; k < DIM; k++)
261 double tmp = dtestdx(l, k) * beta_local;
262 if (!ALE_is_disabled_flag)
264 tmp -= alpha_local * mesh_velocity[k] * test(l);
266 jacobian(local_eqn, local_unknown) +=
267 dpsidx(l2, k) * tmp *
W * hang_weight * hang_weight2;
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
Class that contains data for hanging nodes.
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
unsigned nmaster() const
Return the number of master nodes.
Refineable version of 2D QUnsteadyHeatElement elements.
void fill_in_generic_residual_contribution_ust_heat(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Add element's contribution to elemental residual vector and/or Jacobian matrix flag=1: compute both f...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...