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

MeshedSurfaceIOAllocator.C

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 \*---------------------------------------------------------------------------*/
00025 
00026 #include "MeshedSurfaceIOAllocator.H"
00027 
00028 
00029 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00030 
00031 Foam::MeshedSurfaceIOAllocator::MeshedSurfaceIOAllocator
00032 (
00033     const IOobject& ioPoints,
00034     const IOobject& ioFaces,
00035     const IOobject& ioZones
00036 )
00037 :
00038     points_(ioPoints),
00039     faces_(ioFaces),
00040     zones_(ioZones)
00041 {}
00042 
00043 
00044 Foam::MeshedSurfaceIOAllocator::MeshedSurfaceIOAllocator
00045 (
00046     const IOobject& ioPoints,
00047     const pointField& points,
00048     const IOobject& ioFaces,
00049     const faceList& faces,
00050     const IOobject& ioZones,
00051     const surfZoneList& zones
00052 )
00053 :
00054     points_(ioPoints, points),
00055     faces_(ioFaces, faces),
00056     zones_(ioZones, zones)
00057 {}
00058 
00059 
00060 Foam::MeshedSurfaceIOAllocator::MeshedSurfaceIOAllocator
00061 (
00062     const IOobject& ioPoints,
00063     const Xfer< pointField >& points,
00064     const IOobject& ioFaces,
00065     const Xfer< faceList >& faces,
00066     const IOobject& ioZones,
00067     const Xfer< surfZoneList >& zones
00068 )
00069 :
00070     points_(ioPoints, points),
00071     faces_(ioFaces, faces),
00072     zones_(ioZones, zones)
00073 {}
00074 
00075 
00076 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00077 
00078 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00079 
00080 void Foam::MeshedSurfaceIOAllocator::clear()
00081 {
00082     points_.clear();
00083     faces_.clear();
00084     zones_.clear();
00085 }
00086 
00087 
00088 void Foam::MeshedSurfaceIOAllocator::resetFaces
00089 (
00090     const Xfer< List<face> >& faces,
00091     const Xfer< surfZoneList >& zones
00092 )
00093 {
00094     if (&faces)
00095     {
00096         faces_.transfer(faces());
00097     }
00098 
00099     if (&zones)
00100     {
00101         zones_.transfer(zones());
00102     }
00103 }
00104 
00105 
00106 void Foam::MeshedSurfaceIOAllocator::reset
00107 (
00108     const Xfer< pointField >& points,
00109     const Xfer< faceList >& faces,
00110     const Xfer< surfZoneList >& zones
00111 )
00112 {
00113     // Take over new primitive data.
00114     // Optimized to avoid overwriting data at all
00115     if (&points)
00116     {
00117         points_.transfer(points());
00118     }
00119 
00120     resetFaces(faces, zones);
00121 }
00122 
00123 
00124 void Foam::MeshedSurfaceIOAllocator::reset
00125 (
00126     const Xfer< List<point> >& points,
00127     const Xfer< faceList >& faces,
00128     const Xfer< surfZoneList >& zones
00129 )
00130 {
00131     // Take over new primitive data.
00132     // Optimized to avoid overwriting data at all
00133     if (&points)
00134     {
00135         points_.transfer(points());
00136     }
00137 
00138     resetFaces(faces, zones);
00139 }
00140 
00141 
00142 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines