MeshedSurfaceIOAllocator.H
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 Class
28  Foam::Detail::MeshedSurfaceIOAllocator
29 
30 Description
31  A helper class for storing points and faces with IO capabilities.
32 
33 SourceFiles
34  MeshedSurfaceIOAllocator.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_MeshedSurfaceIOAllocator_H
39 #define Foam_MeshedSurfaceIOAllocator_H
40 
41 #include "pointIOField.H"
42 #include "faceIOList.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 namespace Detail
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class Detail::MeshedSurfaceIOAllocator Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 {
57  // Private Data
58 
59  //- Points
60  pointIOField points_;
61 
62  //- Faces
63  faceCompactIOList faces_;
64 
65 
66  // Private Member Functions
67 
68  //- No copy construct
70 
71  //- No copy assignment
72  void operator=(const MeshedSurfaceIOAllocator&) = delete;
73 
74 
75 public:
76 
77  // Constructors
78 
79  //- Read construct from IOobjects
81  (
82  const IOobject& ioPoints,
83  const IOobject& ioFaces
84  );
85 
86  //- Construct from IOobjects, copying components
88  (
89  const IOobject& ioPoints, const pointField& points,
90  const IOobject& ioFaces, const faceList& faces
91  );
92 
93  //- Construct from IOobjects, moving components
95  (
96  const IOobject& ioPoints, pointField&& points,
97  const IOobject& ioFaces, faceList&& faces
98  );
99 
100 
101  //- Destructor
102  virtual ~MeshedSurfaceIOAllocator();
103 
104 
105  // Member Functions
106 
107  // Database
108 
109  //- Set the instance for mesh files
110  void setInstance(const fileName& inst);
111 
112  //- Adjust the write option for all components
114 
115 
116  // Access
117 
118  //- Non-const access to the points
120  {
121  return points_;
122  }
123 
124  //- Non-const access to the faces
126  {
127  return faces_;
128  }
129 
130  //- Const access to the points
131  const pointIOField& storedIOPoints() const
132  {
133  return points_;
134  }
135 
136  //- Const access to the faces
137  const faceCompactIOList& storedIOFaces() const
138  {
139  return faces_;
140  }
141 
142 
143  // Storage Management
145  //- Clear primitive data (points, faces)
146  void clear();
147 
148 
149  // Writing
150 
151  //- Write using stream options
152  virtual bool writeObject
153  (
154  IOstreamOption streamOpt,
155  const bool valid
156  ) const;
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Detail
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
writeOption
Enumeration defining write preferences.
A class for handling file names.
Definition: fileName.H:71
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.
const pointField & points
pointIOField & storedIOPoints()
Non-const access to the points.
faceCompactIOList & storedIOFaces()
Non-const access to the faces.
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write using stream options.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:166
A helper class for storing points and faces with IO capabilities.
A primitive field of type <T> with automated input and output.
Namespace for OpenFOAM.