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) 2011-2014 OpenFOAM Foundation
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 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
31 (
32  const IOobject& ioPoints,
33  const IOobject& ioFaces,
34  const IOobject& ioZones
35 )
36 :
37  points_(ioPoints),
38  faces_(ioFaces),
39  zones_(ioZones)
40 {}
41 
42 
44 (
45  const IOobject& ioPoints,
46  const pointField& points,
47  const IOobject& ioFaces,
48  const faceList& faces,
49  const IOobject& ioZones,
50  const surfZoneList& zones
51 )
52 :
53  points_(ioPoints, points),
54  faces_(ioFaces, faces),
55  zones_(ioZones, zones)
56 {}
57 
58 
60 (
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
67 )
68 :
69  points_(ioPoints, points),
70  faces_(ioFaces, faces),
71  zones_(ioZones, zones)
72 {}
73 
74 
75 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
76 
78 {
79  points_.clear();
80  faces_.clear();
81  zones_.clear();
82 }
83 
84 
86 (
87  const Xfer<List<face> >& faces,
88  const Xfer<surfZoneList>& zones
89 )
90 {
91  if (notNull(faces))
92  {
93  faces_.transfer(faces());
94  }
95 
96  if (notNull(zones))
97  {
98  zones_.transfer(zones());
99  }
100 }
101 
102 
104 (
105  const Xfer<pointField>& points,
106  const Xfer<faceList>& faces,
107  const Xfer<surfZoneList>& zones
108 )
109 {
110  // Take over new primitive data.
111  // Optimized to avoid overwriting data at all
112  if (notNull(points))
113  {
114  points_.transfer(points());
115  }
116 
117  resetFaces(faces, zones);
118 }
119 
120 
122 (
123  const Xfer<List<point> >& points,
124  const Xfer<faceList>& faces,
125  const Xfer<surfZoneList>& zones
126 )
127 {
128  // Take over new primitive data.
129  // Optimized to avoid overwriting data at all
130  if (notNull(points))
131  {
132  points_.transfer(points());
133  }
134 
135  resetFaces(faces, zones);
136 }
137 
138 
139 // ************************************************************************* //
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::MeshedSurfaceIOAllocator::MeshedSurfaceIOAllocator
MeshedSurfaceIOAllocator(const MeshedSurfaceIOAllocator &)
Disallow default bitwise copy construct.
Foam::notNull
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
Definition: nullObjectI.H:46
Foam::MeshedSurfaceIOAllocator::resetFaces
void resetFaces(const Xfer< faceList > &faces, const Xfer< surfZoneList > &zones)
Reset primitive data (points, faces and zones)
Definition: MeshedSurfaceIOAllocator.C:86
Foam::Xfer
A simple container for copying or transferring objects of type <T>.
Definition: Xfer.H:85
Foam::MeshedSurfaceIOAllocator::reset
void reset(const Xfer< pointField > &points, const Xfer< faceList > &faces, const Xfer< surfZoneList > &zones)
Reset primitive data (points, faces and zones)
Definition: MeshedSurfaceIOAllocator.C:104
Foam::MeshedSurfaceIOAllocator::faces_
faceCompactIOList faces_
Faces.
Definition: MeshedSurfaceIOAllocator.H:58
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::MeshedSurfaceIOAllocator::zones_
surfZoneIOList zones_
Surface zones.
Definition: MeshedSurfaceIOAllocator.H:61
Foam::MeshedSurfaceIOAllocator::clear
void clear()
Clear primitive data (points, faces and zones)
Definition: MeshedSurfaceIOAllocator.C:77
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::List::clear
void clear()
Clear the list, i.e. set size to zero.
Definition: List.C:379
Foam::MeshedSurfaceIOAllocator::points_
pointIOField points_
Points.
Definition: MeshedSurfaceIOAllocator.H:55
MeshedSurfaceIOAllocator.H
ioPoints
IOobject ioPoints("points", runTime.timeName(), mesh.name(), mesh)