decompositionInformation.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) 2017 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::decompositionInformation
28 
29 Description
30  Abstract base class for decomposition
31 
32 SourceFiles
33  decompositionInformation.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef decompositionInformation_H
38 #define decompositionInformation_H
39 
40 #include "polyMesh.H"
41 #include "CompactListList.H"
42 #include "IOstreams.H"
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class decompositionInformation Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 {
53  //- Simple storage for organizing min/max/median quantities
54  struct stats
55  {
56  label min;
57  label max;
58  label median;
59 
60  stats() : min(0), max(0), median(0) {}
61 
62  void clear()
63  {
64  min = 0;
65  max = 0;
66  median = 0;
67  }
68 
69  Ostream& print(Ostream& os) const;
70  };
71 
72  // Private data
73 
74  labelListList distrib_;
75  label nDomains_;
76 
77  stats cellsInfo_;
78  stats neighInfo_;
79  stats facesInfo_;
80 
81 
82  // Private Member Functions
83 
84  //- Populate from cell decomposition list
85  void populate
86  (
87  const labelUList& adjncy,
88  const labelUList& xadj,
89  const labelUList& decomp,
90  const label nDomains
91  );
92 
93  //- No copy construct
95 
96  //- No copy assignment
97  void operator=(const decompositionInformation&) = delete;
98 
99 
100 public:
101 
102  // Constructors
103 
104  //- Construct
106  (
107  const labelUList& adjncy,
108  const labelUList& xadj,
109  const labelUList& decomp,
110  const label nDomains
111  );
112 
113  //- Construct
115  (
116  const CompactListList<label>& cellCells,
117  const labelUList& decomp,
118  const label nDomains
119  );
120 
121 
122  //- Destructor
124  {}
125 
126 
127  // Member Functions
128 
129  void clear();
130 
131  label nDomains() const
132  {
133  return nDomains_;
134  }
135 
136 
137  void printSummary(Ostream& os) const;
138 
139  void printDetails(Ostream& os) const;
140 
141  void printAll(Ostream& os) const;
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
IOstreams.H
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Foam::decompositionInformation::printAll
void printAll(Ostream &os) const
Definition: decompositionInformation.C:216
Foam::decompositionInformation::clear
void clear()
Definition: decompositionInformation.C:150
Foam::CompactListList
A packed storage unstructured matrix of objects of type <T> using an offset table for access.
Definition: CompactListList.H:63
polyMesh.H
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
Foam::decompositionInformation::printDetails
void printDetails(Ostream &os) const
Definition: decompositionInformation.C:167
Foam::decompositionInformation::nDomains
label nDomains() const
Definition: decompositionInformation.H:130
Foam::decompositionInformation::printSummary
void printSummary(Ostream &os) const
Definition: decompositionInformation.C:159
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::decompositionInformation::~decompositionInformation
~decompositionInformation()
Destructor.
Definition: decompositionInformation.H:122
Foam::List< labelList >
Foam::BitOps::print
Ostream & print(Ostream &os, UIntType value, char off='0', char on='1')
Print 0/1 bits in the (unsigned) integral type.
Definition: BitOps.H:199
Foam::UList< label >
Foam::decompositionInformation
Abstract base class for decomposition.
Definition: decompositionInformation.H:50
CompactListList.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56