shell_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 KL shell elements
27 #ifndef OOMPH_KIRCHHOFF_LOVE_SHELL_ELEMENTS_HEADER
28 #define OOMPH_KIRCHHOFF_LOVE_SHELL_ELEMENTS_HEADER
29 
30 // Config header generated by autoconfig
31 #ifdef HAVE_CONFIG_H
32 #include <oomph-lib-config.h>
33 #endif
34 
35 // OOMPH-LIB header
36 #include "../generic/hermite_elements.h"
37 #include "../generic/geom_objects.h"
38 #include "../generic/fsi.h"
39 #include "../generic/stored_shape_function_elements.h"
40 #include "../generic/matrices.h"
41 
42 namespace oomph
43 {
44  //========================================================================
47  //========================================================================
49  {
50  private:
52  static double Default_nu_value;
53 
55  static double Default_lambda_sq_value;
56 
58  static double Default_h_value;
59 
62 
64  double* Nu_pt;
65 
67  double* H_pt;
68 
70  double* Lambda_sq_pt;
71 
75 
77  static double Zero_prestress;
78 
79  protected:
81  inline double calculate_contravariant(double A[2][2], double Aup[2][2]);
82 
84  static void Zero_traction_fct(const Vector<double>& xi,
85  const Vector<double>& x,
86  const Vector<double>& N,
88 
95  const Vector<double>& x,
96  const Vector<double>& N,
98 
99 
103 
104 
112 
124  const unsigned& intpt,
125  const Vector<double>& xi,
126  const Vector<double>& x,
127  const Vector<double>& N,
129  {
130  load_vector(intpt, xi, x, N, load);
131  }
132 
133 
134  public:
137  {
138  // Set the default values of physical parameters
142 
143  // Don't ignore membrane terms
144  Ignore_membrane_terms = false;
145 
146  // Default load is zero traction
148 
149  // Default prestress is zero
150  Prestress_pt.resize(2, 2);
151  Prestress_pt(0, 0) = &Zero_prestress;
152  Prestress_pt(1, 0) = &Zero_prestress;
153  Prestress_pt(0, 1) = &Zero_prestress;
154  Prestress_pt(1, 1) = &Zero_prestress;
155  }
156 
158  void (*&load_vector_fct_pt())(const Vector<double>& xi,
159  const Vector<double>& x,
160  const Vector<double>& N,
162  {
163  return Load_vector_fct_pt;
164  }
165 
172  virtual void load_vector(const unsigned& intpt,
173  const Vector<double>& xi,
174  const Vector<double>& x,
175  const Vector<double>& N,
177  {
178  Load_vector_fct_pt(xi, x, N, load);
179  }
180 
181 
185  void set_prestress_pt(const unsigned& i,
186  const unsigned& j,
187  double* value_pt)
188  {
189  Prestress_pt(i, j) = value_pt;
190  Prestress_pt(j, i) = value_pt;
191  }
192 
195  double prestress(const unsigned& i, const unsigned& j)
196  {
197  return *Prestress_pt(i, j);
198  }
199 
202  {
203  Ignore_membrane_terms = true;
204  }
205 
208  {
209  Ignore_membrane_terms = false;
210  }
211 
213  const double& nu() const
214  {
215  return *Nu_pt;
216  }
217 
219  const double& h() const
220  {
221  return *H_pt;
222  }
223 
225  const double& lambda_sq() const
226  {
227  return *Lambda_sq_pt;
228  }
229 
231  double*& nu_pt()
232  {
233  return Nu_pt;
234  }
235 
237  double*& h_pt()
238  {
239  return H_pt;
240  }
241 
243  double*& lambda_sq_pt()
244  {
245  return Lambda_sq_pt;
246  }
247 
251  {
252  return Undeformed_midplane_pt;
253  }
254 
256  void get_normal(const Vector<double>& s, Vector<double>& N);
257 
260  {
261  // Simply call the shell residuals
263  }
264 
267  DenseMatrix<double>& jacobian);
268 
270  void get_energy(double& pot_en, double& kin_en);
271 
272 
276  std::pair<double, double> get_strain_and_bend(const Vector<double>& s,
277  DenseDoubleMatrix& strain,
278  DenseDoubleMatrix& bend);
279 
280 
290  double load_rate_of_work();
291 
293  void output(std::ostream& outfile)
294  {
295  FiniteElement::output(outfile);
296  }
297 
299  void output(std::ostream& outfile, const unsigned& n_plot)
300  {
301  FiniteElement::output(outfile, n_plot);
302  }
303 
305  void output(FILE* file_pt)
306  {
307  FiniteElement::output(file_pt);
308  }
309 
311  void output(FILE* file_pt, const unsigned& n_plot)
312  {
313  FiniteElement::output(file_pt, n_plot);
314  }
315  };
316 
317 
318  //==================================================================
320  //==================================================================
322  double Aup[2][2])
323  {
324  // Calculate determinant
325  double det = A[0][0] * A[1][1] - A[0][1] * A[1][0];
326 
327  // Calculate entries of the inverse
328  Aup[0][0] = A[1][1] / det;
329  Aup[0][1] = -A[0][1] / det;
330  Aup[1][0] = -A[1][0] / det;
331  Aup[1][1] = A[0][0] / det;
332 
333  // Return determinant
334  return (det);
335  }
336 
337 
338  //=======================================================================
344  //=======================================================================
345  class HermiteShellElement : public virtual SolidQHermiteElement<2>,
347  {
348  public:
352  {
353  // Set the number of dimensions at each node (3D nodes on 2D surface)
355  }
356 
358  void output_with_time_dep_quantities(std::ostream& outfile,
359  const unsigned& n_plot);
360 
362  void output(std::ostream& outfile)
363  {
365  }
366 
368  void output(std::ostream& outfile, const unsigned& n_plot);
369 
371  void output(FILE* file_pt)
372  {
374  }
375 
377  void output(FILE* file_pt, const unsigned& n_plot);
378  };
379 
380 
381  //=========================================================================
389  //=========================================================================
391  public SolidDiagQHermiteElement<2>
392  {
393  public:
397  {
398  }
399  };
400 
401 
405 
406 
407  //=======================================================================
409  //=======================================================================
410  template<>
412  : public virtual SolidQHermiteElement<1>
413  {
414  public:
418  };
419 
420 
424 
425 
426  //=========================================================================
429  //=========================================================================
431  public virtual FSIWallElement
432  {
433  private:
443  const unsigned& intpt,
444  const Vector<double>& xi,
445  const Vector<double>& x,
446  const Vector<double>& N,
448  {
451  {
452  fluid_load_vector(intpt, N, load);
453  }
454  // Get full load vector as per default
455  else
456  {
457  load_vector(intpt, xi, x, N, load);
458  }
459  }
460 
463 
467 
468  public:
480  {
481  unsigned n_lagr = 2;
482  unsigned n_dim = 3;
483  setup_fsi_wall_element(n_lagr, n_dim);
484  }
485 
488 
492  {
494  }
495 
499  {
500  Normal_points_into_fluid = false;
501  }
502 
503 
507  const Vector<double>& s, DenseMatrix<double>& drdxi) const;
508 
509 
514  {
516  double tmp = load_rate_of_work();
518  return tmp;
519  }
520 
521 
532  void load_vector(const unsigned& intpt,
533  const Vector<double>& xi,
534  const Vector<double>& x,
535  const Vector<double>& N,
537  {
538  // Initially call the standard Load_vector_fct_pt
539  Load_vector_fct_pt(xi, x, N, load);
540 
541  // Memory for the FSI load
542  Vector<double> fsi_load(3);
543 
544  // Get the fluid load on the wall stress scale
545  fluid_load_vector(intpt, N, fsi_load);
546 
547  // If the normal is outer to the fluid switch the direction
548  double sign = 1.0;
550  {
551  sign = -1.0;
552  }
553 
554  // Add the FSI load to the load vector
555  for (unsigned i = 0; i < 3; i++)
556  {
557  load[i] += sign * fsi_load[i];
558  }
559  }
560 
565  DenseMatrix<double>& jacobian)
566  {
567  // Call the basic shell jacobian
569  jacobian);
570  // Fill in the external interaction by finite differences
572  }
573 
574 
577  unsigned ndof_types() const
578  {
579  return 1;
580  }
581 
589  std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list) const;
590  };
591 
592 
596 
597 
598  //======================================================================
628  //======================================================================
630  : public virtual FaceGeometry<HermiteShellElement>,
631  public virtual SolidFaceElement
632  {
633  public:
637  FiniteElement* const& bulk_el_pt, const int& face_index);
638 
639 
642  {
643  throw OomphLibError("Don't call empty constructor for "
644  "ClampedHermiteShellBoundaryConditionElement",
647  }
648 
651  const ClampedHermiteShellBoundaryConditionElement& dummy) = delete;
652 
655 
657  void set_symmetry_line(const Vector<double>& normal_to_clamping_plane)
658  {
659  Normal_to_clamping_plane[0] = normal_to_clamping_plane[0];
660  Normal_to_clamping_plane[1] = normal_to_clamping_plane[1];
661  Normal_to_clamping_plane[2] = normal_to_clamping_plane[2];
662  }
663 
666 
667 
669  // Note: We should also overload all other versions of shape(...)
670  // and dshape(...) but these are the only ones that are used.
672 
673 
676  void shape(const Vector<double>& s, Shape& psi) const
677  {
678  // Initialise all of them to zero
679  unsigned n = psi.nindex1();
680  unsigned m = psi.nindex2();
681  for (unsigned i = 0; i < n; i++)
682  {
683  for (unsigned j = 0; j < m; j++)
684  {
685  psi(i, j) = 0.0;
686  }
687  }
689  }
690 
691 
694  void dshape_local(const Vector<double>& s, Shape& psi, DShape& dpsids) const
695  {
696  // Initialise all of them to zero
697  unsigned n = psi.nindex1();
698  unsigned m = psi.nindex2();
699  for (unsigned i = 0; i < n; i++)
700  {
701  for (unsigned j = 0; j < m; j++)
702  {
703  psi(i, j) = 0.0;
704  }
705  }
706  unsigned n1 = dpsids.nindex1();
707  unsigned n2 = dpsids.nindex2();
708  unsigned n3 = dpsids.nindex3();
709  for (unsigned i = 0; i < n1; i++)
710  {
711  for (unsigned j = 0; j < n2; j++)
712  {
713  for (unsigned k = 0; k < n3; k++)
714  {
715  dpsids(i, j, k) = 0.0;
716  }
717  }
718  }
720  }
721 
724  void output(std::ostream& outfile)
725  {
726  FiniteElement::output(outfile);
727  }
728 
730  void output(std::ostream& outfile, const unsigned& n_plot);
731 
734  void output(FILE* file_pt)
735  {
736  FiniteElement::output(file_pt);
737  }
738 
742  void output(FILE* file_pt, const unsigned& n_plot)
743  {
744  FiniteElement::output(file_pt, n_plot);
745  }
746 
749  unsigned ndof_types() const
750  {
751  return 1;
752  }
753 
761  std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list) const;
762 
763 
764  private:
767  };
768 
769 
770 } // namespace oomph
771 
772 #endif
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
void load(Archive &ar, ParticleHandler &handl)
Definition: Particles.h:21
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
void output(std::ostream &outfile)
Definition: shell_elements.h:724
unsigned ndof_types() const
Definition: shell_elements.h:749
ClampedHermiteShellBoundaryConditionElement()
Broken empty constructor.
Definition: shell_elements.h:641
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Definition: shell_elements.cc:1789
void set_symmetry_line(const Vector< double > &normal_to_clamping_plane)
Set normal vector to clamping plane.
Definition: shell_elements.h:657
void dshape_local(const Vector< double > &s, Shape &psi, DShape &dpsids) const
Definition: shell_elements.h:694
void operator=(const ClampedHermiteShellBoundaryConditionElement &)=delete
Broken assignment operator.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the element's contribution to its residual vector.
Definition: shell_elements.cc:1520
ClampedHermiteShellBoundaryConditionElement(const ClampedHermiteShellBoundaryConditionElement &dummy)=delete
Broken copy constructor.
void output(FILE *file_pt, const unsigned &n_plot)
Definition: shell_elements.h:742
Vector< double > Normal_to_clamping_plane
Normal vector to the clamping plane.
Definition: shell_elements.h:766
void shape(const Vector< double > &s, Shape &psi) const
Definition: shell_elements.h:676
void output(FILE *file_pt)
Definition: shell_elements.h:734
Definition: shape.h:278
unsigned long nindex3() const
Return the range of index 3 of the derivatives of the shape functions.
Definition: shape.h:506
unsigned long nindex2() const
Return the range of index 2 of the derivatives of the shape functions.
Definition: shape.h:500
unsigned long nindex1() const
Return the range of index 1 of the derivatives of the shape functions.
Definition: shape.h:494
Definition: matrices.h:1271
void resize(const unsigned long &n)
Definition: matrices.h:498
Definition: shell_elements.h:392
DiagHermiteShellElement()
Constructor, there are no internal data points.
Definition: shell_elements.h:395
void fill_in_jacobian_from_external_interaction_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: element_with_external_element.h:345
Definition: shell_elements.h:432
void load_vector(const unsigned &intpt, const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Definition: shell_elements.h:532
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Definition: shell_elements.cc:1398
void set_normal_pointing_out_of_fluid()
Definition: shell_elements.h:498
bool Compute_rate_of_work_by_load_with_fluid_load_only
Definition: shell_elements.h:466
virtual void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: shell_elements.h:564
FSIDiagHermiteShellElement()
Definition: shell_elements.h:476
~FSIDiagHermiteShellElement()
Destructor: empty.
Definition: shell_elements.h:487
void dposition_dlagrangian_at_local_coordinate(const Vector< double > &s, DenseMatrix< double > &drdxi) const
Definition: shell_elements.cc:1332
unsigned ndof_types() const
Definition: shell_elements.h:577
bool Normal_points_into_fluid
Boolean flag to indicate whether the normal is directed into the fluid.
Definition: shell_elements.h:462
void set_normal_pointing_into_fluid()
Definition: shell_elements.h:491
double fluid_load_rate_of_work()
Definition: shell_elements.h:513
virtual void load_vector_for_rate_of_work_computation(const unsigned &intpt, const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Definition: shell_elements.h:442
Definition: fsi.h:194
void setup_fsi_wall_element(const unsigned &nlagr_solid, const unsigned &ndim_fluid)
Definition: fsi.cc:121
void fluid_load_vector(const unsigned &intpt, const Vector< double > &N, Vector< double > &load)
Definition: fsi.cc:162
int & face_index()
Definition: elements.h:4626
FaceGeometry()
Definition: shell_elements.h:417
Definition: elements.h:4998
Definition: elements.h:1313
void set_nodal_dimension(const unsigned &nodal_dim)
Definition: elements.h:1390
virtual void output(std::ostream &outfile)
Definition: elements.h:3050
Definition: geom_objects.h:101
Definition: shell_elements.h:347
void output(FILE *file_pt)
Overload the output function.
Definition: shell_elements.h:371
void output_with_time_dep_quantities(std::ostream &outfile, const unsigned &n_plot)
Output position veloc and accel.
Definition: shell_elements.cc:1233
void output(std::ostream &outfile)
Overload the output function.
Definition: shell_elements.h:362
HermiteShellElement()
Constructor, there are no internal data points.
Definition: shell_elements.h:350
Definition: shell_elements.h:49
void fill_in_contribution_to_residuals_shell(Vector< double > &residuals)
Return the residuals for the equations of KL shell theory.
Definition: shell_elements.cc:357
double *& lambda_sq_pt()
Return a pointer to timescale ratio (nondim density)
Definition: shell_elements.h:243
static void Zero_traction_fct(const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Default load function (zero traction)
Definition: shell_elements.cc:50
const double & nu() const
Return the Poisson's ratio.
Definition: shell_elements.h:213
double *& h_pt()
Return a pointer to the non-dim wall thickness.
Definition: shell_elements.h:237
void output(FILE *file_pt, const unsigned &n_plot)
Generic FiniteElement output function.
Definition: shell_elements.h:311
bool Ignore_membrane_terms
Boolean flag to ignore membrane terms.
Definition: shell_elements.h:61
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Return the jacobian is calculated by finite differences by default,.
Definition: shell_elements.cc:744
double * H_pt
Pointer to dimensionless wall thickness.
Definition: shell_elements.h:67
void(*&)(const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load) load_vector_fct_pt()
Access to the load vector function pointer.
Definition: shell_elements.h:158
KirchhoffLoveShellEquations()
Constructor: Initialise physical parameter values to defaults.
Definition: shell_elements.h:136
void output(std::ostream &outfile, const unsigned &n_plot)
Generic FiniteElement output function.
Definition: shell_elements.h:299
double prestress(const unsigned &i, const unsigned &j)
Definition: shell_elements.h:195
static double Default_lambda_sq_value
Static default value for the timescale ratio (1.0 for natural scaling)
Definition: shell_elements.h:55
double calculate_contravariant(double A[2][2], double Aup[2][2])
Invert a DIM by DIM matrix.
Definition: shell_elements.h:321
DenseMatrix< double * > Prestress_pt
Definition: shell_elements.h:74
double * Lambda_sq_pt
Pointer to timescale ratio (non-dimensional density)
Definition: shell_elements.h:70
static double Zero_prestress
Static default for prestress (set to zero)
Definition: shell_elements.h:77
void get_energy(double &pot_en, double &kin_en)
Get potential (strain) and kinetic energy of the element.
Definition: shell_elements.cc:777
void output(std::ostream &outfile)
Generic FiniteElement output function.
Definition: shell_elements.h:293
void get_normal(const Vector< double > &s, Vector< double > &N)
Get normal vector.
Definition: shell_elements.cc:72
const double & lambda_sq() const
Return the timescale ratio (non-dimensional density)
Definition: shell_elements.h:225
double * Nu_pt
Pointer to Poisson's ratio.
Definition: shell_elements.h:64
static double Default_h_value
Static default value for the thickness ratio.
Definition: shell_elements.h:58
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Overload the standard fill in residuals contribution.
Definition: shell_elements.h:259
double load_rate_of_work()
Definition: shell_elements.cc:1080
GeomObject *& undeformed_midplane_pt()
Definition: shell_elements.h:250
void(* Load_vector_fct_pt)(const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Definition: shell_elements.h:94
static double Default_nu_value
Static default value for the Poisson's ratio.
Definition: shell_elements.h:52
void set_prestress_pt(const unsigned &i, const unsigned &j, double *value_pt)
Definition: shell_elements.h:185
double *& nu_pt()
Return a pointer to the Poisson ratio.
Definition: shell_elements.h:231
virtual void load_vector(const unsigned &intpt, const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Definition: shell_elements.h:172
std::pair< double, double > get_strain_and_bend(const Vector< double > &s, DenseDoubleMatrix &strain, DenseDoubleMatrix &bend)
Get strain and bending tensors.
Definition: shell_elements.cc:154
void enable_membrane_terms()
Set to renable the calculation of membrane terms (default)
Definition: shell_elements.h:207
void output(FILE *file_pt)
Generic FiniteElement output function.
Definition: shell_elements.h:305
void disable_membrane_terms()
Set to disable the calculation of membrane terms.
Definition: shell_elements.h:201
virtual void load_vector_for_rate_of_work_computation(const unsigned &intpt, const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Definition: shell_elements.h:123
const double & h() const
Return the wall thickness to undeformed radius ratio.
Definition: shell_elements.h:219
GeomObject * Undeformed_midplane_pt
Definition: shell_elements.h:102
Definition: oomph_definitions.h:222
Definition: shape.h:76
unsigned nindex1() const
Return the range of index 1 of the shape function object.
Definition: shape.h:259
unsigned nindex2() const
Return the range of index 2 of the shape function object.
Definition: shape.h:265
Definition: hermite_elements.h:570
Definition: elements.h:4914
Definition: elements.h:3561
Definition: hermite_elements.h:504
void output(std::ostream &outfile)
Overload the output function.
Definition: hermite_elements.cc:1072
@ N
Definition: constructor.cpp:22
RealScalar s
Definition: level1_cplx_impl.h:130
int * m
Definition: level2_cplx_impl.h:294
char char char int int * k
Definition: level2_impl.h:374
Eigen::Matrix< Scalar, Dynamic, Dynamic, ColMajor > tmp
Definition: level3_impl.h:365
T sign(T x)
Definition: cxx11_tensor_builtins_sycl.cpp:172
void shape(const double &s, double *Psi)
Definition: shape.h:564
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
list x
Definition: plotDoE.py:28
#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