circular_shell_mesh.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-2025 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
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
41namespace oomph
42{
43 //========================================================================
44 /// A 2D solid mesh for (topologically) circular cylindrical shells.
45 /// The shell is represented by two Lagrangian coordinates that correspond
46 /// to z and theta in cylindrical polars. The required mesh is therefore a
47 /// 2D mesh and is therefore inherited from the generic RectangularQuadMesh
48 //=======================================================================
49 template<class ELEMENT>
51 : public virtual RectangularQuadMesh<ELEMENT>,
52 public virtual SolidMesh
53 {
54 public:
55 /// Typedef for fct that defines the axial stretching fct
56 typedef double (*AxialBLStretchingFctPt)(const double& x);
57
58 /// Constructor for the mesh -- uniformly spaced elements
60 const unsigned& nx,
61 const unsigned& ny,
62 const double& lx,
63 const double& ly,
64 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
65 : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt)
66 {
67 // Use default stretching fct
69
70 // Assign dummy data consistent with uniform spacing
71 Nx_bl = 1;
72 Delta_bl = lx / double(nx);
73
74 // Build mesh
75 this->build_mesh(nx, ny, lx, ly);
76 }
77
78
79 /// Constructor for the mesh -- specify fct that maps axial
80 /// Lagr. coordinates to new positions to allow for better resolution of
81 /// bending boundary layer
83 const unsigned& nx,
84 const unsigned& ny,
85 const double& lx,
86 const double& ly,
88 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
89 : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt)
90 {
91 // Apply stretching fct
93
94 // Assign dummy data consistent with uniform spacing
95 Nx_bl = 1;
96 Delta_bl = lx / double(nx);
97
98 // Build mesh
99 this->build_mesh(nx, ny, lx, ly);
100 }
101
102 /// Constructor for the mesh. nx_bl azimuthal layers of
103 /// elements near the ends are squashed to that axial extent
104 /// of the elements changes from lx/nx to delta_bl.
106 const unsigned& nx,
107 const unsigned& ny,
108 const double& lx,
109 const double& ly,
110 const unsigned& nx_bl,
111 const double& delta_bl,
112 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
113 : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt)
114 {
115 // Use default stretching fct
117
118 // Store bl data
119 Nx_bl = nx_bl;
121
122 // Build mesh
123 this->build_mesh(nx, ny, lx, ly);
124 }
125
126
127 /// In all elastic problems, the nodes must be assigned an
128 /// undeformed, or reference, position, corresponding to the
129 /// stress-free state of the elastic body. This function assigns
130 /// the undeformed position for the nodes on the elastic tube
131 void assign_undeformed_positions(GeomObject* const& undeformed_midplane_pt);
132
133 /// Access to fct pointer to fct that defines the axial stretching fct
138
139 private:
140 /// Mesh build helper fct
141 void build_mesh(const unsigned& nx,
142 const unsigned& ny,
143 const double& lx,
144 const double& ly);
145
146
147 /// Fct that defines the axial stretching to accomodate
148 /// bending boundary layers
149 double scaled_x(const double& x)
150 {
152 {
154 }
155 else
156 {
157 return (*Axial_bl_stretching_fct_pt)(x);
158 }
159 }
160
161 /// Default axial scaling fct
163 {
164 // Length of shell
165 double lx = this->Xmax - this->Xmin;
166
167 // Old axial extent of the elements spanning the boundary layer
168 double old_delta_bl = double(Nx_bl) * lx / double(this->Nx);
169
170 double tmp_xi = xi;
171 if (xi < old_delta_bl)
172 {
174 }
175 else if (xi < (lx - old_delta_bl))
176 {
177 tmp_xi = Delta_bl + (xi - old_delta_bl) / (lx - 2.0 * old_delta_bl) *
178 (lx - 2.0 * Delta_bl);
179 }
180 else
181 {
182 double end_x = lx - Delta_bl;
183 tmp_xi = end_x + (xi - (lx - old_delta_bl)) / old_delta_bl * Delta_bl;
184 }
185 return tmp_xi;
186 }
187
188 /// Fct pointer to fct that defines the axial stretching fct
190
191 /// Number of azimuthal element layers that get squashed into
192 /// each of the the two boundary layers at the ends of the tube
193 unsigned Nx_bl;
194
195 /// Axial extent of the squashed boundary layer part of the mesh
196 /// occupied by Nx_bl elements (at each end of the tube)
197 double Delta_bl;
198 };
199
200} // namespace oomph
201
203#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.
A geometric object is an object that provides a parametrised description of its shape via the functio...
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors.
Definition mesh.h:75
RectangularQuadMesh is a two-dimensional mesh of Quad elements with Nx elements in the "x" (horizonal...
const unsigned & ny() const
Return number of elements in y direction.
unsigned Nx
Nx: number of elements in x-direction.
const unsigned & nx() const
Return number of elements in x direction.
double Xmax
Maximum value of x coordinate.
double Xmin
Minimum value of x coordinate.
General SolidMesh class.
Definition mesh.h:2570
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).