cylinder_with_flag_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_CYLINDER_WITH_FLAG_MESH_HEADER
27#define OOMPH_CYLINDER_WITH_FLAG_MESH_HEADER
28
29// Include the domain header
31
32// Generic includes
34#include "generic/quad_mesh.h"
35
36// Include algebraic elements
38
39namespace oomph
40{
41 //=============================================================
42 /// Domain-based mesh for cylinder with flag as in Turek
43 /// benchmark.
44 //=============================================================
45 template<class ELEMENT>
46 class CylinderWithFlagMesh : public virtual Mesh, public virtual QuadMeshBase
47 {
48 public:
49 /// Constructor. Pass the pointers to the GeomObjects that
50 /// parametrise the cylinder, the three edges of the flag, the length and
51 /// height of the domain, the length and height of the flag, the coordinates
52 /// of the centre of the cylinder and its radius. Timestepper defaults to
53 /// Steady default timestepper.
55 Circle* cylinder_pt,
56 GeomObject* top_flag_pt,
57 GeomObject* bottom_flag_pt,
58 GeomObject* tip_flag_pt,
59 const double& length,
60 const double& height,
61 const double& flag_length,
62 const double& flag_height,
63 const double& centre_x,
64 const double& centre_y,
65 const double& a,
66 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper);
67
68 /// Destructor: Kill the domain
70 {
71 delete Domain_pt;
72 }
73
74 /// Access function to the domain
79
80 protected:
81 /// Pointer to the domain
83
84 }; // end of mesh class
85
86
87 //////////////////////////////////////////////////////////////////////////
88 //////////////////////////////////////////////////////////////////////////
89 //////////////////////////////////////////////////////////////////////////
90
91 //===================================================================
92 /// Refineable version of CylinderWithFlagMesh.
93 //===================================================================
94 template<class ELEMENT>
96 public RefineableQuadMesh<ELEMENT>
97 {
98 public:
99 /// Constructor. Pass the pointers to the GeomObjects that
100 /// parametrise the cylinder, the three edges of the flag, the length and
101 /// height of the domain, the length and height of the flag, the coordinates
102 /// of the centre of the cylinder and its radius. Timestepper defaults to
103 /// Steady default timestepper.
105 Circle* cylinder_pt,
106 GeomObject* top_flag_pt,
107 GeomObject* bottom_flag_pt,
108 GeomObject* tip_flag_pt,
109 const double& length,
110 const double& height,
111 const double& flag_length,
112 const double& flag_height,
113 const double& centre_x,
114 const double& centre_y,
115 const double& a,
116 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
117 : CylinderWithFlagMesh<ELEMENT>(cylinder_pt,
118 top_flag_pt,
119 bottom_flag_pt,
120 tip_flag_pt,
121 length,
122 height,
125 centre_x,
126 centre_y,
127 a,
128 time_stepper_pt)
129 {
130 // Nodal positions etc. were created in constructor for
131 // Cylinder...<...>. Need to setup adaptive information.
132
133 // Setup quadtree forest for mesh refinement
134 this->setup_quadtree_forest();
135 }
136
137
138 /// Destructor: Empty
140 };
141
142
143 //////////////////////////////////////////////////////////////////////////
144 //////////////////////////////////////////////////////////////////////////
145 //////////////////////////////////////////////////////////////////////////
146
147 //===================================================================
148 /// Algebraic version of CylinderWithFlagMesh.
149 //===================================================================
150 template<class ELEMENT>
152 : public AlgebraicMesh,
153 public virtual CylinderWithFlagMesh<ELEMENT>
154 {
155 public:
156 /// Constructor. Pass the pointers to the GeomObjects that
157 /// parametrise the cylinder, the three edges of the flag, the length and
158 /// height of the domain, the length and height of the flag, the coordinates
159 /// of the centre of the cylinder and its radius. Timestepper defaults to
160 /// Steady default timestepper.
162 Circle* cylinder_pt,
166 const double& length,
167 const double& height,
168 const double& flag_length,
169 const double& flag_height,
170 const double& centre_x,
171 const double& centre_y,
172 const double& a,
173 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
174 : CylinderWithFlagMesh<ELEMENT>(cylinder_pt,
178 length,
179 height,
182 centre_x,
183 centre_y,
184 a,
185 time_stepper_pt),
186 Cylinder_pt(cylinder_pt),
190 Length(length),
191 Height(height),
196 A(a)
197 {
198 // Add the geometric objects to the list associated with this
199 // AlgebraicMesh
204
205 // Setup algebraic node update operations
207 }
208
209 /// Destructor: empty
211
212
213 /// Set geometric object that defines the
214 /// bottom face of the flag
216 {
217 // Need to alter the domain's bottom_flag_pt too
220 }
221
222 /// Set the geometric object that defines the
223 /// top face of the flag
229
230
231 /// Set the geometric object that defines the
232 /// tip of the flag
238
239
240 /// Read-only access to geometric object that defines the
241 /// bottom face of the flag
243 {
244 return Bottom_flag_pt;
245 }
246
247
248 /// Read-only access to geometric object that defines the
249 /// top face of the flag
251 {
252 return Top_flag_pt;
253 }
254
255 /// Read-only access to geometric object that defines the
256 /// tip of the flag
258 {
259 return Tip_flag_pt;
260 }
261
262
263 /// Update the geometric references that are used
264 /// to update node after mesh adaptation.
265 /// Empty -- no update of node update required without adaptativity
267
268
269 /// Update nodal position at time level t (t=0: present;
270 /// t>0: previous)
271 void algebraic_node_update(const unsigned& t, AlgebraicNode*& node_pt);
272
273 protected:
274 /// Function to setup the algebraic node update
276
277 /// Helper function
278 void node_update_I(const unsigned& t, AlgebraicNode*& node_pt);
279
280 /// Helper function
281 void node_update_II(const unsigned& t, AlgebraicNode*& node_pt);
282
283 /// Helper function
284 void node_update_III(const unsigned& t, AlgebraicNode*& node_pt);
285
286 /// Helper function
287 void node_update_IV(const unsigned& t, AlgebraicNode*& node_pt);
288
289 /// Helper function
290 void node_update_V(const unsigned& t, AlgebraicNode*& node_pt);
291
292 /// Helper function
293 void node_update_VI(const unsigned& t, AlgebraicNode*& node_pt);
294
295 /// Helper function
296 void node_update_VII(const unsigned& t, AlgebraicNode*& node_pt);
297
298 /// Helper function
299 void node_update_VIII(const unsigned& t, AlgebraicNode*& node_pt);
300
301 /// Helper function
302 void node_update_IX(const unsigned& t, AlgebraicNode*& node_pt);
303
304 /// Cylinder
306
307 /// Top flag
309
310 /// Bottom flag
312
313 /// Tip flag
315
316 /// Length of the domain
317 double Length;
318
319 /// Height of the domain
320 double Height;
321
322 /// Flag length
324
325 /// Flag thickness
327
328 /// x position of the centre of the cylinder
329 double Centre_x;
330
331 /// x position of the centre of the cylinder
332 double Centre_y;
333
334 /// radius of the cylinder
335 double A;
336 };
337
338
339 ///////////////////////////////////////////////////////////////////////////
340 ///////////////////////////////////////////////////////////////////////////
341 ///////////////////////////////////////////////////////////////////////////
342
343 //===================================================================
344 /// Refineable version of AlgebraicCylinderWithFlagMesh
345 //===================================================================
346 template<class ELEMENT>
348 : public RefineableQuadMesh<ELEMENT>,
349 public virtual AlgebraicCylinderWithFlagMesh<ELEMENT>
350 {
351 public:
352 /// Constructor: Pass the pointers to the GeomObjects that
353 /// parametrise the cylinder, the three edges of the flag, the length and
354 /// height of the domain, the length and height of the flag, the coordinates
355 /// of the centre of the cylinder and its radius. Timestepper defaults to
356 /// Steady default timestepper.
358 Circle* cylinder_pt,
362 const double& length,
363 const double& height,
364 const double& flag_length,
365 const double& flag_height,
366 const double& centre_x,
367 const double& centre_y,
368 const double& a,
369 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
370 : CylinderWithFlagMesh<ELEMENT>(cylinder_pt,
374 length,
375 height,
378 centre_x,
379 centre_y,
380 a,
381 time_stepper_pt),
382 AlgebraicCylinderWithFlagMesh<ELEMENT>(cylinder_pt,
386 length,
387 height,
390 centre_x,
391 centre_y,
392 a,
393 time_stepper_pt)
394 {
395 // Build quadtree forest
396 this->setup_quadtree_forest();
397 }
398
399 /// Update the node update data for specified node following
400 /// any mesh adapation
402 };
403
404} // namespace oomph
405
407#endif
char t
Definition cfortran.h:568
Algebraic version of CylinderWithFlagMesh.
void node_update_V(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
GeomObject * tip_flag_pt() const
Read-only access to geometric object that defines the tip of the flag.
void set_tip_flag_pt(GeomObject *tip_flag_pt)
Set the geometric object that defines the tip of the flag.
void node_update_II(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
AlgebraicCylinderWithFlagMesh(Circle *cylinder_pt, GeomObject *top_flag_pt, GeomObject *bottom_flag_pt, GeomObject *tip_flag_pt, const double &length, const double &height, const double &flag_length, const double &flag_height, const double &centre_x, const double &centre_y, const double &a, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor. Pass the pointers to the GeomObjects that parametrise the cylinder, the three edges of t...
double Centre_x
x position of the centre of the cylinder
void node_update_III(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
GeomObject * top_flag_pt() const
Read-only access to geometric object that defines the top face of the flag.
void algebraic_node_update(const unsigned &t, AlgebraicNode *&node_pt)
Update nodal position at time level t (t=0: present; t>0: previous)
void node_update_IV(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
void set_bottom_flag_pt(GeomObject *bottom_flag_pt)
Set geometric object that defines the bottom face of the flag.
double Centre_y
x position of the centre of the cylinder
void node_update_I(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
void node_update_VIII(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
GeomObject * bottom_flag_pt() const
Read-only access to geometric object that defines the bottom face of the flag.
void node_update_VI(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
void set_top_flag_pt(GeomObject *top_flag_pt)
Set the geometric object that defines the top face of the flag.
void update_node_update(AlgebraicNode *&node_pt)
Update the geometric references that are used to update node after mesh adaptation....
void node_update_VII(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
virtual ~AlgebraicCylinderWithFlagMesh()
Destructor: empty.
void setup_algebraic_node_update()
Function to setup the algebraic node update.
void node_update_IX(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
Algebraic meshes contain AlgebraicElements and AlgebraicNodes. They implement the node update functio...
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...
AlgebraicNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global AlgebraicNode.
Algebraic nodes are nodes with an algebraic positional update function.
Circle in 2D space.
Domain for cylinder with flag as in Turek benchmark.
GeomObject *& bottom_flag_pt()
Access fct to GeomObjects for top, bottom and tip.
Domain-based mesh for cylinder with flag as in Turek benchmark.
virtual ~CylinderWithFlagMesh()
Destructor: Kill the domain.
CylinderWithFlagDomain * Domain_pt
Pointer to the domain.
CylinderWithFlagDomain * domain_pt()
Access function to the domain.
A geometric object is an object that provides a parametrised description of its shape via the functio...
A general mesh class.
Definition mesh.h:67
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors.
Definition mesh.h:75
Base class for quad meshes (meshes made of 2D quad elements).
Definition quad_mesh.h:57
Refineable version of AlgebraicCylinderWithFlagMesh.
void update_node_update(AlgebraicNode *&node_pt)
Update the node update data for specified node following any mesh adapation.
RefineableAlgebraicCylinderWithFlagMesh(Circle *cylinder_pt, GeomObject *top_flag_pt, GeomObject *bottom_flag_pt, GeomObject *tip_flag_pt, const double &length, const double &height, const double &flag_length, const double &flag_height, const double &centre_x, const double &centre_y, const double &a, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass the pointers to the GeomObjects that parametrise the cylinder, the three edges of t...
Refineable version of CylinderWithFlagMesh.
virtual ~RefineableCylinderWithFlagMesh()
Destructor: Empty.
RefineableCylinderWithFlagMesh(Circle *cylinder_pt, GeomObject *top_flag_pt, GeomObject *bottom_flag_pt, GeomObject *tip_flag_pt, const double &length, const double &height, const double &flag_length, const double &flag_height, const double &centre_x, const double &centre_y, const double &a, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor. Pass the pointers to the GeomObjects that parametrise the cylinder, the three edges of t...
Intermediate mesh class that implements the mesh adaptation functions specified in the TreeBasedRefin...
void setup_quadtree_forest()
Set up QuadTreeForest. Wipes any existing tree structure below the minimum refinement level and regar...
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).