Loading...
Searching...
No Matches
polyBoundaryMeshEntries.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-2015 OpenFOAM Foundation
9 Copyright (C) 2020-2023 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::polyBoundaryMeshEntries
29
30Description
31 Read and store dictionary entries for boundary patches
32 The object is *never* registered to avoid registry name clashes with
33 polyBoundaryMesh, which may either already have been registered, or
34 which should subsequently be registered.
35
36SourceFiles
37 polyBoundaryMeshEntries.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef Foam_polyBoundaryMeshEntries_H
42#define Foam_polyBoundaryMeshEntries_H
43
44#include "regIOobject.H"
45#include "PtrList.H"
46#include "entry.H"
47#include "wordList.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
54/*---------------------------------------------------------------------------*\
55 Class polyBoundaryMeshEntries Declaration
56\*---------------------------------------------------------------------------*/
57
59:
60 public PtrList<entry>,
61 public regIOobject
62{
63public:
64
65 //- Runtime type information
66 TypeNameNoDebug("polyBoundaryMesh");
67
68
69 // Constructors
70
71 //- Read construct from IOobject. Never register!
72 explicit polyBoundaryMeshEntries(const IOobject& io);
73
74
75 // Factory Methods
76
77 //- Read and return contents. The IOobject is never registered
79
80
81 // Static Functions
82
83 //- Truncate entries at the first processor patch entry
84 static void removeProcPatches(PtrList<entry>& entries);
85
86 //- Write list of entries
87 static bool writeEntries(Ostream& os, const UPtrList<entry>& entries);
88
89 //- Return a list of patch types, uses the "patch" entry
90 static wordList types(const UPtrList<entry>& entries);
91
92 //- Return a list of patch start face indices, uses "startFace" entry
93 static labelList patchStarts(const UPtrList<entry>& entries);
94
95 //- Return a list of patch sizes, uses "nFaces" entry
96 static labelList patchSizes(const UPtrList<entry>& entries);
97
98
99 // Member Functions
100
101 //- Truncate at the first processor patch entry
102 void removeProcPatches();
103
104
105 // Characteristics
106
107 //- Return a list of patch types, uses the "patch" entry
108 wordList types() const;
109
110 //- Return a list of patch start face indices, uses "startFace" entry
111 labelList patchStarts() const;
112
113 //- Return a list of patch sizes, uses "nFaces" entry
114 labelList patchSizes() const;
115
116
117 // Write
118
119 //- Write as a plain list of entries
120 void writeEntry(Ostream& os) const;
121
122 //- Write as a primitive entry with given name.
123 //- If the keyword is empty, revert to a plain list.
124 void writeEntry(const word& keyword, Ostream& os) const;
125
126 //- The writeData member function required by regIOobject
127 virtual bool writeData(Ostream& os) const;
128
129 //- Write using stream options, forces UNCOMPRESSED
130 virtual bool writeObject
131 (
132 IOstreamOption streamOpt,
133 const bool writeOnProc = true
134 ) const;
135};
136
137
138// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139
140} // End namespace Foam
141
142// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143
144#endif
145
146// ************************************************************************* //
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.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
constexpr PtrList() noexcept
Definition PtrListI.H:29
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition UPtrList.H:101
labelList patchStarts() const
Return a list of patch start face indices, uses "startFace" entry.
TypeNameNoDebug("polyBoundaryMesh")
Runtime type information.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc=true) const
Write using stream options, forces UNCOMPRESSED.
wordList types() const
Return a list of patch types, uses the "patch" entry.
virtual bool writeData(Ostream &os) const
The writeData member function required by regIOobject.
polyBoundaryMeshEntries(const IOobject &io)
Read construct from IOobject. Never register!
static PtrList< entry > readContents(const IOobject &io)
Read and return contents. The IOobject is never registered.
static bool writeEntries(Ostream &os, const UPtrList< entry > &entries)
Write list of entries.
void writeEntry(Ostream &os) const
Write as a plain list of entries.
labelList patchSizes() const
Return a list of patch sizes, uses "nFaces" entry.
void removeProcPatches()
Truncate at the first processor patch entry.
regIOobject(const IOobject &io, const bool isTimeObject=false)
Construct from IOobject. The optional flag adds special handling if the object is the top-level regIO...
Definition regIOobject.C:43
A class for handling words, derived from Foam::string.
Definition word.H:66
OBJstream os(runTime.globalPath()/outputName)
const auto & io
Namespace for OpenFOAM.
List< word > wordList
List of word.
Definition fileName.H:60
List< label > labelList
A List of labels.
Definition List.H:62
#define TypeNameNoDebug(TypeNameString)
Declare a ClassNameNoDebug() with extra virtual type info.
Definition typeInfo.H:61