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 -------------------------------------------------------------------------------
11 License
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 
27 Application
28  makeFaMesh
29 
30 Description
31  Check a finiteArea mesh
32 
33 Original 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"
48 #include "foamVtkIndPatchWriter.H"
49 #include "foamVtkLineWriter.H"
50 #include "faMeshTools.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 using namespace Foam;
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 int main(int argc, char *argv[])
59 {
61  (
62  "Check a finiteArea mesh"
63  );
64 
66  (
67  "write-vtk",
68  "Write mesh as a vtp (vtk) file for display or debugging"
69  );
70 
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
94  faMesh aMesh(mesh);
95 
96  Info<< "Time = " << runTime.timeName() << nl << endl;
97 
98  // Mesh information (verbose)
100 
101  if (args.found("write-vtk"))
102  {
103  #include "faMeshWriteVTK.H"
104  }
105 
106  Info<< "\nEnd\n" << endl;
107 
108  return 0;
109 }
110 
111 
112 // ************************************************************************* //
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:88
static void addNote(const string &note)
Add extra notes for the usage information.
Definition: argList.C:453
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:49
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:487
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
Definition: argList.C:365
Required Variables.
static int geometryOrder() noexcept
Return the current geometry treatment.
Definition: faMesh.H:782
dynamicFvMesh & mesh
static void addOption(const word &optName, const string &param="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
Definition: argList.C:376
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
Definition: Time.C:760
static void printMeshChecks(const faMesh &mesh, const int verbose=1)
Report mesh information.
messageStream Info
Information stream (stdout output on master, null elsewhere)
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Definition: argListI.H:316
faMesh aMesh(mesh)
Foam::argList args(argc, argv)
bool found(const word &optName) const
Return true if the named option is found.
Definition: argListI.H:171
Namespace for OpenFOAM.