54 const unsigned n_node =
nnode();
57 const unsigned u_nodal_index = u_index_cons_axisym_adv_diff();
60 Shape psi(n_node), test(n_node);
61 DShape dpsidx(n_node, 2), dtestdx(n_node, 2);
70 const double peclet =
pe();
73 const double peclet_st =
pe_st();
77 int local_eqn = 0, local_unknown = 0;
80 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
90 ipt, psi, dpsidx, test, dtestdx);
97 double interpolated_u = 0.0;
107 for (
unsigned l = 0; l < n_node; l++)
111 interpolated_u += u_value * psi(l);
114 for (
unsigned j = 0; j < 2; j++)
117 interpolated_dudx[j] += u_value * dpsidx(l, j);
124 for (
unsigned l = 0; l < n_node; l++)
126 for (
unsigned j = 0; j < 2; j++)
162 for (
unsigned l = 0; l < n_node; l++)
171 residuals[local_eqn] -= (peclet_st * dudt + source) * r * test(l) *
W;
175 for (
unsigned k = 0; k < 2; k++)
179 double tmp = peclet *
wind[k];
183 tmp -= peclet_st * mesh_velocity[k];
185 tmp *= interpolated_dudx[k];
189 double tmp2 = -conserved_wind[k] * interpolated_u;
191 for (
unsigned j = 0; j < 2; j++)
193 tmp2 +=
D(k, j) * interpolated_dudx[j];
196 residuals[local_eqn] -=
197 (tmp * test(l) + tmp2 * dtestdx(l, k)) * r *
W;
205 for (
unsigned l2 = 0; l2 < n_node; l2++)
211 if (local_unknown >= 0)
214 jacobian(local_eqn, local_unknown) -=
215 peclet_st * test(l) * psi(l2) *
221 mass_matrix(local_eqn, local_unknown) +=
222 peclet_st * test(l) * psi(l2) * r *
W;
226 for (
unsigned k = 0; k < 2; k++)
229 double tmp = -peclet *
wind[k];
232 tmp -= peclet_st * mesh_velocity[k];
234 tmp *= dpsidx(l2, k);
236 double tmp2 = -conserved_wind[k] * psi(l2);
238 for (
unsigned j = 0; j < 2; j++)
240 tmp2 +=
D(k, j) * dpsidx(l2, j);
244 jacobian(local_eqn, local_unknown) -=
245 (tmp * test(l) + tmp2 * dtestdx(l, k)) * r *
W;
291 std::ostream& outfile,
const unsigned& nplot)
299 const unsigned n_node = this->
nnode();
305 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
314 for (
unsigned i = 0;
i < 2;
i++)
316 outfile << x[
i] <<
" ";
342 for (
unsigned i = 0;
i < 3;
i++)
344 outfile <<
wind[
i] <<
" ";
346 outfile << std::endl;
362 FILE* file_pt,
const unsigned& nplot)
372 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
377 for (
unsigned i = 0;
i < 2;
i++)
398 std::ostream& outfile,
399 const unsigned& nplot,
416 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
425 (*exact_soln_pt)(x, exact_soln);
428 for (
unsigned i = 0;
i < 2;
i++)
430 outfile << x[
i] <<
" ";
432 outfile << exact_soln[0] << std::endl;
448 std::ostream& outfile,
464 unsigned n_node =
nnode();
472 outfile <<
"ZONE" << std::endl;
478 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
481 for (
unsigned i = 0;
i < 2;
i++)
502 (*exact_soln_pt)(x, exact_soln);
505 for (
unsigned i = 0;
i < 2;
i++)
507 outfile << x[
i] <<
" ";
509 outfile << exact_soln[0] <<
" " << exact_soln[0] - u_fe << std::endl;
512 norm += exact_soln[0] * exact_soln[0] * x[0] *
W;
513 error += (exact_soln[0] - u_fe) * (exact_soln[0] - u_fe) * x[0] *
W;
527 const unsigned n_node = this->
nnode();
530 const unsigned u_nodal_index = this->u_index_cons_axisym_adv_diff();
539 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
548 double interpolated_u = 0.0;
549 for (
unsigned l = 0; l < n_node; l++)
551 interpolated_u += this->
nodal_value(l, u_nodal_index) * psi(l);
556 for (
unsigned l = 0; l < n_node; l++)
565 sum += interpolated_u * r * w * J;
576 template<
unsigned NNODE_1D>
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.
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s.
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 std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
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.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction")
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 ...
virtual double J_eulerian_at_knot(const unsigned &ipt) const
Return the Jacobian of the mapping from local to global coordinates at the ipt-th integration point.
double raw_dnodal_position_dt(const unsigned &n, const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt at local node n. Do not use the hanging node repre...
double raw_nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n but do NOT take hanging nodes into account.
double raw_nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. Do not use the hanging node representation....
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Add tecplot zone "footer" to output stream (when plotting nplot points in each "coordinate direction"...
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Return the geometric shape function at the ipt-th integration point.
virtual unsigned self_test()
Self-test: Check inversion of element & do self-test for GeneralisedElement. Return 0 if OK.
const double & pe_st() const
Peclet number multiplied by Strouhal number.
double interpolated_u_cons_axisym_adv_diff(const Vector< double > &s) const
Return FE representation of function value u(s) at local coordinate s.
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...
static double Default_peclet_number
Static default value for the Peclet number.
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...
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact soln: r,z,u_exact at nplot^2 plot points.
double integrate_u()
Integrate the concentration over the element.
virtual 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 its residual vector only (if flag=and/or element Jacobian matrix.
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
unsigned self_test()
Self-test: Return 0 for OK.
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Get error against and norm of exact solution.
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.
void output(std::ostream &outfile)
Output with default number of plot points.
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.
//////////////////////////////////////////////////////////////////////// ////////////////////////////...
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.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...