59 unsigned n_node = this->
nnode();
66 if (n_position_type != 1)
68 throw OomphLibError(
"AxisymmetricLinearElasticity is not yet implemented "
69 "for more than one position type",
70 OOMPH_CURRENT_FUNCTION,
71 OOMPH_EXCEPTION_LOCATION);
76 unsigned u_nodal_index[3];
77 for (
unsigned i = 0;
i < 3;
i++)
100 for (
unsigned l = 0; l < n_node; l++)
103 for (
unsigned i = 0;
i < 2;
i++)
109 for (
unsigned i = 0;
i < 3;
i++)
112 interpolated_u[
i] += u_value * psi(l);
115 for (
unsigned j = 0; j < 2; j++)
117 interpolated_dudx(
i, j) += u_value * dpsidx(l, j);
127 double ur = interpolated_u[0];
130 double uth = interpolated_u[2];
133 double durdr = interpolated_dudx(0, 0);
134 double durdz = interpolated_dudx(0, 1);
135 double duzdr = interpolated_dudx(1, 0);
136 double duzdz = interpolated_dudx(1, 1);
137 double duthdr = interpolated_dudx(2, 0);
138 double duthdz = interpolated_dudx(2, 1);
142 strain(0, 0) = durdr;
144 strain(0, 1) = 0.5 * (durdz + duzdr);
145 strain(1, 0) = 0.5 * (durdz + duzdr);
147 strain(0, 2) = 0.5 * (duthdr - uth / r);
148 strain(2, 0) = 0.5 * (duthdr - uth / r);
150 strain(1, 1) = duzdz;
152 strain(1, 2) = 0.5 * duthdz;
153 strain(2, 1) = 0.5 * duthdz;
155 strain(2, 2) = ur / r;
167 unsigned n_node = this->
nnode();
176 if (n_position_type != 1)
178 throw OomphLibError(
"AxisymmetricLinearElasticity is not yet implemented "
179 "for more than one position type",
180 OOMPH_CURRENT_FUNCTION,
181 OOMPH_EXCEPTION_LOCATION);
186 unsigned u_nodal_index[3];
187 for (
unsigned i = 0;
i < 3;
i++)
193 double nu_local = this->
nu();
197 double lambda = youngs_modulus_local * nu_local / (1.0 + nu_local) /
198 (1.0 - 2.0 * nu_local);
199 double mu = youngs_modulus_local / 2.0 / (1.0 + nu_local);
218 int local_eqn = 0, local_unknown = 0;
221 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
224 for (
unsigned i = 0;
i < 2; ++
i)
248 for (
unsigned l = 0; l < n_node; l++)
251 for (
unsigned i = 0;
i < 2;
i++)
256 for (
unsigned i = 0;
i < 3;
i++)
260 interpolated_u[
i] += u_value * psi(l);
265 for (
unsigned j = 0; j < 2; j++)
267 interpolated_dudx(
i, j) += u_value * dpsidx(l, j);
283 double rsq = pow(r, 2);
286 double ur = interpolated_u[0];
289 double uth = interpolated_u[2];
292 double durdr = interpolated_dudx(0, 0);
293 double durdz = interpolated_dudx(0, 1);
294 double duzdr = interpolated_dudx(1, 0);
295 double duzdz = interpolated_dudx(1, 1);
296 double duthdr = interpolated_dudx(2, 0);
297 double duthdz = interpolated_dudx(2, 1);
300 double G_r, G_z, G_theta;
303 for (
unsigned l = 0; l < n_node; l++)
306 for (
unsigned a = 0; a < 3; a++)
315 residuals[local_eqn] +=
316 (
lambda_sq * d2u_dt2[a] - b[a]) * psi(l) * r *
W;
324 residuals[local_eqn] += (mu * (2.0 * durdr * dpsidx(l, 0) +
325 +dpsidx(l, 1) * (durdz + duzdr) +
326 2.0 * psi(l) / pow(r, 2) * (ur)) +
327 lambda * (durdr + ur / r + duzdz) *
328 (dpsidx(l, 0) + psi(l) / r)) *
334 residuals[local_eqn] +=
335 (mu * (dpsidx(l, 0) * (durdz + duzdr) +
336 2.0 * duzdz * dpsidx(l, 1)) +
337 lambda * (durdr + ur / r + duzdz) * dpsidx(l, 1)) *
343 residuals[local_eqn] +=
344 (mu * ((duthdr - uth / r) * (dpsidx(l, 0) - psi(l) / r) +
345 dpsidx(l, 1) * (duthdz))) *
352 OOMPH_CURRENT_FUNCTION,
353 OOMPH_EXCEPTION_LOCATION);
360 for (
unsigned l2 = 0; l2 < n_node; l2++)
369 (mu * (2.0 * dpsidx(l2, 0) * dpsidx(l, 0) +
370 2.0 / rsq * psi(l2) * psi(l) +
371 dpsidx(l2, 1) * dpsidx(l, 1)) +
372 lambda * (dpsidx(l2, 0) + psi(l2) / r) *
373 (dpsidx(l, 0) + psi(l) / r) +
378 G_z = (mu * dpsidx(l2, 0) * dpsidx(l, 1) +
379 lambda * dpsidx(l2, 1) * (dpsidx(l, 0) + psi(l) / r)) *
389 (mu * dpsidx(l2, 1) * dpsidx(l, 0) +
390 lambda * (dpsidx(l2, 0) + psi(l2) / r) * dpsidx(l, 1)) *
394 (mu * (dpsidx(l2, 0) * dpsidx(l, 0) +
395 2.0 * dpsidx(l2, 1) * dpsidx(l, 1)) +
396 lambda * dpsidx(l2, 1) * dpsidx(l, 1) +
413 (mu * ((dpsidx(l2, 0) - psi(l2) / r) *
414 (dpsidx(l, 0) - psi(l) / r) +
415 dpsidx(l2, 1) * dpsidx(l, 1)) +
422 for (
unsigned c = 0; c < 3; c++)
428 if (local_unknown >= 0)
432 jacobian(local_eqn, local_unknown) += G_r;
436 jacobian(local_eqn, local_unknown) += G_z;
440 jacobian(local_eqn, local_unknown) += G_theta;
457 std::ostream& outfile,
458 const unsigned& nplot,
475 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
484 (*exact_soln_pt)(x, exact_soln);
487 for (
unsigned i = 0;
i < 2;
i++)
489 outfile << x[
i] <<
" ";
492 for (
unsigned i = 0;
i < 3;
i++)
494 outfile << exact_soln[
i] <<
" ";
496 outfile << std::endl;
508 std::ostream& outfile,
509 const unsigned& nplot,
527 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
536 (*exact_soln_pt)(time, x, exact_soln);
539 for (
unsigned i = 0;
i < 2;
i++)
541 outfile << x[
i] <<
" ";
544 for (
unsigned i = 0;
i < 9;
i++)
546 outfile << exact_soln[
i] <<
" ";
548 outfile << std::endl;
559 const unsigned& nplot)
574 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
586 for (
unsigned i = 0;
i < 2;
i++)
588 outfile << x[
i] <<
" ";
592 for (
unsigned i = 0;
i < 3;
i++)
594 outfile << u[
i] <<
" ";
598 for (
unsigned i = 0;
i < 3;
i++)
600 outfile << du_dt[
i] <<
" ";
604 for (
unsigned i = 0;
i < 3;
i++)
606 outfile << d2u_dt2[
i] <<
" ";
609 outfile << std::endl;
621 const unsigned& nplot)
631 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
637 for (
unsigned i = 0;
i < 2;
i++)
643 for (
unsigned i = 0;
i < 3;
i++)
650 fprintf(file_pt,
"\n");
663 std::ostream& outfile,
680 outfile <<
"ZONE" << std::endl;
686 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
689 for (
unsigned i = 0;
i < 2;
i++)
707 (*exact_soln_pt)(x, exact_soln);
710 for (
unsigned i = 0;
i < 3;
i++)
712 norm += (exact_soln[
i] * exact_soln[
i]) *
W;
713 error += ((exact_soln[
i] -
722 for (
unsigned i = 0;
i < 2;
i++)
724 outfile << x[
i] <<
" ";
728 for (
unsigned i = 0;
i < 3;
i++)
730 outfile << exact_soln[
i] -
734 outfile << std::endl;
745 std::ostream& outfile,
763 outfile <<
"ZONE" << std::endl;
769 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
772 for (
unsigned i = 0;
i < 2;
i++)
790 (*exact_soln_pt)(time, x, exact_soln);
793 for (
unsigned i = 0;
i < 3;
i++)
795 norm += (exact_soln[
i] * exact_soln[
i]) *
W;
796 error += ((exact_soln[
i] -
805 for (
unsigned i = 0;
i < 2;
i++)
807 outfile << x[
i] <<
" ";
811 for (
unsigned i = 0;
i < 3;
i++)
813 outfile << exact_soln[
i] -
817 outfile << std::endl;
double d2u_dt2_axisymmetric_linear_elasticity(const unsigned &n, const unsigned &i) const
d^2u/dt^2 at local node n
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.
double & nu() const
Access function for Poisson's ratio.
const double & lambda_sq() const
Access function for timescale ratio (nondim density)
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.
static double Default_lambda_sq_value
Static default value for timescale ratio (1.0 for natural scaling)
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.
static double Default_youngs_modulus_value
Static default value for Young's modulus (1.0 – for natural scaling, i.e. all stresses have been non-...
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 interpolated_u_axisymmetric_linear_elasticity(const Vector< double > &s, Vector< double > &disp) const
Compute vector of FE interpolated displacement u at local coordinate s.
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 output(std::ostream &outfile)
Output: r,z, u_r, u_z, u_theta.
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Validate against exact solution. Solution is provided via function pointer. Plot at a given number of...
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.
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.
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 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-...
unsigned nnodal_position_type() const
Return the number of coordinate types that the element requires to interpolate the geometry between t...
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 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"...
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
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.
An OomphLibError object which should be thrown when an run-time error is encountered....
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
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.
Time *const & time_pt() const
Access function for the pointer to time (const version)
double & time()
Return the current value of the continuous time.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...