simple_rectangular_tri_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-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 // Header file for simple 2D triangle mesh class
27 
28 // Include guards to prevent multiple inclusion of the header
29 #ifndef OOMPH_SIMPLE_RECTANGULAR_TRIMESH_HEADER
30 #define OOMPH_SIMPLE_RECTANGULAR_TRIMESH_HEADER
31 
32 // Config header generated by autoconfig
33 #ifdef HAVE_CONFIG_H
34 #include <oomph-lib-config.h>
35 #endif
36 
37 
38 // Oomph-lib includes
39 #include "../generic/mesh.h"
40 #include "../generic/triangle_mesh.h"
41 
42 namespace oomph
43 {
44  //===================================================================
45  /// Simple 2D triangular mesh for TElements
46  //===================================================================
47  template<class ELEMENT>
48  class SimpleRectangularTriMesh : public virtual TriangleMeshBase
49  {
50  public:
51  /// Constructor
52  /// n_x : number of elements in the x direction;
53  /// n_y : number of elements in the y direction;
54  /// l_x : length in the x direction
55  /// l_y : length in the y direction
56  /// Ordering of elements: 'lower left' to 'lower right' then 'upwards'
58  const unsigned& n_x,
59  const unsigned& n_y,
60  const double& l_x,
61  const double& l_y,
62  TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper);
63 
64  /// Access function for number of elements in x directions
65  const unsigned& nx() const
66  {
67  return Nx;
68  }
69 
70  /// Access function for number of elements in y directions
71  const unsigned& ny() const
72  {
73  return Ny;
74  }
75 
76  private:
77  /// Number of elements in x direction
78  unsigned Nx;
79 
80  /// Number of elements in y directions
81  unsigned Ny;
82 
83  /// Length of mesh in x-direction
84  double Lx;
85 
86  /// Length of mesh in y-direction
87  double Ly;
88  };
89 
90 } // namespace oomph
91 
92 #endif
Simple 2D triangular mesh for TElements.
const unsigned & ny() const
Access function for number of elements in y directions.
SimpleRectangularTriMesh(const unsigned &n_x, const unsigned &n_y, const double &l_x, const double &l_y, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor n_x : number of elements in the x direction; n_y : number of elements in the y direction;...
double Lx
Length of mesh in x-direction.
unsigned Ny
Number of elements in y directions.
const unsigned & nx() const
Access function for number of elements in x directions.
unsigned Nx
Number of elements in x direction.
double Ly
Length of mesh in y-direction.
////////////////////////////////////////////////////////////////////// //////////////////////////////...