GeoMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::GeoMesh
28 
29 Description
30  Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
31 
32  Derived classes are typically expected to implement the static methods
33  size() and boundary_size().
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef Foam_GeoMesh_H
38 #define Foam_GeoMesh_H
39 
40 #include "objectRegistry.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class GeoMesh Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class MESH>
52 class GeoMesh
53 {
54 protected:
55 
56  // Protected Data
57 
58  //- Reference to Mesh
59  const MESH& mesh_;
60 
61 
62 public:
63 
64  // Public Typedefs
65 
66  typedef MESH Mesh;
67  typedef typename MESH::BoundaryMesh BoundaryMesh;
68 
69 
70  // Constructors
71 
72  //- Construct from mesh reference
73  explicit GeoMesh(const MESH& mesh)
74  :
75  mesh_(mesh)
76  {}
77 
78 
79  // Member Functions
80 
81  //- Return true if thisDb() is a valid DB - here = false
82  bool hasDb() const
83  {
84  return true;
85  }
86 
87  //- Return the object registry
88  const objectRegistry& thisDb() const
89  {
90  return mesh_;
91  }
92 
93 
94  // Member Operators
95 
96  //- Return reference to the underlying mesh
97  const MESH& operator()() const
98  {
99  return mesh_;
100  }
101 };
102 
103 
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 
106 } // End namespace Foam
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 #endif
111 
112 // ************************************************************************* //
MESH::BoundaryMesh BoundaryMesh
Definition: GeoMesh.H:62
dynamicFvMesh & mesh
MESH Mesh
Definition: GeoMesh.H:61
const objectRegistry & thisDb() const
Return the object registry.
Definition: GeoMesh.H:89
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:45
Registry of regIOobjects.
GeoMesh(const MESH &mesh)
Construct from mesh reference.
Definition: GeoMesh.H:70
const MESH & mesh_
Reference to Mesh.
Definition: GeoMesh.H:54
bool hasDb() const
Return true if thisDb() is a valid DB - here = false.
Definition: GeoMesh.H:81
const MESH & operator()() const
Return reference to the underlying mesh.
Definition: GeoMesh.H:100
Namespace for OpenFOAM.