Loading...
Searching...
No Matches
IOmapDistributePolyMesh.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) 2015 OpenFOAM Foundation
9 Copyright (C) 2022-2025 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::IOmapDistributePolyMesh
29
30Description
31 IOmapDistributePolyMesh is derived from mapDistributePolyMesh and
32 IOobject to give the mapDistributePolyMesh
33 automatic IO functionality via the objectRegistry.
34
35SourceFiles
36 IOmapDistributePolyMesh.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef Foam_IOmapDistributePolyMesh_H
41#define Foam_IOmapDistributePolyMesh_H
42
44#include "regIOobject.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
51/*---------------------------------------------------------------------------*\
52 Class IOmapDistributePolyMesh Declaration
53\*---------------------------------------------------------------------------*/
54
56:
57 public regIOobject,
59{
60 // Private Member Functions
61
62 //- Read if IOobject flags set. Return true if read.
63 bool readIOcontents();
64
65public:
66
67 //- Runtime type information
68 TypeName("mapDistributePolyMesh");
69
70
71 // Constructors
72
73 //- Construct from IOobject
74 explicit IOmapDistributePolyMesh(const IOobject& io);
75
76 //- Construct from IOobject, copying mapDistributePolyMesh contents
78 (
79 const IOobject& io,
80 const mapDistributePolyMesh& map
81 );
82
83 //- Construct from IOobject, moving mapDistributePolyMesh contents
85 (
86 const IOobject& io,
88 );
89
90
91 // Factory Methods
92
93 //- Write contents. The IOobject is never registered.
94 // Uses IOmapDistributePolyMeshRef internally.
95 static void writeContents
96 (
97 const IOobject& io,
98 const mapDistributePolyMesh& map
99 );
100
101
102 //- Destructor
103 virtual ~IOmapDistributePolyMesh() = default;
104
105
106 // Member Functions
107
108 //- The readData method for regIOobject read operation
109 virtual bool readData(Istream& is);
110
111 //- The writeData method for regIOobject write operation
112 virtual bool writeData(Ostream& os) const;
114
115
116/*---------------------------------------------------------------------------*\
117 Class IOmapDistributePolyMeshRef Declaration
118\*---------------------------------------------------------------------------*/
119
120//- A IOmapDistributePolyMesh wrapper for using referenced external data.
122:
123 public regIOobject
124{
125 // Private Data
126
127 //- Reference to the external content
129
130public:
131
132 //- Type is identical to IOmapDistributePolyMesh
133 virtual const word& type() const
134 {
135 return IOmapDistributePolyMesh::typeName;
136 }
138
139 // Generated Methods
140
141 //- No default construct
143
144 //- No copy construct
146
147 //- No copy assignment
148 void operator=(const IOmapDistributePolyMeshRef&) = delete;
149
150
151 // Constructors
152
153 //- Construct from IOobject and const data reference
155 (
156 const IOobject& io,
157 const mapDistributePolyMesh& map
158 );
159
160
161 //- Destructor
162 virtual ~IOmapDistributePolyMeshRef() = default;
163
165 // Member Functions
166
167 //- Allow cast to const content
168 // Fatal if content is not set
169 operator const mapDistributePolyMesh&() const
170 {
171 return contentRef_.cref();
172 }
173
174 //- The readData method for regIOobject read operation
175 // Fatal if content is constant (or not set)
176 virtual bool readData(Istream& is);
177
178 //- The writeData method for regIOobject write operation
179 // Fatal if content is not set
180 virtual bool writeData(Ostream& os) const;
181};
182
183
184// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185
186} // End namespace Foam
187
188// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189
190#endif
191
192// ************************************************************************* //
A IOmapDistributePolyMesh wrapper for using referenced external data.
IOmapDistributePolyMeshRef()=delete
No default construct.
IOmapDistributePolyMeshRef(const IOmapDistributePolyMeshRef &)=delete
No copy construct.
virtual bool writeData(Ostream &os) const
The writeData method for regIOobject write operation.
virtual bool readData(Istream &is)
The readData method for regIOobject read operation.
virtual const word & type() const
Type is identical to IOmapDistributePolyMesh.
virtual ~IOmapDistributePolyMeshRef()=default
Destructor.
void operator=(const IOmapDistributePolyMeshRef &)=delete
No copy assignment.
static void writeContents(const IOobject &io, const mapDistributePolyMesh &map)
Write contents. The IOobject is never registered.
virtual ~IOmapDistributePolyMesh()=default
Destructor.
TypeName("mapDistributePolyMesh")
Runtime type information.
virtual bool writeData(Ostream &os) const
The writeData method for regIOobject write operation.
IOmapDistributePolyMesh(const IOobject &io)
Construct from IOobject.
virtual bool readData(Istream &is)
The readData method for regIOobject read operation.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
mapDistributePolyMesh()
Default construct - uses worldComm.
A class for managing references or pointers (no reference counting).
Definition refPtr.H:54
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition regIOobject.H:71
regIOobject(const IOobject &io, const bool isTimeObject=false)
Construct from IOobject. The optional flag adds special handling if the object is the top-level regIO...
Definition regIOobject.C:43
A class for handling words, derived from Foam::string.
Definition word.H:66
OBJstream os(runTime.globalPath()/outputName)
const auto & io
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68