printMeshSummary.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) 2020 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
12 
13 Description
14  Summary of mesh information (eg, after blockMesh)
15 
16 \*---------------------------------------------------------------------------*/
17 
18 {
19  Info<< "----------------" << nl
20  << "Mesh Information" << nl
21  << "----------------" << nl
22  << " " << "boundingBox: " << boundBox(mesh.points()) << nl
23  << " " << "nPoints: " << mesh.nPoints() << nl
24  << " " << "nCells: " << mesh.nCells() << nl
25  << " " << "nFaces: " << mesh.nFaces() << nl
26  << " " << "nInternalFaces: " << mesh.nInternalFaces() << nl;
27 
28  const auto printZone =
29  [](const Foam::zone& zn)
30  {
31  Info<< " " << "zone " << zn.index()
32  << " (size: " << zn.size()
33  << ") name: " << zn.name() << nl;
34  };
35 
36  if (mesh.cellZones().size())
37  {
38  Info<< "----------------" << nl
39  << "Cell Zones" << nl
40  << "----------------" << nl;
41 
42  for (const cellZone& zn : mesh.cellZones())
43  {
44  printZone(zn);
45  }
46  }
47  if (mesh.faceZones().size())
48  {
49  Info<< "----------------" << nl
50  << "Face Zones" << nl
51  << "----------------" << nl;
52 
53  for (const faceZone& zn : mesh.faceZones())
54  {
55  printZone(zn);
56  }
57  }
58  if (mesh.pointZones().size())
59  {
60  Info<< "----------------" << nl
61  << "Point Zones" << nl
62  << "----------------" << nl;
63 
64  for (const pointZone& zn : mesh.pointZones())
65  {
66  printZone(zn);
67  }
68  }
69 
70  Info<< "----------------" << nl
71  << "Patches" << nl
72  << "----------------" << nl;
73 
74  for (const polyPatch& p : mesh.boundaryMesh())
75  {
76  Info<< " " << "patch " << p.index()
77  << " (start: " << p.start()
78  << " size: " << p.size()
79  << ") name: " << p.name()
80  << nl;
81  }
82 }
83 
84 
85 // ************************************************************************* //
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:49
dynamicFvMesh & mesh
Base class for mesh zones.
Definition: zone.H:59
const auto printZone
messageStream Info
Information stream (stdout output on master, null elsewhere)
volScalarField & p