backward_step_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: 1097 $
7 //LIC//
8 //LIC// $LastChangedDate: 2015-12-17 11:53:17 +0000 (Thu, 17 Dec 2015) $
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 //Header file for a relatively simple Quad Meshe
31 #ifndef OOMPH_BACKWARD_STEP_MESH_HEADER
32 #define OOMPH_BACKWARD_STEP_MESH_HEADER
33 
34 // Config header generated by autoconfig
35 #ifdef HAVE_CONFIG_H
36  #include <oomph-lib-config.h>
37 #endif
38 
39 //OOMPH-LIB headers
41 #include "../generic/refineable_quad_mesh.h"
42 
43 namespace oomph
44 {
45 
46 
47 //=================================================================
48 /// Backward step mesh
49 //=================================================================
50  template<class ELEMENT>
52  public virtual RectangularQuadMesh<ELEMENT>
53  {
54 
55  public:
56 
57  /// \short Pass overall number of elements in the horizontal
58  /// and vertical directions, nx and ny, and the corresponding
59  /// dimensions, lx and ly. nx_cut_out and ny_cut_out elements
60  /// are cut out from the lower right corner to create the
61  /// (reversed) backward step geometry. Timestepper defaults
62  /// to Steady.
63  BackwardStepQuadMesh(const unsigned &nx,
64  const unsigned &ny,
65  const unsigned& nx_cut_out,
66  const unsigned& ny_cut_out,
67  const double &lx,
68  const double &ly,
69  TimeStepper* time_stepper_pt=
71  RectangularQuadMesh<ELEMENT>(nx,ny,lx,ly,time_stepper_pt)
72  {
73  // Do the actual build
74  build_mesh(nx,ny,nx_cut_out,ny_cut_out,lx,ly);
75  }
76 
77  /// Destructor: Empty
78  virtual ~BackwardStepQuadMesh() {}
79 
80  private:
81 
82  /// Actual build function
83  void build_mesh(const unsigned &nx,
84  const unsigned &ny,
85  const unsigned& nx_cut_out,
86  const unsigned& ny_cut_out,
87  const double &lx,
88  const double &ly);
89 
90  }; // end of mesh
91 
92 
93 ////////////////////////////////////////////////////////////////////
94 ////////////////////////////////////////////////////////////////////
95 ////////////////////////////////////////////////////////////////////
96 
97 
98 //=================================================================
99 /// Refineable backward step mesh
100 //=================================================================
101  template<class ELEMENT>
103  public virtual BackwardStepQuadMesh<ELEMENT>,
104  public RefineableQuadMesh<ELEMENT>
105  {
106 
107  public:
108 
109  /// \short Pass overall number of elements in the horizontal
110  /// and vertical directions, nx and ny, and the corresponding
111  /// dimensions, lx and ly. nx_cut_out and ny_cut_out elements
112  /// are cut out from the lower right corner to create the
113  /// (reversed) backward step geometry. Timestepper defaults
114  /// to Steady.
116  const unsigned &ny,
117  const unsigned& nx_cut_out,
118  const unsigned& ny_cut_out,
119  const double &lx,
120  const double &ly,
121  TimeStepper* time_stepper_pt=
123  RectangularQuadMesh<ELEMENT>(nx,ny,lx,ly,time_stepper_pt),
124  BackwardStepQuadMesh<ELEMENT>(nx,ny,nx_cut_out,ny_cut_out,
125  lx,ly,time_stepper_pt)
126  {
127  // Nodal positions etc. were created in constructor for
128  // SimpleRectangularQuadMesh<...> --> We only need to set up
129  // adaptivity information: Associate finite elements with their
130  // QuadTrees and plant them in a QuadTreeForest:
131  this->setup_quadtree_forest();
132 
133  } // end of constructor
134 
135  /// Destructor: Empty
137 
138  }; // end of mesh
139 
140 }
141 #endif
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors. ...
Definition: mesh.h:85
void setup_quadtree_forest()
Set up QuadTreeForest. Wipes any existing tree structure below the minimum refinement level and regar...
BackwardStepQuadMesh(const unsigned &nx, const unsigned &ny, const unsigned &nx_cut_out, const unsigned &ny_cut_out, const double &lx, const double &ly, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Pass overall number of elements in the horizontal and vertical directions, nx and ny...
RefineableBackwardStepQuadMesh(const unsigned &nx, const unsigned &ny, const unsigned &nx_cut_out, const unsigned &ny_cut_out, const double &lx, const double &ly, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Pass overall number of elements in the horizontal and vertical directions, nx and ny...
virtual ~RefineableBackwardStepQuadMesh()
Destructor: Empty.
const unsigned & nx() const
Return number of elements in x direction.
void build_mesh(const unsigned &nx, const unsigned &ny, const unsigned &nx_cut_out, const unsigned &ny_cut_out, const double &lx, const double &ly)
Actual build function.
virtual ~BackwardStepQuadMesh()
Destructor: Empty.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Definition: timesteppers.h:219
const unsigned & ny() const
Return number of elements in y direction.