44 unsigned n_node =
nnode();
47 unsigned u_nodal_index = this->u_index_cons_axisym_adv_diff();
50 Shape psi(n_node), test(n_node);
51 DShape dpsidx(n_node, 2), dtestdx(n_node, 2);
60 double peclet = this->
pe();
63 double peclet_st = this->
pe_st();
67 int local_eqn = 0, local_unknown = 0;
70 HangInfo *hang_info_pt = 0, *hang_info2_pt = 0;
76 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
86 ipt, psi, dpsidx, test, dtestdx);
93 double interpolated_u = 0.0;
104 for (
unsigned l = 0; l < n_node; l++)
107 double u_value = this->
nodal_value(l, u_nodal_index);
108 interpolated_u += u_value * psi(l);
111 for (
unsigned j = 0; j < 2; j++)
114 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 < 2; j++)
158 for (
unsigned l = 0; l < n_node; l++)
162 unsigned n_master = 1;
163 double hang_weight = 1.0;
171 n_master = hang_info_pt->
nmaster();
180 for (
unsigned m = 0; m < n_master; m++)
205 residuals[local_eqn] -=
206 (peclet_st * dudt + source) * test(l) * r *
W * hang_weight;
209 for (
unsigned k = 0; k < 2; k++)
212 double tmp = peclet *
wind[k];
214 if (!ALE_is_disabled_flag)
216 tmp -= peclet_st * mesh_velocity[k];
218 tmp *= interpolated_dudx[k];
222 double tmp2 = -conserved_wind[k] * interpolated_u;
224 for (
unsigned j = 0; j < 2; j++)
226 tmp2 +=
D(k, j) * interpolated_dudx[j];
229 residuals[local_eqn] -=
230 (tmp * test(l) + tmp2 * dtestdx(l, k)) * r *
W * hang_weight;
238 unsigned n_master2 = 1;
239 double hang_weight2 = 1.0;
241 for (
unsigned l2 = 0; l2 < n_node; l2++)
246 if (is_node2_hanging)
249 n_master2 = hang_info2_pt->
nmaster();
258 for (
unsigned m2 = 0; m2 < n_master2; m2++)
262 if (is_node2_hanging)
266 hang_info2_pt->master_node_pt(m2), u_nodal_index);
268 hang_weight2 = hang_info2_pt->master_weight(m2);
280 if (local_unknown >= 0)
284 jacobian(local_eqn, local_unknown) -=
285 peclet_st * test(l) * psi(l2) *
287 W * hang_weight * hang_weight2;
292 mass_matrix(local_eqn, local_unknown) +=
293 peclet_st * test(l) * psi(l2) * r *
W * hang_weight *
298 for (
unsigned k = 0; k < 2; k++)
301 double tmp = peclet *
wind[k];
302 if (!ALE_is_disabled_flag)
304 tmp -= peclet_st * mesh_velocity[k];
306 tmp *= dpsidx(l2, k);
308 double tmp2 = -conserved_wind[k] * psi(l2);
310 for (
unsigned j = 0; j < 2; j++)
312 tmp2 +=
D(k, j) * dpsidx(l2, j);
316 jacobian(local_eqn, local_unknown) -=
317 (tmp * test(l) + tmp2 * dtestdx(l, k)) *
W * r *
318 hang_weight * hang_weight2;
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Return the local equation number corresponding to the i-th value at the n-th local node.
unsigned nnode() const
Return the number of nodes.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
double nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. If the node is hanging, the appropriate interpolation is ...
double dnodal_position_dt(const unsigned &n, const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt at local node n.
const double & pe_st() const
Peclet number multiplied by Strouhal number.
double du_dt_cons_axisym_adv_diff(const unsigned &n) const
du/dt at local node n. Uses suitably interpolated value for hanging nodes.
virtual void get_conserved_wind_cons_axisym_adv_diff(const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &wind) const
Get additional (conservative) wind at (Eulerian) position x and/or local coordinate s....
virtual double dshape_and_dtest_eulerian_at_knot_cons_axisym_adv_diff(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Shape/test functions and derivs w.r.t. to global coords at integration point ipt; return Jacobian of ...
virtual void get_diff_cons_axisym_adv_diff(const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, DenseMatrix< double > &D) const
Get diffusivity tensor at (Eulerian) position x and/or local coordinate s. This function is virtual t...
virtual void get_wind_cons_axisym_adv_diff(const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &wind) const
Get wind at (Eulerian) position x and/or local coordinate s. This function is virtual to allow overlo...
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when time-derivatives are computed....
Function pointer to wind function Vector< double > & wind
virtual void get_source_cons_axisym_adv_diff(const unsigned &ipt, const Vector< double > &x, double &source) const
Get source term at (Eulerian) position x. This function is virtual to allow overloading in multi-phys...
const double & pe() const
Peclet number.
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.
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
bool is_hanging() const
Test whether the node is geometrically hanging.
int local_hang_eqn(Node *const &node_pt, const unsigned &i)
Access function that returns the local equation number for the hanging node variables (values stored ...
void fill_in_generic_residual_contribution_cons_axisym_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...
Refineable version of QGeneralisedAxisymAdvectionDiffusionElement. Inherit from the standard QGeneral...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...