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) 2021 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
12
13Description
14 Summary of faMesh information
15
16\*---------------------------------------------------------------------------*/
17
18{
19 const faBoundaryMesh& patches = aMesh.boundary();
20 const label nNonProcessor = patches.nNonProcessor();
21 const label nPatches = patches.size();
22
23 Info<< "----------------" << nl
24 << "Mesh Information" << nl
25 << "----------------" << nl
26 << " " << "boundingBox: " << boundBox(aMesh.points()) << nl
27 << " " << "nFaces: " << returnReduce(aMesh.nFaces(), sumOp<label>())
28 << nl;
31 Info<< "----------------" << nl
32 << "Patches" << nl
33 << "----------------" << nl;
34
35 for (label patchi = 0; patchi < nNonProcessor; ++patchi)
36 {
37 const faPatch& p = patches[patchi];
38
39 Info<< " " << "patch " << p.index()
40 << " (size: " << returnReduce(p.size(), sumOp<label>())
41 << ") name: " << p.name()
42 << nl;
43 }
44
45 // Geometry information
46 Info<< nl;
47 {
48 scalarMinMax limit(gMinMax(aMesh.S().field()));
49 Info<< "Face area:" << nl
50 << " min = " << limit.min() << " max = " << limit.max() << nl;
51 }
52
53 {
54 scalarMinMax limit(minMax(aMesh.magLe().primitiveField()));
55
56 // Include processor boundaries into 'internal' edges
57 if (Pstream::parRun())
58 {
59 for (label patchi = nNonProcessor; patchi < nPatches; ++patchi)
60 {
61 limit.add(minMax(aMesh.magLe().boundaryField()[patchi]));
62 }
63
64 reduce(limit, minMaxOp<scalar>());
65 }
66
67 Info<< "Edge length (internal):" << nl
68 << " min = " << limit.min() << " max = " << limit.max() << nl;
69
70
71 // Include (non-processor) boundaries
72 for (label patchi = 0; patchi < nNonProcessor; ++patchi)
73 {
74 limit.add(minMax(aMesh.magLe().boundaryField()[patchi]));
75 }
76
77 if (Pstream::parRun())
78 {
79 reduce(limit, minMaxOp<scalar>());
80 }
81
82 Info<< "Edge length:" << nl
83 << " min = " << limit.min()
84 << " max = " << limit.max() << nl;
85 }
86
87 // Not particularly meaningful
88 #if 0
89 {
90 MinMax<vector> limit(gMinMax(aMesh.faceAreaNormals().field()));
91
92 Info<< "Face area normals:" << nl
93 << " min = " << limit.min() << " max = " << limit.max() << nl;
94 }
95 #endif
96}
97
98
99// ************************************************************************* //
reduce(hasMovingMesh, orOp< bool >())
volScalarField & p
pressureControl limit(p)
const polyBoundaryMesh & patches
const label nNonProcessor
const label nPatches
messageStream Info
Information stream (stdout output on master, null elsewhere)
MinMax< scalar > scalarMinMax
A scalar min/max range.
Definition: MinMax.H:117
MinMax< label > minMax(const labelHashSet &set)
Find the min/max values of labelHashSet.
Definition: hashSets.C:61
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
faMesh aMesh(mesh)