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 Copyright (C) 2021-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Application
28 makeFaMesh
29
30Description
31 Check a finiteArea mesh
32
33Original Authors
34 Zeljko Tukovic, FAMENA
35 Hrvoje Jasak, Wikki Ltd.
36
37\*---------------------------------------------------------------------------*/
38
39#include "Time.H"
40#include "argList.H"
41#include "faMesh.H"
42#include "polyMesh.H"
43#include "areaFaMesh.H"
44#include "edgeFaMesh.H"
45#include "areaFields.H"
46#include "edgeFields.H"
47#include "processorFaPatch.H"
49#include "foamVtkLineWriter.H"
50#include "faMeshTools.H"
51
52// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53
54using namespace Foam;
55
56// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57
58int main(int argc, char *argv[])
59{
60 argList::addNote
61 (
62 "Check a finiteArea mesh"
63 );
64
65 argList::addBoolOption
66 (
67 "write-vtk",
68 "Write mesh as a vtp (vtk) file for display or debugging"
69 );
70
71 argList::addOption
72 (
73 "geometryOrder",
74 "N",
75 "Test different geometry order - experimental!!",
76 true // Advanced option
77 );
78
79 #include "addRegionOption.H"
80 #include "setRootCase.H"
81 #include "createTime.H"
82 #include "createNamedPolyMesh.H"
83
84 int geometryOrder(1);
85 if (args.readIfPresent("geometryOrder", geometryOrder))
86 {
87 Info<< "Setting faMesh::geometryOrder = " << geometryOrder << nl
88 << "(experimental)" << nl << endl;
89
90 faMesh::geometryOrder(geometryOrder);
91 }
92
93 // Create
95
96 Info<< "Time = " << runTime.timeName() << nl << endl;
97
98 #include "printMeshSummary.H"
99
100 if (args.found("write-vtk"))
101 {
102 #include "faMeshWriteVTK.H"
103 }
104
105 Info<< "\nEnd\n" << endl;
106
107 return 0;
108}
109
110
111// ************************************************************************* //
bool found(const word &optName) const
Return true if the named option is found.
Definition: argListI.H:178
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Definition: argListI.H:323
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:100
dynamicFvMesh & mesh
engineTime & runTime
Required Variables.
Namespace for OpenFOAM.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
Foam::argList args(argc, argv)
faMesh aMesh(mesh)