cylinder_with_flag_domain.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$
7 //LIC//
8 //LIC// $LastChangedDate$
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 #ifndef OOMPH_CYLINDER_WITH_FLAG_DOMAIN_HEADER
31 #define OOMPH_CYLINDER_WITH_FLAG_DOMAIN_HEADER
32 
33 
34 // Generic includes
35 #include "../generic/geom_objects.h"
36 #include "../generic/macro_element.h"
37 #include "../generic/domain.h"
38 
39 
40 namespace oomph
41 {
42 
43 
44 //===========================================================
45 /// Domain for cylinder with flag as in Turek benchmark.
46 //===========================================================
48 {
49 
50 public:
51 
52  /// Constructor. Pass the pointers to the GeomObjects that parametrise
53  /// the cylinder, the three edges of the flag, the length and height of the
54  /// domain, the length and height of the flag, the coordinates of the
55  /// centre of the cylinder and its radius.
60  const double &length,
61  const double &height,
62  const double &flag_length,
63  const double &flag_height,
64  const double &centre_x,
65  const double &centre_y,
66  const double &a);
67 
68 
69  /// \short Destructor: Kill macro elements
71  {
72  for (unsigned i=0;i<31;i++){delete Macro_element_pt[i];}
73  }
74 
75 
76  /// \short Parametrisation of macro element boundaries: f(s) is the position
77  /// vector to macro-element m's boundary in the specified direction [N/S/E/W]
78  /// at the specfied discrete time level (time=0: present; time>0: previous)
79  void macro_element_boundary(const unsigned &time,
80  const unsigned &m,
81  const unsigned &direction,
82  const Vector<double> &s,
83  Vector<double>& f);
84 
85  /// \short Access fct to GeomObject (of type Circle)
86  /// that represents the cylinder
88 
89  /// \short Access fct to GeomObjects for top, bottom and tip
93 
94 private:
95 
96  /// \short Helper function to interpolate linearly between the
97  /// "right" and "left" points; \f$ s \in [-1,1] \f$
99  const Vector<double>& right,
100  const double &s,
101  Vector<double> &f)
102  {
103  for(unsigned i=0;i<2;i++)
104  {
105  f[i] = left[i] + (right[i] - left[i])*0.5*(s+1.0);
106  }
107  }
108 
109  // Helper points
160 
161 
162  /// Pointer to geometric object that represents the central cylinder
164 
165  ///Pointer to geometric object that represents the top of the flag
167 
168  ///Pointer to geometric object that represents the bottom of the flag
170 
171  ///Pointer to geometric object that represents the tip of the flag
173 
174  //Length of the flag
175  double Lx;
176 
177  //Thickness of the flag
178  double Ly;
179 
180  //Centre of the cylinder : x coordinate
181  double Centre_x;
182 
183  //Centre of the cylinder : y coordinate
184  double Centre_y;
185 
186  //Radius of the cylinder
187  double A;
188 
189 
190 };//end of domain
191 
192 }
193 
194 #endif
GeomObject *& bottom_flag_pt()
Access fct to GeomObjects for top, bottom and tip.
GeomObject * Tip_flag_pt
Pointer to geometric object that represents the tip of the flag.
Circle in 2D space. .
Definition: geom_objects.h:854
CylinderWithFlagDomain(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)
cstr elem_len * i
Definition: cfortran.h:607
Vector< MacroElement * > Macro_element_pt
Vector of pointers to macro elements.
Definition: domain.h:237
GeomObject * Top_flag_pt
Pointer to geometric object that represents the top of the flag.
Circle * cylinder_pt()
Access fct to GeomObject (of type Circle) that represents the cylinder.
~CylinderWithFlagDomain()
Destructor: Kill macro elements.
static char t char * s
Definition: cfortran.h:572
void macro_element_boundary(const unsigned &time, const unsigned &m, const unsigned &direction, const Vector< double > &s, Vector< double > &f)
Parametrisation of macro element boundaries: f(s) is the position vector to macro-element m&#39;s boundar...
Domain for cylinder with flag as in Turek benchmark.
GeomObject * Bottom_flag_pt
Pointer to geometric object that represents the bottom of the flag.
void linear_interpolate(const Vector< double > &left, const Vector< double > &right, const double &s, Vector< double > &f)
Helper function to interpolate linearly between the "right" and "left" points; .
Circle * Cylinder_pt
Pointer to geometric object that represents the central cylinder.
Base class for Domains with curvilinear and/or time-dependent boundaries. Domain boundaries are typic...
Definition: domain.h:71