52 const unsigned n_node =
nnode();
58 Shape psi(n_node), test(n_node);
59 DShape dpsidx(n_node,2), dtestdx(n_node,2);
68 const double scaled_peclet = this->
pe();
71 const double scaled_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++)
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);
121 for(
unsigned j=0;j<2;j++)
124 interpolated_dudx[j] += u_value*dpsidx(l,j);
153 double r = interpolated_x[0];
155 double sin_th = sin(interpolated_x[1]);
157 double dS = r*r*sin_th;
164 for(
unsigned l=0;l<n_node;l++)
168 unsigned n_master=1;
double hang_weight=1.0;
176 n_master = hang_info_pt->
nmaster();
185 for(
unsigned m=0;m<n_master;m++)
210 residuals[local_eqn] -=
211 (scaled_peclet_st*dudt + source)*dS*test(l)*W*hang_weight;
214 residuals[local_eqn] -=
216 (dS*interpolated_dudx[0]*
217 (scaled_peclet*wind[0]*test(l) + dtestdx(l,0)) +
219 (sin_th*interpolated_dudx[1]*
220 (r*scaled_peclet*wind[1]*test(l) + dtestdx(l,1))))*W*hang_weight;
227 unsigned n_master2=1;
double hang_weight2=1.0;
229 for(
unsigned l2=0;l2<n_node;l2++)
237 n_master2 = hang_info2_pt->
nmaster();
246 for(
unsigned m2=0;m2<n_master2;m2++)
257 hang_weight2 = hang_info2_pt->master_weight(m2);
269 if(local_unknown >= 0)
273 jacobian(local_eqn,local_unknown)
274 -= scaled_peclet_st*test(l)*psi(l2)*
276 *dS*W*hang_weight*hang_weight2;
281 mass_matrix(local_eqn,local_unknown) +=
282 scaled_peclet_st*test(l)*psi(l2)*dS*
283 W*hang_weight*hang_weight2;
288 jacobian(local_eqn,local_unknown) -=
291 (scaled_peclet*wind[0]*test(l) + dtestdx(l,0)) +
293 (sin_th*dpsidx(l2,1)*
294 (r*scaled_peclet*wind[1]*test(l) + dtestdx(l,1))))*W*
295 hang_weight*hang_weight2;
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 ...
const double & pe() const
Peclet number.
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 ...
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
virtual void get_source_spherical_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...
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
virtual void get_wind_spherical_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...
unsigned nmaster() const
Return the number of master nodes.
bool is_hanging() const
Test whether the node is geometrically hanging.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
double du_dt_spherical_adv_diff(const unsigned &n) const
du/dt at local node n.
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
void fill_in_generic_residual_contribution_spherical_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 QSphericalAdvectionDiffusionElement. Inherit from the standard QSphericalAdvect...
virtual double dshape_and_dtest_eulerian_at_knot_spherical_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 ...
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
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...
Class that contains data for hanging nodes.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
const double & pe_st() const
Peclet number multiplied by Strouhal number.
unsigned nnode() const
Return the number of nodes.
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
virtual unsigned u_index_spherical_adv_diff() const
Return the index at which the unknown value is stored. The default value, 0, is appropriate for singl...
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...