single_layer_spine_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// 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_SINGLE_LAYER_SPINE_MESH_HEADER
31 #define OOMPH_SINGLE_LAYER_SPINE_MESH_HEADER
32 
33 // oomph-lib includes
34 #include "../generic/spines.h"
36 
37 namespace oomph
38 {
39 
40 
41 //======================================================================
42 /// Single-layer spine mesh class derived from standard 2D mesh.
43 /// The mesh contains a layer of spinified fluid elements (of type ELEMENT;
44 /// e.g SpineElement<QCrouzeixRaviartElement<2>).
45 /// It constructs the spines and contains the information on how to update
46 /// the nodal positions within the mesh as a function of the spine lengths.
47 /// Equations that determine the spine heights (even if they are pinned)
48 /// must be specified externally or else there will be problems.
49 //======================================================================
50 template <class ELEMENT>
51 class SingleLayerSpineMesh : public RectangularQuadMesh<ELEMENT >,
52  public SpineMesh
53 {
54 
55 public:
56 
57  /// \short Constructor: Pass number of elements in x-direction, number of
58  /// elements in y-direction, axial length, height of layer, and pointer
59  /// to timestepper (defaults to Steady timestepper)
60  SingleLayerSpineMesh(const unsigned &nx,
61  const unsigned &ny,
62  const double &lx,
63  const double &h,
64  TimeStepper* time_stepper_pt=
66 
67 
68  /// \short Constructor: Pass number of elements in x-direction, number of
69  /// elements in y-direction, axial length, height of layer, a boolean
70  /// flag to make the mesh periodic in the x-direction, and a pointer
71  /// to timestepper (defaults to Steady timestepper)
72  SingleLayerSpineMesh(const unsigned &nx,
73  const unsigned &ny,
74  const double &lx,
75  const double &h,
76  const bool& periodic_in_x,
77  TimeStepper* time_stepper_pt=
79 
80  /// \short General node update function implements pure virtual function
81  /// defined in SpineMesh base class and performs specific node update
82  /// actions: along vertical spines
83  virtual void spine_node_update(SpineNode* spine_node_pt)
84  {
85  //Get fraction along the spine
86  double W = spine_node_pt->fraction();
87  //Get spine height
88  double H = spine_node_pt->h();
89  //Set the value of y
90  spine_node_pt->x(1) = this->Ymin + W*H;
91  }
92 
93 
94 protected:
95 
96 
97  /// \short Helper function to actually build the single-layer spine mesh
98  /// (called from various constructors)
99  virtual void build_single_layer_mesh(TimeStepper* time_stepper_pt);
100 
101 };
102 
103 }
104 
105 #endif
const unsigned & nx() const
Return number of elements in x direction.
SingleLayerSpineMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &h, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in x-direction, number of elements in y-direction, axial length, height of layer, and pointer to timestepper (defaults to Steady timestepper)
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors. ...
Definition: mesh.h:85
virtual void build_single_layer_mesh(TimeStepper *time_stepper_pt)
Helper function to actually build the single-layer spine mesh (called from various constructors) ...
double & fraction()
Set reference to fraction along spine.
Definition: spines.h:350
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:995
const unsigned & ny() const
Return number of elements in y direction.
virtual void spine_node_update(SpineNode *spine_node_pt)
General node update function implements pure virtual function defined in SpineMesh base class and per...
double & h()
Access function to spine height.
Definition: spines.h:363
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Definition: timesteppers.h:219
double Ymin
Minimum value of y coordinate.