Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 #include <OpenFOAM/argList.H>
00070 #include <OpenFOAM/timeSelector.H>
00071 #include <OpenFOAM/Time.H>
00072
00073 #include <OpenFOAM/polyMesh.H>
00074 #include <OpenFOAM/globalMeshData.H>
00075
00076 #include "printMeshStats.H"
00077 #include "checkTopology.H"
00078 #include "checkGeometry.H"
00079
00080 using namespace Foam;
00081
00082
00083
00084 int main(int argc, char *argv[])
00085 {
00086 timeSelector::addOptions();
00087 # include <OpenFOAM/addRegionOption.H>
00088 argList::validOptions.insert("noTopology", "");
00089 argList::validOptions.insert("allGeometry", "");
00090 argList::validOptions.insert("allTopology", "");
00091
00092 # include <OpenFOAM/setRootCase.H>
00093 # include <OpenFOAM/createTime.H>
00094 instantList timeDirs = timeSelector::select0(runTime, args);
00095 # include <OpenFOAM/createNamedPolyMesh.H>
00096
00097 const bool noTopology = args.optionFound("noTopology");
00098 const bool allGeometry = args.optionFound("allGeometry");
00099 const bool allTopology = args.optionFound("allTopology");
00100
00101 forAll(timeDirs, timeI)
00102 {
00103 runTime.setTime(timeDirs[timeI], timeI);
00104
00105 polyMesh::readUpdateState state = mesh.readUpdate();
00106
00107 if
00108 (
00109 !timeI
00110 || state == polyMesh::TOPO_CHANGE
00111 || state == polyMesh::TOPO_PATCH_CHANGE
00112 )
00113 {
00114 Info<< "Time = " << runTime.timeName() << nl << endl;
00115
00116
00117 mesh.clearOut();
00118
00119
00120 mesh.globalData();
00121
00122 printMeshStats(mesh, allTopology);
00123
00124 label noFailedChecks = 0;
00125
00126 if (!noTopology)
00127 {
00128 noFailedChecks += checkTopology(mesh, allTopology, allGeometry);
00129 }
00130
00131 noFailedChecks += checkGeometry(mesh, allGeometry);
00132
00133
00134
00135
00136 if (noFailedChecks == 0)
00137 {
00138 Info<< "\nMesh OK.\n" << endl;
00139 }
00140 else
00141 {
00142 Info<< "\nFailed " << noFailedChecks << " mesh checks.\n"
00143 << endl;
00144 }
00145 }
00146 else if (state == polyMesh::POINTS_MOVED)
00147 {
00148 Info<< "Time = " << runTime.timeName() << nl << endl;
00149
00150 label nFailedChecks = checkGeometry(mesh, allGeometry);
00151
00152 if (nFailedChecks)
00153 {
00154 Info<< "\nFailed " << nFailedChecks << " mesh checks.\n"
00155 << endl;
00156 }
00157 else
00158 {
00159 Info << "\nMesh OK.\n" << endl;
00160 }
00161 }
00162 }
00163
00164 Info<< "End\n" << endl;
00165
00166 return 0;
00167 }
00168
00169
00170