45 double AxisymmetricLinearElasticityEquationsBase::
46 Default_youngs_modulus_value = 1.0;
63 unsigned n_node = this->
nnode();
70 if(n_position_type != 1)
73 "AxisymmetricLinearElasticity is not yet implemented for more than one position type",
74 OOMPH_CURRENT_FUNCTION,
75 OOMPH_EXCEPTION_LOCATION);
80 unsigned u_nodal_index[3];
81 for(
unsigned i=0;
i<3;
i++)
83 u_nodal_index[
i] = this->
105 for(
unsigned l=0;l<n_node;l++)
108 for(
unsigned i=0;
i<2;
i++)
114 for(
unsigned i=0;
i<3;
i++)
118 interpolated_u[
i]+=u_value*psi(l);
121 for(
unsigned j=0;j<2;j++)
123 interpolated_dudx(i,j) += u_value*dpsidx(l,j);
130 double r = interpolated_x[0];
133 double ur = interpolated_u[0];
136 double uth = interpolated_u[2];
139 double durdr = interpolated_dudx(0,0);
140 double durdz = interpolated_dudx(0,1);
141 double duzdr = interpolated_dudx(1,0);
142 double duzdz = interpolated_dudx(1,1);
143 double duthdr = interpolated_dudx(2,0);
144 double duthdz = interpolated_dudx(2,1);
150 strain(0,1)=durdz+duzdr;
151 strain(1,0)=durdz+duzdr;
153 strain(0,2)=duthdr-uth/r;
154 strain(2,0)=duthdr-uth/r;
174 unsigned n_node = this->
nnode();
183 if(n_position_type != 1)
186 "AxisymmetricLinearElasticity is not yet implemented for more than one position type",
187 OOMPH_CURRENT_FUNCTION,
188 OOMPH_EXCEPTION_LOCATION);
193 unsigned u_nodal_index[3];
194 for(
unsigned i=0;
i<3;
i++)
196 u_nodal_index[
i] = this->
201 double nu_local = this->
nu();
206 youngs_modulus_local*nu_local/(1.0+nu_local)/(1.0-2.0*nu_local);
207 double mu = youngs_modulus_local/2.0/(1.0+nu_local);
226 int local_eqn=0, local_unknown=0;
229 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
232 for(
unsigned i=0;
i<2;++
i)
248 interpolated_u(3,0.0);
253 interpolated_dudx(3,2,0.0);
258 for(
unsigned l=0;l<n_node;l++)
261 for(
unsigned i=0;
i<2;
i++)
266 for(
unsigned i=0;
i<3;
i++)
271 interpolated_u[
i]+=u_value*psi(l);
276 for(
unsigned j=0;j<2;j++)
278 interpolated_dudx(i,j) += u_value*dpsidx(l,j);
293 double r = interpolated_x[0];
294 double rsq = pow(r,2);
297 double ur = interpolated_u[0];
300 double uth = interpolated_u[2];
303 double durdr = interpolated_dudx(0,0);
304 double durdz = interpolated_dudx(0,1);
305 double duzdr = interpolated_dudx(1,0);
306 double duzdz = interpolated_dudx(1,1);
307 double duthdr = interpolated_dudx(2,0);
308 double duthdz = interpolated_dudx(2,1);
311 double G_r, G_z, G_theta;
314 for(
unsigned l=0;l<n_node;l++)
317 for(
unsigned a=0;a<3;a++)
326 residuals[local_eqn] +=
327 (lambda_sq*d2u_dt2[a] - b[a])*psi(l)*r*
W;
335 residuals[local_eqn] +=
338 2.0*durdr*dpsidx(l,0)+
339 +dpsidx(l,1)*(durdz+duzdr)+
340 2.0*psi(l)/pow(r,2)*(ur)
344 )*(dpsidx(l,0)+psi(l)/r)
350 residuals[local_eqn] +=
353 dpsidx(l,0)*(durdz+duzdr)
355 2.0*duzdz*dpsidx(l,1)
365 residuals[local_eqn] +=
369 (dpsidx(l,0)-psi(l)/r)
379 "a should equal 0, 1 or 2",
380 OOMPH_CURRENT_FUNCTION,
381 OOMPH_EXCEPTION_LOCATION);
388 for(
unsigned l2=0;l2<n_node;l2++)
395 G_r = (mu*(2.0*dpsidx(l2,0)*dpsidx(l,0)+
396 2.0/rsq*psi(l2)*psi(l)+
397 dpsidx(l2,1)*dpsidx(l,1))+
398 lambda*(dpsidx(l2,0)+psi(l2)/r)*
399 (dpsidx(l,0)+psi(l)/r)+
404 G_z=(mu*dpsidx(l2,0)*dpsidx(l,1)+
405 lambda*dpsidx(l2,1)*(dpsidx(l,0)+psi(l)/r))*r*
W;
413 G_r=(mu*dpsidx(l2,1)*dpsidx(l,0)+
414 lambda*(dpsidx(l2,0)+psi(l2)/r)*dpsidx(l,1))*r*W;
416 G_z=(mu*(dpsidx(l2,0)*dpsidx(l,0)
417 +2.0*dpsidx(l2,1)*dpsidx(l,1))
418 +lambda*dpsidx(l2,1)*dpsidx(l,1)
433 G_theta=(mu*((dpsidx(l2,0)-psi(l2)/r)*(dpsidx(l,0)-psi(l)/r)
434 +dpsidx(l2,1)*dpsidx(l,1))
441 for(
unsigned c=0;c<3;c++)
447 if(local_unknown >= 0)
451 jacobian(local_eqn,local_unknown) += G_r;
455 jacobian(local_eqn,local_unknown) += G_z;
459 jacobian(local_eqn,local_unknown) += G_theta;
477 std::ostream &outfile,
478 const unsigned &nplot,
495 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
505 (*exact_soln_pt)(x,exact_soln);
508 for(
unsigned i=0;
i<2;
i++)
510 outfile << x[
i] <<
" ";
513 for(
unsigned i=0;
i<3;
i++)
515 outfile << exact_soln[
i] <<
" ";
517 outfile << std::endl;
530 std::ostream &outfile,
531 const unsigned &nplot,
549 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
559 (*exact_soln_pt)(time,x,exact_soln);
562 for(
unsigned i=0;
i<2;
i++)
564 outfile << x[
i] <<
" ";
567 for(
unsigned i=0;
i<9;
i++)
569 outfile << exact_soln[
i] <<
" ";
571 outfile << std::endl;
584 const unsigned &nplot)
599 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
612 for(
unsigned i=0;
i<2;
i++)
613 {outfile << x[
i] <<
" ";}
616 for(
unsigned i=0;
i<3;
i++)
617 {outfile << u[
i] <<
" ";}
620 for(
unsigned i=0;
i<3;
i++)
621 {outfile << du_dt[
i] <<
" ";}
624 for(
unsigned i=0;
i<3;
i++)
625 {outfile << d2u_dt2[
i] <<
" ";}
627 outfile << std::endl;
640 const unsigned &nplot)
650 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
656 for(
unsigned i=0;
i<2;
i++)
662 for(
unsigned i=0;
i<3;
i++)
664 fprintf(file_pt,
"%g ",
669 fprintf(file_pt,
"\n");
683 std::ostream &outfile,
685 double& error,
double& norm)
700 outfile <<
"ZONE" << std::endl;
706 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
710 for(
unsigned i=0;
i<2;
i++)
728 (*exact_soln_pt)(x,exact_soln);
731 for(
unsigned i=0;
i<3;
i++)
733 norm+=(exact_soln[
i]*exact_soln[
i])*W;
746 for(
unsigned i=0;
i<2;
i++)
748 outfile << x[
i] <<
" ";
752 for(
unsigned i=0;
i<3;
i++)
754 outfile << exact_soln[
i]-
759 outfile << std::endl;
770 std::ostream &outfile,
772 const double& time,
double& error,
double& norm)
787 outfile <<
"ZONE" << std::endl;
793 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
797 for(
unsigned i=0;
i<2;
i++)
815 (*exact_soln_pt)(time,x,exact_soln);
818 for(
unsigned i=0;
i<3;
i++)
820 norm+=(exact_soln[
i]*exact_soln[
i])*W;
833 for(
unsigned i=0;
i<2;
i++)
835 outfile << x[
i] <<
" ";
839 for(
unsigned i=0;
i<3;
i++)
841 outfile << exact_soln[
i]-
846 outfile << std::endl;
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction") ...
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
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.
static double Default_lambda_sq_value
Static default value for timescale ratio (1.0 for natural scaling)
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 double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Return the geometric shape functions and also first derivatives w.r.t. global coordinates at the ipt-...
const double & lambda_sq() const
Access function for timescale ratio (nondim density)
void get_strain(const Vector< double > &s, DenseMatrix< double > &strain)
Get strain (3x3 entries; r, z, phi)
virtual void fill_in_generic_contribution_to_residuals_axisymmetric_linear_elasticity(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Private helper function to compute residuals and (if requested via flag) also the Jacobian matrix...
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as ...
void output(std::ostream &outfile)
Output: r,z, u_r, u_z, u_theta.
void body_force(const double &time, const Vector< double > &x, Vector< double > &b) const
Evaluate body force at Eulerian coordinate x at present time (returns zero vector if no body force fu...
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact solution: r,z, u_r, u_z, u_theta.
double & nu() const
Access function for Poisson's ratio.
double d2u_dt2_axisymmetric_linear_elasticity(const unsigned &n, const unsigned &i) const
d^2u/dt^2 at local node n
void interpolated_u_axisymmetric_linear_elasticity(const Vector< double > &s, Vector< double > &disp) const
Compute vector of FE interpolated displacement u at local coordinate s.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
void interpolated_du_dt_axisymmetric_linear_elasticity(const Vector< double > &s, Vector< double > &du_dt) const
Compute vector of FE interpolated velocity du/dt at local coordinate s.
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction") ...
void interpolated_d2u_dt2_axisymmetric_linear_elasticity(const Vector< double > &s, Vector< double > &d2u_dt2) const
Compute vector of FE interpolated accel d2u/dt2 at local coordinate s.
unsigned nnodal_position_type() const
Return the number of coordinate types that the element requires to interpolate the geometry between t...
virtual unsigned u_index_axisymmetric_linear_elasticity(const unsigned &i) const
Return the index at which the i-th (i=0: r, i=1: z; i=2: theta) unknown displacement component is sto...
double youngs_modulus() const
Access function to Young's modulus.
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
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"...
double & time()
Return the current value of the continuous time.
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...
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
Time *const & time_pt() const
Access function for the pointer to time (const version)
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
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...
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...