updated DebugSwitches, surfaceWriter

- added obj surfaceWriter
- don't bother with prepended field names on obj and stl surfaceWriter.
  It fills the disk and suggests differences where there are none.
This commit is contained in:
Mark Olesen
2009-03-09 15:37:54 +01:00
parent b968e62ef9
commit 6ecdf4fc41
16 changed files with 601 additions and 72 deletions

View File

@ -29,6 +29,9 @@ Description
#include "argList.H"
#include "dictionary.H"
#include "IFstream.H"
#include "IOobject.H"
#include "HashSet.H"
using namespace Foam;
@ -38,18 +41,108 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validOptions.insert("new", "");
argList::validOptions.insert("old", "");
wordList ds(debug::debugSwitches().toc());
sort(ds);
Info<< "debug switches: " << ds << endl;
Foam::argList args(argc, argv);
wordList currDebug(debug::debugSwitches().toc());
wordList currInfo(debug::infoSwitches().toc());
wordList currOpt(debug::optimisationSwitches().toc());
if (args.options().found("old") || args.options().found("new"))
{
dictionary controlDict(IFstream(findEtcFile("controlDict", true))());
wordHashSet oldDebug
(
controlDict.subDict("DebugSwitches").toc()
);
wordHashSet oldInfo
(
controlDict.subDict("InfoSwitches").toc()
);
wordHashSet oldOpt
(
controlDict.subDict("OptimisationSwitches").toc()
);
wordHashSet hashset;
wordList listing;
// list old switches - but this can't work since the (old) inserted
// switches are in both sets
// Workaround:
// 1. run without any options (get complete list)
// 2. comment out DebugSwitches, run again with -new to find new ones
// and do a diff
if (args.options().found("old"))
{
IOobject::writeDivider(Info);
hashset = oldDebug;
hashset -= currDebug;
listing = hashset.toc();
sort(listing);
Info<< "old DebugSwitches: " << listing << endl;
hashset = oldInfo;
hashset -= currInfo;
listing = hashset.toc();
sort(listing);
Info<< "old InfoSwitches: " << listing << endl;
hashset = oldOpt;
hashset -= currOpt;
listing = hashset.toc();
sort(listing);
Info<< "old OptimisationSwitches: " << listing << endl;
}
// list new switches
if (args.options().found("new"))
{
IOobject::writeDivider(Info);
hashset = currDebug;
hashset -= oldDebug;
listing = hashset.toc();
sort(listing);
Info<< "new DebugSwitches: " << listing << endl;
hashset = currInfo;
hashset -= oldInfo;
listing = hashset.toc();
sort(listing);
Info<< "new InfoSwitches: " << listing << endl;
hashset = currOpt;
hashset -= oldOpt;
listing = hashset.toc();
sort(listing);
Info<< "new OptimisationSwitches: " << listing << endl;
}
}
else
{
IOobject::writeDivider(Info);
sort(currDebug);
Info<< "DebugSwitches: " << currDebug << endl;
sort(currInfo);
Info<< "InfoSwitches: " << currInfo << endl;
sort(currOpt);
Info<< "OptimisationSwitches: " << currOpt << endl;
}
wordList is(debug::infoSwitches().toc());
sort(is);
Info<< "info switches: " << is << endl;
wordList os(debug::optimisationSwitches().toc());
sort(os);
Info<< "optimisation switches: " << os << endl;
Info<< "done" << endl;

View File

@ -40,6 +40,7 @@ Description
- dx : DX scalar or vector format
- vtk : VTK ascii format
- raw : x y z value format for use with e.g. gnuplot 'splot'.
- obj : Wavefron stl. Does not contain values!
- stl : ascii stl. Does not contain values!
@param interpolationScheme : interpolation scheme, choice of \n

View File

@ -30,6 +30,7 @@ setFormat raw;
// dx : DX scalar or vector format
// vtk : VTK ascii format
// raw : x y z value format for use with e.g. gnuplot 'splot'.
// obj : Wavefront obj. Does not contain values!
// stl : ascii stl. Does not contain values!
surfaceFormat vtk;