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-2024 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" // faceIOList and faceCompactIOList
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 public:
66 
67  // Generated Methods
68 
69  //- No copy construct
71 
72  //- No copy assignment
73  void operator=(const MeshedSurfaceIOAllocator&) = delete;
74 
75 
76  // Constructors
77 
78  //- Read construct from IOobjects
80  (
81  const IOobject& ioPoints,
82  const IOobject& ioFaces
83  );
84 
85  //- Construct from IOobjects, copying components
87  (
88  const IOobject& ioPoints, const pointField& points,
89  const IOobject& ioFaces, const faceList& faces
90  );
91 
92  //- Construct from IOobjects, moving components
94  (
95  const IOobject& ioPoints, pointField&& points,
96  const IOobject& ioFaces, faceList&& faces
97  );
98 
99 
100  //- Destructor
101  virtual ~MeshedSurfaceIOAllocator() = default;
102 
103 
104  // Member Functions
105 
106  // Database
107 
108  //- Set the instance for mesh files
109  void setInstance(const fileName& inst);
110 
111  //- Adjust the write option for all components
113 
114 
115  // Access
116 
117  //- Non-const access to the points
119  {
120  return points_;
121  }
122 
123  //- Non-const access to the faces
125  {
126  return faces_;
127  }
128 
129  //- Const access to the points
130  const pointIOField& storedIOPoints() const noexcept
131  {
132  return points_;
133  }
134 
135  //- Const access to the faces
137  {
138  return faces_;
139  }
140 
141 
142  // Storage Management
144  //- Clear primitive data (points, faces)
145  void clear();
146 
147 
148  // Writing
149 
150  //- Write using stream options
151  virtual bool writeObject
152  (
153  IOstreamOption streamOpt,
154  const bool writeOnProc
155  ) const;
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Detail
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
writeOption
Enumeration defining write preferences.
A class for handling file names.
Definition: fileName.H:72
void operator=(const MeshedSurfaceIOAllocator &)=delete
No copy assignment.
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.
faceCompactIOList & storedIOFaces() noexcept
Non-const access to the faces.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write using stream options.
virtual ~MeshedSurfaceIOAllocator()=default
Destructor.
const pointField & points
pointIOField & storedIOPoints() noexcept
Non-const access to the points.
MeshedSurfaceIOAllocator(const MeshedSurfaceIOAllocator &)=delete
No copy construct.
const direction noexcept
Definition: Scalar.H:258
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:180
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.