fsi_driven_cavity_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: 1097 $
7 //LIC//
8 //LIC// $LastChangedDate: 2015-12-17 11:53:17 +0000 (Thu, 17 Dec 2015) $
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 
31 //Include guards
32 #ifndef OOMPH_FSI_DRIVEN_CAVITY_MESH_HEADER
33 #define OOMPH_FSI_DRIVEN_CAVITY_MESH_HEADER
34 
35 // Generic includes
36 #include "../generic/refineable_quad_mesh.h"
37 #include "../generic/macro_element.h"
38 #include "../generic/domain.h"
39 #include "../generic/quad_mesh.h"
40 
41 // Mesh is based on simple_rectangular_quadmesh
44 
45 //Include algebraic elements
46 #include "../generic/algebraic_elements.h"
47 
48 
49 namespace oomph
50 {
51 
52 
53 //========================================================================
54 /// \short Mesh for W. Wall's FSI driven cavity problem.
55 /// The mesh is derived from the \c SimpleRectangularQuadMesh
56 /// so it's node and element numbering scheme is the same
57 /// as in that mesh. Only the boundaries are numbered differently
58 /// to allow the easy identification of the "collapsible" segment.
59 /// Boundary coordinates are set up for all nodes
60 /// located on boundary 3 (the collapsible segment).
61 /// The curvilinear ("collapsible") segment is defined by
62 /// a \c GeomObject.
63 /// - Boundary 0 is the moving lid.
64 /// - Boundary 1 is the gap above the moving lid on the right wall
65 /// - Boundary 2 is the rigid part of the right wall
66 /// - Boundary 3 is the moving (elastic) wall
67 /// - Boundary 4 is the rigid part of the left wall
68 /// - Boundary 5 is the gap above the moving lid on the left wall
69 //========================================================================
70 template <class ELEMENT>
72 {
73 
74 public:
75 
76  /// \short Constructor: Pass number of elements, number of elements,
77  /// fractional height of the gap above the moving wall,
78  /// pointer to GeomObject that defines the collapsible segment and pointer to
79  /// TimeStepper (defaults to the default timestepper, Steady).
80  FSIDrivenCavityMesh(const unsigned& nx,
81  const unsigned& ny,
82  const double& lx,
83  const double& ly,
84  const double& gap_fraction,
85  GeomObject* wall_pt,
86  TimeStepper* time_stepper_pt=
88 
89 protected:
90 
91  /// Number of elements in x direction
92  unsigned Nx;
93 
94  /// Number of elements in y direction
95  unsigned Ny;
96 
97  /// \short Fraction of the gap next to moving lid, relative to the
98  /// height of the domain
99  double Gap_fraction;
100 
101  /// Pointer to geometric object that represents the moving wall
103 
104 
105 };
106 
107 
108 /////////////////////////////////////////////////////////////////////
109 /////////////////////////////////////////////////////////////////////
110 /////////////////////////////////////////////////////////////////////
111 
112 
113 
114 //===================================================================
115 /// Refineable version of FSIDrivenCavityMesh.
116 /// The mesh is derived from the \c SimpleRectangularQuadMesh
117 /// so it's node and element numbering scheme is the same
118 /// as in that mesh. Only the boundaries are numbered differently
119 /// to allow the easy identification of the "collapsible" segment.
120 /// Boundary coordinates are set up for all nodes
121 /// located on boundary 3 (the collapsible segment).
122 /// The curvilinear ("collapsible") segment is defined by
123 /// a \c GeomObject.
124 /// - Boundary 0 is the moving lid.
125 /// - Boundary 1 is the gap above the moving lid on the right wall
126 /// - Boundary 2 is the rigid part of the right wall
127 /// - Boundary 3 is the moving (elastic) wall
128 /// - Boundary 4 is the rigid part of the left wall
129 /// - Boundary 5 is the gap above the moving lid on the left wall
130 //====================================================================
131 template <class ELEMENT>
133  public virtual FSIDrivenCavityMesh<ELEMENT>,
134  public RefineableQuadMesh<ELEMENT>
135 {
136 
137 public :
138 
139  /// \short Constructor: Pass number of elements, lengths, pointer to
140  /// geometric object that describes the wall and timestepper
142  const unsigned& ny,
143  const double& lx,
144  const double& ly,
145  const double& gap_fraction,
146  GeomObject* wall_pt,
147  TimeStepper* time_stepper_pt=
149  FSIDrivenCavityMesh<ELEMENT>(nx, ny, lx, ly, gap_fraction,
150  wall_pt, time_stepper_pt)
151  {
152  // Build quadtree forest
153  this->setup_quadtree_forest();
154  }
155 
156 
157  ///Destructor(empty)
159 
160 };
161 
162 
163 //=================================================================
164 //// Alebraic node update version of FSIDrivenCavityMesh
165 /// - Boundary 0 is the moving lid.
166 /// - Boundary 1 is the gap above the moving lid on the right wall
167 /// - Boundary 2 is the rigid part of the right wall
168 /// - Boundary 3 is the moving (elastic) wall
169 /// - Boundary 4 is the rigid part of the left wall
170 /// - Boundary 5 is the gap above the moving lid on the left wall
171 //=================================================================
172 template<class ELEMENT>
174  public virtual FSIDrivenCavityMesh<ELEMENT>,
175  public AlgebraicMesh
176 {
177 
178 public:
179 
180 
181  /// \short Constructor: Pass number of elements, lengths, pointer to
182  /// GeomObject that defines the collapsible segment and pointer to
183  /// TimeStepper (defaults to the default timestepper, Steady).
185  const unsigned& ny,
186  const double& lx,
187  const double& ly,
188  const double& gap_fraction,
189  GeomObject* wall_pt,
190  TimeStepper* time_stepper_pt=
192  FSIDrivenCavityMesh<ELEMENT>(nx, ny, lx, ly, gap_fraction, wall_pt,
193  time_stepper_pt)
194  {
195  // Add the geometric object to the list associated with this AlgebraicMesh
197 
198  // Setup algebraic node update operations
200  }
201 
202  /// \short Destructor: empty
204 
205  /// \short Update nodal position at time level t (t=0: present;
206  /// t>0: previous)
207  void algebraic_node_update(const unsigned& t, AlgebraicNode*& node_pt);
208 
209  /// \short Update the node-udate data after mesh adaptation.
210  /// Empty -- no update of node update required as this is
211  /// non-refineable mesh.
213 
214 protected:
215 
216  /// Function to setup the algebraic node update
218 
219 };
220 
221 
222 
223 
224 
225 ///////////////////////////////////////////////////////////////////////////
226 ///////////////////////////////////////////////////////////////////////////
227 ///////////////////////////////////////////////////////////////////////////
228 
229 
230 
231 //=================================================================
232 /// Refineable version algebraic FSIDrivenCavityMesh.
233 /// - Boundary 0 is the moving lid.
234 /// - Boundary 1 is the gap above the moving lid on the right wall
235 /// - Boundary 2 is the rigid part of the right wall
236 /// - Boundary 3 is the moving (elastic) wall
237 /// - Boundary 4 is the rigid part of the left wall
238 /// - Boundary 5 is the gap above the moving lid on the left wall
239 //=================================================================
240 template<class ELEMENT>
242  public RefineableQuadMesh<ELEMENT>,
243  public virtual AlgebraicFSIDrivenCavityMesh<ELEMENT>
244 {
245 
246 public:
247 
248 
249  /// \short Constructor: Pass number of elements, lengths, pointer to
250  /// GeomObject that defines the collapsible segment and pointer to
251  /// TimeStepper (defaults to the default timestepper, Steady).
253  const unsigned& ny,
254  const double& lx,
255  const double& ly,
256  const double& gap_fraction,
257  GeomObject* wall_pt,
258  TimeStepper* time_stepper_pt=
260  FSIDrivenCavityMesh<ELEMENT>(nx, ny, lx, ly, gap_fraction,
261  wall_pt, time_stepper_pt),
262  AlgebraicFSIDrivenCavityMesh<ELEMENT>(nx, ny, lx, ly, gap_fraction, wall_pt,
263  time_stepper_pt)
264  {
265  // Build quadtree forest
266  this->setup_quadtree_forest();
267  }
268 
269  /// \short Update the node update data for specified node following
270  /// any mesh adapation
272 
273 };
274 
275 
276 
277 
278 }
279 
280 #endif
281 
AlgebraicNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global AlgebraicNode.
void update_node_update(AlgebraicNode *&node_pt)
Update the node update data for specified node following any mesh adapation.
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors. ...
Definition: mesh.h:85
void setup_quadtree_forest()
Set up QuadTreeForest. Wipes any existing tree structure below the minimum refinement level and regar...
void add_geom_object_list_pt(GeomObject *geom_object_pt)
Add the specified GeomObject to the list of geometric objects associated with this AlgebraicMesh; rem...
unsigned Ny
Number of elements in y direction.
char t
Definition: cfortran.h:572
double Gap_fraction
Fraction of the gap next to moving lid, relative to the height of the domain.
void algebraic_node_update(const unsigned &t, AlgebraicNode *&node_pt)
Update nodal position at time level t (t=0: present; t>0: previous)
const unsigned & ny() const
Access function for number of elements in y directions.
GeomObject * Wall_pt
Pointer to geometric object that represents the moving wall.
unsigned Nx
Number of elements in x direction.
void setup_algebraic_node_update()
Function to setup the algebraic node update.
void update_node_update(AlgebraicNode *&node_pt)
Update the node-udate data after mesh adaptation. Empty – no update of node update required as this i...
FSIDrivenCavityMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, const double &gap_fraction, GeomObject *wall_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements, number of elements, fractional height of the gap above the movi...
RefineableFSIDrivenCavityMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, const double &gap_fraction, GeomObject *wall_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements, lengths, pointer to geometric object that describes the wall an...
RefineableAlgebraicFSIDrivenCavityMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, const double &gap_fraction, GeomObject *wall_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements, lengths, pointer to GeomObject that defines the collapsible seg...
const unsigned & nx() const
Access function for number of elements in x directions.
virtual ~AlgebraicFSIDrivenCavityMesh()
Destructor: empty.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Definition: timesteppers.h:219
Mesh for W. Wall's FSI driven cavity problem. The mesh is derived from the SimpleRectangularQuadMesh ...
AlgebraicFSIDrivenCavityMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, const double &gap_fraction, GeomObject *wall_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements, lengths, pointer to GeomObject that defines the collapsible seg...