40 template<
unsigned NNODE_1D>
60 const unsigned n_node =
nnode();
63 Shape psi(n_node), test(n_node);
64 DShape dpsidr(n_node,1), dtestdr(n_node,1);
81 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
91 double interpolated_r = 0;
93 double interpolated_w = 0;
94 double interpolated_laplacian_w = 0;
95 double interpolated_phi = 0;
96 double interpolated_laplacian_phi = 0;
98 double interpolated_dwdr = 0;
99 double interpolated_dlaplacian_wdr = 0;
100 double interpolated_dphidr = 0;
101 double interpolated_dlaplacian_phidr = 0;
103 double interpolated_smooth_dwdr = 0;
104 double interpolated_smooth_dphidr = 0;
105 double interpolated_continuous_d2wdr2 = 0;
106 double interpolated_continuous_d2phidr2 = 0;
112 for(
unsigned l=0;l<n_node;l++)
133 interpolated_laplacian_phi +=
nodal_value[3]*psi(l);
135 interpolated_smooth_dphidr +=
nodal_value[5]*psi(l);
137 interpolated_continuous_d2wdr2 +=
nodal_value[4]*dpsidr(l,0);
138 interpolated_continuous_d2phidr2 +=
nodal_value[5]*dpsidr(l,0);
143 interpolated_dlaplacian_wdr +=
nodal_value[1]*dpsidr(l,0);
148 interpolated_dlaplacian_phidr +=
nodal_value[3]*dpsidr(l,0);
154 double W = w*interpolated_r*J;
169 for(
unsigned l=0;l<n_node;l++)
177 residuals[local_eqn] += pressure*test(l)*
W;
180 residuals[local_eqn] += interpolated_dlaplacian_wdr*dtestdr(l,0)*
W;
185 residuals[local_eqn] +=
187 (interpolated_continuous_d2wdr2*interpolated_dphidr
188 + interpolated_dwdr*interpolated_continuous_d2phidr2)
189 /interpolated_r * test(l) *
W;
200 residuals[local_eqn] += interpolated_laplacian_w*test(l)*
W;
201 residuals[local_eqn] += interpolated_dwdr*dtestdr(l,0)*
W;
210 residuals[local_eqn] += airy_forcing*test(l)*
W;
213 residuals[local_eqn] +=
214 interpolated_dlaplacian_phidr*dtestdr(l,0)*
W;
217 residuals[local_eqn] -=
218 interpolated_continuous_d2wdr2*interpolated_dwdr
219 /interpolated_r * test(l) *
W;
229 residuals[local_eqn] += interpolated_laplacian_phi*test(l)*
W;
230 residuals[local_eqn] += interpolated_dphidr*dtestdr(l,0)*
W;
237 residuals[local_eqn] +=
238 (interpolated_dwdr - interpolated_smooth_dwdr)*test(l)*
W;
244 residuals[local_eqn] +=
245 (interpolated_dphidr - interpolated_smooth_dphidr)*test(l)*
W;
303 unsigned n_dim=this->
dim();
304 unsigned n_node=this->
nnode();
306 DShape dpsi_dr(n_node,n_dim);
325 double interpolated_r = 0;
326 double interpolated_dphi_dr = 0;
327 double interpolated_continuous_d2phi_dr2 = 0;
333 for(
unsigned l=0;l<n_node;l++)
337 interpolated_dphi_dr +=
338 this->
nodal_value(l,smooth_dphi_dr_nodal_index)*psi(l);
339 interpolated_continuous_d2phi_dr2 +=
340 this->
nodal_value(l,smooth_dphi_dr_nodal_index)*dpsi_dr(l,0);
344 sigma_r_r = interpolated_dphi_dr / interpolated_r;
345 sigma_phi_phi = interpolated_continuous_d2phi_dr2;
361 const unsigned &nplot)
372 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
378 double sigma_r_r=0.0;
379 double sigma_phi_phi=0.0;
386 << sigma_phi_phi << std::endl;
399 const unsigned &nplot)
409 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
432 (std::ostream &outfile,
433 const unsigned &nplot,
451 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
460 (*exact_soln_pt)(r,exact_soln);
463 outfile << r[0] <<
" ";
464 outfile << exact_soln[0] << std::endl;
480 (std::ostream &outfile,
482 double& error,
double& norm)
495 unsigned n_node =
nnode();
503 outfile <<
"ZONE" << std::endl;
510 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
531 (*exact_soln_pt)(r,exact_soln);
534 outfile << r[0] <<
" ";
535 outfile << exact_soln[0] <<
" " << exact_soln[0]-w_fe << std::endl;
538 norm+=exact_soln[0]*exact_soln[0]*
W;
539 error+=(exact_soln[0]-w_fe)*(exact_soln[0]-w_fe)*
W;
554 unsigned n_node =
nnode();
562 outfile <<
"ZONE" << std::endl;
569 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
590 (*exact_soln_pt)(r,exact_soln);
593 outfile << r[0] <<
" ";
594 outfile << exact_soln[0] <<
" " << exact_soln[0]-w_fe << std::endl;
597 norm+=exact_soln[0]*exact_soln[0]*
W;
598 error+=(exact_soln[0]-w_fe)*(exact_soln[0]-w_fe)*
W;
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.
bool interpolated_stress(const Vector< double > &s, double &sigma_r_r, double &sigma_phi_phi) const
Compute in-plane stresses. Return boolean to indicate success (false if attempt to evaluate stresses ...
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 void get_pressure_fvk(const unsigned &ipt, const double &r, double &pressure) const
Get pressure term at (Eulerian) position r. This function is virtual to allow overloading in multi-ph...
virtual unsigned self_test()
Self-test: Check inversion of element & do self-test for GeneralisedElement. Return 0 if OK...
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
static const unsigned Initial_Nvalue
Static int that holds the number of variables at nodes: always the same.
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction") ...
void output(std::ostream &outfile)
Output with default number of plot points.
unsigned self_test()
Self-test: Return 0 for OK.
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.
virtual unsigned nodal_index_fvk(const unsigned &i=0) const
Return the index at which the i-th unknown value is stored. The default value, i, is appropriate for ...
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Compute the geometric shape functions and also first derivatives w.r.t. global coordinates at local c...
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"...
virtual double dshape_and_dtest_eulerian_at_knot_axisym_fvk(const unsigned &ipt, Shape &psi, DShape &dpsidr, Shape &test, DShape &dtestdr) const =0
Shape/test functions and derivs w.r.t. to global coords at integration point ipt; return Jacobian of ...
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...
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...
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
static double Default_Physical_Constant_Value
Default value for physical constants.
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Get error against and norm of exact solution.
bool Linear_bending_model
Flag which stores whether we are using a linear, pure bending model instead of the full non-linear Fo...
double interpolated_w_fvk(const Vector< double > &s) const
Return FE representation of transverse displacement.
unsigned nnode() const
Return the number of nodes.
virtual void get_airy_forcing_fvk(const unsigned &ipt, const double &r, double &airy_forcing) const
Get Airy forcing term at (Eulerian) position r. This function is virtual to allow overloading in mult...
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s...
void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact soln: r,w_exact at n_plot plot points.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals with this element's contribution.
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...
const double & eta() const
FvK parameter.