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// 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// Header file for a relatively simple Quad Meshe
27#ifndef OOMPH_BACKWARD_STEP_MESH_HEADER
28#define OOMPH_BACKWARD_STEP_MESH_HEADER
29
30// Config header generated by autoconfig
31#ifdef HAVE_CONFIG_H
32#include <oomph-lib-config.h>
33#endif
34
35// OOMPH-LIB headers
37#include "../generic/refineable_quad_mesh.h"
38
39namespace oomph
40{
41 //=================================================================
42 /// Backward step mesh
43 //=================================================================
44 template<class ELEMENT>
45 class BackwardStepQuadMesh : public virtual RectangularQuadMesh<ELEMENT>
46 {
47 public:
48 /// Pass overall number of elements in the horizontal
49 /// and vertical directions, nx and ny, and the corresponding
50 /// dimensions, lx and ly. nx_cut_out and ny_cut_out elements
51 /// are cut out from the lower right corner to create the
52 /// (reversed) backward step geometry. Timestepper defaults
53 /// to Steady.
55 const unsigned& nx,
56 const unsigned& ny,
57 const unsigned& nx_cut_out,
58 const unsigned& ny_cut_out,
59 const double& lx,
60 const double& ly,
61 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
62 : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt)
63 {
64 // Do the actual build
65 build_mesh(nx, ny, nx_cut_out, ny_cut_out, lx, ly);
66 }
67
68 /// Destructor: Empty
70
71 private:
72 /// Actual build function
73 void build_mesh(const unsigned& nx,
74 const unsigned& ny,
75 const unsigned& nx_cut_out,
76 const unsigned& ny_cut_out,
77 const double& lx,
78 const double& ly);
79
80 }; // end of mesh
81
82
83 /// /////////////////////////////////////////////////////////////////
84 /// /////////////////////////////////////////////////////////////////
85 /// /////////////////////////////////////////////////////////////////
86
87
88 //=================================================================
89 /// Refineable backward step mesh
90 //=================================================================
91 template<class ELEMENT>
93 : public virtual BackwardStepQuadMesh<ELEMENT>,
94 public RefineableQuadMesh<ELEMENT>
95 {
96 public:
97 /// Pass overall number of elements in the horizontal
98 /// and vertical directions, nx and ny, and the corresponding
99 /// dimensions, lx and ly. nx_cut_out and ny_cut_out elements
100 /// are cut out from the lower right corner to create the
101 /// (reversed) backward step geometry. Timestepper defaults
102 /// to Steady.
104 const unsigned& nx,
105 const unsigned& ny,
106 const unsigned& nx_cut_out,
107 const unsigned& ny_cut_out,
108 const double& lx,
109 const double& ly,
110 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
111 : RectangularQuadMesh<ELEMENT>(nx, ny, lx, ly, time_stepper_pt),
112 BackwardStepQuadMesh<ELEMENT>(
113 nx, ny, nx_cut_out, ny_cut_out, lx, ly, time_stepper_pt)
114 {
115 // Nodal positions etc. were created in constructor for
116 // SimpleRectangularQuadMesh<...> --> We only need to set up
117 // adaptivity information: Associate finite elements with their
118 // QuadTrees and plant them in a QuadTreeForest:
119 this->setup_quadtree_forest();
120
121 } // end of constructor
122
123 /// Destructor: Empty
125
126 }; // end of mesh
127
128} // namespace oomph
129#endif
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.
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,...
virtual ~BackwardStepQuadMesh()
Destructor: Empty.
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors.
Definition: mesh.h:75
RectangularQuadMesh is a two-dimensional mesh of Quad elements with Nx elements in the "x" (horizonal...
const unsigned & ny() const
Return number of elements in y direction.
const unsigned & nx() const
Return number of elements in x direction.
///////////////////////////////////////////////////////////////// ///////////////////////////////////...
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.
Intermediate mesh class that implements the mesh adaptation functions specified in the TreeBasedRefin...
void setup_quadtree_forest()
Set up QuadTreeForest. Wipes any existing tree structure below the minimum refinement level and regar...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
Definition: timesteppers.h:231
//////////////////////////////////////////////////////////////////// ////////////////////////////////...