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 \*---------------------------------------------------------------------------*/
33 
34 #ifndef GeoMesh_H
35 #define GeoMesh_H
36 
37 #include "objectRegistry.H"
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 
44 /*---------------------------------------------------------------------------*\
45  Class GeoMesh Declaration
46 \*---------------------------------------------------------------------------*/
47 
48 template<class MESH>
49 class GeoMesh
50 {
51 
52 protected:
53 
54  // Protected data
55 
56  //- Reference to Mesh
57  const MESH& mesh_;
58 
59 
60 public:
61 
62  // Public typedefs
63 
64  typedef MESH Mesh;
65  typedef typename MESH::BoundaryMesh BoundaryMesh;
66 
67 
68  // Constructors
69 
70  //- Construct from MESH
71  explicit GeoMesh(const MESH& mesh)
72  :
73  mesh_(mesh)
74  {}
75 
76 
77  // Member Functions
78 
79  //- Return true if thisDb() is a valid DB - here = false
80  bool hasDb() const
81  {
82  return true;
83  }
84 
85  //- Return the object registry
86  const objectRegistry& thisDb() const
87  {
88  return mesh_;
89  }
90 
91 
92  // Member Operators
93 
94  //- Return reference to polyMesh
95  const MESH& operator()() const
96  {
97  return mesh_;
98  }
99 };
100 
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 } // End namespace Foam
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 #endif
109 
110 // ************************************************************************* //
Foam::GeoMesh::GeoMesh
GeoMesh(const MESH &mesh)
Construct from MESH.
Definition: GeoMesh.H:70
objectRegistry.H
Foam::GeoMesh::mesh_
const MESH & mesh_
Reference to Mesh.
Definition: GeoMesh.H:56
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::GeoMesh::BoundaryMesh
MESH::BoundaryMesh BoundaryMesh
Definition: GeoMesh.H:64
Foam::GeoMesh::hasDb
bool hasDb() const
Return true if thisDb() is a valid DB - here = false.
Definition: GeoMesh.H:79
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::GeoMesh
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:48
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::GeoMesh::operator()
const MESH & operator()() const
Return reference to polyMesh.
Definition: GeoMesh.H:94
Foam::GeoMesh::Mesh
MESH Mesh
Definition: GeoMesh.H:63
Foam::GeoMesh::thisDb
const objectRegistry & thisDb() const
Return the object registry.
Definition: GeoMesh.H:85