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-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 #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  //========================================================================
49  //=======================================================================
50  template<class ELEMENT>
52  : public virtual RectangularQuadMesh<ELEMENT>,
53  public virtual SolidMesh
54  {
55  public:
57  typedef double (*AxialBLStretchingFctPt)(const double& x);
58 
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 
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 
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 
132  void assign_undeformed_positions(GeomObject* const& undeformed_midplane_pt);
133 
134 
137  {
139  }
140 
141 
142  private:
144  void build_mesh(const unsigned& nx,
145  const unsigned& ny,
146  const double& lx,
147  const double& ly);
148 
149 
152  double scaled_x(const double& x)
153  {
155  {
157  }
158  else
159  {
160  return (*Axial_bl_stretching_fct_pt)(x);
161  }
162  }
163 
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 
194 
197  unsigned Nx_bl;
198 
201  double Delta_bl;
202  };
203 
204 } // namespace oomph
205 
206 
207 #endif
Definition: circular_shell_mesh.template.h:54
void build_mesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly)
Mesh build helper fct.
Definition: circular_shell_mesh.template.cc:41
void assign_undeformed_positions(GeomObject *const &undeformed_midplane_pt)
Set the undeformed coordinates of the nodes.
Definition: circular_shell_mesh.template.cc:127
unsigned Nx_bl
Definition: circular_shell_mesh.template.h:197
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)
Definition: circular_shell_mesh.template.h:83
double scaled_x(const double &x)
Definition: circular_shell_mesh.template.h:152
AxialBLStretchingFctPt Axial_bl_stretching_fct_pt
Fct pointer to fct that defines the axial stretching fct.
Definition: circular_shell_mesh.template.h:193
double piecewise_linear_axial_bl_stretching_fct(const double &xi)
Default axial scaling fct.
Definition: circular_shell_mesh.template.h:165
double(* AxialBLStretchingFctPt)(const double &x)
Typedef for fct that defines the axial stretching fct.
Definition: circular_shell_mesh.template.h:57
double Delta_bl
Definition: circular_shell_mesh.template.h:201
AxialBLStretchingFctPt axial_bl_stretching_fct_pt() const
Access to fct pointer to fct that defines the axial stretching fct.
Definition: circular_shell_mesh.template.h:136
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)
Definition: circular_shell_mesh.template.h:106
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.
Definition: circular_shell_mesh.template.h:60
Definition: geom_objects.h:101
static Steady< 0 > Default_TimeStepper
The Steady Timestepper.
Definition: mesh.h:75
Definition: rectangular_quadmesh.template.h:59
unsigned Nx
Nx: number of elements in x-direction.
Definition: rectangular_quadmesh.template.h:63
const unsigned & ny() const
Return number of elements in y direction.
Definition: rectangular_quadmesh.template.h:231
double Xmax
Maximum value of x coordinate.
Definition: rectangular_quadmesh.template.h:72
const unsigned & nx() const
Return number of elements in x direction.
Definition: rectangular_quadmesh.template.h:224
double Xmin
Minimum value of x coordinate.
Definition: rectangular_quadmesh.template.h:70
Definition: mesh.h:2562
Definition: timesteppers.h:231
const double ly
Definition: ConstraintElementsUnitTest.cpp:34
const double lx
Definition: ConstraintElementsUnitTest.cpp:33
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
list x
Definition: plotDoE.py:28