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