FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

MeshedSurfaceIOAllocator.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::MeshedSurfaceIOAllocator
00026 
00027 Description
00028     A helper class for storing points, faces and zones with IO capabilities.
00029 
00030 SourceFiles
00031     MeshedSurfaceIOAllocator.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef MeshedSurfaceIOAllocator_H
00036 #define MeshedSurfaceIOAllocator_H
00037 
00038 #include <OpenFOAM/pointIOField.H>
00039 #include <OpenFOAM/faceIOList.H>
00040 #include <surfMesh/surfZoneIOList.H>
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                   Class MeshedSurfaceIOAllocator Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 //- A helper class for storing points, faces and zones
00052 class MeshedSurfaceIOAllocator
00053 {
00054     // Private data
00055 
00056         //- Points
00057         pointIOField   points_;
00058 
00059         //- Faces
00060         faceIOList     faces_;
00061 
00062         //- Surface zones
00063         surfZoneIOList zones_;
00064 
00065 
00066     // Private Member Functions
00067 
00068         //- Disallow default bitwise copy construct
00069         MeshedSurfaceIOAllocator(const MeshedSurfaceIOAllocator&);
00070 
00071         //- Disallow default bitwise assignment
00072         void operator=(const MeshedSurfaceIOAllocator&);
00073 
00074 
00075 public:
00076 
00077     // Constructors
00078 
00079         //- Read construct from IOobjects
00080         MeshedSurfaceIOAllocator
00081         (
00082             const IOobject& ioPoints,
00083             const IOobject& ioFaces,
00084             const IOobject& ioZones
00085         );
00086 
00087         //- Construct from IOobjects, copying components
00088         MeshedSurfaceIOAllocator
00089         (
00090             const IOobject& ioPoints,
00091             const pointField& points,
00092             const IOobject& ioFaces,
00093             const faceList& faces,
00094             const IOobject& ioZones,
00095             const surfZoneList& zones
00096         );
00097 
00098         //- Construct from IOobjects, possibly transferring components
00099         MeshedSurfaceIOAllocator
00100         (
00101             const IOobject& ioPoints,
00102             const Xfer< pointField >& points,
00103             const IOobject& ioFaces,
00104             const Xfer< faceList >& faces,
00105             const IOobject& ioZones,
00106             const Xfer< surfZoneList >& zones
00107         );
00108 
00109     // Destructor
00110 
00111 
00112     // Member Functions
00113 
00114         // Access
00115 
00116             //- Non-const access to the points
00117             pointIOField& storedIOPoints()
00118             {
00119                 return points_;
00120             }
00121 
00122             //- Non-const access to the faces
00123             faceIOList& storedIOFaces()
00124             {
00125                 return faces_;
00126             }
00127 
00128             //- Non-const access to the zones
00129             surfZoneIOList& storedIOZones()
00130             {
00131                 return zones_;
00132             }
00133 
00134             //- Const access to the points
00135             const pointIOField& storedIOPoints() const
00136             {
00137                 return points_;
00138             }
00139 
00140             //- Const access to the faces
00141             const faceIOList& storedIOFaces() const
00142             {
00143                 return faces_;
00144             }
00145 
00146             //- Const access to the zones
00147             const surfZoneIOList& storedIOZones() const
00148             {
00149                 return zones_;
00150             }
00151 
00152 
00153         //  Storage management
00154 
00155             //- Clear primitive data (points, faces and zones)
00156             void clear();
00157 
00158             //- Reset primitive data (points, faces and zones)
00159             //  Note, optimized to avoid overwriting data (with Xfer::null)
00160             void resetFaces
00161             (
00162                 const Xfer< faceList >& faces,
00163                 const Xfer< surfZoneList >& zones
00164             );
00165 
00166             //- Reset primitive data (points, faces and zones)
00167             //  Note, optimized to avoid overwriting data (with Xfer::null)
00168             void reset
00169             (
00170                 const Xfer< pointField >& points,
00171                 const Xfer< faceList >& faces,
00172                 const Xfer< surfZoneList >& zones
00173             );
00174 
00175             //- Reset primitive data (points, faces and zones)
00176             //  Note, optimized to avoid overwriting data (with Xfer::null)
00177             void reset
00178             (
00179                 const Xfer< List<point> >& points,
00180                 const Xfer< faceList >& faces,
00181                 const Xfer< surfZoneList >& zones
00182             );
00183 };
00184 
00185 
00186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00187 
00188 } // End namespace Foam
00189 
00190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00191 
00192 #endif
00193 
00194 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines