cloudFunctionObjectTools.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) 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::cloudFunctionObjectTools::collector
28 
29 Description
30  Implementation of template-invariant tools for
31  various function objects such as Foam::ParticleHistogram.
32 
33 SourceFiles
34  cloudFunctionObjectTools.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef cloudFunctionObjectTools_collector_H
39 #define cloudFunctionObjectTools_collector_H
40 
41 #include "polyMesh.H"
42 #include "boundBox.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Namespace cloudFunctionObjectTools Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 namespace cloudFunctionObjectTools
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class collector Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 class collector
61 {
62  // Private Data
63 
64  //- Flag to decide if the collector is patch based
65  bool isPatch_;
66 
67  //- List of indices of collectors (zones or patches)
68  labelList IDs_;
69 
70  //- List of names of collectors
71  wordList names_;
72 
73  //- List of bounding-boxes of collectors
74  List<boundBox> BBs_;
75 
76 
77 public:
78 
79  // Constructors
80 
81  //- Construct from dictionary
82  collector
83  (
84  const dictionary& dict,
85  const polyMesh& mesh
86  );
87 
88  //- Copy construct
89  collector(const collector& phc);
90 
91  //- No copy assignment
92  void operator=(const collector&) = delete;
93 
94 
95  //- Destructor
96  virtual ~collector() = default;
97 
98 
99  // Member Functions
100 
101  // Access
102 
103  //- Return the flag if the collector is patch based
104  bool isPatch() const noexcept { return isPatch_; }
105 
106  //- Return number of collectors (zones or patches)
107  label size() const noexcept { return IDs_.size(); }
108 
109  //- Return const reference to the indices of collectors
110  const labelList& IDs() const noexcept { return IDs_; }
111 
112  //- Return const reference to the names of collectors
113  const wordList& names() const noexcept { return names_; }
114 
115  //- Return const reference to the bounding-boxes of collectors
116  const List<boundBox>& BBs() const noexcept { return BBs_; }
117 };
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace cloudFunctionObjectTools
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #endif
128 
129 // ************************************************************************* //
dictionary dict
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:116
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
const wordList & names() const noexcept
Return const reference to the names of collectors.
void operator=(const collector &)=delete
No copy assignment.
const labelList & IDs() const noexcept
Return const reference to the indices of collectors.
dynamicFvMesh & mesh
bool isPatch() const noexcept
Return the flag if the collector is patch based.
label size() const noexcept
Return number of collectors (zones or patches)
const direction noexcept
Definition: Scalar.H:258
Implementation of template-invariant tools for various function objects such as Foam::ParticleHistogr...
const List< boundBox > & BBs() const noexcept
Return const reference to the bounding-boxes of collectors.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
collector(const dictionary &dict, const polyMesh &mesh)
Construct from dictionary.
virtual ~collector()=default
Destructor.
Namespace for OpenFOAM.