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-2018 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  // Private Member Functions
66 
67  //- Disallow default bitwise copy construct
69 
70  //- Disallow default bitwise assignment
71  void operator=(const MeshedSurfaceIOAllocator&);
72 
73 
74 public:
75 
76  // Constructors
77 
78  //- Read construct from IOobjects
80  (
81  const IOobject& ioPoints,
82  const IOobject& ioFaces,
83  const IOobject& ioZones
84  );
85 
86  //- Construct from IOobjects, copying components
88  (
89  const IOobject& ioPoints,
90  const pointField& points,
91  const IOobject& ioFaces,
92  const faceList& faces,
93  const IOobject& ioZones,
94  const surfZoneList& zones
95  );
96 
97  //- Construct from IOobjects, possibly transferring components
99  (
100  const IOobject& ioPoints,
101  const Xfer<pointField>& points,
102  const IOobject& ioFaces,
103  const Xfer<faceList>& faces,
104  const IOobject& ioZones,
105  const Xfer<surfZoneList>& zones
106  );
107 
108 
109  // Member Functions
110 
111  // Access
112 
113  //- Non-const access to the points
115  {
116  return points_;
117  }
118 
119  //- Non-const access to the faces
121  {
122  return faces_;
123  }
124 
125  //- Non-const access to the zones
127  {
128  return zones_;
129  }
130 
131  //- Const access to the points
132  const pointIOField& storedIOPoints() const
133  {
134  return points_;
135  }
136 
137  //- Const access to the faces
138  const faceCompactIOList& storedIOFaces() const
139  {
140  return faces_;
141  }
142 
143  //- Const access to the zones
144  const surfZoneIOList& storedIOZones() const
145  {
146  return zones_;
147  }
148 
149 
150  // Storage management
151 
152  //- Clear primitive data (points, faces and zones)
153  void clear();
154 
155  //- Reset primitive data (points, faces and zones)
156  // Note, optimized to avoid overwriting data (with Xfer::null)
157  void resetFaces
158  (
159  const Xfer<faceList>& faces,
160  const Xfer<surfZoneList>& zones
161  );
162 
163  //- Reset primitive data (points, faces and zones)
164  // Note, optimized to avoid overwriting data (with Xfer::null)
165  void reset
166  (
167  const Xfer<pointField>& points,
168  const Xfer<faceList>& faces,
169  const Xfer<surfZoneList>& zones
170  );
171 
172  //- Reset primitive data (points, faces and zones)
173  // Note, optimized to avoid overwriting data (with Xfer::null)
174  void reset
175  (
176  const Xfer<List<point>>& points,
177  const Xfer<faceList>& faces,
178  const Xfer<surfZoneList>& zones
179  );
180 };
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace Foam
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************************************************************* //
A simple container for copying or transferring objects of type <T>.
Definition: Xfer.H:85
IOobject ioPoints("points", runTime.timeName(), mesh.name(), mesh)
faceCompactIOList & storedIOFaces()
Non-const access to the faces.
pointIOField & storedIOPoints()
Non-const access to the points.
void resetFaces(const Xfer< faceList > &faces, const Xfer< surfZoneList > &zones)
Reset primitive data (points, faces and zones)
const pointField & points
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(const Xfer< pointField > &points, const Xfer< faceList > &faces, const Xfer< 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.