Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::Detail::MeshedSurfaceIOAllocator
29
30Description
31 A helper class for storing points and faces with IO capabilities.
32
33SourceFiles
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
46namespace Foam
47{
48namespace Detail
49{
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
65public:
66
67 // Generated Methods
68
69 //- No copy construct
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
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// ************************************************************************* //
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write using stream options.
MeshedSurfaceIOAllocator(const MeshedSurfaceIOAllocator &)=delete
No copy construct.
void operator=(const MeshedSurfaceIOAllocator &)=delete
No copy assignment.
const pointIOField & storedIOPoints() const noexcept
Const access to the points.
virtual ~MeshedSurfaceIOAllocator()=default
Destructor.
faceCompactIOList & storedIOFaces() noexcept
Non-const access to the faces.
pointIOField & storedIOPoints() noexcept
Non-const access to the points.
const faceCompactIOList & storedIOFaces() const noexcept
Const access to the faces.
void clear()
Clear primitive data (points, faces).
void setInstance(const fileName &inst)
Set the instance for mesh files.
void setWriteOption(IOobjectOption::writeOption wOpt)
Adjust the write option for all components.
writeOption
Enumeration defining write preferences.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
A simple container for options an IOstream can normally have.
A class for handling file names.
Definition fileName.H:75
const pointField & points
Implementation details for various OpenFOAM classes.
Definition zoneSubSet.C:30
Namespace for OpenFOAM.
CompactIOList< face > faceCompactIOList
Compact IO for a List of face.
Definition faceIOList.H:35
List< face > faceList
List of faces.
Definition faceListFwd.H:41
vectorIOField pointIOField
pointIOField is a vectorIOField.
const direction noexcept
Definition scalarImpl.H:265
vectorField pointField
pointField is a vectorField.