faBoundaryMeshEntries.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) 2022-2023 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::faBoundaryMeshEntries
28 
29 Description
30  Read and store dictionary entries for finite-area boundary patches.
31  The object is *never* registered to avoid registry name clashes with
32  faBoundaryMesh, which may either already have been registered, or
33  which should subsequently be registered.
34 
35 SourceFiles
36  faBoundaryMeshEntries.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef Foam_faBoundaryMeshEntries_H
41 #define Foam_faBoundaryMeshEntries_H
42 
43 #include "regIOobject.H"
44 #include "PtrList.H"
45 #include "entry.H"
46 #include "wordList.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class faBoundaryMeshEntries Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
59  public PtrList<entry>,
60  public regIOobject
61 {
62 public:
63 
64  //- Runtime type information
65  TypeNameNoDebug("faBoundaryMesh");
66 
67 
68  // Constructors
69 
70  //- Read construct from IOobject. Never register!
71  explicit faBoundaryMeshEntries(const IOobject& io);
72 
73 
74  // Factory Methods
75 
76  //- Read and return contents. The IOobject is never registered
77  static PtrList<entry> readContents(const IOobject& io);
78 
79 
80  // Static Functions
81 
82  //- Truncate entries at the first processor patch entry
83  static void removeProcPatches(PtrList<entry>& entries);
84 
85  //- Write list of entries
86  static bool writeEntries(Ostream& os, const UPtrList<entry>& entries);
87 
88  //- Return a list of patch types, uses the "patch" entry
89  static wordList types(const UPtrList<entry>& entries);
90 
91 
92  // Member Functions
93 
94  //- Truncate at the first processor patch entry
95  void removeProcPatches();
96 
97 
98  // Characteristics
99 
100  //- Return a list of patch types, uses the "patch" entry
101  wordList types() const;
102 
103 
104  // Write
105 
106  //- Write as a plain list of entries
107  void writeEntry(Ostream& os) const;
108 
109  //- Write as a primitive entry with given name.
110  //- If the keyword is empty, revert to a plain list.
111  void writeEntry(const keyType& keyword, Ostream& os) const;
112 
113  //- The writeData member function required by regIOobject
114  virtual bool writeData(Ostream& os) const;
115 
116  //- Write using stream options, forces UNCOMPRESSED
117  virtual bool writeObject
118  (
119  IOstreamOption streamOpt,
120  const bool writeOnProc = true
121  ) const;
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
faBoundaryMeshEntries(const IOobject &io)
Read construct from IOobject. Never register!
A class for handling keywords in dictionaries.
Definition: keyType.H:66
static bool writeEntries(Ostream &os, const UPtrList< entry > &entries)
Write list of entries.
TypeNameNoDebug("faBoundaryMesh")
Runtime type information.
A simple container for options an IOstream can normally have.
void writeEntry(Ostream &os) const
Write as a plain list of entries.
void removeProcPatches()
Truncate at the first processor patch entry.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: HashTable.H:106
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
OBJstream os(runTime.globalPath()/outputName)
virtual bool writeData(Ostream &os) const
The writeData member function required by regIOobject.
Read and store dictionary entries for finite-area boundary patches. The object is *never* registered ...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition: List.H:55
static PtrList< entry > readContents(const IOobject &io)
Read and return contents. The IOobject is never registered.
wordList types() const
Return a list of patch types, uses the "patch" entry.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:66
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc=true) const
Write using stream options, forces UNCOMPRESSED.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
Namespace for OpenFOAM.