MeshedSurfaceIOAllocator.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-2019 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::MeshedSurfaceIOAllocator
26 
27 Description
28  A helper class for storing points, faces and zones with IO capabilities.
29 
30 SourceFiles
31  MeshedSurfaceIOAllocator.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef MeshedSurfaceIOAllocator_H
36 #define MeshedSurfaceIOAllocator_H
37 
38 #include "pointIOField.H"
39 #include "faceIOList.H"
40 #include "surfZoneIOList.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class MeshedSurfaceIOAllocator Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 {
53  // Private Data
54 
55  //- Points
56  pointIOField points_;
57 
58  //- Faces
59  faceCompactIOList faces_;
60 
61  //- Surface zones
62  surfZoneIOList zones_;
63 
64 
65 public:
66 
67  // Constructors
68 
69  //- Read construct from IOobjects
71  (
72  const IOobject& ioPoints,
73  const IOobject& ioFaces,
74  const IOobject& ioZones
75  );
76 
77  //- Construct from IOobjects, copying components
79  (
80  const IOobject& ioPoints,
81  const pointField& points,
82  const IOobject& ioFaces,
83  const faceList& faces,
84  const IOobject& ioZones,
85  const surfZoneList& zones
86  );
87 
88  //- Construct from IOobjects, possibly transferring components
90  (
91  const IOobject& ioPoints,
92  pointField&& points,
93  const IOobject& ioFaces,
94  faceList&& faces,
95  const IOobject& ioZones,
96  surfZoneList&& zones
97  );
98 
99  //- Disallow default bitwise copy construction
101 
102 
103  // Member Functions
104 
105  // Access
106 
107  //- Non-const access to the points
109  {
110  return points_;
111  }
112 
113  //- Non-const access to the faces
115  {
116  return faces_;
117  }
118 
119  //- Non-const access to the zones
121  {
122  return zones_;
123  }
124 
125  //- Const access to the points
126  const pointIOField& storedIOPoints() const
127  {
128  return points_;
129  }
130 
131  //- Const access to the faces
132  const faceCompactIOList& storedIOFaces() const
133  {
134  return faces_;
135  }
136 
137  //- Const access to the zones
138  const surfZoneIOList& storedIOZones() const
139  {
140  return zones_;
141  }
142 
143 
144  // Storage management
145 
146  //- Clear primitive data (points, faces and zones)
147  void clear();
148 
149  //- Reset primitive data (points, faces and zones)
150  void resetFaces
151  (
152  faceList&& faces,
153  surfZoneList&& zones
154  );
155 
156  //- Reset primitive data (points, faces and zones)
157  void reset
158  (
159  pointField&& points,
160  faceList&& faces,
161  surfZoneList&& zones
162  );
163 
164  //- Reset primitive data (points, faces and zones)
165  // Note, optimized to avoid overwriting data (with null)
166  void reset
167  (
168  List<point>&& points,
169  faceList&& faces,
170  surfZoneList&& zones
171  );
172 
173 
174  // Member Operators
175 
176  //- Disallow default bitwise assignment
177  void operator=(const MeshedSurfaceIOAllocator&) = delete;
178 };
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
IOobject ioPoints("points", runTime.timeName(), mesh.name(), mesh)
faceCompactIOList & storedIOFaces()
Non-const access to the faces.
MeshedSurfaceIOAllocator(const IOobject &ioPoints, const IOobject &ioFaces, const IOobject &ioZones)
Read construct from IOobjects.
void operator=(const MeshedSurfaceIOAllocator &)=delete
Disallow default bitwise assignment.
pointIOField & storedIOPoints()
Non-const access to the points.
const pointField & points
void resetFaces(faceList &&faces, surfZoneList &&zones)
Reset primitive data (points, faces and zones)
surfZoneIOList & storedIOZones()
Non-const access to the zones.
IOobject for a surfZoneList.
A helper class for storing points, faces and zones with IO capabilities.
void reset(pointField &&points, faceList &&faces, surfZoneList &&zones)
Reset primitive data (points, faces and zones)
void clear()
Clear primitive data (points, faces and zones)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
A primitive field of type <T> with automated input and output.
Definition: IOField.H:50
Namespace for OpenFOAM.