FreeFOAM The Cross-Platform CFD Toolkit
MeshedSurfaceIOAllocator.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
27 
28 
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 
31 Foam::MeshedSurfaceIOAllocator::MeshedSurfaceIOAllocator
32 (
33  const IOobject& ioPoints,
34  const IOobject& ioFaces,
35  const IOobject& ioZones
36 )
37 :
38  points_(ioPoints),
39  faces_(ioFaces),
40  zones_(ioZones)
41 {}
42 
43 
44 Foam::MeshedSurfaceIOAllocator::MeshedSurfaceIOAllocator
45 (
46  const IOobject& ioPoints,
47  const pointField& points,
48  const IOobject& ioFaces,
49  const faceList& faces,
50  const IOobject& ioZones,
51  const surfZoneList& zones
52 )
53 :
54  points_(ioPoints, points),
55  faces_(ioFaces, faces),
56  zones_(ioZones, zones)
57 {}
58 
59 
60 Foam::MeshedSurfaceIOAllocator::MeshedSurfaceIOAllocator
61 (
62  const IOobject& ioPoints,
63  const Xfer< pointField >& points,
64  const IOobject& ioFaces,
65  const Xfer< faceList >& faces,
66  const IOobject& ioZones,
67  const Xfer< surfZoneList >& zones
68 )
69 :
70  points_(ioPoints, points),
71  faces_(ioFaces, faces),
72  zones_(ioZones, zones)
73 {}
74 
75 
76 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
77 
78 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
79 
81 {
82  points_.clear();
83  faces_.clear();
84  zones_.clear();
85 }
86 
87 
89 (
90  const Xfer< List<face> >& faces,
91  const Xfer< surfZoneList >& zones
92 )
93 {
94  if (&faces)
95  {
96  faces_.transfer(faces());
97  }
98 
99  if (&zones)
100  {
101  zones_.transfer(zones());
102  }
103 }
104 
105 
107 (
108  const Xfer< pointField >& points,
109  const Xfer< faceList >& faces,
110  const Xfer< surfZoneList >& zones
111 )
112 {
113  // Take over new primitive data.
114  // Optimized to avoid overwriting data at all
115  if (&points)
116  {
117  points_.transfer(points());
118  }
119 
120  resetFaces(faces, zones);
121 }
122 
123 
125 (
126  const Xfer< List<point> >& points,
127  const Xfer< faceList >& faces,
128  const Xfer< surfZoneList >& zones
129 )
130 {
131  // Take over new primitive data.
132  // Optimized to avoid overwriting data at all
133  if (&points)
134  {
135  points_.transfer(points());
136  }
137 
138  resetFaces(faces, zones);
139 }
140 
141 
142 // ************************ vim: set sw=4 sts=4 et: ************************ //