60 const unsigned n_node =
nnode();
66 Shape psi(n_node), test(n_node);
67 DShape dpsidx(n_node,2), dtestdx(n_node,2);
76 const double scaled_peclet =
pe();
79 const double scaled_peclet_st =
pe_st();
83 int local_eqn=0, local_unknown=0;
86 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
98 ipt,psi,dpsidx,test,dtestdx);
105 double interpolated_u = 0.0;
114 for(
unsigned l=0;l<n_node;l++)
118 interpolated_u += u_value*psi(l);
121 for(
unsigned j=0;j<2;j++)
124 interpolated_dudx[j] += u_value*dpsidx(l,j);
130 for(
unsigned l=0;l<n_node;l++)
132 for(
unsigned j=0;j<2;j++)
152 double diff = this->
d();
155 double r = interpolated_x[0];
162 for(
unsigned l=0;l<n_node;l++)
171 residuals[local_eqn] -= (scaled_peclet_st*dudt + source)*r*test(l)*
W;
174 residuals[local_eqn] -=
176 (interpolated_dudx[0]*
177 (scaled_peclet*wind[0]*test(l) + diff*dtestdx(l,0)) +
179 (interpolated_dudx[1]*
180 (scaled_peclet*wind[1]*test(l) + diff*dtestdx(l,1))))*r*
W;
184 residuals[local_eqn] += scaled_peclet_st*(
185 mesh_velocity[0]*interpolated_dudx[0] +
186 mesh_velocity[1]*interpolated_dudx[1])*test(l)*r*
W;
194 for(
unsigned l2=0;l2<n_node;l2++)
200 if(local_unknown >= 0)
203 jacobian(local_eqn,local_unknown)
204 -= scaled_peclet_st*test(l)*psi(l2)*
210 mass_matrix(local_eqn,local_unknown)
211 += scaled_peclet_st*test(l)*psi(l2)*r*
W;
215 jacobian(local_eqn,local_unknown) -=
218 (scaled_peclet*wind[0]*test(l) + diff*dtestdx(l,0)) +
221 (scaled_peclet*wind[1]*test(l) + diff*dtestdx(l,1))))*r*W;
225 jacobian(local_eqn,local_unknown)
226 += scaled_peclet_st*(
227 mesh_velocity[0]*dpsidx(l2,0) +
228 mesh_velocity[1]*dpsidx(l2,1))*test(l)*r*
W;
280 const unsigned &nplot)
290 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
299 for(
unsigned i=0;
i<2;
i++)
301 outfile << x[
i] <<
" ";
312 for(
unsigned i=0;
i<3;
i++)
314 outfile << wind[
i] <<
" ";
316 outfile << std::endl;
335 const unsigned &nplot)
345 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
351 for(
unsigned i=0;
i<2;
i++)
375 std::ostream &outfile,
376 const unsigned &nplot,
394 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
404 (*exact_soln_pt)(x,exact_soln);
407 for(
unsigned i=0;
i<2;
i++)
409 outfile << x[
i] <<
" ";
411 outfile << exact_soln[0] << std::endl;
429 std::ostream &outfile,
446 unsigned n_node =
nnode();
454 outfile <<
"ZONE" << std::endl;
460 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
464 for(
unsigned i=0;
i<2;
i++)
485 (*exact_soln_pt)(x,exact_soln);
488 for(
unsigned i=0;
i<2;
i++)
490 outfile << x[
i] <<
" ";
492 outfile << exact_soln[0] <<
" " << exact_soln[0]-u_fe << std::endl;
495 norm+=exact_soln[0]*exact_soln[0]*x[0]*
W;
496 error+=(exact_soln[0]-u_fe)*(exact_soln[0]-u_fe)*x[0]*
W;
506 template<
unsigned NNODE_1D>
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction") ...
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.
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_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...
bool ALE_is_disabled
Boolean flag to indicate whether AlE formulation is disable.
virtual unsigned self_test()
Self-test: Check inversion of element & do self-test for GeneralisedElement. Return 0 if OK...
virtual double dshape_and_dtest_eulerian_at_knot_axi_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 ...
const double & pe_st() const
Peclet number multiplied by Strouhal number.
unsigned self_test()
Self-test: Return 0 for OK.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
virtual void get_wind_axi_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...
virtual void fill_in_generic_residual_contribution_axi_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...
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction") ...
QAxisymAdvectionDiffusionElement elements are linear/quadrilateral/brick-shaped Axisymmetric Advectio...
void output(std::ostream &outfile)
Output with default number of plot points.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as ...
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)
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
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"...
const double & pe() const
Peclet number.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
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. NOTE: Moved to cc file because of a possible compiler bug in gcc (yes, really!). The move to the cc file avoids inlining which appears to cause problems (only) when compiled with gcc and -O3; offensive "illegal read" is in optimised-out section of code and data that is allegedly illegal is readily readable (by other means) just before this function is called so I can't really see how we could possibly be responsible for this...
static double Default_peclet_number
Static default value for the Peclet number.
double du_dt_axi_adv_diff(const unsigned &n) const
du/dt at local node n.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
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 interpolated_u_axi_adv_diff(const Vector< double > &s) const
Return FE representation of function value u(s) at local coordinate s.
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...
virtual unsigned u_index_axi_adv_diff() const
Broken assignment operator.
static double Default_diffusion_parameter
Static default value for the Peclet number.
virtual void get_source_axi_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...
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 double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s...
const double & d() const
Peclet number multiplied by Strouhal number.
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...