MeshedSurfaceIOAllocator.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 | Copyright (C) 2011 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
57 
58  //- Faces
60 
61  //- Surface zones
63 
64 
65  // Private Member Functions
66 
67  //- Disallow default bitwise copy construct
69 
70  //- Disallow default bitwise assignment
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 // ************************************************************************* //
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::MeshedSurfaceIOAllocator::storedIOZones
surfZoneIOList & storedIOZones()
Non-const access to the zones.
Definition: MeshedSurfaceIOAllocator.H:125
Foam::IOField< vector >
Foam::MeshedSurfaceIOAllocator::MeshedSurfaceIOAllocator
MeshedSurfaceIOAllocator(const MeshedSurfaceIOAllocator &)
Disallow default bitwise copy construct.
Foam::MeshedSurfaceIOAllocator::resetFaces
void resetFaces(const Xfer< faceList > &faces, const Xfer< surfZoneList > &zones)
Reset primitive data (points, faces and zones)
Definition: MeshedSurfaceIOAllocator.C:86
pointIOField.H
Foam::MeshedSurfaceIOAllocator::storedIOPoints
pointIOField & storedIOPoints()
Non-const access to the points.
Definition: MeshedSurfaceIOAllocator.H:113
Foam::Xfer
A simple container for copying or transferring objects of type <T>.
Definition: Xfer.H:85
Foam::MeshedSurfaceIOAllocator::reset
void reset(const Xfer< pointField > &points, const Xfer< faceList > &faces, const Xfer< surfZoneList > &zones)
Reset primitive data (points, faces and zones)
Definition: MeshedSurfaceIOAllocator.C:104
Foam::MeshedSurfaceIOAllocator::faces_
faceCompactIOList faces_
Faces.
Definition: MeshedSurfaceIOAllocator.H:58
Foam::surfZoneIOList
IOobject for a surfZoneList.
Definition: surfZoneIOList.H:53
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::MeshedSurfaceIOAllocator::zones_
surfZoneIOList zones_
Surface zones.
Definition: MeshedSurfaceIOAllocator.H:61
Foam::CompactIOList
A List of objects of type <T> with automated input and output using a compact storage....
Definition: CompactIOList.H:53
Foam::MeshedSurfaceIOAllocator::storedIOZones
const surfZoneIOList & storedIOZones() const
Const access to the zones.
Definition: MeshedSurfaceIOAllocator.H:143
Foam::MeshedSurfaceIOAllocator::storedIOPoints
const pointIOField & storedIOPoints() const
Const access to the points.
Definition: MeshedSurfaceIOAllocator.H:131
Foam::MeshedSurfaceIOAllocator::storedIOFaces
faceCompactIOList & storedIOFaces()
Non-const access to the faces.
Definition: MeshedSurfaceIOAllocator.H:119
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
faceIOList.H
Foam::MeshedSurfaceIOAllocator::clear
void clear()
Clear primitive data (points, faces and zones)
Definition: MeshedSurfaceIOAllocator.C:77
Foam::MeshedSurfaceIOAllocator::storedIOFaces
const faceCompactIOList & storedIOFaces() const
Const access to the faces.
Definition: MeshedSurfaceIOAllocator.H:137
surfZoneIOList.H
Foam::MeshedSurfaceIOAllocator::operator=
void operator=(const MeshedSurfaceIOAllocator &)
Disallow default bitwise assignment.
Foam::MeshedSurfaceIOAllocator
A helper class for storing points, faces and zones with IO capabilities.
Definition: MeshedSurfaceIOAllocator.H:50
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::MeshedSurfaceIOAllocator::points_
pointIOField points_
Points.
Definition: MeshedSurfaceIOAllocator.H:55
ioPoints
IOobject ioPoints("points", runTime.timeName(), mesh.name(), mesh)