cylinder_with_flag_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_CYLINDER_WITH_FLAG_MESH_HEADER
27 #define OOMPH_CYLINDER_WITH_FLAG_MESH_HEADER
28 
29 
30 // Include the headers file for domain
32 
33 // Generic includes
34 #include "../generic/refineable_quad_mesh.h"
35 #include "../generic/quad_mesh.h"
36 
37 // Include algebraic elements
38 #include "../generic/algebraic_elements.h"
39 
40 
41 namespace oomph
42 {
43  //=============================================================
46  //=============================================================
47  template<class ELEMENT>
48  class CylinderWithFlagMesh : public virtual Mesh, public virtual QuadMeshBase
49  {
50  public:
57  Circle* cylinder_pt,
58  GeomObject* top_flag_pt,
59  GeomObject* bottom_flag_pt,
60  GeomObject* tip_flag_pt,
61  const double& length,
62  const double& height,
63  const double& flag_length,
64  const double& flag_height,
65  const double& centre_x,
66  const double& centre_y,
67  const double& a,
68  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper);
69 
72  {
73  delete Domain_pt;
74  }
75 
78  {
79  return Domain_pt;
80  }
81 
82  protected:
85 
86  }; // end of mesh class
87 
88 
92 
93 
94  //===================================================================
96  //===================================================================
97  template<class ELEMENT>
99  public RefineableQuadMesh<ELEMENT>
100  {
101  public:
108  Circle* cylinder_pt,
109  GeomObject* top_flag_pt,
110  GeomObject* bottom_flag_pt,
111  GeomObject* tip_flag_pt,
112  const double& length,
113  const double& height,
114  const double& flag_length,
115  const double& flag_height,
116  const double& centre_x,
117  const double& centre_y,
118  const double& a,
119  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
120  : CylinderWithFlagMesh<ELEMENT>(cylinder_pt,
121  top_flag_pt,
122  bottom_flag_pt,
123  tip_flag_pt,
124  length,
125  height,
126  flag_length,
127  flag_height,
128  centre_x,
129  centre_y,
130  a,
131  time_stepper_pt)
132  {
133  // Nodal positions etc. were created in constructor for
134  // Cylinder...<...>. Need to setup adaptive information.
135 
136  // Setup quadtree forest for mesh refinement
137  this->setup_quadtree_forest();
138  }
139 
140 
143  };
144 
145 
149 
150 
151  //===================================================================
153  //===================================================================
154  template<class ELEMENT>
156  : public AlgebraicMesh,
157  public virtual CylinderWithFlagMesh<ELEMENT>
158  {
159  public:
166  Circle* cylinder_pt,
170  const double& length,
171  const double& height,
172  const double& flag_length,
173  const double& flag_height,
174  const double& centre_x,
175  const double& centre_y,
176  const double& a,
177  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
178  : CylinderWithFlagMesh<ELEMENT>(cylinder_pt,
179  top_flag_pt,
181  tip_flag_pt,
182  length,
183  height,
184  flag_length,
185  flag_height,
186  centre_x,
187  centre_y,
188  a,
189  time_stepper_pt),
190  Cylinder_pt(cylinder_pt),
194  Length(length),
195  Height(height),
196  Flag_length(flag_length),
197  Flag_height(flag_height),
198  Centre_x(centre_x),
199  Centre_y(centre_y),
200  A(a)
201  {
202  // Add the geometric objects to the list associated with this
203  // AlgebraicMesh
208 
209  // Setup algebraic node update operations
211  }
212 
215 
216 
220  {
221  // Need to alter the domain's bottom_flag_pt too
224  }
225 
229  {
230  this->domain_pt()->top_flag_pt() = top_flag_pt;
232  }
233 
234 
238  {
239  this->domain_pt()->tip_flag_pt() = tip_flag_pt;
241  }
242 
243 
247  {
248  return Bottom_flag_pt;
249  }
250 
251 
255  {
256  return Top_flag_pt;
257  }
258 
262  {
263  return Tip_flag_pt;
264  }
265 
266 
271 
272 
275  void algebraic_node_update(const unsigned& t, AlgebraicNode*& node_pt);
276 
277  protected:
280 
282  void node_update_I(const unsigned& t, AlgebraicNode*& node_pt);
283 
285  void node_update_II(const unsigned& t, AlgebraicNode*& node_pt);
286 
288  void node_update_III(const unsigned& t, AlgebraicNode*& node_pt);
289 
291  void node_update_IV(const unsigned& t, AlgebraicNode*& node_pt);
292 
294  void node_update_V(const unsigned& t, AlgebraicNode*& node_pt);
295 
297  void node_update_VI(const unsigned& t, AlgebraicNode*& node_pt);
298 
300  void node_update_VII(const unsigned& t, AlgebraicNode*& node_pt);
301 
303  void node_update_VIII(const unsigned& t, AlgebraicNode*& node_pt);
304 
306  void node_update_IX(const unsigned& t, AlgebraicNode*& node_pt);
307 
310 
313 
316 
319 
321  double Length;
322 
324  double Height;
325 
327  double Flag_length;
328 
330  double Flag_height;
331 
333  double Centre_x;
334 
336  double Centre_y;
337 
339  double A;
340  };
341 
342 
346 
347  //===================================================================
349  //===================================================================
350  template<class ELEMENT>
352  : public RefineableQuadMesh<ELEMENT>,
353  public virtual AlgebraicCylinderWithFlagMesh<ELEMENT>
354  {
355  public:
362  Circle* cylinder_pt,
366  const double& length,
367  const double& height,
368  const double& flag_length,
369  const double& flag_height,
370  const double& centre_x,
371  const double& centre_y,
372  const double& a,
373  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
374  : CylinderWithFlagMesh<ELEMENT>(cylinder_pt,
375  top_flag_pt,
377  tip_flag_pt,
378  length,
379  height,
380  flag_length,
381  flag_height,
382  centre_x,
383  centre_y,
384  a,
385  time_stepper_pt),
386  AlgebraicCylinderWithFlagMesh<ELEMENT>(cylinder_pt,
387  top_flag_pt,
389  tip_flag_pt,
390  length,
391  height,
392  flag_length,
393  flag_height,
394  centre_x,
395  centre_y,
396  a,
397  time_stepper_pt)
398  {
399  // Build quadtree forest
400  this->setup_quadtree_forest();
401  }
402 
406  };
407 
408 
409 } // namespace oomph
410 
411 
412 #endif
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
Algebraic version of CylinderWithFlagMesh.
Definition: cylinder_with_flag_mesh.template.h:158
void node_update_V(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
Definition: cylinder_with_flag_mesh.template.cc:1571
GeomObject * top_flag_pt() const
Definition: cylinder_with_flag_mesh.template.h:254
void set_tip_flag_pt(GeomObject *tip_flag_pt)
Definition: cylinder_with_flag_mesh.template.h:237
void node_update_II(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
Definition: cylinder_with_flag_mesh.template.cc:1441
double Height
Height of the domain.
Definition: cylinder_with_flag_mesh.template.h:324
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)
Definition: cylinder_with_flag_mesh.template.h:165
GeomObject * Top_flag_pt
Top flag.
Definition: cylinder_with_flag_mesh.template.h:312
double Centre_x
x position of the centre of the cylinder
Definition: cylinder_with_flag_mesh.template.h:333
void node_update_III(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
Definition: cylinder_with_flag_mesh.template.cc:1477
GeomObject * Cylinder_pt
Cylinder.
Definition: cylinder_with_flag_mesh.template.h:309
void algebraic_node_update(const unsigned &t, AlgebraicNode *&node_pt)
The algebraic node update function.
Definition: cylinder_with_flag_mesh.template.cc:1344
void node_update_IV(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
Definition: cylinder_with_flag_mesh.template.cc:1523
void set_bottom_flag_pt(GeomObject *bottom_flag_pt)
Definition: cylinder_with_flag_mesh.template.h:219
double Centre_y
x position of the centre of the cylinder
Definition: cylinder_with_flag_mesh.template.h:336
void node_update_I(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
Definition: cylinder_with_flag_mesh.template.cc:1402
double Length
Length of the domain.
Definition: cylinder_with_flag_mesh.template.h:321
double Flag_height
Flag thickness.
Definition: cylinder_with_flag_mesh.template.h:330
double Flag_length
Flag length.
Definition: cylinder_with_flag_mesh.template.h:327
void node_update_VIII(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
Definition: cylinder_with_flag_mesh.template.cc:1707
void node_update_VI(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
Definition: cylinder_with_flag_mesh.template.cc:1620
GeomObject * bottom_flag_pt() const
Definition: cylinder_with_flag_mesh.template.h:246
void set_top_flag_pt(GeomObject *top_flag_pt)
Definition: cylinder_with_flag_mesh.template.h:228
void update_node_update(AlgebraicNode *&node_pt)
Definition: cylinder_with_flag_mesh.template.h:270
double A
radius of the cylinder
Definition: cylinder_with_flag_mesh.template.h:339
void node_update_VII(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
Definition: cylinder_with_flag_mesh.template.cc:1662
GeomObject * Bottom_flag_pt
Bottom flag.
Definition: cylinder_with_flag_mesh.template.h:315
virtual ~AlgebraicCylinderWithFlagMesh()
Destructor: empty.
Definition: cylinder_with_flag_mesh.template.h:214
GeomObject * Tip_flag_pt
Tip flag.
Definition: cylinder_with_flag_mesh.template.h:318
void setup_algebraic_node_update()
Function to setup the algebraic node update.
Definition: cylinder_with_flag_mesh.template.cc:915
GeomObject * tip_flag_pt() const
Definition: cylinder_with_flag_mesh.template.h:261
void node_update_IX(const unsigned &t, AlgebraicNode *&node_pt)
Helper function.
Definition: cylinder_with_flag_mesh.template.cc:1793
Definition: algebraic_elements.h:599
void add_geom_object_list_pt(GeomObject *geom_object_pt)
Definition: algebraic_elements.h:823
AlgebraicNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global AlgebraicNode.
Definition: algebraic_elements.h:620
Definition: algebraic_elements.h:55
Definition: geom_objects.h:873
Domain for cylinder with flag as in Turek benchmark.
Definition: cylinder_with_flag_domain.h:42
GeomObject *& top_flag_pt()
Definition: cylinder_with_flag_domain.h:88
GeomObject *& bottom_flag_pt()
Access fct to GeomObjects for top, bottom and tip.
Definition: cylinder_with_flag_domain.h:84
GeomObject *& tip_flag_pt()
Definition: cylinder_with_flag_domain.h:92
Definition: cylinder_with_flag_mesh.template.h:49
virtual ~CylinderWithFlagMesh()
Destructor: Kill the domain.
Definition: cylinder_with_flag_mesh.template.h:71
CylinderWithFlagDomain * Domain_pt
Pointer to the domain.
Definition: cylinder_with_flag_mesh.template.h:84
CylinderWithFlagMesh(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)
Definition: cylinder_with_flag_mesh.template.cc:43
CylinderWithFlagDomain * domain_pt()
Access function to the domain.
Definition: cylinder_with_flag_mesh.template.h:77
Definition: geom_objects.h:101
Definition: mesh.h:67
static Steady< 0 > Default_TimeStepper
The Steady Timestepper.
Definition: mesh.h:75
Base class for quad meshes (meshes made of 2D quad elements).
Definition: quad_mesh.h:57
Refineable version of AlgebraicCylinderWithFlagMesh.
Definition: cylinder_with_flag_mesh.template.h:354
void update_node_update(AlgebraicNode *&node_pt)
Update the node update functions.
Definition: cylinder_with_flag_mesh.template.cc:1883
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)
Definition: cylinder_with_flag_mesh.template.h:361
Refineable version of CylinderWithFlagMesh.
Definition: cylinder_with_flag_mesh.template.h:100
virtual ~RefineableCylinderWithFlagMesh()
Destructor: Empty.
Definition: cylinder_with_flag_mesh.template.h:142
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)
Definition: cylinder_with_flag_mesh.template.h:107
Definition: refineable_quad_mesh.h:53
void setup_quadtree_forest()
Definition: refineable_quad_mesh.h:88
Definition: timesteppers.h:231
const Scalar * a
Definition: level2_cplx_impl.h:32
double height(const double &x)
Height of domain.
Definition: simple_spine_channel.cc:429
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
t
Definition: plotPSD.py:36