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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2016-2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
34 (
35  const IOobject& ioPoints,
36  const IOobject& ioFaces
37 )
38 :
39  points_(ioPoints),
40  faces_(ioFaces)
41 {}
42 
43 
45 (
46  const IOobject& ioPoints, const pointField& points,
47  const IOobject& ioFaces, const faceList& faces
48 )
49 :
50  points_(ioPoints, points),
51  faces_(ioFaces, faces)
52 {}
53 
54 
56 (
57  const IOobject& ioPoints, pointField&& points,
58  const IOobject& ioFaces, faceList&& faces
59 )
60 :
61  points_(ioPoints, std::move(points)),
62  faces_(ioFaces, std::move(faces))
63 {}
64 
65 
66 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
67 
69 (
70  const fileName& inst
71 )
72 {
73  points_.instance() = inst;
74  faces_.instance() = inst;
75 }
76 
77 
79 (
81 )
82 {
83  points_.writeOpt(wOpt);
84  faces_.writeOpt(wOpt);
85 }
86 
87 
89 {
90  points_.clear();
91  faces_.clear();
92 }
93 
94 
96 (
97  IOstreamOption streamOpt,
98  const bool writeOnProc
99 ) const
100 {
101  return
102  (
103  points_.writeObject(streamOpt, writeOnProc)
104  && faces_.writeObject(streamOpt, writeOnProc)
105  );
106 }
107 
108 
109 // ************************************************************************* //
writeOption
Enumeration defining write preferences.
A class for handling file names.
Definition: fileName.H:72
void clear()
Clear primitive data (points, faces)
A simple container for options an IOstream can normally have.
void setInstance(const fileName &inst)
Set the instance for mesh files.
void setWriteOption(IOobjectOption::writeOption wOpt)
Adjust the write option for all components.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write using stream options.
const pointField & points
MeshedSurfaceIOAllocator(const MeshedSurfaceIOAllocator &)=delete
No copy construct.
const fileName & instance() const noexcept
Read access to instance path component.
Definition: IOobjectI.H:266
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:180