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// 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 
27 // Include guards
28 #ifndef OOMPH_FSI_DRIVEN_CAVITY_MESH_HEADER
29 #define OOMPH_FSI_DRIVEN_CAVITY_MESH_HEADER
30 
31 // Generic includes
32 #include "../generic/refineable_quad_mesh.h"
33 #include "../generic/macro_element.h"
34 #include "../generic/domain.h"
35 #include "../generic/quad_mesh.h"
36 
37 // Mesh is based on simple_rectangular_quadmesh
40 
41 // Include algebraic elements
42 #include "../generic/algebraic_elements.h"
43 
44 
45 namespace oomph
46 {
47  //========================================================================
48  /// Mesh for W. Wall's FSI driven cavity problem.
49  /// The mesh is derived from the \c SimpleRectangularQuadMesh
50  /// so it's node and element numbering scheme is the same
51  /// as in that mesh. Only the boundaries are numbered differently
52  /// to allow the easy identification of the "collapsible" segment.
53  /// Boundary coordinates are set up for all nodes
54  /// located on boundary 3 (the collapsible segment).
55  /// The curvilinear ("collapsible") segment is defined by
56  /// a \c GeomObject.
57  /// - Boundary 0 is the moving lid.
58  /// - Boundary 1 is the gap above the moving lid on the right wall
59  /// - Boundary 2 is the rigid part of the right wall
60  /// - Boundary 3 is the moving (elastic) wall
61  /// - Boundary 4 is the rigid part of the left wall
62  /// - Boundary 5 is the gap above the moving lid on the left wall
63  //========================================================================
64  template<class ELEMENT>
66  {
67  public:
68  /// Constructor: Pass number of elements, number of elements,
69  /// fractional height of the gap above the moving wall,
70  /// pointer to GeomObject that defines the collapsible segment and pointer
71  /// to TimeStepper (defaults to the default timestepper, Steady).
73  const unsigned& nx,
74  const unsigned& ny,
75  const double& lx,
76  const double& ly,
77  const double& gap_fraction,
78  GeomObject* wall_pt,
79  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper);
80 
81  protected:
82  /// Number of elements in x direction
83  unsigned Nx;
84 
85  /// Number of elements in y direction
86  unsigned Ny;
87 
88  /// Fraction of the gap next to moving lid, relative to the
89  /// height of the domain
90  double Gap_fraction;
91 
92  /// Pointer to geometric object that represents the moving wall
93  GeomObject* Wall_pt;
94  };
95 
96 
97  /// //////////////////////////////////////////////////////////////////
98  /// //////////////////////////////////////////////////////////////////
99  /// //////////////////////////////////////////////////////////////////
100 
101 
102  //===================================================================
103  /// Refineable version of FSIDrivenCavityMesh.
104  /// The mesh is derived from the \c SimpleRectangularQuadMesh
105  /// so it's node and element numbering scheme is the same
106  /// as in that mesh. Only the boundaries are numbered differently
107  /// to allow the easy identification of the "collapsible" segment.
108  /// Boundary coordinates are set up for all nodes
109  /// located on boundary 3 (the collapsible segment).
110  /// The curvilinear ("collapsible") segment is defined by
111  /// a \c GeomObject.
112  /// - Boundary 0 is the moving lid.
113  /// - Boundary 1 is the gap above the moving lid on the right wall
114  /// - Boundary 2 is the rigid part of the right wall
115  /// - Boundary 3 is the moving (elastic) wall
116  /// - Boundary 4 is the rigid part of the left wall
117  /// - Boundary 5 is the gap above the moving lid on the left wall
118  //====================================================================
119  template<class ELEMENT>
121  : public virtual FSIDrivenCavityMesh<ELEMENT>,
122  public RefineableQuadMesh<ELEMENT>
123  {
124  public:
125  /// Constructor: Pass number of elements, lengths, pointer to
126  /// geometric object that describes the wall and timestepper
128  const unsigned& nx,
129  const unsigned& ny,
130  const double& lx,
131  const double& ly,
132  const double& gap_fraction,
133  GeomObject* wall_pt,
134  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
135  : FSIDrivenCavityMesh<ELEMENT>(
136  nx, ny, lx, ly, gap_fraction, wall_pt, time_stepper_pt)
137  {
138  // Build quadtree forest
139  this->setup_quadtree_forest();
140  }
141 
142 
143  /// Destructor(empty)
145  };
146 
147 
148  //=================================================================
149  /// / Alebraic node update version of FSIDrivenCavityMesh
150  /// - Boundary 0 is the moving lid.
151  /// - Boundary 1 is the gap above the moving lid on the right wall
152  /// - Boundary 2 is the rigid part of the right wall
153  /// - Boundary 3 is the moving (elastic) wall
154  /// - Boundary 4 is the rigid part of the left wall
155  /// - Boundary 5 is the gap above the moving lid on the left wall
156  //=================================================================
157  template<class ELEMENT>
159  : public virtual FSIDrivenCavityMesh<ELEMENT>,
160  public AlgebraicMesh
161  {
162  public:
163  /// Constructor: Pass number of elements, lengths, pointer to
164  /// GeomObject that defines the collapsible segment and pointer to
165  /// TimeStepper (defaults to the default timestepper, Steady).
167  const unsigned& nx,
168  const unsigned& ny,
169  const double& lx,
170  const double& ly,
171  const double& gap_fraction,
172  GeomObject* wall_pt,
173  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
174  : FSIDrivenCavityMesh<ELEMENT>(
175  nx, ny, lx, ly, gap_fraction, wall_pt, time_stepper_pt)
176  {
177  // Add the geometric object to the list associated with this AlgebraicMesh
178  AlgebraicMesh::add_geom_object_list_pt(wall_pt);
179 
180  // Setup algebraic node update operations
182  }
183 
184  /// Destructor: empty
186 
187  /// Update nodal position at time level t (t=0: present;
188  /// t>0: previous)
189  void algebraic_node_update(const unsigned& t, AlgebraicNode*& node_pt);
190 
191  /// Update the node-udate data after mesh adaptation.
192  /// Empty -- no update of node update required as this is
193  /// non-refineable mesh.
194  void update_node_update(AlgebraicNode*& node_pt) {}
195 
196  protected:
197  /// Function to setup the algebraic node update
199  };
200 
201 
202  /// ////////////////////////////////////////////////////////////////////////
203  /// ////////////////////////////////////////////////////////////////////////
204  /// ////////////////////////////////////////////////////////////////////////
205 
206 
207  //=================================================================
208  /// Refineable version algebraic FSIDrivenCavityMesh.
209  /// - Boundary 0 is the moving lid.
210  /// - Boundary 1 is the gap above the moving lid on the right wall
211  /// - Boundary 2 is the rigid part of the right wall
212  /// - Boundary 3 is the moving (elastic) wall
213  /// - Boundary 4 is the rigid part of the left wall
214  /// - Boundary 5 is the gap above the moving lid on the left wall
215  //=================================================================
216  template<class ELEMENT>
218  : public RefineableQuadMesh<ELEMENT>,
219  public virtual AlgebraicFSIDrivenCavityMesh<ELEMENT>
220  {
221  public:
222  /// Constructor: Pass number of elements, lengths, pointer to
223  /// GeomObject that defines the collapsible segment and pointer to
224  /// TimeStepper (defaults to the default timestepper, Steady).
226  const unsigned& nx,
227  const unsigned& ny,
228  const double& lx,
229  const double& ly,
230  const double& gap_fraction,
231  GeomObject* wall_pt,
232  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
233  : FSIDrivenCavityMesh<ELEMENT>(
234  nx, ny, lx, ly, gap_fraction, wall_pt, time_stepper_pt),
236  nx, ny, lx, ly, gap_fraction, wall_pt, time_stepper_pt)
237  {
238  // Build quadtree forest
239  this->setup_quadtree_forest();
240  }
241 
242  /// Update the node update data for specified node following
243  /// any mesh adapation
244  void update_node_update(AlgebraicNode*& node_pt);
245  };
246 
247 
248 } // namespace oomph
249 
250 #endif
/ Alebraic node update version of FSIDrivenCavityMesh
virtual ~AlgebraicFSIDrivenCavityMesh()
Destructor: empty.
void algebraic_node_update(const unsigned &t, AlgebraicNode *&node_pt)
Update nodal position at time level t (t=0: present; t>0: previous)
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...
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...
Mesh for W. Wall's FSI driven cavity problem. The mesh is derived from the SimpleRectangularQuadMesh ...
unsigned Nx
Number of elements in x direction.
GeomObject * Wall_pt
Pointer to geometric object that represents the moving wall.
double Gap_fraction
Fraction of the gap next to moving lid, relative to the height of the domain.
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...
unsigned Ny
Number of elements in y direction.
//////////////////////////////////////////////////////////////////////// ////////////////////////////...
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...
void update_node_update(AlgebraicNode *&node_pt)
Update the node update data for specified node following any mesh adapation.
////////////////////////////////////////////////////////////////// //////////////////////////////////...
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...
Simple rectangular 2D Quad mesh class. Nx : number of elements in the x direction.
const unsigned & ny() const
Access function for number of elements in y directions.
const unsigned & nx() const
Access function for number of elements in x directions.
////////////////////////////////////////////////////////////////////// //////////////////////////////...