initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / surfMesh / MeshedSurfaceAllocator / MeshedSurfaceIOAllocator.H
blob3e9eec778fedff5c17d176bd2168acf19ca4f451
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::MeshedSurfaceIOAllocator
28 Description
29     A helper class for storing points, faces and zones with IO capabilities.
31 SourceFiles
32     MeshedSurfaceIOAllocator.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef MeshedSurfaceIOAllocator_H
37 #define MeshedSurfaceIOAllocator_H
39 #include "pointIOField.H"
40 #include "faceIOList.H"
41 #include "surfZoneIOList.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                   Class MeshedSurfaceIOAllocator Declaration
50 \*---------------------------------------------------------------------------*/
52 //- A helper class for storing points, faces and zones
53 class MeshedSurfaceIOAllocator
55     // Private data
57         //- Points
58         pointIOField   points_;
60         //- Faces
61         faceIOList     faces_;
63         //- Surface zones
64         surfZoneIOList zones_;
67     // Private Member Functions
69         //- Disallow default bitwise copy construct
70         MeshedSurfaceIOAllocator(const MeshedSurfaceIOAllocator&);
72         //- Disallow default bitwise assignment
73         void operator=(const MeshedSurfaceIOAllocator&);
76 public:
78     // Constructors
80         //- Read construct from IOobjects
81         MeshedSurfaceIOAllocator
82         (
83             const IOobject& ioPoints,
84             const IOobject& ioFaces,
85             const IOobject& ioZones
86         );
88         //- Construct from IOobjects, copying components
89         MeshedSurfaceIOAllocator
90         (
91             const IOobject& ioPoints,
92             const pointField& points,
93             const IOobject& ioFaces,
94             const faceList& faces,
95             const IOobject& ioZones,
96             const surfZoneList& zones
97         );
99         //- Construct from IOobjects, possibly transferring components
100         MeshedSurfaceIOAllocator
101         (
102             const IOobject& ioPoints,
103             const Xfer< pointField >& points,
104             const IOobject& ioFaces,
105             const Xfer< faceList >& faces,
106             const IOobject& ioZones,
107             const Xfer< surfZoneList >& zones
108         );
110     // Destructor
113     // Member Functions
115         // Access
117             //- Non-const access to the points
118             pointIOField& storedIOPoints()
119             {
120                 return points_;
121             }
123             //- Non-const access to the faces
124             faceIOList& storedIOFaces()
125             {
126                 return faces_;
127             }
129             //- Non-const access to the zones
130             surfZoneIOList& storedIOZones()
131             {
132                 return zones_;
133             }
135             //- Const access to the points
136             const pointIOField& storedIOPoints() const
137             {
138                 return points_;
139             }
141             //- Const access to the faces
142             const faceIOList& storedIOFaces() const
143             {
144                 return faces_;
145             }
147             //- Const access to the zones
148             const surfZoneIOList& storedIOZones() const
149             {
150                 return zones_;
151             }
154         //  Storage management
156             //- Clear primitive data (points, faces and zones)
157             void clear();
159             //- Reset primitive data (points, faces and zones)
160             //  Note, optimized to avoid overwriting data (with Xfer::null)
161             void resetFaces
162             (
163                 const Xfer< faceList >& faces,
164                 const Xfer< surfZoneList >& zones
165             );
167             //- Reset primitive data (points, faces and zones)
168             //  Note, optimized to avoid overwriting data (with Xfer::null)
169             void reset
170             (
171                 const Xfer< pointField >& points,
172                 const Xfer< faceList >& faces,
173                 const Xfer< surfZoneList >& zones
174             );
176             //- Reset primitive data (points, faces and zones)
177             //  Note, optimized to avoid overwriting data (with Xfer::null)
178             void reset
179             (
180                 const Xfer< List<point> >& points,
181                 const Xfer< faceList >& faces,
182                 const Xfer< surfZoneList >& zones
183             );
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 } // End namespace Foam
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 #endif
195 // ************************************************************************* //