axisym_linear_elasticity_elements.h
Go to the documentation of this file.
1 //LIC// ====================================================================
2 //LIC// This file forms part of oomph-lib, the object-oriented,
3 //LIC// multi-physics finite-element library, available
4 //LIC// at http://www.oomph-lib.org.
5 //LIC//
6 //LIC// Version 1.0; svn revision $LastChangedRevision: 1104 $
7 //LIC//
8 //LIC// $LastChangedDate: 2016-01-09 08:06:50 +0000 (Sat, 09 Jan 2016) $
9 //LIC//
10 //LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11 //LIC//
12 //LIC// This library is free software; you can redistribute it and/or
13 //LIC// modify it under the terms of the GNU Lesser General Public
14 //LIC// License as published by the Free Software Foundation; either
15 //LIC// version 2.1 of the License, or (at your option) any later version.
16 //LIC//
17 //LIC// This library is distributed in the hope that it will be useful,
18 //LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 //LIC// Lesser General Public License for more details.
21 //LIC//
22 //LIC// You should have received a copy of the GNU Lesser General Public
23 //LIC// License along with this library; if not, write to the Free Software
24 //LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 //LIC// 02110-1301 USA.
26 //LIC//
27 //LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28 //LIC//
29 //LIC//====================================================================
30 
31 //Include guards to prevent multiple inclusion of the header
32 #ifndef OOMPH_AXISYMMETRIC_LINEAR_ELASTICITY_ELEMENTS_HEADER
33 #define OOMPH_AXISYMMETRIC_LINEAR_ELASTICITY_ELEMENTS_HEADER
34 
35 // Config header generated by autoconfig
36 #ifdef HAVE_CONFIG_H
37  #include <oomph-lib-config.h>
38 #endif
39 
40 
41 #ifdef OOMPH_HAS_MPI
42 #include "mpi.h"
43 #endif
44 
45 //OOMPH-LIB headers
46 #include "src/generic/Qelements.h"
47 #include "src/generic/Telements.h"
48 #include "src/generic/projection.h"
49 
50 
51 namespace oomph
52 {
53 //=======================================================================
54 /// A base class for elements that solve the axisymmetric (in
55 /// cylindrical polars) equations of linear elasticity.
56 //=======================================================================
58  public virtual FiniteElement
59  {
60  public:
61 
62  /// \short Return the index at which the i-th (i=0: r, i=1: z; i=2: theta)
63  /// unknown displacement component is stored at the nodes. The default
64  /// assignment here (u_r, u_z, u_theta) is appropriate for single-physics
65  /// problems.
66  virtual inline unsigned
68  {
69  return i;
70  }
71 
72  /// d^2u/dt^2 at local node n
73  double d2u_dt2_axisymmetric_linear_elasticity(const unsigned &n,
74  const unsigned &i) const
75  {
76  // Get the timestepper
78 
79  // Storage for the derivative - initialise to 0
80  double d2u_dt2=0.0;
81 
82  // If we are doing an unsteady solve then calculate the derivative
83  if(!time_stepper_pt->is_steady())
84  {
85  // Get the nodal index
86  const unsigned u_nodal_index=u_index_axisymmetric_linear_elasticity(i);
87 
88  // Get the number of values required to represent history
89  const unsigned n_time=time_stepper_pt->ntstorage();
90 
91  // Loop over history values
92  for(unsigned t=0;t<n_time;t++)
93  {
94  //Add the contribution to the derivative
95  d2u_dt2+=time_stepper_pt->weight(2,t)*nodal_value(t,n,u_nodal_index);
96  }
97  }
98 
99  return d2u_dt2;
100  }
101 
102 
103  /// du/dt at local node n
104  double du_dt_axisymmetric_linear_elasticity(const unsigned &n,
105  const unsigned &i) const
106  {
107  // Get the timestepper
109 
110  // Storage for the derivative - initialise to 0
111  double du_dt=0.0;
112 
113  // If we are doing an unsteady solve then calculate the derivative
114  if(!time_stepper_pt->is_steady())
115  {
116  // Get the nodal index
117  const unsigned u_nodal_index=u_index_axisymmetric_linear_elasticity(i);
118 
119  // Get the number of values required to represent history
120  const unsigned n_time=time_stepper_pt->ntstorage();
121 
122  // Loop over history values
123  for(unsigned t=0;t<n_time;t++)
124  {
125  //Add the contribution to the derivative
126  du_dt+=time_stepper_pt->weight(1,t)*nodal_value(t,n,u_nodal_index);
127  }
128  }
129  return du_dt;
130  }
131 
132  /// Compute vector of FE interpolated displacement u at local coordinate s
134  const Vector<double> &s,
135  Vector<double>& disp)
136  const
137  {
138  //Find number of nodes
139  unsigned n_node = nnode();
140 
141  //Local shape function
142  Shape psi(n_node);
143 
144  //Find values of shape function
145  shape(s,psi);
146 
147  for (unsigned i=0;i<3;i++)
148  {
149  //Index at which the nodal value is stored
150  unsigned u_nodal_index =
152 
153  //Initialise value of u
154  disp[i] = 0.0;
155 
156  //Loop over the local nodes and sum
157  for(unsigned l=0;l<n_node;l++)
158  {
159  const double u_value = nodal_value(l,u_nodal_index);
160 
161  disp[i] += u_value*psi[l];
162  }
163  }
164  }
165 
166  /// \short Return FE interpolated displacement u[i] (i=0: r, i=1: z; i=2:
167  /// theta) at local coordinate s
169  const unsigned &i) const
170  {
171  //Find number of nodes
172  unsigned n_node = nnode();
173 
174  //Local shape function
175  Shape psi(n_node);
176 
177  //Find values of shape function
178  shape(s,psi);
179 
180  //Get nodal index at which i-th velocity is stored
181  unsigned u_nodal_index =
183 
184  //Initialise value of u
185  double interpolated_u = 0.0;
186 
187  //Loop over the local nodes and sum
188  for(unsigned l=0;l<n_node;l++)
189  {
190  const double u_value = nodal_value(l,u_nodal_index);
191 
192  interpolated_u += u_value*psi[l];
193  }
194 
195  return(interpolated_u);
196  }
197 
198 
199 
200  /// Compute vector of FE interpolated velocity du/dt at local coordinate s
202  const Vector<double> &s, Vector<double>& du_dt) const
203  {
204  //Find number of nodes
205  unsigned n_node = nnode();
206 
207  //Local shape function
208  Shape psi(n_node);
209 
210  //Find values of shape function
211  shape(s,psi);
212 
213  // Loop over directions
214  for (unsigned i=0;i<3;i++)
215  {
216  //Initialise value of u
217  du_dt[i] = 0.0;
218 
219  //Loop over the local nodes and sum
220  for(unsigned l=0;l<n_node;l++)
221  {
222  du_dt[i] += du_dt_axisymmetric_linear_elasticity(l,i)*psi[l];
223  }
224  }
225  }
226 
227  /// Compute vector of FE interpolated accel d2u/dt2 at local coordinate s
229  const Vector<double> &s, Vector<double>& d2u_dt2) const
230  {
231  //Find number of nodes
232  unsigned n_node = nnode();
233 
234  //Local shape function
235  Shape psi(n_node);
236 
237  //Find values of shape function
238  shape(s,psi);
239 
240  // Loop over directions
241  for (unsigned i=0;i<3;i++)
242  {
243  //Initialise value of u
244  d2u_dt2[i] = 0.0;
245 
246  //Loop over the local nodes and sum
247  for(unsigned l=0;l<n_node;l++)
248  {
249  d2u_dt2[i] += d2u_dt2_axisymmetric_linear_elasticity(l,i)*psi[l];
250  }
251  }
252  }
253 
254  /// \short Function pointer to function that specifies the body force
255  /// as a function of the Cartesian coordinates and time FCT(x,b) --
256  /// x and b are Vectors!
257  typedef void (*BodyForceFctPt)(const double& time,
258  const Vector<double>& x,
259  Vector<double>& b);
260 
261  /// \short Constructor: Set null pointers for constitutive law.
262  /// Set physical parameter values to
263  /// default values, and set body force to zero.
267  Body_force_fct_pt(0) {}
268 
269  /// Return the pointer to Young's modulus
271 
272  /// Access function to Young's modulus
273  inline double youngs_modulus() const
274  {
275  return (*Youngs_modulus_pt);
276  }
277 
278  ///Access function for Poisson's ratio
279  double& nu() const
280  {
281 #ifdef PARANOID
282  if (Nu_pt==0)
283  {
284  std::ostringstream error_message;
285  error_message << "No pointer to Poisson's ratio set. Please set one!\n";
286  throw OomphLibError(
287  error_message.str(),
288  OOMPH_CURRENT_FUNCTION,
289  OOMPH_EXCEPTION_LOCATION);
290  }
291 #endif
292  return *Nu_pt;
293  }
294 
295  /// Access function for pointer to Poisson's ratio
296  double*& nu_pt() {return Nu_pt;}
297 
298  /// Access function for pointer to timescale ratio (nondim density)
299  double*& lambda_sq_pt() {return Lambda_sq_pt;}
300 
301  /// Access function for timescale ratio (nondim density)
302  const double& lambda_sq() const {return *Lambda_sq_pt;}
303 
304  /// Access function: Pointer to body force function
306 
307  /// Access function: Pointer to body force function (const version)
309 
310  /// \short Evaluate body force at Eulerian coordinate x at present time
311  /// (returns zero vector if no body force function pointer has been set)
312  inline void body_force(const double& time,
313  const Vector<double>& x,
314  Vector<double>& b) const
315  {
316  //If no function has been set, return zero vector
317  if(Body_force_fct_pt==0)
318  {
319  // Get spatial dimension of element
320  unsigned n=dim();
321  for (unsigned i=0;i<n;i++)
322  {
323  b[i] = 0.0;
324  }
325  }
326  else
327  {
328  (*Body_force_fct_pt)(time,x,b);
329  }
330  }
331 
332  /// \short The number of "DOF types" that degrees of freedom in this element
333  /// are sub-divided into: for now lump them all into one DOF type.
334  /// Can be adjusted later
335  unsigned ndof_types() const
336  {
337  return 1;
338  }
339 
340  /// \short Create a list of pairs for all unknowns in this element,
341  /// so that the first entry in each pair contains the global equation
342  /// number of the unknown, while the second one contains the number
343  /// of the "DOF type" that this unknown is associated with.
344  /// (Function can obviously only be called if the equation numbering
345  /// scheme has been set up.)
347  std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list) const
348  {
349 
350  // temporary pair (used to store DOF lookup prior to being added
351  // to list)
352  std::pair<unsigned long,unsigned> dof_lookup;
353 
354  // number of nodes
355  const unsigned n_node = this->nnode();
356 
357  //Integer storage for local unknown
358  int local_unknown=0;
359 
360  //Loop over the nodes
361  for(unsigned n=0;n<n_node;n++)
362  {
363  //Loop over dimension
364  for(unsigned i=0;i<3;i++)
365  {
366  //If the variable is free
367  local_unknown = nodal_local_eqn(n,i);
368 
369  // ignore pinned values
370  if (local_unknown >= 0)
371  {
372  // store DOF type lookup in temporary pair: First entry in pair
373  // is global equation number; second entry is DOF type
374  dof_lookup.first = this->eqn_number(local_unknown);
375  dof_lookup.second = 0;
376 
377  // add to list
378  dof_lookup_list.push_front(dof_lookup);
379  }
380  }
381  }
382  }
383 
384 
385  protected:
386 
387  /// Pointer to the Young's modulus
389 
390  /// Pointer to Poisson's ratio
391  double* Nu_pt;
392 
393  /// Timescale ratio (non-dim. density)
394  double* Lambda_sq_pt;
395 
396  /// Pointer to body force function
398 
399  /// \short Static default value for Young's modulus (1.0 -- for natural
400  /// scaling, i.e. all stresses have been non-dimensionalised by
401  /// the same reference Young's modulus. Setting the "non-dimensional"
402  /// Young's modulus (obtained by de-referencing Youngs_modulus_pt)
403  /// to a number larger than one means that the material is stiffer
404  /// than assumed in the non-dimensionalisation.
406 
407  /// Static default value for timescale ratio (1.0 for natural scaling)
408  static double Default_lambda_sq_value;
409  };
410 
411 
412 ///////////////////////////////////////////////////////////////////////
413 ///////////////////////////////////////////////////////////////////////
414 ///////////////////////////////////////////////////////////////////////
415 
416 
417 //=======================================================================
418 /// A class for elements that solve the axisymmetric (in cylindrical
419 /// polars) equations of linear elasticity
420 //=======================================================================
423  {
424  public:
425 
426  /// \short Constructor
428 
429  /// Number of values required at node n.
430  unsigned required_nvalue(const unsigned &n) const {return 3;}
431 
432  /// \short Return the residuals for the equations (the discretised
433  /// principle of virtual displacements)
435  {
438  }
439 
440 
441  /// The jacobian is calculated by finite differences by default,
442  /// We need only to take finite differences w.r.t. positional variables
443  /// For this element
445  DenseMatrix<double> &jacobian)
446  {
447  //Add the contribution to the residuals
448  this->
450  residuals,jacobian,1);
451  }
452 
453 
454 
455  /// Get strain (3x3 entries; r, z, phi)
456  void get_strain(const Vector<double>& s, DenseMatrix<double>& strain);
457 
458  ///Output exact solution: r,z, u_r, u_z, u_theta
459  void output_fct(std::ostream &outfile,
460  const unsigned &nplot,
462 
463  ///Output exact solution: r,z, u_r, u_z, u_theta
464  ///Time dependent version
465  void output_fct(std::ostream &outfile,
466  const unsigned &nplot,
467  const double &time,
469 
470  /// Output: r,z, u_r, u_z, u_theta
471  void output(std::ostream &outfile)
472  {
473  unsigned n_plot=5;
474  output(outfile,n_plot);
475  }
476 
477  /// Output: r,z, u_r, u_z, u_theta
478  void output(std::ostream &outfile, const unsigned &n_plot);
479 
480  /// C-style output: r,z, u_r, u_z, u_theta
481  void output(FILE* file_pt)
482  {
483  unsigned n_plot=5;
484  output(file_pt,n_plot);
485  }
486 
487  /// Output: r,z, u_r, u_z, u_theta
488  void output(FILE* file_pt, const unsigned &n_plot);
489 
490  /// Validate against exact solution.
491  /// Solution is provided via function pointer.
492  /// Plot at a given number of plot points and compute L2 error
493  /// and L2 norm of displacement solution over element
494  void compute_error(std::ostream &outfile,
496  double& error, double& norm);
497 
498  /// Validate against exact solution.
499  /// Time-dependent version
500  void compute_error(std::ostream &outfile,
502  const double& time, double& error, double& norm);
503 
504 
505  protected:
506 
507  /// \short Private helper function to compute residuals and (if requested
508  /// via flag) also the Jacobian matrix.
510  Vector<double> &residuals,DenseMatrix<double> &jacobian,unsigned flag);
511 
512  };
513 
514 
515 ////////////////////////////////////////////////////////////////////////
516 ////////////////////////////////////////////////////////////////////////
517 ////////////////////////////////////////////////////////////////////////
518 
519 
520 //===========================================================================
521 /// An Element that solves the equations of axisymmetric (in cylindrical
522 /// polars) linear elasticity, using QElements for the geometry.
523 //============================================================================
524  template<unsigned NNODE_1D>
526  public virtual QElement<2,NNODE_1D>,
528  {
529  public:
530 
531  /// Constructor
533  QElement<2,NNODE_1D>(),
535 
536  /// Output function
537  void output(std::ostream &outfile)
539 
540  /// Output function
541  void output(std::ostream &outfile, const unsigned &n_plot)
543  output(outfile,n_plot);}
544 
545 
546  /// C-style output function
547  void output(FILE* file_pt)
549 
550  /// C-style output function
551  void output(FILE* file_pt, const unsigned &n_plot)
553  output(file_pt,n_plot);}
554 
555  };
556 
557 
558 //============================================================================
559 /// FaceGeometry of a linear
560 /// QAxisymmetricLinearElasticityElement element
561 //============================================================================
562  template<unsigned NNODE_1D>
564  public virtual QElement<1,NNODE_1D>
565  {
566  public:
567  /// Constructor must call the constructor of the underlying element
568  FaceGeometry() : QElement<1,NNODE_1D>() {}
569  };
570 
571 
572 
573 
574 /* //////////////////////////////////////////////////////////////////////// */
575 /* //////////////////////////////////////////////////////////////////////// */
576 /* //////////////////////////////////////////////////////////////////////// */
577 
578 
579 /* //=========================================================================== */
580 /* /// An Element that solves the equations of axisymmetric (in cylindrical */
581 /* /// polars) linear elasticity, using TElements for the geometry. */
582 /* //============================================================================ */
583 /* template<unsigned NNODE_1D> */
584 /* class TAxisymmetricLinearElasticityElement : */
585 /* public virtual TElement<2,NNODE_1D>, */
586 /* public virtual AxisymmetricLinearElasticityEquations */
587 /* { */
588 /* public: */
589 
590 /* /// Constructor */
591 /* TAxisymmetricLinearElasticityElement() : */
592 /* TElement<2,NNODE_1D>(), */
593 /* AxisymmetricLinearElasticityEquations() { } */
594 
595 /* /// Output function */
596 /* void output(std::ostream &outfile) */
597 /* {AxisymmetricLinearElasticityEquations::output(outfile);} */
598 
599 /* /// Output function */
600 /* void output(std::ostream &outfile, const unsigned &n_plot) */
601 /* {AxisymmetricLinearElasticityEquations:: */
602 /* output(outfile,n_plot);} */
603 
604 /* /// C-style output function */
605 /* void output(FILE* file_pt) */
606 /* {AxisymmetricLinearElasticityEquations::output(file_pt);} */
607 
608 /* /// C-style output function */
609 /* void output(FILE* file_pt, const unsigned &n_plot) */
610 /* {AxisymmetricLinearElasticityEquations:: */
611 /* output(file_pt,n_plot);} */
612 
613 /* }; */
614 
615 
616 /* //============================================================================ */
617 /* /// FaceGeometry of a linear */
618 /* /// TAxisymmetricLinearElasticityElement element */
619 /* //============================================================================ */
620 /* template<unsigned NNODE_1D> */
621 /* class FaceGeometry<TAxisymmetricLinearElasticityElement<NNODE_1D> > : */
622 /* public virtual TElement<1,NNODE_1D> */
623 /* { */
624 /* public: */
625 /* /// Constructor must call the constructor of the underlying element */
626 /* FaceGeometry() : TElement<1,NNODE_1D>() {} */
627 /* }; */
628 
629 
630 ////////////////////////////////////////////////////////////////////
631 ////////////////////////////////////////////////////////////////////
632 ////////////////////////////////////////////////////////////////////
633 
634 
635 //==========================================================
636 /// Axisym linear elasticity upgraded to become projectable
637 //==========================================================
638  template<class AXISYM_LINEAR_ELAST_ELEMENT>
640  public virtual ProjectableElement<AXISYM_LINEAR_ELAST_ELEMENT>
641  {
642 
643  public:
644 
645  /// \short Constructor [this was only required explicitly
646  /// from gcc 4.5.2 onwards...]
648 
649 
650  /// \short Specify the values associated with field fld.
651  /// The information is returned in a vector of pairs which comprise
652  /// the Data object and the value within it, that correspond to field fld.
653  /// In the underlying linear elasticity elements the
654  /// the displacements are stored at the nodal values
656  {
657  // Create the vector
658  Vector<std::pair<Data*,unsigned> > data_values;
659 
660  // Loop over all nodes and extract the fld-th nodal value
661  unsigned nnod=this->nnode();
662  for (unsigned j=0;j<nnod;j++)
663  {
664  // Add the data value associated with the displacement components
665  data_values.push_back(std::make_pair(this->node_pt(j),fld));
666  }
667 
668  // Return the vector
669  return data_values;
670 
671  }
672 
673  /// \short Number of fields to be projected: 3, corresponding to
674  /// the displacement components
676  {
677  return 3;
678  }
679 
680  /// \short Number of history values to be stored for fld-th field.
681  /// (includes present value!)
682  unsigned nhistory_values_for_projection(const unsigned &fld)
683  {
684 #ifdef PARANOID
685  if (fld>2)
686  {
687  std::stringstream error_stream;
688  error_stream
689  << "Elements only store two fields so fld can't be"
690  << " " << fld << std::endl;
691  throw OomphLibError(
692  error_stream.str(),
693  OOMPH_CURRENT_FUNCTION,
694  OOMPH_EXCEPTION_LOCATION);
695  }
696 #endif
697  return this->node_pt(0)->ntstorage();
698  }
699 
700  ///\short Number of positional history values: Read out from
701  /// positional timestepper (Note: count includes current value!)
703  {
704  return this->node_pt(0)->position_time_stepper_pt()->ntstorage();
705  }
706 
707  /// \short Return Jacobian of mapping and shape functions of field fld
708  /// at local coordinate s
709  double jacobian_and_shape_of_field(const unsigned &fld,
710  const Vector<double> &s,
711  Shape &psi)
712  {
713  unsigned n_dim=this->dim();
714  unsigned n_node=this->nnode();
715  DShape dpsidx(n_node,n_dim);
716 
717  // Call the derivatives of the shape functions and return
718  // the Jacobian
719  return this->dshape_eulerian(s,psi,dpsidx);
720  }
721 
722 
723 
724  /// \short Return interpolated field fld at local coordinate s, at time level
725  /// t (t=0: present; t>0: history values)
726  double get_field(const unsigned &t,
727  const unsigned &fld,
728  const Vector<double>& s)
729  {
730  unsigned n_node=this->nnode();
731 
732  //Local shape function
733  Shape psi(n_node);
734 
735  //Find values of shape function
736  this->shape(s,psi);
737 
738  //Initialise value of u
739  double interpolated_u = 0.0;
740 
741  //Sum over the local nodes at that time
742  for(unsigned l=0;l<n_node;l++)
743  {
744  interpolated_u += this->nodal_value(t,l,fld)*psi[l];
745  }
746  return interpolated_u;
747  }
748 
749 
750  ///Return number of values in field fld
751  unsigned nvalue_of_field(const unsigned &fld)
752  {
753  return this->nnode();
754  }
755 
756 
757  ///Return local equation number of value j in field fld.
758  int local_equation(const unsigned &fld,
759  const unsigned &j)
760  {
761  return this->nodal_local_eqn(j,fld);
762  }
763 
764 
765  };
766 
767 
768 //=======================================================================
769 /// Face geometry for element is the same as that for the underlying
770 /// wrapped element
771 //=======================================================================
772  template<class ELEMENT>
774  : public virtual FaceGeometry<ELEMENT>
775  {
776  public:
777  FaceGeometry() : FaceGeometry<ELEMENT>() {}
778  };
779 
780 
781 //=======================================================================
782 /// Face geometry of the Face Geometry for element is the same as
783 /// that for the underlying wrapped element
784 //=======================================================================
785  template<class ELEMENT>
787  : public virtual FaceGeometry<FaceGeometry<ELEMENT> >
788  {
789  public:
791  };
792 
793 
794 }
795 
796 
797 #endif
798 
const double & lambda_sq() const
Access function for timescale ratio (nondim density)
Vector< std::pair< Data *, unsigned > > data_values_of_field(const unsigned &fld)
Specify the values associated with field fld. The information is returned in a vector of pairs which ...
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
unsigned required_nvalue(const unsigned &n) const
Number of values required at node n.
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...
double interpolated_u_axisymmetric_linear_elasticity(const Vector< double > &s, const unsigned &i) const
Return FE interpolated displacement u[i] (i=0: r, i=1: z; i=2: theta) at local coordinate s...
static double Default_lambda_sq_value
Static default value for timescale ratio (1.0 for natural scaling)
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-...
double d2u_dt2_axisymmetric_linear_elasticity(const unsigned &n, const unsigned &i) const
d^2u/dt^2 at local node n
double youngs_modulus() const
Access function to Young's modulus.
unsigned ntstorage() const
Return total number of doubles stored per value to record time history of each value (one for steady ...
Definition: nodes.cc:847
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...
Definition: elements.cc:3225
cstr elem_len * i
Definition: cfortran.h:607
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...
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
BodyForceFctPt body_force_fct_pt() const
Access function: Pointer to body force function (const version)
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number...
Definition: elements.h:709
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...
Definition: elements.h:2458
A general Finite Element class.
Definition: elements.h:1271
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, const unsigned &n_plot)
Output function.
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
Definition: timesteppers.h:557
char t
Definition: cfortran.h:572
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
Definition: nodes.h:969
void output(std::ostream &outfile)
Output: r,z, u_r, u_z, u_theta.
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.
bool is_steady() const
Flag to indicate if a timestepper has been made steady (possibly temporarily to switch off time-depen...
Definition: timesteppers.h:375
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
Definition: timesteppers.h:562
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.
double *& nu_pt()
Access function for pointer to Poisson's ratio.
unsigned nhistory_values_for_projection(const unsigned &fld)
Number of history values to be stored for fld-th field. (includes present value!) ...
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.
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
Definition: geom_objects.h:197
void(* BodyForceFctPt)(const double &time, const Vector< double > &x, Vector< double > &b)
Function pointer to function that specifies the body force as a function of the Cartesian coordinates...
double *& youngs_modulus_pt()
Return the pointer to Young's modulus.
Axisym linear elasticity upgraded to become projectable.
void output(FILE *file_pt)
C-style output: r,z, u_r, u_z, u_theta.
double get_field(const unsigned &t, const unsigned &fld, const Vector< double > &s)
Return interpolated field fld at local coordinate s, at time level t (t=0: present; t>0: history valu...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
static char t char * s
Definition: cfortran.h:572
AxisymmetricLinearElasticityEquationsBase()
Constructor: Set null pointers for constitutive law. Set physical parameter values to default values...
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 fill_in_contribution_to_residuals(Vector< double > &residuals)
Return the residuals for the equations (the discretised principle of virtual displacements) ...
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as ...
Definition: elements.h:1720
BodyForceFctPt Body_force_fct_pt
Pointer to body force function.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2097
ProjectableAxisymLinearElasticityElement()
Constructor [this was only required explicitly from gcc 4.5.2 onwards...].
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...
Definition: elements.h:1383
double & nu() const
Access function for Poisson's ratio.
FaceGeometry()
Constructor must call the constructor of the underlying element.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
Definition: elements.h:2470
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld.
double jacobian_and_shape_of_field(const unsigned &fld, const Vector< double > &s, Shape &psi)
Return Jacobian of mapping and shape functions of field fld at local coordinate s.
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:246
double *& lambda_sq_pt()
Access function for pointer to timescale ratio (nondim density)
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2134
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as ...
Definition: elements.h:1726
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of value j in field fld.
unsigned nfields_for_projection()
Number of fields to be projected: 3, corresponding to the displacement components.
void output(FILE *file_pt)
C-style output function.
double du_dt_axisymmetric_linear_elasticity(const unsigned &n, const unsigned &i) const
du/dt at local node n
double * Lambda_sq_pt
Timescale ratio (non-dim. density)
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Definition: timesteppers.h:219
virtual void shape(const Vector< double > &s, Shape &psi) const =0
Calculate the geometric shape functions at local coordinate s. This function must be overloaded for e...
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
Definition: elements.h:228
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into: for now lump ...
BodyForceFctPt & body_force_fct_pt()
Access function: Pointer to body force function.
void output(std::ostream &outfile)
Output function.
unsigned nhistory_values_for_coordinate_projection()
Number of positional history values: Read out from positional timestepper (Note: count includes curre...