pml_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_PML_TIME_HARMONIC_LINEAR_ELASTICITY_ELEMENTS_HEADER
34 #define OOMPH_PML_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 #include "math.h"
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 #include "../generic/nodes.h"
56 #include "../generic/oomph_utilities.h"
57 #include "../generic/pml_meshes.h"
58 #include "../generic/pml_mapping_functions.h"
59 
60 // The meshes (needed for building of pml meshes!)
61 // Include template files to avoid unnecessary re-compilation
62 // (*.template.h files get included indirectly).
63 //#include "../meshes/triangle_mesh.template.cc"
64 //#include "../meshes/rectangular_quadmesh.template.cc"
65 
66 // Why not just to include the *.h files, Just as all other files
67 // #include "../meshes/triangle_mesh.template.h"
68 // #include "../meshes/rectangular_quadmesh.template.h"
69 
70 namespace oomph
71 {
72 
73 //=======================================================================
74 /// A base class for elements that solve the equations of time-harmonic linear
75 /// elasticity in Cartesian coordinates.
76 /// Combines a few generic functions that are shared by
77 /// PMLTimeHarmonicLinearElasticityEquations
78 /// and PMLTimeHarmonicLinearElasticityEquationsWithPressure
79 /// (Note: The latter
80 /// don't exist yet but will be written as soon as somebody needs them...)
81 //=======================================================================
82 template <unsigned DIM,class PML_ELEMENT>
84 public virtual FiniteElement, public virtual PML_ELEMENT
85 {
86 public:
87 
88  /// \short Constructor: Set null pointers for constitutive law and for
89  /// isotropic growth function. Set physical parameter values to
90  /// default values, and set body force to zero.
94  {
95  this->Pml_mapping_pt =
97  }
98 
99  /// Broken assignment operator
101  {
102  BrokenCopy::broken_assign("PMLTimeHarmonicLinearElasticityEquationsBase");
103  }
104 
105  /// \short Return the index at which the i-th real or imag unknown
106  /// displacement component is stored. The default value is appropriate for
107  /// single-physics problems:
108  virtual inline std::complex<unsigned>
110  {
111  return std::complex<unsigned>(i,i+DIM);
112  }
113 
114  /// Compute vector of FE interpolated displacement u at local coordinate s
116  const Vector<double> &s,
117  Vector<std::complex<double> >& disp)
118  const
119  {
120  //Find number of nodes
121  unsigned n_node = nnode();
122 
123  //Local shape function
124  Shape psi(n_node);
125 
126  //Find values of shape function
127  shape(s,psi);
128 
129  for (unsigned i=0;i<DIM;i++)
130  {
131  //Index at which the nodal value is stored
132  std::complex<unsigned> u_nodal_index =
134 
135  //Initialise value of u
136  disp[i] = std::complex<double>(0.0,0.0);
137 
138  //Loop over the local nodes and sum
139  for(unsigned l=0;l<n_node;l++)
140  {
141  const std::complex<double> u_value(
142  nodal_value(l,u_nodal_index.real()),
143  nodal_value(l,u_nodal_index.imag()));
144 
145  disp[i] += u_value*psi[l];
146  }
147  }
148  }
149 
150  /// Return FE interpolated displacement u[i] at local coordinate s
152  const Vector<double> &s,
153  const unsigned &i) const
154  {
155  //Find number of nodes
156  unsigned n_node = nnode();
157 
158  //Local shape function
159  Shape psi(n_node);
160 
161  //Find values of shape function
162  shape(s,psi);
163 
164  //Get nodal index at which i-th velocity is stored
165  std::complex<unsigned> u_nodal_index =
167 
168  //Initialise value of u
169  std::complex<double> interpolated_u(0.0,0.0);
170 
171  //Loop over the local nodes and sum
172  for(unsigned l=0;l<n_node;l++)
173  {
174  const std::complex<double> u_value(
175  nodal_value(l,u_nodal_index.real()),
176  nodal_value(l,u_nodal_index.imag()));
177 
178  interpolated_u += u_value*psi[l];
179  }
180 
181  return(interpolated_u);
182  }
183 
184 
185  /// \short Function pointer to function that specifies the body force
186  /// as a function of the Cartesian coordinates FCT(x,b) --
187  /// x and b are Vectors!
188  typedef void (*BodyForceFctPt)(const Vector<double>& x,
190 
191  /// Return the pointer to the elasticity_tensor
193  {return Elasticity_tensor_pt;}
194 
195  /// Access function to the entries in the elasticity tensor
196  inline std::complex<double> E(const unsigned &i,const unsigned &j,
197  const unsigned &k, const unsigned &l) const
198  {
199  return (*Elasticity_tensor_pt)(i,j,k,l);
200  }
201 
202  /// Access function to nu in the elasticity tensor
203  inline double nu() const
204  {
205  return Elasticity_tensor_pt->nu();
206  }
207 
208  ///Access function for square of non-dim frequency
209  const double& omega_sq() const {return *Omega_sq_pt;}
210 
211  /// Access function for square of non-dim frequency
212  double* &omega_sq_pt() {return Omega_sq_pt;}
213 
214  /// Wavenumber for the PML
215  double wavenumber() const
216  {
217  return std::sqrt(2.0*(1.0+this->nu()) * this->omega_sq());
218  }
219 
220  /// Access function: Pointer to body force function
222 
223  /// Access function: Pointer to body force function (const version)
225 
226  /// \short Return the Cauchy stress tensor, as calculated
227  /// from the elasticity tensor at specified local coordinate
228  /// Virtual so separaete versions can (and must!) be provided
229  /// for displacement and pressure-displacement formulations.
230  virtual void get_stress(const Vector<double> &s,
231  DenseMatrix<std::complex<double> > &sigma) const=0;
232 
233  /// \short Return the strain tensor
234  void get_strain(const Vector<double> &s,
235  DenseMatrix<std::complex<double> >&strain) const;
236 
237  /// \short Evaluate body force at Eulerian coordinate x
238  /// (returns zero vector if no body force function pointer has been set)
239  inline void body_force(const Vector<double>& x,
240  Vector<std::complex<double> >& b) const
241  {
242  //If no function has been set, return zero vector
243  if(Body_force_fct_pt==0)
244  {
245  // Get spatial dimension of element
246  unsigned n=dim();
247  for (unsigned i=0;i<n;i++)
248  {
249  b[i] = std::complex<double>(0.0,0.0);
250  }
251  }
252  else
253  {
254  // Get body force
255  (*Body_force_fct_pt)(x,b);
256  }
257  }
258 
259 
260  /// \short Pure virtual function in which we specify the
261  /// values to be pinned (and set to zero) on the outer edge of
262  /// the pml layer. All of them! Vector is resized internally.
264  values_to_pin)
265  {
266  values_to_pin.resize(DIM*2);
267  for (unsigned j=0;j<DIM*2;j++)
268  {
269  values_to_pin[j]=j;
270  }
271  }
272 
273  /// \short The number of "DOF types" that degrees of freedom in this element
274  /// are sub-divided into: for now lump them all into one DOF type.
275  /// Can be adjusted later
276  unsigned ndof_types() const
277  {
278  return 1;
279  }
280 
281  /// \short Create a list of pairs for all unknowns in this element,
282  /// so that the first entry in each pair contains the global equation
283  /// number of the unknown, while the second one contains the number
284  /// of the "DOF types" that this unknown is associated with.
285  /// (Function can obviously only be called if the equation numbering
286  /// scheme has been set up.)
288  std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list) const
289  {
290 
291  // temporary pair (used to store dof lookup prior to being added
292  // to list)
293  std::pair<unsigned long,unsigned> dof_lookup;
294 
295  // number of nodes
296  const unsigned n_node = this->nnode();
297 
298  //Integer storage for local unknown
299  int local_unknown=0;
300 
301  //Loop over the nodes
302  for(unsigned n=0;n<n_node;n++)
303  {
304  //Loop over dimension (real and imag)
305  for(unsigned i=0;i<2*DIM;i++)
306  {
307  //If the variable is free
308  local_unknown = nodal_local_eqn(n,i);
309 
310  // ignore pinned values
311  if (local_unknown >= 0)
312  {
313  // store dof lookup in temporary pair: First entry in pair
314  // is global equation number; second entry is dof type
315  dof_lookup.first = this->eqn_number(local_unknown);
316  dof_lookup.second = 0;
317 
318  // add to list
319  dof_lookup_list.push_front(dof_lookup);
320 
321  }
322  }
323  }
324  }
325 
326  /// Static so that the class doesn't need to instantiate a new default
327  /// everytime it uses it
329 
330 protected:
331 
332  /// Pointer to the elasticity tensor
334 
335  /// Square of nondim frequency
336  double* Omega_sq_pt;
337 
338  /// Pointer to body force function
340 
341  /// Static default value for square of frequency
342  static double Default_omega_sq_value;
343 
344 };
345 
346 
347 ///////////////////////////////////////////////////////////////////////
348 ///////////////////////////////////////////////////////////////////////
349 ///////////////////////////////////////////////////////////////////////
350 
351 
352 //=======================================================================
353 /// A class for elements that solve the equations of linear elasticity
354 /// in cartesian coordinates.
355 //=======================================================================
356  template <unsigned DIM, class PML_ELEMENT>
358  public PMLTimeHarmonicLinearElasticityEquationsBase<DIM, PML_ELEMENT>
359  {
360  public:
361 
362  /// \short Constructor
364 
365  /// Number of values required at node n.
366  unsigned required_nvalue(const unsigned &n) const {return 2*DIM;}
367 
368  /// \short Return the residuals for the solid equations (the discretised
369  /// principle of virtual displacements)
371  {
372  fill_in_generic_contribution_to_residuals_time_harmonic_linear_elasticity(
374  }
375 
376  /// The jacobian is calculated by finite differences by default,
377  /// We need only to take finite differences w.r.t. positional variables
378  /// For this element
380  DenseMatrix<double> &jacobian)
381  {
382  //Add the contribution to the residuals
383  this->
384  fill_in_generic_contribution_to_residuals_time_harmonic_linear_elasticity(
385  residuals,jacobian,1);
386  }
387 
388  /// \short Return the Cauchy stress tensor, as calculated
389  /// from the elasticity tensor at specified local coordinate
390  void get_stress(const Vector<double> &s,
391  DenseMatrix<std::complex<double> >&sigma) const;
392 
393  ///Output exact solution x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i]
394  void output_fct(std::ostream &outfile,
395  const unsigned &nplot,
397 
398  /// Output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i]
399  void output(std::ostream &outfile)
400  {
401  unsigned n_plot=5;
402  output(outfile,n_plot);
403  }
404 
405  /// Output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i]
406  void output(std::ostream &outfile, const unsigned &n_plot);
407 
408 
409  /// C-style output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i]
410  void output(FILE* file_pt)
411  {
412  unsigned n_plot=5;
413  output(file_pt,n_plot);
414  }
415 
416  /// Output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i]
417  void output(FILE* file_pt, const unsigned &n_plot);
418 
419  /// Output function for real part of full time-dependent solution
420  /// constructed by adding the scattered field
421  /// u = Re( (u_r +i u_i) exp(-i omega t)
422  /// at phase angle omega t = phi computed here, to the corresponding
423  /// incoming wave specified via the function pointer.
424  void output_total_real(
425  std::ostream &outfile,
426  FiniteElement::SteadyExactSolutionFctPt incoming_wave_fct_pt,
427  const double& phi,
428  const unsigned &nplot);
429 
430 
431  /// \short Output function for real part of full time-dependent solution
432  /// u = Re( (u_r +i u_i) exp(-i omega t))
433  /// at phase angle omega t = phi.
434  /// x,y,u or x,y,z,u at n_plot plot points in each coordinate
435  /// direction
436  void output_real(std::ostream &outfile, const double& phi,
437  const unsigned &n_plot);
438 
439  /// \short Output function for imaginary part of full time-dependent solution
440  /// u = Im( (u_r +i u_i) exp(-i omega t) )
441  /// at phase angle omega t = phi.
442  /// x,y,u or x,y,z,u at n_plot plot points in each coordinate
443  /// direction
444  void output_imag(std::ostream &outfile, const double& phi,
445  const unsigned &n_plot);
446 
447 
448 
449  /// \short Compute norm of solution: square of the L2 norm
450  void compute_norm(double& norm);
451 
452  /// Get error against and norm of exact solution
453  void compute_error(std::ostream &outfile,
455  double& error, double& norm);
456 
457 
458  /// Dummy, time dependent error checker
459  void compute_error(std::ostream &outfile,
461  const double& time, double& error, double& norm)
462  {
463  std::ostringstream error_stream;
464  error_stream << "There is no time-dependent compute_error() "
465  << std::endl
466  <<"for pml time harmonic linear elasticity elements"
467  << std::endl;
468  throw OomphLibError(
469  error_stream.str(),
470  OOMPH_CURRENT_FUNCTION,
471  OOMPH_EXCEPTION_LOCATION);
472  }
473 
474 private:
475 
476  /// \short Private helper function to compute residuals and (if requested
477  /// via flag) also the Jacobian matrix.
478  virtual void
479  fill_in_generic_contribution_to_residuals_time_harmonic_linear_elasticity(
480  Vector<double> &residuals,DenseMatrix<double> &jacobian,unsigned flag);
481 };
482 
483 ////////////////////////////////////////////////////////////////////////
484 ////////////////////////////////////////////////////////////////////////
485 ////////////////////////////////////////////////////////////////////////
486 
487 
488 //===========================================================================
489 /// An Element that solves the equations of linear elasticity
490 /// in Cartesian coordinates, using QElements for the geometry
491 //============================================================================
492  template<unsigned DIM, unsigned NNODE_1D, class PML_ELEMENT>
494  public virtual QElement<DIM,NNODE_1D>,
495  public virtual PMLTimeHarmonicLinearElasticityEquations<DIM, PML_ELEMENT>
496  {
497  public:
498 
499  /// Constructor
501  QElement<DIM,NNODE_1D>(),
502  PMLTimeHarmonicLinearElasticityEquations<DIM, PML_ELEMENT>() { }
503 
504  /// Output function
505  void output(std::ostream &outfile)
507 
508  /// Output function
509  void output(std::ostream &outfile, const unsigned &n_plot)
511  n_plot);}
512 
513 
514  /// C-style output function
515  void output(FILE* file_pt)
517 
518  /// C-style output function
519  void output(FILE* file_pt, const unsigned &n_plot)
521  n_plot);}
522 
523  };
524 
525 
526 //============================================================================
527 /// FaceGeometry of a linear 2D
528 /// QPMLTimeHarmonicLinearElasticityElement element
529 //============================================================================
530  template<class PML_ELEMENT>
532  public virtual QElement<1,2>
533  {
534  public:
535  /// Constructor must call the constructor of the underlying solid element
536  FaceGeometry() : QElement<1,2>() {}
537  };
538 
539 
540 
541 //============================================================================
542 /// FaceGeometry of a quadratic 2D
543 /// QPMLTimeHarmonicLinearElasticityElement element
544 //============================================================================
545  template<class PML_ELEMENT>
547  public virtual QElement<1,3>
548  {
549  public:
550  /// Constructor must call the constructor of the underlying element
551  FaceGeometry() : QElement<1,3>() {}
552  };
553 
554 
555 
556 //============================================================================
557 /// FaceGeometry of a cubic 2D
558 /// QPMLTimeHarmonicLinearElasticityElement element
559 //============================================================================
560  template<class PML_ELEMENT>
562  public virtual QElement<1,4>
563  {
564  public:
565  /// Constructor must call the constructor of the underlying element
566  FaceGeometry() : QElement<1,4>() {}
567  };
568 
569 
570 //============================================================================
571 /// FaceGeometry of a linear 3D
572 /// QPMLTimeHarmonicLinearElasticityElement element
573 //============================================================================
574  template<class PML_ELEMENT>
576  public virtual QElement<2,2>
577  {
578  public:
579  /// Constructor must call the constructor of the underlying element
580  FaceGeometry() : QElement<2,2>() {}
581  };
582 
583 //============================================================================
584 /// FaceGeometry of a quadratic 3D
585 /// QPMLTimeHarmonicLinearElasticityElement element
586 //============================================================================
587  template<class PML_ELEMENT>
589  public virtual QElement<2,3>
590  {
591  public:
592  /// Constructor must call the constructor of the underlying element
593  FaceGeometry() : QElement<2,3>() {}
594  };
595 
596 
597 //============================================================================
598 /// FaceGeometry of a cubic 3D
599 /// QPMLTimeHarmonicLinearElasticityElement element
600 //============================================================================
601  template<class PML_ELEMENT>
603  public virtual QElement<2,4>
604  {
605  public:
606  /// Constructor must call the constructor of the underlying element
607  FaceGeometry() : QElement<2,4>() {}
608  };
609 
610 ////////////////////////////////////////////////////////////////////
611 ////////////////////////////////////////////////////////////////////
612 ////////////////////////////////////////////////////////////////////
613 
614 
615 //==========================================================
616 /// Time-harmonic linear elasticity upgraded to become projectable
617 //==========================================================
618  template<class TIME_HARMONIC_LINEAR_ELAST_ELEMENT>
620  public virtual ProjectableElement<TIME_HARMONIC_LINEAR_ELAST_ELEMENT>
621  {
622 
623  public:
624 
625  /// \short Constructor [this was only required explicitly
626  /// from gcc 4.5.2 onwards...]
628 
629 
630  /// \short Specify the values associated with field fld.
631  /// The information is returned in a vector of pairs which comprise
632  /// the Data object and the value within it, that correspond to field fld.
633  /// In the underlying time-harmonic linear elasticity elemements the
634  /// real and complex parts of the displacements are stored
635  /// at the nodal values
637  {
638  // Create the vector
639  Vector<std::pair<Data*,unsigned> > data_values;
640 
641  // Loop over all nodes and extract the fld-th nodal value
642  unsigned nnod=this->nnode();
643  for (unsigned j=0;j<nnod;j++)
644  {
645  // Add the data value associated with the velocity components
646  data_values.push_back(std::make_pair(this->node_pt(j),fld));
647  }
648 
649  // Return the vector
650  return data_values;
651 
652  }
653 
654  /// \short Number of fields to be projected: 2*dim, corresponding to
655  /// real and imag parts of the displacement components
657  {
658  return 2*this->dim();
659  }
660 
661  /// \short Number of history values to be stored for fld-th field.
662  /// (includes present value!)
663  unsigned nhistory_values_for_projection(const unsigned &fld)
664  {
665 #ifdef PARANOID
666  if (fld>3)
667  {
668  std::stringstream error_stream;
669  error_stream
670  << "Elements only store four fields so fld can't be"
671  << " " << fld << std::endl;
672  throw OomphLibError(
673  error_stream.str(),
674  OOMPH_CURRENT_FUNCTION,
675  OOMPH_EXCEPTION_LOCATION);
676  }
677 #endif
678  return this->node_pt(0)->ntstorage();
679  }
680 
681  ///\short Number of positional history values: Read out from
682  /// positional timestepper
683  /// (Note: count includes current value!)
685  {
686  return this->node_pt(0)->position_time_stepper_pt()->ntstorage();
687  }
688 
689  /// \short Return Jacobian of mapping and shape functions of field fld
690  /// at local coordinate s
691  double jacobian_and_shape_of_field(const unsigned &fld,
692  const Vector<double> &s,
693  Shape &psi)
694  {
695  unsigned n_dim=this->dim();
696  unsigned n_node=this->nnode();
697  DShape dpsidx(n_node,n_dim);
698 
699  // Call the derivatives of the shape functions and return
700  // the Jacobian
701  return this->dshape_eulerian(s,psi,dpsidx);
702  }
703 
704 
705 
706  /// \short Return interpolated field fld at local coordinate s, at time level
707  /// t (t=0: present; t>0: history values)
708  double get_field(const unsigned &t,
709  const unsigned &fld,
710  const Vector<double>& s)
711  {
712  unsigned n_node=this->nnode();
713 
714 #ifdef PARANOID
715  unsigned n_dim=this->node_pt(0)->ndim();
716 #endif
717 
718  //Local shape function
719  Shape psi(n_node);
720 
721  //Find values of shape function
722  this->shape(s,psi);
723 
724  //Initialise value of u
725  double interpolated_u = 0.0;
726 
727  //Sum over the local nodes at that time
728  for(unsigned l=0;l<n_node;l++)
729  {
730 #ifdef PARANOID
731  unsigned nvalue=this->node_pt(l)->nvalue();
732  if (nvalue!=2*n_dim)
733  {
734  std::stringstream error_stream;
735  error_stream
736  << "Current implementation only works for non-resized nodes\n"
737  << "but nvalue= " << nvalue << "!= 2 dim = " << 2*n_dim << std::endl;
738  throw OomphLibError(
739  error_stream.str(),
740  OOMPH_CURRENT_FUNCTION,
741  OOMPH_EXCEPTION_LOCATION);
742  }
743 #endif
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 #ifdef PARANOID
762  unsigned n_dim=this->node_pt(0)->ndim();
763  unsigned nvalue=this->node_pt(j)->nvalue();
764  if (nvalue!=2*n_dim)
765  {
766  std::stringstream error_stream;
767  error_stream
768  << "Current implementation only works for non-resized nodes\n"
769  << "but nvalue= " << nvalue << "!= 2 dim = " << 2*n_dim << std::endl;
770  throw OomphLibError(
771  error_stream.str(),
772  OOMPH_CURRENT_FUNCTION,
773  OOMPH_EXCEPTION_LOCATION);
774  }
775 #endif
776  return this->nodal_local_eqn(j,fld);
777  }
778 
779 
780  };
781 
782 
783 //=======================================================================
784 /// Face geometry for element is the same as that for the underlying
785 /// wrapped element
786 //=======================================================================
787  template<class ELEMENT>
790  : public virtual FaceGeometry<ELEMENT>
791  {
792  public:
793  FaceGeometry() : FaceGeometry<ELEMENT>() {}
794  };
795 
796 
797 //=======================================================================
798 /// Face geometry of the Face Geometry for element is the same as
799 /// that for the underlying wrapped element
800 //=======================================================================
801  template<class ELEMENT>
803  FaceGeometry<
805  : public virtual FaceGeometry<FaceGeometry<ELEMENT> >
806  {
807  public:
809  };
810 
811 
812 //////////////////////////////////////////////////////////////////////
813 //////////////////////////////////////////////////////////////////////
814 //////////////////////////////////////////////////////////////////////
815 
816 
817 
818 //=======================================================================
819 /// Policy class defining the elements to be used in the actual
820 /// PML layers. Same!
821 //=======================================================================
822 template<unsigned NNODE_1D, class PML_ELEMENT>
824  QPMLTimeHarmonicLinearElasticityElement<2,NNODE_1D,PML_ELEMENT> > :
825  public virtual QPMLTimeHarmonicLinearElasticityElement<2,NNODE_1D,PML_ELEMENT>
826 {
827 
828  public:
829 
830  /// \short Constructor: Call the constructor for the
831  /// appropriate QElement
833  QPMLTimeHarmonicLinearElasticityElement<2,NNODE_1D,PML_ELEMENT>()
834  {}
835 
836 };
837 
838 
839 }
840 
841 
842 #endif
PMLTimeHarmonicIsotropicElasticityTensor *& elasticity_tensor_pt()
Return the pointer to the elasticity_tensor.
void values_to_be_pinned_on_outer_pml_boundary(Vector< unsigned > &values_to_pin)
Pure virtual function in which we specify the values to be pinned (and set to zero) on the outer edge...
PMLTimeHarmonicLinearElasticityEquationsBase()
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 nvalue_of_field(const unsigned &fld)
Return number of values in field fld.
double nu() const
Access function to nu in the elasticity tensor.
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
cstr elem_len * i
Definition: cfortran.h:607
unsigned nfields_for_projection()
Number of fields to be projected: 2*dim, corresponding to real and imag parts of the displacement com...
void(* BodyForceFctPt)(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...
unsigned nhistory_values_for_projection(const unsigned &fld)
Number of history values to be stored for fld-th field. (includes present value!) ...
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of value j in field fld.
ProjectablePMLTimeHarmonicLinearElasticityElement()
Constructor [this was only required explicitly from gcc 4.5.2 onwards...].
A general Finite Element class.
Definition: elements.h:1274
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.
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as ...
Definition: elements.h:1729
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, const unsigned &n_plot)
Output function.
BodyForceFctPt & body_force_fct_pt()
Access function: Pointer to body force function.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:448
void operator=(const PMLTimeHarmonicLinearElasticityEquationsBase< DIM, PML_ELEMENT > &)
Broken assignment operator.
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...
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 nhistory_values_for_coordinate_projection()
Number of positional history values: Read out from positional timestepper (Note: count includes curre...
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:992
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.
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.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as ...
Definition: elements.h:1723
void output(FILE *file_pt)
C-style output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i].
Time-harmonic linear elasticity upgraded to become projectable.
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 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...
static char t char * s
Definition: cfortran.h:572
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Dummy, time dependent error checker.
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
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...
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 get_strain(const Vector< double > &s, DenseMatrix< std::complex< double > > &strain) const
Return the strain tensor.
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
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...
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
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Return the residuals for the solid equations (the discretised principle of virtual displacements) ...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
Definition: timesteppers.h:562
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.
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
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into: for now lump ...
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
Definition: elements.h:2482
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
void body_force(const Vector< double > &x, Vector< std::complex< double > > &b) const
Evaluate body force at Eulerian coordinate x (returns zero vector if no body force function pointer h...
static double Default_omega_sq_value
Static default value for square of frequency.
double *& omega_sq_pt()
Access function for square of non-dim frequency.
BodyForceFctPt body_force_fct_pt() const
Access function: Pointer to body force function (const version)
Class for dense matrices, storing all the values of the matrix as a pointer to a pointer with assorte...
Definition: communicator.h:50
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
const double & omega_sq() const
Access function for square of non-dim frequency.
std::complex< double > E(const unsigned &i, const unsigned &j, const unsigned &k, const unsigned &l) const
Access function to the entries in the elasticity tensor.
PMLTimeHarmonicIsotropicElasticityTensor * Elasticity_tensor_pt
Pointer to the elasticity tensor.
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2146
virtual void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Plot the error when compared against a given exact solution . Also calculates the norm of the error a...
Definition: elements.h:3033
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
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
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