surfaceMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::surfaceMesh
26 
27 Description
28  Mesh data for surface fields
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef surfaceMesh_H
33 #define surfaceMesh_H
34 
35 #include "fvBoundaryMesh.H"
36 #include "GeometricFieldSources.H"
37 #include "fvsPatchFieldsFwd.H"
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 
44 class fvMesh;
45 class faceZone;
46 
47 /*---------------------------------------------------------------------------*\
48  Class surfaceMesh Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class surfaceMesh
52 {
53  // Private Data
54 
55  //- Reference to fvMesh
56  const fvMesh& mesh_;
57 
58 
59 protected:
60 
61  // Constructors
62 
63  //- Construct from fvMesh
64  explicit surfaceMesh(const fvMesh& mesh)
65  :
66  mesh_(mesh)
67  {}
68 
69 
70 public:
71 
72  // Destructor
73  virtual ~surfaceMesh()
74  {}
75 
76 
77  // Public typedefs
78 
79  //- Mesh type
80  typedef fvMesh Mesh;
81 
82  //- Boundary mesh type
84 
85  //- Zone type
86  typedef faceZone Zone;
87 
88  //- Patch field type
89  template<class Type>
91 
92  //- Field source type
93  template<class Type>
95 
96 
97  // Member Functions
98 
99  //- Return reference to polyMesh
100  const polyMesh& poly() const;
101 
102  //- Return size (number of internal faces)
103  inline label size() const;
104 
105  //- Return fvMesh database
106  inline const objectRegistry& db() const;
107 
108  //- Return time
109  inline const Time& time() const;
110 
111  //- Return reference to fvBoundaryMesh
112  inline const fvBoundaryMesh& boundary() const;
113 
114  //- Lookup a dimensioned field for this geometry
115  template<class Type>
117 
118 
119  // Member Operators
120 
121  //- Return reference to fvMesh
122  inline const fvMesh& operator()() const;
123 
124  bool operator!=(const surfaceMesh&) const;
125 
126  bool operator==(const surfaceMesh&) const;
127 };
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #ifdef NoRepository
137  #include "surfaceMeshTemplates.C"
138 #endif
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
Named list of face indices representing a sub-set of the mesh faces.
Definition: faceZone.H:66
Foam::fvBoundaryMesh.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Definition: fvsPatchField.H:86
Registry of regIOobjects.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
Mesh data for surface fields.
Definition: surfaceMesh.H:51
const fvMesh & operator()() const
Return reference to fvMesh.
Definition: surfaceMeshI.H:61
const Time & time() const
Return time.
Definition: surfaceMeshI.H:47
const fvBoundaryMesh & boundary() const
Return reference to fvBoundaryMesh.
Definition: surfaceMeshI.H:53
label size() const
Return size (number of internal faces)
Definition: surfaceMeshI.H:34
fvMesh Mesh
Mesh type.
Definition: surfaceMesh.H:79
bool operator==(const surfaceMesh &) const
Definition: surfaceMeshI.H:74
faceZone Zone
Zone type.
Definition: surfaceMesh.H:85
const objectRegistry & db() const
Return fvMesh database.
Definition: surfaceMeshI.H:41
tmp< DimensionedField< Type, surfaceMesh > > lookupField(const word &) const
Lookup a dimensioned field for this geometry.
virtual ~surfaceMesh()
Definition: surfaceMesh.H:72
surfaceMesh(const fvMesh &mesh)
Construct from fvMesh.
Definition: surfaceMesh.H:63
const polyMesh & poly() const
Return reference to polyMesh.
Definition: surfaceMeshI.H:28
fvBoundaryMesh BoundaryMesh
Boundary mesh type.
Definition: surfaceMesh.H:82
bool operator!=(const surfaceMesh &) const
Definition: surfaceMeshI.H:68
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59