checkFaMesh.C
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) 2016-2017 Wikki 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 Application
27  makeFaMesh
28 
29 Description
30  Check a finiteArea mesh
31 
32 Author
33  Zeljko Tukovic, FAMENA
34  Hrvoje Jasak, Wikki Ltd.
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #include "fvCFD.H"
39 #include "faCFD.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 using namespace Foam;
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 int main(int argc, char *argv[])
48 {
50  (
51  "Check a finiteArea mesh"
52  );
53 
54  #include "addRegionOption.H"
55 
56  #include "setRootCase.H"
57  #include "createTime.H"
58  #include "createNamedMesh.H"
59  #include "createFaMesh.H"
60 
61  Info<< "Time = " << runTime.timeName() << nl << endl;
62 
63  // General mesh statistics
64  Info<< "Number of points: " << aMesh.nPoints() << nl
65  << "Number of internal edges: " << aMesh.nInternalEdges() << nl
66  << "Number of edges: " << aMesh.nEdges() << nl
67  << "Number of faces: " << aMesh.nFaces() << nl
68  << endl;
69 
70  // Check geometry
71  Info<< "Face area: min = " << min(aMesh.S().field())
72  << " max = " << max(aMesh.S().field()) << nl
73  << "Internal edge length: min = "
74  << min(aMesh.magLe().internalField()) << nl
75  << " max = " << max(aMesh.magLe().internalField()) << nl
76  << "Edge length: min = "
77  << min(aMesh.magLe()).value() << nl
78  << " max = " << max(aMesh.magLe()).value() << nl
79  << "Face area normals: min = " << min(aMesh.faceAreaNormals().field())
80  << " max = " << max(aMesh.faceAreaNormals().field()) << nl
81  << endl;
82 
83 
84  Info << "\nEnd" << endl;
85  return 0;
86 }
87 
88 
89 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
faCFD.H
Foam::Time::timeName
static word timeName(const scalar t, const int precision=precision_)
Definition: Time.C:785
Foam::argList::addNote
static void addNote(const string &note)
Add extra notes for the usage information.
Definition: argList.C:413
Foam::faMesh::nPoints
label nPoints() const
Definition: faMesh.H:351
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::GeometricField::internalField
const Internal & internalField() const
Return a const-reference to the dimensioned internal field.
Definition: GeometricFieldI.H:43
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
aMesh
faMesh aMesh(mesh)
Foam::faMesh::S
const DimensionedField< scalar, areaMesh > & S() const
Return face areas.
Definition: faMesh.C:1081
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::faMesh::faceAreaNormals
const areaVectorField & faceAreaNormals() const
Return face area normals.
Definition: faMesh.C:1131
addRegionOption.H
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
Foam::faMesh::magLe
const edgeScalarField & magLe() const
Return edge length magnitudes.
Definition: faMesh.C:1047
Foam::faMesh::nEdges
label nEdges() const
Definition: faMesh.H:356
createNamedMesh.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::faMesh::nInternalEdges
label nInternalEdges() const
Definition: faMesh.H:361
setRootCase.H
Foam::nl
constexpr char nl
Definition: Ostream.H:385
createTime.H
fvCFD.H
Foam::faMesh::nFaces
label nFaces() const
Definition: faMesh.H:366