BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / surfMesh / MeshedSurfaceAllocator / MeshedSurfaceIOAllocator.C
blob1a97d5d3ebc37cbcec941afadb8622f913df0186
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 \*---------------------------------------------------------------------------*/
26 #include "MeshedSurfaceIOAllocator.H"
28 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
30 Foam::MeshedSurfaceIOAllocator::MeshedSurfaceIOAllocator
32     const IOobject& ioPoints,
33     const IOobject& ioFaces,
34     const IOobject& ioZones
37     points_(ioPoints),
38     faces_(ioFaces),
39     zones_(ioZones)
43 Foam::MeshedSurfaceIOAllocator::MeshedSurfaceIOAllocator
45     const IOobject& ioPoints,
46     const pointField& points,
47     const IOobject& ioFaces,
48     const faceList& faces,
49     const IOobject& ioZones,
50     const surfZoneList& zones
53     points_(ioPoints, points),
54     faces_(ioFaces, faces),
55     zones_(ioZones, zones)
59 Foam::MeshedSurfaceIOAllocator::MeshedSurfaceIOAllocator
61     const IOobject& ioPoints,
62     const Xfer<pointField>& points,
63     const IOobject& ioFaces,
64     const Xfer<faceList>& faces,
65     const IOobject& ioZones,
66     const Xfer<surfZoneList>& zones
69     points_(ioPoints, points),
70     faces_(ioFaces, faces),
71     zones_(ioZones, zones)
75 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
77 void Foam::MeshedSurfaceIOAllocator::clear()
79     points_.clear();
80     faces_.clear();
81     zones_.clear();
85 void Foam::MeshedSurfaceIOAllocator::resetFaces
87     const Xfer<List<face> >& faces,
88     const Xfer<surfZoneList>& zones
91     if (&faces)
92     {
93         faces_.transfer(faces());
94     }
96     if (&zones)
97     {
98         zones_.transfer(zones());
99     }
103 void Foam::MeshedSurfaceIOAllocator::reset
105     const Xfer<pointField>& points,
106     const Xfer<faceList>& faces,
107     const Xfer<surfZoneList>& zones
110     // Take over new primitive data.
111     // Optimized to avoid overwriting data at all
112     if (&points)
113     {
114         points_.transfer(points());
115     }
117     resetFaces(faces, zones);
121 void Foam::MeshedSurfaceIOAllocator::reset
123     const Xfer<List<point> >& points,
124     const Xfer<faceList>& faces,
125     const Xfer<surfZoneList>& zones
128     // Take over new primitive data.
129     // Optimized to avoid overwriting data at all
130     if (&points)
131     {
132         points_.transfer(points());
133     }
135     resetFaces(faces, zones);
139 // ************************************************************************* //