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