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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
12 
13 Description
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;
29 
30 
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 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::MULES::limit
void limit(const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const surfaceScalarField &phi, surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su, const PsiMaxType &psiMax, const PsiMinType &psiMin, const bool returnCorr)
Definition: MULESTemplates.C:581
Foam::returnReduce
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Definition: PstreamReduceOps.H:94
aMesh
faMesh aMesh(mesh)
nPatches
const label nPatches
Definition: printMeshSummary.H:30
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::scalarMinMax
MinMax< scalar > scalarMinMax
A scalar min/max range.
Definition: MinMax.H:117
reduce
reduce(hasMovingMesh, orOp< bool >())
nNonProcessor
const label nNonProcessor
Definition: printMeshSummary.H:29
Foam::nl
constexpr char nl
Definition: Ostream.H:404
patches
const polyBoundaryMesh & patches
Definition: convertProcessorPatches.H:65
Foam::minMax
MinMax< label > minMax(const labelHashSet &set)
Find the min/max values of labelHashSet.
Definition: hashSets.C:61
Foam::gMinMax
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:595