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// Copyright (C) 2006-2023 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_DOMAIN_HEADER
27 #define OOMPH_CYLINDER_WITH_FLAG_DOMAIN_HEADER
28 
29 
30 // Generic includes
31 #include "../generic/geom_objects.h"
32 #include "../generic/macro_element.h"
33 #include "../generic/domain.h"
34 
35 
36 namespace oomph
37 {
38  //===========================================================
39  /// Domain for cylinder with flag as in Turek benchmark.
40  //===========================================================
42  {
43  public:
44  /// Constructor. Pass the pointers to the GeomObjects that parametrise
45  /// the cylinder, the three edges of the flag, the length and height of the
46  /// domain, the length and height of the flag, the coordinates of the
47  /// centre of the cylinder and its radius.
52  const double& length,
53  const double& height,
54  const double& flag_length,
55  const double& flag_height,
56  const double& centre_x,
57  const double& centre_y,
58  const double& a);
59 
60 
61  /// Destructor: Emtpy because clean up happens in base class
62  /// as a service to the user!
64 
65 
66  /// Parametrisation of macro element boundaries: f(s) is the position
67  /// vector to macro-element m's boundary in the specified direction
68  /// [N/S/E/W] at the specfied discrete time level (time=0: present; time>0:
69  /// previous)
70  void macro_element_boundary(const unsigned& time,
71  const unsigned& m,
72  const unsigned& direction,
73  const Vector<double>& s,
74  Vector<double>& f);
75 
76  /// Access fct to GeomObject (of type Circle)
77  /// that represents the cylinder
79  {
80  return Cylinder_pt;
81  }
82 
83  /// Access fct to GeomObjects for top, bottom and tip
85  {
86  return Bottom_flag_pt;
87  }
89  {
90  return Top_flag_pt;
91  }
93  {
94  return Tip_flag_pt;
95  }
96 
97  private:
98  /// Helper function to interpolate linearly between the
99  /// "right" and "left" points; \f$ s \in [-1,1] \f$
101  const Vector<double>& right,
102  const double& s,
103  Vector<double>& f)
104  {
105  for (unsigned i = 0; i < 2; i++)
106  {
107  f[i] = left[i] + (right[i] - left[i]) * 0.5 * (s + 1.0);
108  }
109  }
110 
111  // Helper points
162 
163 
164  /// Pointer to geometric object that represents the central cylinder
166 
167  /// Pointer to geometric object that represents the top of the flag
169 
170  /// Pointer to geometric object that represents the bottom of the flag
172 
173  /// Pointer to geometric object that represents the tip of the flag
175 
176  // Length of the flag
177  double Lx;
178 
179  // Thickness of the flag
180  double Ly;
181 
182  // Centre of the cylinder : x coordinate
183  double Centre_x;
184 
185  // Centre of the cylinder : y coordinate
186  double Centre_y;
187 
188  // Radius of the cylinder
189  double A;
190 
191 
192  }; // end of domain
193 
194 } // namespace oomph
195 
196 #endif
static char t char * s
Definition: cfortran.h:568
cstr elem_len * i
Definition: cfortran.h:603
////////////////////////////////////////////////////////////////////
Definition: geom_objects.h:873
Domain for cylinder with flag as in Turek benchmark.
GeomObject * Tip_flag_pt
Pointer to geometric object that represents the tip of the flag.
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's boundar...
GeomObject *& bottom_flag_pt()
Access fct to GeomObjects for top, bottom and tip.
~CylinderWithFlagDomain()
Destructor: Emtpy because clean up happens in base class as a service to the user!
Circle * cylinder_pt()
Access fct to GeomObject (of type Circle) that represents the cylinder.
GeomObject * Top_flag_pt
Pointer to geometric object that represents the top 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; .
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)
Constructor. Pass the pointers to the GeomObjects that parametrise the cylinder, the three edges of t...
GeomObject * Bottom_flag_pt
Pointer to geometric object that represents the bottom of the flag.
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:67
/////////////////////////////////////////////////////////////////////
Definition: geom_objects.h:101
//////////////////////////////////////////////////////////////////// ////////////////////////////////...