Tpml_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// Copyright (C) 2006-2022 Matthias Heil and Andrew Hazel
7 // LIC//
8 // LIC// This library is free software; you can redistribute it and/or
9 // LIC// modify it under the terms of the GNU Lesser General Public
10 // LIC// License as published by the Free Software Foundation; either
11 // LIC// version 2.1 of the License, or (at your option) any later version.
12 // LIC//
13 // LIC// This library is distributed in the hope that it will be useful,
14 // LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // LIC// Lesser General Public License for more details.
17 // LIC//
18 // LIC// You should have received a copy of the GNU Lesser General Public
19 // LIC// License along with this library; if not, write to the Free Software
20 // LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 // LIC// 02110-1301 USA.
22 // LIC//
23 // LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24 // LIC//
25 // LIC//====================================================================
26 // Header file for Tri/Tet linear elasticity elements
27 #ifndef OOMPH_TPML_TIME_HARMONIC_LINEAR_ELASTICITY_ELEMENTS_HEADER
28 #define OOMPH_TPML_TIME_HARMONIC_LINEAR_ELASTICITY_ELEMENTS_HEADER
29 
30 
31 // Config header generated by autoconfig
32 #ifdef HAVE_CONFIG_H
33 #include <oomph-lib-config.h>
34 #endif
35 
36 
37 // OOMPH-LIB headers
38 #include "../generic/nodes.h"
39 #include "../generic/oomph_utilities.h"
40 #include "../generic/Telements.h"
41 #include "../generic/error_estimator.h"
42 
44 
45 namespace oomph
46 {
49  // TPMLTimeHarmonicLinearElasticityElement
52 
53 
54  //======================================================================
61  //======================================================================
62  template<unsigned DIM, unsigned NNODE_1D>
64  : public TElement<DIM, NNODE_1D>,
66  public virtual ElementWithZ2ErrorEstimator
67  {
68  public:
72  : TElement<DIM, NNODE_1D>(),
74  {
75  }
76 
77 
81  delete;
82 
84  void operator=(
86 
88  void output(std::ostream& outfile)
89  {
91  }
92 
94  void output(std::ostream& outfile, const unsigned& nplot)
95  {
97  }
98 
99 
101  void output(FILE* file_pt)
102  {
104  }
105 
107  void output(FILE* file_pt, const unsigned& n_plot)
108  {
110  }
111 
112 
114  unsigned nvertex_node() const
115  {
117  }
118 
120  Node* vertex_node_pt(const unsigned& j) const
121  {
123  }
124 
127  unsigned nrecovery_order()
128  {
129  return NNODE_1D - 1;
130  }
131 
133  unsigned num_Z2_flux_terms()
134  {
135  // DIM Diagonal strain rates and DIM*(DIM-1)/2 off diagonal terms
136  return 2 * (DIM + DIM * (DIM - 1) / 2);
137  }
138 
142  {
143 #ifdef PARANOID
144  unsigned num_entries = 2 * (DIM + ((DIM * DIM) - DIM) / 2);
145  if (flux.size() != num_entries)
146  {
147  std::ostringstream error_message;
148  error_message << "The flux vector has the wrong number of entries, "
149  << flux.size() << ", whereas it should be " << num_entries
150  << std::endl;
151  throw OomphLibError(error_message.str(),
154  }
155 #endif
156 
157  // Get strain matrix
159  this->get_strain(s, strain);
160 
161  // Pack into flux Vector
162  unsigned icount = 0;
163 
164  // Start with diagonal terms
165  for (unsigned i = 0; i < DIM; i++)
166  {
167  flux[icount] = strain(i, i).real();
168  icount++;
169  flux[icount] = strain(i, i).imag();
170  icount++;
171  }
172 
173  // Off diagonals row by row
174  for (unsigned i = 0; i < DIM; i++)
175  {
176  for (unsigned j = i + 1; j < DIM; j++)
177  {
178  flux[icount] = strain(i, j).real();
179  icount++;
180  flux[icount] = strain(i, j).imag();
181  icount++;
182  }
183  }
184  }
185  };
186 
187  //=======================================================================
193  //=======================================================================
194  template<unsigned DIM, unsigned NNODE_1D>
196  : public virtual TElement<DIM - 1, NNODE_1D>
197  {
198  public:
201  FaceGeometry() : TElement<DIM - 1, NNODE_1D>() {}
202  };
203 
204  //=======================================================================
207  //=======================================================================
208  template<unsigned NNODE_1D>
210  : public virtual PointElement
211  {
212  public:
216  };
217 
218 
222 
223 
224  //=======================================================================
228  //=======================================================================
229  template<unsigned NNODE_1D>
231  : public virtual QPMLTimeHarmonicLinearElasticityElement<2, NNODE_1D>
232  {
233  public:
237  {
238  }
239  };
240 
241  //=======================================================================
247  //=======================================================================
248  template<unsigned DIM, unsigned NNODE_1D>
251  : public virtual QElement<DIM - 1, NNODE_1D>
252  {
253  public:
256  FaceGeometry() : QElement<DIM - 1, NNODE_1D>() {}
257  };
258 
259 
263 
264 
265  //=======================================================================
269  //=======================================================================
270  template<unsigned NNODE_1D>
273  : public virtual QPMLTimeHarmonicLinearElasticityElement<2, NNODE_1D>
274  {
275  public:
279  {
280  }
281  };
282 
283 
284 } // namespace oomph
285 
286 #endif
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Definition: matrices.h:386
Definition: error_estimator.h:79
FaceGeometry()
Definition: Tpml_time_harmonic_linear_elasticity_elements.h:256
FaceGeometry()
Definition: Tpml_time_harmonic_linear_elasticity_elements.h:215
FaceGeometry()
Definition: Tpml_time_harmonic_linear_elasticity_elements.h:201
Definition: elements.h:4998
Definition: nodes.h:906
Definition: oomph_definitions.h:222
PMLLayerElement()
Definition: Tpml_time_harmonic_linear_elasticity_elements.h:236
Definition: pml_meshes.h:48
void get_strain(const Vector< double > &s, DenseMatrix< std::complex< double >> &strain) const
Return the strain tensor.
Definition: pml_time_harmonic_linear_elasticity_elements.cc:49
Definition: pml_time_harmonic_linear_elasticity_elements.h:448
void output(std::ostream &outfile)
Output: x,y,[z],u_r,v_r,[w_r],u_i,v_i,[w_i].
Definition: pml_time_harmonic_linear_elasticity_elements.h:490
Definition: elements.h:3439
Time-harmonic linear elasticity upgraded to become projectable.
Definition: pml_time_harmonic_linear_elasticity_elements.h:714
Definition: Qelements.h:459
Definition: pml_time_harmonic_linear_elasticity_elements.h:585
Definition: Telements.h:1208
Definition: Tpml_time_harmonic_linear_elasticity_elements.h:67
void output(std::ostream &outfile)
Output function:
Definition: Tpml_time_harmonic_linear_elasticity_elements.h:88
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Definition: Tpml_time_harmonic_linear_elasticity_elements.h:141
TPMLTimeHarmonicLinearElasticityElement(const TPMLTimeHarmonicLinearElasticityElement< DIM, NNODE_1D > &dummy)=delete
Broken copy constructor.
void output(std::ostream &outfile, const unsigned &nplot)
Output function:
Definition: Tpml_time_harmonic_linear_elasticity_elements.h:94
void output(FILE *file_pt)
C-style output function:
Definition: Tpml_time_harmonic_linear_elasticity_elements.h:101
unsigned nrecovery_order()
Definition: Tpml_time_harmonic_linear_elasticity_elements.h:127
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
Definition: Tpml_time_harmonic_linear_elasticity_elements.h:120
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
Definition: Tpml_time_harmonic_linear_elasticity_elements.h:133
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function:
Definition: Tpml_time_harmonic_linear_elasticity_elements.h:107
void operator=(const TPMLTimeHarmonicLinearElasticityElement< DIM, NNODE_1D > &)=delete
Broken assignment operator.
unsigned nvertex_node() const
Number of vertex nodes in the element.
Definition: Tpml_time_harmonic_linear_elasticity_elements.h:114
TPMLTimeHarmonicLinearElasticityElement()
Definition: Tpml_time_harmonic_linear_elasticity_elements.h:71
RealScalar s
Definition: level1_cplx_impl.h:130
#define DIM
Definition: linearised_navier_stokes_elements.h:44
void flux(const double &time, const Vector< double > &x, double &flux)
Get flux applied along boundary x=0.
Definition: pretend_melt.cc:59
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2