print.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::zoneGenerators::print
26 
27 Description
28  Print a summary of one or more zones to the terminal
29 
30  All zone types
31  The number of elements (points, faces or cells) in the zone
32  The bounding box containing the elements
33  The bounding sphere containing the elements
34 
35  pointZones
36  The average position of all the points
37 
38  faceZones
39  The total face area magnitude
40  The centroid of the faces
41 
42  cellZones
43  The total volume
44  The centroid of the cells
45 
46 Usage
47  \table
48  Property | Description | Required | Default value
49  type | Type: print | yes |
50  zoneType | Type of zone | no | all
51  zone | Name of the zone to print | no |
52  zones | List of zone names to print | no |
53  geometry | Print the geometry? | no | true
54  \endtable
55 
56  Examples:
57  Print a summary of a zone named 'fan'
58  \verbatim
59  printOneZone
60  {
61  type print;
62 
63  zone fan;
64  }
65  \endverbatim
66 
67  Print a summary of a zone named 'fan' and a zone named 'baffle'
68  \verbatim
69  printTwoZones
70  {
71  type print;
72 
73  zones
74  (
75  fan
76  baffle
77  );
78  }
79  \endverbatim
80 
81  Print a summary of all the zones, by omitting 'zone' and 'zones'
82  \verbatim
83  printAllZones
84  {
85  type print;
86  }
87  \endverbatim
88 
89  In createZonesDict, shorthand notation can be used to print all zones
90  \verbatim
91  print;
92  \endverbatim
93 
94 SourceFiles
95  print.C
96 
97 \*---------------------------------------------------------------------------*/
98 
99 #ifndef print_zoneGenerator_H
100 #define print_zoneGenerator_H
101 
102 #include "zoneGeneratorList.H"
103 
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 
106 namespace Foam
107 {
108 namespace zoneGenerators
109 {
110 
111 /*---------------------------------------------------------------------------*\
112  Class print Declaration
113 \*---------------------------------------------------------------------------*/
114 
115 class print
116 :
117  public zoneGenerator
118 {
119  // Private Data
120 
121  //- Type of zone to print
122  zoneTypesAll zoneType_;
123 
124  //- List of zone names to print
125  autoPtr<wordList> zoneNames_;
126 
127  //- Print the geometry
128  bool geometry_;
129 
130 
131 public:
132 
133  //- Runtime type information
134  TypeName("print");
135 
136 
137  // Constructors
138 
139  //- Construct from dictionary
140  print
141  (
142  const word& name,
143  const polyMesh& mesh,
145  );
146 
147 
148  //- Destructor
149  virtual ~print();
150 
151 
152  // Member Functions
153 
154  virtual zoneSet generate() const;
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace zoneGenerators
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
const word & name() const
Return the zoneGenerator name.
const polyMesh & mesh() const
Return reference to the polyMesh.
virtual zoneSet generate() const
Generate and return the zoneSet.
Definition: print.C:82
virtual ~print()
Destructor.
Definition: print.C:76
print(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
Definition: print.C:46
TypeName("print")
Runtime type information.
Zone container returned by zoneGenerator::generate.
Definition: zoneSet.H:94
Namespace for OpenFOAM.
zoneTypesAll
Enumeration defining the zone types with an option for all the types.
Definition: zoneSet.H:77
dictionary dict