beam_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 beam elements
27 #ifndef OOMPH_KIRCHHOFF_LOVE_BEAM_ELEMENTS_HEADER
28 #define OOMPH_KIRCHHOFF_LOVE_BEAM_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 files
36 #include "../generic/hermite_elements.h"
37 #include "../generic/geom_objects.h"
38 #include "../generic/fsi.h"
39 #include "../generic/block_preconditioner.h"
40 
41 namespace oomph
42 {
43  //=======================================================================
92  //=======================================================================
94  {
95  private:
97  static double Default_sigma0_value;
98 
100  static double Default_lambda_sq_value;
101 
103  // i.e. The reference value 'h_0'
104  static double Default_h_value;
105 
107  double* Sigma0_pt;
108 
110  // i.e. The reference value 'h_0'
111  double* H_pt;
112 
114  double* Lambda_sq_pt;
115 
116  protected:
118  static void Zero_traction_fct(const Vector<double>& xi,
119  const Vector<double>& x,
120  const Vector<double>& N,
122 
129  const Vector<double>& x,
130  const Vector<double>& N,
132 
134  static void Unit_profile_fct(const Vector<double>& xi,
135  const Vector<double>& x,
136  double& h_ratio);
137 
144  const Vector<double>& x,
145  double& h_ratio);
146 
150 
151  public:
155  {
156  // Set physical parameter pointers to the default values
159  // The reference thickness 'h_0'
161  // Zero traction
163  // Unit thickness profile
165  }
166 
167 
169  void (*&load_vector_fct_pt())(const Vector<double>& xi,
170  const Vector<double>& x,
171  const Vector<double>& N,
173  {
174  return Load_vector_fct_pt;
175  }
176 
177 
183  virtual void load_vector(const unsigned& intpt,
184  const Vector<double>& xi,
185  const Vector<double>& x,
186  const Vector<double>& N,
188  {
189  Load_vector_fct_pt(xi, x, N, load);
190  }
191 
193  void (*&wall_profile_fct_pt())(const Vector<double>& xi,
194  const Vector<double>& x,
195  double& h_ratio)
196  {
197  return Wall_profile_fct_pt;
198  }
199 
200 
205  void wall_profile(const Vector<double>& xi,
206  const Vector<double>& x,
207  double& h_ratio)
208  {
209  Wall_profile_fct_pt(xi, x, h_ratio);
210  }
211 
212 
214  // i.e. the reference value 'h_0'
215  const double& h() const
216  {
217  return *H_pt;
218  }
219 
221  const double& lambda_sq() const
222  {
223  return *Lambda_sq_pt;
224  }
225 
227  const double& sigma0() const
228  {
229  return *Sigma0_pt;
230  }
231 
233  double*& sigma0_pt()
234  {
235  return Sigma0_pt;
236  }
237 
239  // i.e. the reference value 'h_0'
240  double*& h_pt()
241  {
242  return H_pt;
243  }
244 
246  double*& lambda_sq_pt()
247  {
248  return Lambda_sq_pt;
249  }
250 
254  {
255  return Undeformed_beam_pt;
256  }
257 
260  {
261  Vector<double> r(2);
262  get_normal(s, r, N);
263  }
264 
265 
267  void get_normal(const Vector<double>& s,
268  Vector<double>& r,
269  Vector<double>& N);
270 
274  Vector<double>& r,
275  Vector<double>& drds);
276 
282  {
284  }
285 
286 
292 
293 
296  Vector<double>& residuals, DenseMatrix<double>& jacobian);
297 
299  void get_energy(double& pot_en, double& kin_en);
300 
303  void get_energy(double& stretch, double& bend, double& kin_en);
304  };
305 
306 
307  //=========================================================================
310  //=========================================================================
311  class HermiteBeamElement : public virtual SolidQHermiteElement<1>,
313  {
314  public:
318  {
319  // Set the number of dimensions at each node (2D node on 1D surface)
321  }
322 
324  void output(std::ostream& outfile);
325 
327  void output(std::ostream& outfile, const unsigned& n_plot);
328 
331  void output(const unsigned& t,
332  std::ostream& outfile,
333  const unsigned& n_plot) const;
334 
336  void output(FILE* file_pt);
337 
339  void output(FILE* file_pt, const unsigned& n_plot);
340 
343  void output(const unsigned& t, FILE* file_pt, const unsigned& n_plot) const;
344  };
345 
346  //=========================================================================
349  //=========================================================================
351  public virtual FSIWallElement
352  {
353  private:
354  // Boolean flag to indicate whether the normal is directed into the fluid
356 
357  public:
366  {
367  unsigned n_lagr = 1;
368  unsigned n_dim = 2;
369  setup_fsi_wall_element(n_lagr, n_dim);
370  }
371 
374 
378  {
380  }
381 
385  {
386  Normal_points_into_fluid = false;
387  }
388 
389 
393  const Vector<double>& s, DenseMatrix<double>& drdxi) const;
394 
405  void load_vector(const unsigned& intpt,
406  const Vector<double>& xi,
407  const Vector<double>& x,
408  const Vector<double>& N,
410  {
411  // Initially call the standard Load_vector_fct_pt
412  Load_vector_fct_pt(xi, x, N, load);
413 
414  // Memory for the FSI load
415  Vector<double> fsi_load(2);
416 
417  // Get the fluid load on the wall stress scale
418  fluid_load_vector(intpt, N, fsi_load);
419 
420  // If the normal is outer to the fluid switch the direction
421  double sign = 1.0;
423  {
424  sign = -1.0;
425  }
426 
427  // Add the FSI load to the load vector
428  for (unsigned i = 0; i < 2; i++)
429  {
430  load[i] += sign * fsi_load[i];
431  }
432  }
433 
438  DenseMatrix<double>& jacobian)
439  {
440  // Call the standard beam element's jacobian function
442  // Now add the external interaction data by finite differences
444  }
445 
454  void locate_zeta(const Vector<double>& zeta,
455  GeomObject*& geom_object_pt,
456  Vector<double>& s,
457  const bool& use_coordinate_as_initial_guess = false);
458 
459 
462  unsigned ndof_types() const
463  {
464  return 1;
465  }
466 
474  std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list) const;
475  };
476 
477 
481 
482 
483  //=======================================================================
485  //=======================================================================
486  template<>
488  {
489  public:
493  };
494 
495 
499 
500 
501  //======================================================================
508  //======================================================================
510  : public virtual FaceGeometry<HermiteBeamElement>,
511  public virtual SolidFaceElement
512  {
513  public:
520  FiniteElement* const& bulk_el_pt, const int& face_index);
521 
524  {
525  throw OomphLibError("Don't call empty constructor for "
526  "ClampedSlidingHermiteBeamBoundaryConditionElement ",
529  }
530 
531 
535 
537  // Commented out broken assignment operator because this can lead to a
538  // conflict warning when used in the virtual inheritence hierarchy.
539  // Essentially the compiler doesn't realise that two separate
540  // implementations of the broken function are the same and so, quite
541  // rightly, it shouts.
542  /*void operator=(const ClampedSlidingHermiteBeamBoundaryConditionElement&) =
543  delete;*/
544 
545 
548  void set_symmetry_line(const Vector<double>& vector_to_symmetry_line,
549  const Vector<double>& normal_to_symmetry_line)
550  {
551  Vector_to_symmetry_line[0] = vector_to_symmetry_line[0];
552  Vector_to_symmetry_line[1] = vector_to_symmetry_line[1];
553  Normal_to_symmetry_line[0] = normal_to_symmetry_line[0];
554  Normal_to_symmetry_line[1] = normal_to_symmetry_line[1];
555  }
556 
557 
560 
561 
564  void output(std::ostream& outfile)
565  {
566  FiniteElement::output(outfile);
567  }
568 
571  void output(std::ostream& outfile, const unsigned& n_plot)
572  {
573  FiniteElement::output(outfile, n_plot);
574  }
575 
578  void output(FILE* file_pt)
579  {
580  FiniteElement::output(file_pt);
581  }
582 
586  void output(FILE* file_pt, const unsigned& n_plot)
587  {
588  FiniteElement::output(file_pt, n_plot);
589  }
590 
591  private:
595 
599  };
600 
601 
602 } // namespace oomph
603 
604 #endif
int i
Definition: BiCGSTAB_step_by_step.cpp:9
void load(Archive &ar, ParticleHandler &handl)
Definition: Particles.h:21
void output(FILE *file_pt, const unsigned &n_plot)
Definition: beam_elements.h:586
Vector< double > Vector_to_symmetry_line
Definition: beam_elements.h:594
void set_symmetry_line(const Vector< double > &vector_to_symmetry_line, const Vector< double > &normal_to_symmetry_line)
Broken assignment operator.
Definition: beam_elements.h:548
void output(std::ostream &outfile, const unsigned &n_plot)
Definition: beam_elements.h:571
ClampedSlidingHermiteBeamBoundaryConditionElement(const ClampedSlidingHermiteBeamBoundaryConditionElement &dummy)=delete
Broken copy constructor.
void output(FILE *file_pt)
Definition: beam_elements.h:578
void output(std::ostream &outfile)
Definition: beam_elements.h:564
Vector< double > Normal_to_symmetry_line
Definition: beam_elements.h:598
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the element's contribution to its residual vector.
Definition: beam_elements.cc:1357
ClampedSlidingHermiteBeamBoundaryConditionElement()
Broken empty constructor.
Definition: beam_elements.h:523
void fill_in_jacobian_from_external_interaction_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: element_with_external_element.h:345
Definition: beam_elements.h:352
void dposition_dlagrangian_at_local_coordinate(const Vector< double > &s, DenseMatrix< double > &drdxi) const
Definition: beam_elements.cc:1199
FSIHermiteBeamElement()
Definition: beam_elements.h:364
unsigned ndof_types() const
Definition: beam_elements.h:462
void set_normal_pointing_into_fluid()
Definition: beam_elements.h:377
~FSIHermiteBeamElement()
Destructor: empty.
Definition: beam_elements.h:373
virtual void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: beam_elements.h:437
void set_normal_pointing_out_of_fluid()
Definition: beam_elements.h:384
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Definition: beam_elements.cc:1261
void locate_zeta(const Vector< double > &zeta, GeomObject *&geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
Definition: beam_elements.cc:1114
void load_vector(const unsigned &intpt, const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Definition: beam_elements.h:405
bool Normal_points_into_fluid
Definition: beam_elements.h:355
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: beam_elements.h:492
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: beam_elements.h:313
void output(std::ostream &outfile)
Output function.
Definition: beam_elements.cc:929
HermiteBeamElement()
Constructor (empty)
Definition: beam_elements.h:316
Definition: beam_elements.h:94
KirchhoffLoveBeamEquations()
Definition: beam_elements.h:154
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Definition: beam_elements.h:281
static double Default_sigma0_value
Static default value for 2nd Piola Kirchhoff prestress.
Definition: beam_elements.h:97
void(*&)(const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load) load_vector_fct_pt()
Reference to the load vector function pointer.
Definition: beam_elements.h:169
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: beam_elements.cc:51
GeomObject * Undeformed_beam_pt
Definition: beam_elements.h:149
static void Unit_profile_fct(const Vector< double > &xi, const Vector< double > &x, double &h_ratio)
Default profile function (constant thickness 'h_0')
Definition: beam_elements.cc:66
void fill_in_contribution_to_residuals_beam(Vector< double > &residuals)
Definition: beam_elements.cc:275
void(* Load_vector_fct_pt)(const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Definition: beam_elements.h:128
double *& sigma0_pt()
Return a pointer to axial prestress.
Definition: beam_elements.h:233
void(* Wall_profile_fct_pt)(const Vector< double > &xi, const Vector< double > &x, double &h_ratio)
Definition: beam_elements.h:143
double * Lambda_sq_pt
Pointer to Timescale ratio (non-dim. density)
Definition: beam_elements.h:114
void get_non_unit_tangent(const Vector< double > &s, Vector< double > &r, Vector< double > &drds)
Get position vector to and non-unit tangent vector on wall: dr/ds.
Definition: beam_elements.cc:184
void(*&)(const Vector< double > &xi, const Vector< double > &x, double &h_ratio) wall_profile_fct_pt()
Reference to the wall thickness ratio profile function pointer.
Definition: beam_elements.h:193
static double Default_h_value
Static default value for non-dim wall thickness.
Definition: beam_elements.h:104
double * Sigma0_pt
Pointer to axial prestress.
Definition: beam_elements.h:107
const double & lambda_sq() const
Return the timescale ratio (non-dimensional density)
Definition: beam_elements.h:221
void get_normal(const Vector< double > &s, Vector< double > &N)
Get normal vector on wall.
Definition: beam_elements.h:259
static double Default_lambda_sq_value
Static default value for timescale ratio (1.0 – for natural scaling)
Definition: beam_elements.h:100
void wall_profile(const Vector< double > &xi, const Vector< double > &x, double &h_ratio)
Definition: beam_elements.h:205
double *& h_pt()
Return a pointer to non-dim. wall thickness.
Definition: beam_elements.h:240
const double & sigma0() const
Return the axial prestress.
Definition: beam_elements.h:227
void get_energy(double &pot_en, double &kin_en)
Get potential (strain) and kinetic energy of the element.
Definition: beam_elements.cc:568
double *& lambda_sq_pt()
Return a pointer to timescale ratio (nondim density)
Definition: beam_elements.h:246
const double & h() const
Return the non-dimensional wall thickness.
Definition: beam_elements.h:215
GeomObject *& undeformed_beam_pt()
Definition: beam_elements.h:253
double * H_pt
Pointer to wall thickness.
Definition: beam_elements.h:111
virtual void load_vector(const unsigned &intpt, const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Definition: beam_elements.h:183
virtual void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Get FE jacobian and residuals (Jacobian done by finite differences)
Definition: beam_elements.cc:534
Definition: oomph_definitions.h:222
Definition: elements.h:4914
Definition: elements.h:3561
Solid point element.
Definition: elements.h:4980
Definition: hermite_elements.h:504
@ N
Definition: constructor.cpp:22
RealScalar s
Definition: level1_cplx_impl.h:130
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp< Eigen::internal::scalar_zeta_op< typename DerivedX::Scalar >, const DerivedX, const DerivedQ > zeta(const Eigen::ArrayBase< DerivedX > &x, const Eigen::ArrayBase< DerivedQ > &q)
Definition: SpecialFunctionsArrayAPI.h:152
T sign(T x)
Definition: cxx11_tensor_builtins_sycl.cpp:172
r
Definition: UniformPSDSelfTest.py:20
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
list x
Definition: plotDoE.py:28
t
Definition: plotPSD.py:36
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86