OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::MeshedSurfaceIOAllocator
00027 
00028 Description
00029     A helper class for storing points, faces and zones with IO capabilities.
00030 
00031 SourceFiles
00032     MeshedSurfaceIOAllocator.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef MeshedSurfaceIOAllocator_H
00037 #define MeshedSurfaceIOAllocator_H
00038 
00039 #include "pointIOField.H"
00040 #include "faceIOList.H"
00041 #include "surfZoneIOList.H"
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                   Class MeshedSurfaceIOAllocator Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 //- A helper class for storing points, faces and zones
00053 class MeshedSurfaceIOAllocator
00054 {
00055     // Private data
00056 
00057         //- Points
00058         pointIOField   points_;
00059 
00060         //- Faces
00061         faceIOList     faces_;
00062 
00063         //- Surface zones
00064         surfZoneIOList zones_;
00065 
00066 
00067     // Private Member Functions
00068 
00069         //- Disallow default bitwise copy construct
00070         MeshedSurfaceIOAllocator(const MeshedSurfaceIOAllocator&);
00071 
00072         //- Disallow default bitwise assignment
00073         void operator=(const MeshedSurfaceIOAllocator&);
00074 
00075 
00076 public:
00077 
00078     // Constructors
00079 
00080         //- Read construct from IOobjects
00081         MeshedSurfaceIOAllocator
00082         (
00083             const IOobject& ioPoints,
00084             const IOobject& ioFaces,
00085             const IOobject& ioZones
00086         );
00087 
00088         //- Construct from IOobjects, copying components
00089         MeshedSurfaceIOAllocator
00090         (
00091             const IOobject& ioPoints,
00092             const pointField& points,
00093             const IOobject& ioFaces,
00094             const faceList& faces,
00095             const IOobject& ioZones,
00096             const surfZoneList& zones
00097         );
00098 
00099         //- Construct from IOobjects, possibly transferring components
00100         MeshedSurfaceIOAllocator
00101         (
00102             const IOobject& ioPoints,
00103             const Xfer< pointField >& points,
00104             const IOobject& ioFaces,
00105             const Xfer< faceList >& faces,
00106             const IOobject& ioZones,
00107             const Xfer< surfZoneList >& zones
00108         );
00109 
00110     // Destructor
00111 
00112 
00113     // Member Functions
00114 
00115         // Access
00116 
00117             //- Non-const access to the points
00118             pointIOField& storedIOPoints()
00119             {
00120                 return points_;
00121             }
00122 
00123             //- Non-const access to the faces
00124             faceIOList& storedIOFaces()
00125             {
00126                 return faces_;
00127             }
00128 
00129             //- Non-const access to the zones
00130             surfZoneIOList& storedIOZones()
00131             {
00132                 return zones_;
00133             }
00134 
00135             //- Const access to the points
00136             const pointIOField& storedIOPoints() const
00137             {
00138                 return points_;
00139             }
00140 
00141             //- Const access to the faces
00142             const faceIOList& storedIOFaces() const
00143             {
00144                 return faces_;
00145             }
00146 
00147             //- Const access to the zones
00148             const surfZoneIOList& storedIOZones() const
00149             {
00150                 return zones_;
00151             }
00152 
00153 
00154         //  Storage management
00155 
00156             //- Clear primitive data (points, faces and zones)
00157             void clear();
00158 
00159             //- Reset primitive data (points, faces and zones)
00160             //  Note, optimized to avoid overwriting data (with Xfer::null)
00161             void resetFaces
00162             (
00163                 const Xfer< faceList >& faces,
00164                 const Xfer< surfZoneList >& zones
00165             );
00166 
00167             //- Reset primitive data (points, faces and zones)
00168             //  Note, optimized to avoid overwriting data (with Xfer::null)
00169             void reset
00170             (
00171                 const Xfer< pointField >& points,
00172                 const Xfer< faceList >& faces,
00173                 const Xfer< surfZoneList >& zones
00174             );
00175 
00176             //- Reset primitive data (points, faces and zones)
00177             //  Note, optimized to avoid overwriting data (with Xfer::null)
00178             void reset
00179             (
00180                 const Xfer< List<point> >& points,
00181                 const Xfer< faceList >& faces,
00182                 const Xfer< surfZoneList >& zones
00183             );
00184 };
00185 
00186 
00187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00188 
00189 } // End namespace Foam
00190 
00191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00192 
00193 #endif
00194 
00195 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd