ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / surfMesh / MeshedSurfaceAllocator / MeshedSurfaceIOAllocator.H
blobbd4d8ad6b55bce713000472974ad72c960afbb59
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.
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.
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.
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/>.
24 Class
25     Foam::MeshedSurfaceIOAllocator
27 Description
28     A helper class for storing points, faces and zones with IO capabilities.
30 SourceFiles
31     MeshedSurfaceIOAllocator.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef MeshedSurfaceIOAllocator_H
36 #define MeshedSurfaceIOAllocator_H
38 #include "pointIOField.H"
39 #include "faceIOList.H"
40 #include "surfZoneIOList.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 /*---------------------------------------------------------------------------*\
48                   Class MeshedSurfaceIOAllocator Declaration
49 \*---------------------------------------------------------------------------*/
51 class MeshedSurfaceIOAllocator
53     // Private data
55         //- Points
56         pointIOField points_;
58         //- Faces
59         faceCompactIOList faces_;
61         //- Surface zones
62         surfZoneIOList zones_;
65     // Private Member Functions
67         //- Disallow default bitwise copy construct
68         MeshedSurfaceIOAllocator(const MeshedSurfaceIOAllocator&);
70         //- Disallow default bitwise assignment
71         void operator=(const MeshedSurfaceIOAllocator&);
74 public:
76     // Constructors
78         //- Read construct from IOobjects
79         MeshedSurfaceIOAllocator
80         (
81             const IOobject& ioPoints,
82             const IOobject& ioFaces,
83             const IOobject& ioZones
84         );
86         //- Construct from IOobjects, copying components
87         MeshedSurfaceIOAllocator
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         );
97         //- Construct from IOobjects, possibly transferring components
98         MeshedSurfaceIOAllocator
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         );
109     // Member Functions
111         // Access
113             //- Non-const access to the points
114             pointIOField& storedIOPoints()
115             {
116                 return points_;
117             }
119             //- Non-const access to the faces
120             faceCompactIOList& storedIOFaces()
121             {
122                 return faces_;
123             }
125             //- Non-const access to the zones
126             surfZoneIOList& storedIOZones()
127             {
128                 return zones_;
129             }
131             //- Const access to the points
132             const pointIOField& storedIOPoints() const
133             {
134                 return points_;
135             }
137             //- Const access to the faces
138             const faceCompactIOList& storedIOFaces() const
139             {
140                 return faces_;
141             }
143             //- Const access to the zones
144             const surfZoneIOList& storedIOZones() const
145             {
146                 return zones_;
147             }
150         //  Storage management
152             //- Clear primitive data (points, faces and zones)
153             void clear();
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             );
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             );
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             );
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 } // End namespace Foam
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 #endif
191 // ************************************************************************* //