time_harmonic_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$
7 //LIC//
8 //LIC// $LastChangedDate$
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 //Header file for general linear elasticity elements
31 
32 //Include guards to prevent multiple inclusion of the header
33 #ifndef OOMPH_TIME_HARMONIC_LINEAR_ELASTICITY_ELEMENTS_HEADER
34 #define OOMPH_TIME_HARMONIC_LINEAR_ELASTICITY_ELEMENTS_HEADER
35 
36 // Config header generated by autoconfig
37 #ifdef HAVE_CONFIG_H
38  #include <oomph-lib-config.h>
39 #endif
40 
41 
42 #ifdef OOMPH_HAS_MPI
43 #include "mpi.h"
44 #endif
45 
46 #include<complex>
47 
48 
49 //OOMPH-LIB headers
50 #include "../generic/Qelements.h"
51 #include "../generic/mesh.h"
52 #include "../generic/hermite_elements.h"
54 #include "../generic/projection.h"
55 
56 namespace oomph
57 {
58 //=======================================================================
59 /// A base class for elements that solve the equations of time-harmonic linear
60 /// elasticity in Cartesian coordinates.
61 /// Combines a few generic functions that are shared by
62 /// TimeHarmonicLinearElasticityEquations
63 /// and TimeHarmonicLinearElasticityEquationsWithPressure (Note: The latter
64 /// don't exist yet but will be written as soon as somebody needs them...)
65 //=======================================================================
66  template <unsigned DIM>
68  {
69  public:
70 
71  /// \short Return the index at which the i-th real or imag unknown
72  /// displacement component is stored. The default value is appropriate for
73  /// single-physics problems:
74  virtual inline std::complex<unsigned>
76  {
77  return std::complex<unsigned>(i,i+DIM);
78  }
79 
80  /// Compute vector of FE interpolated displacement u at local coordinate s
82  const Vector<double> &s,
83  Vector<std::complex<double> >& disp)
84  const
85  {
86  //Find number of nodes
87  unsigned n_node = nnode();
88 
89  //Local shape function
90  Shape psi(n_node);
91 
92  //Find values of shape function
93  shape(s,psi);
94 
95  for (unsigned i=0;i<DIM;i++)
96  {
97  //Index at which the nodal value is stored
98  std::complex<unsigned> u_nodal_index =
100 
101  //Initialise value of u
102  disp[i] = std::complex<double>(0.0,0.0);
103 
104  //Loop over the local nodes and sum
105  for(unsigned l=0;l<n_node;l++)
106  {
107  const std::complex<double> u_value(
108  nodal_value(l,u_nodal_index.real()),
109  nodal_value(l,u_nodal_index.imag()));
110 
111  disp[i] += u_value*psi[l];
112  }
113  }
114  }
115 
116  /// Return FE interpolated displacement u[i] at local coordinate s
118  const Vector<double> &s,
119  const unsigned &i) const
120  {
121  //Find number of nodes
122  unsigned n_node = nnode();
123 
124  //Local shape function
125  Shape psi(n_node);
126 
127  //Find values of shape function
128  shape(s,psi);
129 
130  //Get nodal index at which i-th velocity is stored
131  std::complex<unsigned> u_nodal_index =
133 
134  //Initialise value of u
135  std::complex<double> interpolated_u(0.0,0.0);
136 
137  //Loop over the local nodes and sum
138  for(unsigned l=0;l<n_node;l++)
139  {
140  const std::complex<double> u_value(
141  nodal_value(l,u_nodal_index.real()),
142  nodal_value(l,u_nodal_index.imag()));
143 
144  interpolated_u += u_value*psi[l];
145  }
146 
147  return(interpolated_u);
148  }
149 
150 
151  /// \short Function pointer to function that specifies the body force
152  /// as a function of the Cartesian coordinates and time FCT(t,x,b) --
153  /// x and b are Vectors!
154  typedef void (*BodyForceFctPt)(const double& t,
155  const Vector<double>& x,
157 
158  /// \short Constructor: Set null pointers for constitutive law and for
159  /// isotropic growth function. Set physical parameter values to
160  /// default values, and set body force to zero.
163 
164  /// Return the pointer to the elasticity_tensor
166  {return Elasticity_tensor_pt;}
167 
168  /// Access function to the entries in the elasticity tensor
169  inline double E(const unsigned &i,const unsigned &j,
170  const unsigned &k, const unsigned &l) const
171  {
172  return (*Elasticity_tensor_pt)(i,j,k,l);
173  }
174 
175  ///Access function for square of non-dim frequency
176  const double& omega_sq() const {return *Omega_sq_pt;}
177 
178  /// Access function for square of non-dim frequency
179  double* &omega_sq_pt() {return Omega_sq_pt;}
180 
181  /// Access function: Pointer to body force function
183 
184  /// Access function: Pointer to body force function (const version)
186 
187  /// \short Return the Cauchy stress tensor, as calculated
188  /// from the elasticity tensor at specified local coordinate
189  /// Virtual so separaete versions can (and must!) be provided
190  /// for displacement and pressure-displacement formulations.
191  virtual void get_stress(const Vector<double> &s,
192  DenseMatrix<std::complex<double> > &sigma) const=0;
193 
194  /// \short Return the strain tensor
195  void get_strain(const Vector<double> &s,
196  DenseMatrix<std::complex<double> >&strain) const;
197 
198  /// \short Evaluate body force at Eulerian coordinate x at present time
199  /// (returns zero vector if no body force function pointer has been set)
200  inline void body_force(const Vector<double>& x,
201  Vector<std::complex<double> >& b) const
202  {
203  //If no function has been set, return zero vector
204  if(Body_force_fct_pt==0)
205  {
206  // Get spatial dimension of element
207  unsigned n=dim();
208  for (unsigned i=0;i<n;i++)
209  {
210  b[i] = std::complex<double>(0.0,0.0);
211  }
212  }
213  else
214  {
215  // Get time from timestepper of first node (note that this must
216  // work -- body force only makes sense for elements that can be
217  // deformed and thefore store displacements (at their nodes)
218  double time=node_pt(0)->time_stepper_pt()->time_pt()->time();
219 
220  // Get body force
221  (*Body_force_fct_pt)(time,x,b);
222  }
223  }
224 
225  /// \short The number of "DOF types" that degrees of freedom in this element
226  /// are sub-divided into: for now lump them all into one DOF.
227  /// Can be adjusted later
228  unsigned ndof_types() const
229  {
230  return 1;
231  }
232 
233  /// \short Create a list of pairs for all unknowns in this element,
234  /// so that the first entry in each pair contains the global equation
235  /// number of the unknown, while the second one contains the number
236  /// of the "DOF type" that this unknown is associated with.
237  /// (Function can obviously only be called if the equation numbering
238  /// scheme has been set up.)
240  std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list) const
241  {
242 
243  // temporary pair (used to store DOF lookup prior to being added
244  // to list)
245  std::pair<unsigned long,unsigned> dof_lookup;
246 
247  // number of nodes
248  const unsigned n_node = this->nnode();
249 
250  //Integer storage for local unknown
251  int local_unknown=0;
252 
253  //Loop over the nodes
254  for(unsigned n=0;n<n_node;n++)
255  {
256  //Loop over dimension (real and imag)
257  for(unsigned i=0;i<2*DIM;i++)
258  {
259  //If the variable is free
260  local_unknown = nodal_local_eqn(n,i);
261 
262  // ignore pinned values
263  if (local_unknown >= 0)
264  {
265  // store DOF lookup in temporary pair: First entry in pair
266  // is global equation number; second entry is DOF type
267  dof_lookup.first = this->eqn_number(local_unknown);
268  dof_lookup.second = 0;
269 
270  // add to list
271  dof_lookup_list.push_front(dof_lookup);
272 
273  }
274  }
275  }
276  }
277 
278 
279  protected:
280 
281  /// Pointer to the elasticity tensor
283 
284  /// Square of nondim frequency
285  double* Omega_sq_pt;
286 
287  /// Pointer to body force function
289 
290  /// Static default value for square of frequency
291  static double Default_omega_sq_value;
292 
293  };
294 
295 
296 ///////////////////////////////////////////////////////////////////////
297 ///////////////////////////////////////////////////////////////////////
298 ///////////////////////////////////////////////////////////////////////
299 
300 
301 //=======================================================================
302 /// A class for elements that solve the equations of linear elasticity
303 /// in cartesian coordinates.
304 //=======================================================================
305  template <unsigned DIM>
308  {
309  public:
310 
311  /// \short Constructor
313 
314  /// Number of values required at node n.
315  unsigned required_nvalue(const unsigned &n) const {return 2*DIM;}
316 
317  /// \short Return the residuals for the solid equations (the discretised
318  /// principle of virtual displacements)
320  {
321  fill_in_generic_contribution_to_residuals_time_harmonic_linear_elasticity(
323  }
324 
325 
326  /// The jacobian is calculated by finite differences by default,
327  /// We need only to take finite differences w.r.t. positional variables
328  /// For this element
330  DenseMatrix<double> &jacobian)
331  {
332  //Add the contribution to the residuals
333  this->fill_in_generic_contribution_to_residuals_time_harmonic_linear_elasticity(
334  residuals,jacobian,1);
335  }
336 
337  /// \short Return the Cauchy stress tensor, as calculated
338  /// from the elasticity tensor at specified local coordinate
339  void get_stress(const Vector<double> &s,
340  DenseMatrix<std::complex<double> >&sigma) const;
341 
342  ///Output exact solution x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i]
343  void output_fct(std::ostream &outfile,
344  const unsigned &nplot,
346 
347  /// Output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i]
348  void output(std::ostream &outfile)
349  {
350  unsigned n_plot=5;
351  output(outfile,n_plot);
352  }
353 
354  /// Output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i]
355  void output(std::ostream &outfile, const unsigned &n_plot);
356 
357 
358  /// C-style output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i]
359  void output(FILE* file_pt)
360  {
361  unsigned n_plot=5;
362  output(file_pt,n_plot);
363  }
364 
365  /// Output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i]
366  void output(FILE* file_pt, const unsigned &n_plot);
367 
368 
369  /// \short Compute norm of solution: square of the L2 norm
370  void compute_norm(double& norm);
371 
372  private:
373 
374  /// \short Private helper function to compute residuals and (if requested
375  /// via flag) also the Jacobian matrix.
376  virtual void fill_in_generic_contribution_to_residuals_time_harmonic_linear_elasticity(
377  Vector<double> &residuals,DenseMatrix<double> &jacobian,unsigned flag);
378 
379  };
380 
381 
382 ////////////////////////////////////////////////////////////////////////
383 ////////////////////////////////////////////////////////////////////////
384 ////////////////////////////////////////////////////////////////////////
385 
386 
387 //===========================================================================
388 /// An Element that solves the equations of linear elasticity
389 /// in Cartesian coordinates, using QElements for the geometry
390 //============================================================================
391  template<unsigned DIM, unsigned NNODE_1D>
392  class QTimeHarmonicLinearElasticityElement : public virtual QElement<DIM,NNODE_1D>,
393  public virtual TimeHarmonicLinearElasticityEquations<DIM>
394  {
395  public:
396 
397  /// Constructor
400 
401  /// Output function
402  void output(std::ostream &outfile)
404 
405  /// Output function
406  void output(std::ostream &outfile, const unsigned &n_plot)
408 
409 
410  /// C-style output function
411  void output(FILE* file_pt)
413 
414  /// C-style output function
415  void output(FILE* file_pt, const unsigned &n_plot)
417 
418  };
419 
420 
421 //============================================================================
422 /// FaceGeometry of a linear 2D QTimeHarmonicLinearElasticityElement element
423 //============================================================================
424  template<>
426  public virtual QElement<1,2>
427  {
428  public:
429  /// Constructor must call the constructor of the underlying solid element
430  FaceGeometry() : QElement<1,2>() {}
431  };
432 
433 
434 
435 //============================================================================
436 /// FaceGeometry of a quadratic 2D QTimeHarmonicLinearElasticityElement element
437 //============================================================================
438  template<>
440  public virtual QElement<1,3>
441  {
442  public:
443  /// Constructor must call the constructor of the underlying element
444  FaceGeometry() : QElement<1,3>() {}
445  };
446 
447 
448 
449 //============================================================================
450 /// FaceGeometry of a cubic 2D QTimeHarmonicLinearElasticityElement element
451 //============================================================================
452  template<>
454  public virtual QElement<1,4>
455  {
456  public:
457  /// Constructor must call the constructor of the underlying element
458  FaceGeometry() : QElement<1,4>() {}
459  };
460 
461 
462 //============================================================================
463 /// FaceGeometry of a linear 3D QTimeHarmonicLinearElasticityElement element
464 //============================================================================
465  template<>
467  public virtual QElement<2,2>
468  {
469  public:
470  /// Constructor must call the constructor of the underlying element
471  FaceGeometry() : QElement<2,2>() {}
472  };
473 
474 //============================================================================
475 /// FaceGeometry of a quadratic 3D QTimeHarmonicLinearElasticityElement element
476 //============================================================================
477  template<>
479  public virtual QElement<2,3>
480  {
481  public:
482  /// Constructor must call the constructor of the underlying element
483  FaceGeometry() : QElement<2,3>() {}
484  };
485 
486 
487 //============================================================================
488 /// FaceGeometry of a cubic 3D QTimeHarmonicLinearElasticityElement element
489 //============================================================================
490  template<>
492  public virtual QElement<2,4>
493  {
494  public:
495  /// Constructor must call the constructor of the underlying element
496  FaceGeometry() : QElement<2,4>() {}
497  };
498 
499 ////////////////////////////////////////////////////////////////////
500 ////////////////////////////////////////////////////////////////////
501 ////////////////////////////////////////////////////////////////////
502 
503 
504 //==========================================================
505 /// Time-harmonic linear elasticity upgraded to become projectable
506 //==========================================================
507  template<class TIME_HARMONIC_LINEAR_ELAST_ELEMENT>
509  public virtual ProjectableElement<TIME_HARMONIC_LINEAR_ELAST_ELEMENT>
510  {
511 
512  public:
513 
514  /// \short Constructor [this was only required explicitly
515  /// from gcc 4.5.2 onwards...]
517 
518 
519  /// \short Specify the values associated with field fld.
520  /// The information is returned in a vector of pairs which comprise
521  /// the Data object and the value within it, that correspond to field fld.
522  /// In the underlying time-harmonic linear elasticity elements the
523  /// real and complex parts of the displacements are stored
524  /// at the nodal values
526  {
527  // Create the vector
528  Vector<std::pair<Data*,unsigned> > data_values;
529 
530  // Loop over all nodes and extract the fld-th nodal value
531  unsigned nnod=this->nnode();
532  for (unsigned j=0;j<nnod;j++)
533  {
534  // Add the data value associated with the displacement components
535  data_values.push_back(std::make_pair(this->node_pt(j),fld));
536  }
537 
538  // Return the vector
539  return data_values;
540 
541  }
542 
543  /// \short Number of fields to be projected: 2*dim, corresponding to
544  /// real and imag parts of the displacement components
546  {
547  return 2*this->dim();
548  }
549 
550  /// \short Number of history values to be stored for fld-th field.
551  /// (includes present value!)
552  unsigned nhistory_values_for_projection(const unsigned &fld)
553  {
554 #ifdef PARANOID
555  if (fld>3)
556  {
557  std::stringstream error_stream;
558  error_stream
559  << "Elements only store four fields so fld can't be"
560  << " " << fld << std::endl;
561  throw OomphLibError(
562  error_stream.str(),
563  OOMPH_CURRENT_FUNCTION,
564  OOMPH_EXCEPTION_LOCATION);
565  }
566 #endif
567  return this->node_pt(0)->ntstorage();
568  }
569 
570  ///\short Number of positional history values: Read out from
571  /// positional timestepper
572  /// (Note: count includes current value!)
574  {
575  return this->node_pt(0)->position_time_stepper_pt()->ntstorage();
576  }
577 
578  /// \short Return Jacobian of mapping and shape functions of field fld
579  /// at local coordinate s
580  double jacobian_and_shape_of_field(const unsigned &fld,
581  const Vector<double> &s,
582  Shape &psi)
583  {
584  unsigned n_dim=this->dim();
585  unsigned n_node=this->nnode();
586  DShape dpsidx(n_node,n_dim);
587 
588  // Call the derivatives of the shape functions and return
589  // the Jacobian
590  return this->dshape_eulerian(s,psi,dpsidx);
591  }
592 
593 
594 
595  /// \short Return interpolated field fld at local coordinate s, at time level
596  /// t (t=0: present; t>0: history values)
597  double get_field(const unsigned &t,
598  const unsigned &fld,
599  const Vector<double>& s)
600  {
601  unsigned n_node=this->nnode();
602 
603 #ifdef PARANOID
604  unsigned n_dim=this->node_pt(0)->ndim();
605 #endif
606 
607  //Local shape function
608  Shape psi(n_node);
609 
610  //Find values of shape function
611  this->shape(s,psi);
612 
613  //Initialise value of u
614  double interpolated_u = 0.0;
615 
616  //Sum over the local nodes at that time
617  for(unsigned l=0;l<n_node;l++)
618  {
619 #ifdef PARANOID
620  unsigned nvalue=this->node_pt(l)->nvalue();
621  if (nvalue!=2*n_dim)
622  {
623  std::stringstream error_stream;
624  error_stream
625  << "Current implementation only works for non-resized nodes\n"
626  << "but nvalue= " << nvalue << "!= 2 dim = " << 2*n_dim << std::endl;
627  throw OomphLibError(
628  error_stream.str(),
629  OOMPH_CURRENT_FUNCTION,
630  OOMPH_EXCEPTION_LOCATION);
631  }
632 #endif
633  interpolated_u += this->nodal_value(t,l,fld)*psi[l];
634  }
635  return interpolated_u;
636  }
637 
638 
639  ///Return number of values in field fld
640  unsigned nvalue_of_field(const unsigned &fld)
641  {
642  return this->nnode();
643  }
644 
645 
646  ///Return local equation number of value j in field fld.
647  int local_equation(const unsigned &fld,
648  const unsigned &j)
649  {
650 #ifdef PARANOID
651  unsigned n_dim=this->node_pt(0)->ndim();
652  unsigned nvalue=this->node_pt(j)->nvalue();
653  if (nvalue!=2*n_dim)
654  {
655  std::stringstream error_stream;
656  error_stream
657  << "Current implementation only works for non-resized nodes\n"
658  << "but nvalue= " << nvalue << "!= 2 dim = " << 2*n_dim << std::endl;
659  throw OomphLibError(
660  error_stream.str(),
661  OOMPH_CURRENT_FUNCTION,
662  OOMPH_EXCEPTION_LOCATION);
663  }
664 #endif
665  return this->nodal_local_eqn(j,fld);
666  }
667 
668 
669  };
670 
671 
672 //=======================================================================
673 /// Face geometry for element is the same as that for the underlying
674 /// wrapped element
675 //=======================================================================
676  template<class ELEMENT>
678  : public virtual FaceGeometry<ELEMENT>
679  {
680  public:
681  FaceGeometry() : FaceGeometry<ELEMENT>() {}
682  };
683 
684 
685 //=======================================================================
686 /// Face geometry of the Face Geometry for element is the same as
687 /// that for the underlying wrapped element
688 //=======================================================================
689  template<class ELEMENT>
691  : public virtual FaceGeometry<FaceGeometry<ELEMENT> >
692  {
693  public:
695  };
696 
697 
698 }
699 
700 #endif
701 
702 
703 
704 
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
TimeHarmonicElasticityTensor *& elasticity_tensor_pt()
Return the pointer to the elasticity_tensor.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Return the residuals for the solid equations (the discretised principle of virtual displacements) ...
void body_force(const Vector< double > &x, Vector< std::complex< double > > &b) const
Evaluate body force at Eulerian coordinate x at present time (returns zero vector if no body force fu...
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing...
Definition: elements.h:2884
BodyForceFctPt & body_force_fct_pt()
Access function: Pointer to body force function.
ProjectableTimeHarmonicLinearElasticityElement()
Constructor [this was only required explicitly from gcc 4.5.2 onwards...].
cstr elem_len * i
Definition: cfortran.h:607
A general Finite Element class.
Definition: elements.h:1274
unsigned nhistory_values_for_coordinate_projection()
Number of positional history values: Read out from positional timestepper (Note: count includes curre...
static double Default_omega_sq_value
Static default value for square of frequency.
void interpolated_u_time_harmonic_linear_elasticity(const Vector< double > &s, Vector< std::complex< double > > &disp) const
Compute vector of FE interpolated displacement u at local coordinate s.
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: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i].
unsigned required_nvalue(const unsigned &n) const
Number of values required at node n.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:448
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
const double & omega_sq() const
Access function for square of non-dim frequency.
FaceGeometry()
Constructor must call the constructor of the underlying element.
virtual void compute_norm(double &norm)
Compute norm of solution – broken virtual can be overloaded by element writer to implement whatever ...
Definition: elements.h:1119
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:992
virtual void get_stress(const Vector< double > &s, DenseMatrix< std::complex< double > > &sigma) const =0
Return the Cauchy stress tensor, as calculated from the elasticity tensor at specified local coordina...
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as ...
Definition: elements.h:1723
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:3227
double E(const unsigned &i, const unsigned &j, const unsigned &k, const unsigned &l) const
Access function to the entries in the elasticity tensor.
FaceGeometry()
Constructor must call the constructor of the underlying element.
void(* BodyForceFctPt)(const double &t, const Vector< double > &x, Vector< std::complex< double > > &b)
Function pointer to function that specifies the body force as a function of the Cartesian coordinates...
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
BodyForceFctPt body_force_fct_pt() const
Access function: Pointer to body force function (const version)
double *& omega_sq_pt()
Access function for square of non-dim frequency.
static char t char * s
Definition: cfortran.h:572
unsigned nfields_for_projection()
Number of fields to be projected: 2*dim, corresponding to real and imag parts of the displacement com...
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into: for now lump ...
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 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.
virtual void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output an exact solution over the element.
Definition: elements.h:2938
BodyForceFctPt Body_force_fct_pt
Pointer to body force function.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
double & time()
Return the current value of the continuous time.
Definition: timesteppers.h:130
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 ...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2109
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:2470
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
Definition: timesteppers.h:562
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of value j in field fld.
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
TimeHarmonicElasticityTensor * Elasticity_tensor_pt
Pointer to the elasticity tensor.
void output(FILE *file_pt)
C-style output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i].
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
Definition: elements.h:2482
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...
FaceGeometry()
Constructor must call the constructor of the underlying element.
Time *const & time_pt() const
Access function for the pointer to time (const version)
Definition: timesteppers.h:540
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:246
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...
void get_strain(const Vector< double > &s, DenseMatrix< std::complex< double > > &strain) const
Return the strain tensor.
Class for dense matrices, storing all the values of the matrix as a pointer to a pointer with assorte...
Definition: communicator.h:50
TimeHarmonicLinearElasticityEquationsBase()
Constructor: Set null pointers for constitutive law and for isotropic growth function. Set physical parameter values to default values, and set body force to zero.
unsigned nhistory_values_for_projection(const unsigned &fld)
Number of history values to be stored for fld-th field. (includes present value!) ...
FaceGeometry()
Constructor must call the constructor of the underlying element.
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2146
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
virtual std::complex< unsigned > u_index_time_harmonic_linear_elasticity(const unsigned i) const
Return the index at which the i-th real or imag unknown displacement component is stored...
FaceGeometry()
Constructor must call the constructor of the underlying element.
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:1386
Time-harmonic linear elasticity upgraded to become projectable.
std::complex< double > interpolated_u_time_harmonic_linear_elasticity(const Vector< double > &s, const unsigned &i) const
Return FE interpolated displacement u[i] at local coordinate s.