foamDebugSwitches.C
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 #include "argList.H"
00031 #include "dictionary.H"
00032 #include "IFstream.H"
00033 #include "IOobject.H"
00034 #include "HashSet.H"
00035
00036 using namespace Foam;
00037
00038
00039
00040
00041 int main(int argc, char *argv[])
00042 {
00043 argList::noParallel();
00044 argList::validOptions.insert("new", "");
00045 argList::validOptions.insert("old", "");
00046
00047 Foam::argList args(argc, argv);
00048
00049 wordList currDebug(debug::debugSwitches().toc());
00050 wordList currInfo(debug::infoSwitches().toc());
00051 wordList currOpt(debug::optimisationSwitches().toc());
00052
00053 if (args.optionFound("old") || args.optionFound("new"))
00054 {
00055 dictionary controlDict(IFstream(findEtcFile("controlDict", true))());
00056
00057 wordHashSet oldDebug
00058 (
00059 controlDict.subDict("DebugSwitches").toc()
00060 );
00061
00062 wordHashSet oldInfo
00063 (
00064 controlDict.subDict("InfoSwitches").toc()
00065 );
00066
00067 wordHashSet oldOpt
00068 (
00069 controlDict.subDict("OptimisationSwitches").toc()
00070 );
00071
00072
00073 wordHashSet hashset;
00074 wordList listing;
00075
00076
00077
00078
00079
00080
00081
00082
00083 if (args.optionFound("old"))
00084 {
00085 IOobject::writeDivider(Info);
00086
00087 hashset = oldDebug;
00088 hashset -= currDebug;
00089 listing = hashset.toc();
00090 sort(listing);
00091 Info<< "old DebugSwitches: " << listing << endl;
00092
00093 hashset = oldInfo;
00094 hashset -= currInfo;
00095 listing = hashset.toc();
00096 sort(listing);
00097 Info<< "old InfoSwitches: " << listing << endl;
00098
00099 hashset = oldOpt;
00100 hashset -= currOpt;
00101 listing = hashset.toc();
00102 sort(listing);
00103 Info<< "old OptimisationSwitches: " << listing << endl;
00104 }
00105
00106
00107 if (args.optionFound("new"))
00108 {
00109 IOobject::writeDivider(Info);
00110
00111 hashset = currDebug;
00112 hashset -= oldDebug;
00113
00114 listing = hashset.toc();
00115 sort(listing);
00116 Info<< "new DebugSwitches: " << listing << endl;
00117
00118 hashset = currInfo;
00119 hashset -= oldInfo;
00120 listing = hashset.toc();
00121 sort(listing);
00122 Info<< "new InfoSwitches: " << listing << endl;
00123
00124 hashset = currOpt;
00125 hashset -= oldOpt;
00126 listing = hashset.toc();
00127 sort(listing);
00128 Info<< "new OptimisationSwitches: " << listing << endl;
00129 }
00130 }
00131 else
00132 {
00133 IOobject::writeDivider(Info);
00134
00135 sort(currDebug);
00136 Info<< "DebugSwitches: " << currDebug << endl;
00137
00138 sort(currInfo);
00139 Info<< "InfoSwitches: " << currInfo << endl;
00140
00141 sort(currOpt);
00142 Info<< "OptimisationSwitches: " << currOpt << endl;
00143 }
00144
00145
00146
00147 Info<< "done" << endl;
00148
00149 return 0;
00150 }
00151
00152
00153
Copyright © 2000-2009 OpenCFD Ltd