42 template<
unsigned NNODE_1D>
55 const unsigned n_node =
nnode();
58 Shape psi(n_node), test(n_node);
59 DShape dpsidr(n_node,1), dtestdr(n_node,1);
70 const double nu_local=
nu();
71 const double eta_local=
eta();
77 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
87 double interpolated_r = 0.0;
89 double interpolated_w = 0.0;
90 double interpolated_laplacian_w = 0.0;
91 double interpolated_u_r = 0.0;
93 double interpolated_dwdr = 0.0;
94 double interpolated_dlaplacian_wdr = 0.0;
95 double interpolated_du_rdr = 0.0;
102 for(
unsigned l=0;l<n_node;l++)
110 interpolated_w += nodal_value[0]*psi(l);
111 interpolated_laplacian_w += nodal_value[1]*psi(l);
112 interpolated_u_r +=nodal_value[2]*psi(l);
116 interpolated_dwdr += nodal_value[0]*dpsidr(l,0);
117 interpolated_dlaplacian_wdr += nodal_value[1]*dpsidr(l,0);
118 interpolated_du_rdr += nodal_value[2]*dpsidr(l,0);
123 double W = w*interpolated_r*J;
133 double sigma_r_r = 0.0;
134 double sigma_phi_phi = 0.0;
138 sigma_r_r = 1.0/(1.0-nu_local*nu_local)*
139 (interpolated_du_rdr+0.5*interpolated_dwdr*
140 interpolated_dwdr+nu_local*1.0/interpolated_r*interpolated_u_r);
142 sigma_phi_phi = 1.0/(1.0-nu_local*nu_local)
143 *(1.0/interpolated_r*interpolated_u_r+nu_local
144 *(interpolated_du_rdr+0.5*interpolated_dwdr*interpolated_dwdr));
148 sigma_r_r = 1.0/(1.0-nu_local*nu_local)
149 *(interpolated_du_rdr+nu_local*1.0/interpolated_r*interpolated_u_r);
151 sigma_phi_phi = 1.0/(1.0-nu_local*nu_local)
152 *(1.0/interpolated_r*interpolated_u_r+nu_local*interpolated_du_rdr);
159 for(
unsigned l=0;l<n_node;l++)
168 residuals[local_eqn] += (pressure*test(l)
170 *interpolated_dlaplacian_wdr)*
W;
173 residuals[local_eqn] -= eta_local*sigma_r_r
175 *interpolated_dwdr*W;
185 residuals[local_eqn] += (test(l)*interpolated_laplacian_w
187 *interpolated_dwdr)*
W;
196 residuals[local_eqn] += (sigma_r_r*dtestdr(l,0)+1.0/interpolated_r
197 *sigma_phi_phi*test(l))*W;
253 unsigned n_dim=this->
dim();
254 unsigned n_node=this->
nnode();
256 DShape dpsidr(n_node,n_dim);
272 double interpolated_r = 0.0;
273 double interpolated_u_r = 0.0;
275 double interpolated_dwdr= 0.0;
276 double interpolated_du_rdr = 0.0;
278 double nu_local =
nu();
284 for(
unsigned l=0;l<n_node;l++)
297 sigma_r_r = 1.0/(1.0-nu_local*nu_local)
298 *(interpolated_du_rdr+0.5*interpolated_dwdr
299 *interpolated_dwdr+nu_local*1.0/interpolated_r*interpolated_u_r);
301 sigma_phi_phi = 1.0/(1.0-nu_local*nu_local)
302 *(1.0/interpolated_r*interpolated_u_r+nu_local
303 *(interpolated_du_rdr+0.5*interpolated_dwdr*interpolated_dwdr));
318 const unsigned &nplot)
329 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
335 double sigma_r_r=0.0;
336 double sigma_phi_phi=0.0;
344 << sigma_phi_phi << std::endl;
356 const unsigned &nplot)
366 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
390 (std::ostream &outfile,
391 const unsigned &nplot,
409 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
418 (*exact_soln_pt)(r,exact_soln);
421 outfile << r[0] <<
" ";
422 outfile << exact_soln[0] << std::endl;
438 (std::ostream &outfile,
440 double& error,
double& norm)
453 unsigned n_node =
nnode();
461 outfile <<
"ZONE" << std::endl;
468 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
489 (*exact_soln_pt)(r,exact_soln);
492 outfile << r[0] <<
" ";
493 outfile << exact_soln[0] <<
" " << exact_soln[0]-w_fe << std::endl;
496 norm+=exact_soln[0]*exact_soln[0]*
W;
497 error+=(exact_soln[0]-w_fe)*(exact_soln[0]-w_fe)*
W;
512 unsigned n_node =
nnode();
520 outfile <<
"ZONE" << std::endl;
527 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
548 (*exact_soln_pt)(r,exact_soln);
551 outfile << r[0] <<
" ";
552 outfile << exact_soln[0] <<
" " << exact_soln[0]-w_fe << std::endl;
555 norm+=exact_soln[0]*exact_soln[0]*
W;
556 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.
double interpolated_u_fvk(const Vector< double > &s) const
Return FE representation of radial displacement.
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...
const double & nu() const
Poisson's ratio.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
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 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.