simple_rectangular_tri_mesh.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-2025 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_TRI_MESH_HEADER
30#define OOMPH_SIMPLE_RECTANGULAR_TRI_MESH_HEADER
31
32// Config header
33#ifdef HAVE_CONFIG_H
34#include <oomph-lib-config.h>
35#endif
36
37// Oomph-lib includes
38#include "generic/mesh.h"
40
41namespace oomph
42{
43 //===================================================================
44 /// Simple 2D triangular mesh for TElements
45 //===================================================================
46 template<class ELEMENT>
48 {
49 public:
50 /// Constructor
51 /// n_x : number of elements in the x direction;
52 /// n_y : number of elements in the y direction;
53 /// l_x : length in the x direction
54 /// l_y : length in the y direction
55 /// Ordering of elements: 'lower left' to 'lower right' then 'upwards'
57 const unsigned& n_x,
58 const unsigned& n_y,
59 const double& l_x,
60 const double& l_y,
61 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper);
62
63 /// Access function for number of elements in x directions
64 const unsigned& nx() const
65 {
66 return Nx;
67 }
68
69 /// Access function for number of elements in y directions
70 const unsigned& ny() const
71 {
72 return Ny;
73 }
74
75 private:
76 /// Number of elements in x direction
77 unsigned Nx;
78
79 /// Number of elements in y directions
80 unsigned Ny;
81
82 /// Length of mesh in x-direction
83 double Lx;
84
85 /// Length of mesh in y-direction
86 double Ly;
87 };
88
89} // namespace oomph
90
92#endif
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors.
Definition mesh.h:75
Simple 2D triangular mesh for TElements.
double Lx
Length of mesh in x-direction.
unsigned Ny
Number of elements in y directions.
unsigned Nx
Number of elements in x direction.
const unsigned & ny() const
Access function for number of elements in y directions.
double Ly
Length of mesh in y-direction.
const unsigned & nx() const
Access function for number of elements in x directions.
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Base class for triangle meshes (meshes made of 2D triangle elements). Note: we choose to template Tri...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).