circular_shell_mesh.template.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-2024 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 #ifndef OOMPH_CIRCULAR_SHELL_MESH_HEADER
27 #define OOMPH_CIRCULAR_SHELL_MESH_HEADER
28 
29 // Config header generated by autoconfig
30 #ifdef HAVE_CONFIG_H
31 #include <oomph-lib-config.h>
32 #endif
33 
34 // OOMPH-LIB headers
35 #include "../generic/mesh.h"
36 #include "../generic/matrices.h"
37 #include "../generic/quadtree.h"
38 #include "../generic/quad_mesh.h"
40 
41 
42 namespace oomph
43 {
44  //========================================================================
45  /// A 2D solid mesh for (topologically) circular cylindrical shells.
46  /// The shell is represented by two Lagrangian coordinates that correspond
47  /// to z and theta in cylindrical polars. The required mesh is therefore a
48  /// 2D mesh and is therefore inherited from the generic RectangularQuadMesh
49  //=======================================================================
50  template<class ELEMENT>
52  : public virtual RectangularQuadMesh<ELEMENT>,
53  public virtual SolidMesh
54  {
55  public:
56  /// Typedef for fct that defines the axial stretching fct
57  typedef double (*AxialBLStretchingFctPt)(const double& x);
58 
59  /// Constructor for the mesh -- uniformly spaced elements
61  const unsigned& nx,
62  const unsigned& ny,
63  const double& lx,
64  const double& ly,
65  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
66  : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt)
67  {
68  // Use default stretching fct
70 
71  // Assign dummy data consistent with uniform spacing
72  Nx_bl = 1;
73  Delta_bl = lx / double(nx);
74 
75  // Build mesh
76  this->build_mesh(nx, ny, lx, ly);
77  }
78 
79 
80  /// Constructor for the mesh -- specify fct that maps axial
81  /// Lagr. coordinates to new positions to allow for better resolution of
82  /// bending boundary layer
84  const unsigned& nx,
85  const unsigned& ny,
86  const double& lx,
87  const double& ly,
89  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
90  : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt)
91  {
92  // Apply stretching fct
94 
95  // Assign dummy data consistent with uniform spacing
96  Nx_bl = 1;
97  Delta_bl = lx / double(nx);
98 
99  // Build mesh
100  this->build_mesh(nx, ny, lx, ly);
101  }
102 
103  /// Constructor for the mesh. nx_bl azimuthal layers of
104  /// elements near the ends are squashed to that axial extent
105  /// of the elements changes from lx/nx to delta_bl.
107  const unsigned& nx,
108  const unsigned& ny,
109  const double& lx,
110  const double& ly,
111  const unsigned& nx_bl,
112  const double& delta_bl,
113  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
114  : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt)
115  {
116  // Use default stretching fct
118 
119  // Store bl data
120  Nx_bl = nx_bl;
121  Delta_bl = delta_bl;
122 
123  // Build mesh
124  this->build_mesh(nx, ny, lx, ly);
125  }
126 
127 
128  /// In all elastic problems, the nodes must be assigned an
129  /// undeformed, or reference, position, corresponding to the
130  /// stress-free state of the elastic body. This function assigns
131  /// the undeformed position for the nodes on the elastic tube
132  void assign_undeformed_positions(GeomObject* const& undeformed_midplane_pt);
133 
134 
135  /// Access to fct pointer to fct that defines the axial stretching fct
137  {
139  }
140 
141 
142  private:
143  /// Mesh build helper fct
144  void build_mesh(const unsigned& nx,
145  const unsigned& ny,
146  const double& lx,
147  const double& ly);
148 
149 
150  /// Fct that defines the axial stretching to accomodate
151  /// bending boundary layers
152  double scaled_x(const double& x)
153  {
155  {
157  }
158  else
159  {
160  return (*Axial_bl_stretching_fct_pt)(x);
161  }
162  }
163 
164  /// Default axial scaling fct
166  {
167  // Length of shell
168  double lx = this->Xmax - this->Xmin;
169 
170  // Old axial extent of the elements spanning the boundary layer
171  double old_delta_bl = double(Nx_bl) * lx / double(this->Nx);
172 
173  double tmp_xi = xi;
174  if (xi < old_delta_bl)
175  {
176  tmp_xi = xi * Delta_bl / old_delta_bl;
177  }
178  else if (xi < (lx - old_delta_bl))
179  {
180  tmp_xi = Delta_bl + (xi - old_delta_bl) / (lx - 2.0 * old_delta_bl) *
181  (lx - 2.0 * Delta_bl);
182  }
183  else
184  {
185  double end_x = lx - Delta_bl;
186  tmp_xi = end_x + (xi - (lx - old_delta_bl)) / old_delta_bl * Delta_bl;
187  }
188  return tmp_xi;
189  }
190 
191 
192  /// Fct pointer to fct that defines the axial stretching fct
194 
195  /// Number of azimuthal element layers that get squashed into
196  /// each of the the two boundary layers at the ends of the tube
197  unsigned Nx_bl;
198 
199  /// Axial extent of the squashed boundary layer part of the mesh
200  /// occupied by Nx_bl elements (at each end of the tube)
201  double Delta_bl;
202  };
203 
204 } // namespace oomph
205 
206 
207 #endif
A 2D solid mesh for (topologically) circular cylindrical shells. The shell is represented by two Lagr...
void build_mesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly)
Mesh build helper fct.
void assign_undeformed_positions(GeomObject *const &undeformed_midplane_pt)
In all elastic problems, the nodes must be assigned an undeformed, or reference, position,...
unsigned Nx_bl
Number of azimuthal element layers that get squashed into each of the the two boundary layers at the ...
CircularCylindricalShellMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, AxialBLStretchingFctPt axial_bl_stretching_fct_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor for the mesh – specify fct that maps axial Lagr. coordinates to new positions to allow fo...
double scaled_x(const double &x)
Fct that defines the axial stretching to accomodate bending boundary layers.
AxialBLStretchingFctPt Axial_bl_stretching_fct_pt
Fct pointer to fct that defines the axial stretching fct.
double piecewise_linear_axial_bl_stretching_fct(const double &xi)
Default axial scaling fct.
double(* AxialBLStretchingFctPt)(const double &x)
Typedef for fct that defines the axial stretching fct.
double Delta_bl
Axial extent of the squashed boundary layer part of the mesh occupied by Nx_bl elements (at each end ...
AxialBLStretchingFctPt axial_bl_stretching_fct_pt() const
Access to fct pointer to fct that defines the axial stretching fct.
CircularCylindricalShellMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, const unsigned &nx_bl, const double &delta_bl, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor for the mesh. nx_bl azimuthal layers of elements near the ends are squashed to that axial...
CircularCylindricalShellMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor for the mesh – uniformly spaced elements.
RectangularQuadMesh is a two-dimensional mesh of Quad elements with Nx elements in the "x" (horizonal...
unsigned Nx
Nx: number of elements in x-direction.
const unsigned & ny() const
Return number of elements in y direction.
double Xmax
Maximum value of x coordinate.
const unsigned & nx() const
Return number of elements in x direction.
double Xmin
Minimum value of x coordinate.
////////////////////////////////////////////////////////////////////// //////////////////////////////...