From 1c1cac66465ef10e76473be3159b6a212e88a5a6 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 28 Apr 2011 16:27:20 +0100 Subject: [PATCH] ENH: ideasUnvToFoam.C: added support for zones --- .../ideasUnvToFoam/ideasUnvToFoam.C | 374 ++- .../ideasUnvToFoam/unv/threeZonesAll.unv | 2251 +++++++++++++++++ 2 files changed, 2592 insertions(+), 33 deletions(-) create mode 100644 applications/utilities/mesh/conversion/ideasUnvToFoam/unv/threeZonesAll.unv diff --git a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C index 4e9559a6d1..92af69626c 100644 --- a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C +++ b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C @@ -41,12 +41,27 @@ Description #include "faceSet.H" #include "DynamicList.H" +#include #include "MeshedSurfaces.H" using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +namespace Foam +{ + template<> + inline unsigned Hash::operator()(const face& t, unsigned seed) const + { + return Hasher(t.cdata(),t.size()*sizeof(label), seed); + } + + template<> + inline unsigned Hash::operator()(const face& t) const + { + return Hash::operator()(t, 0); + } +} const string SEPARATOR(" -1"); bool isSeparator(const string& line) @@ -98,7 +113,7 @@ void readHeader(IFstream& is) } else { - Sout<< line << endl; + Info<< line << endl; } } } @@ -107,7 +122,7 @@ void readHeader(IFstream& is) // Skip void skipSection(IFstream& is) { - Sout<< "Skipping section at line " << is.lineNumber() << '.' << endl; + Info<< "Skipping section at line " << is.lineNumber() << '.' << endl; string line; @@ -119,10 +134,6 @@ void skipSection(IFstream& is) { break; } - else - { -// Sout<< line << endl; - } } } @@ -148,19 +159,19 @@ void readUnits scalar& tempOffset ) { - Sout<< "Starting reading units at line " << is.lineNumber() << '.' << endl; + Info<< "Starting reading units at line " << is.lineNumber() << '.' << endl; string line; is.getLine(line); label l = readLabel(IStringStream(line.substr(0, 10))()); - Sout<< "l:" << l << endl; + Info<< "l:" << l << endl; string units(line.substr(10, 20)); - Sout<< "units:" << units << endl; + Info<< "units:" << units << endl; label unitType = readLabel(IStringStream(line.substr(30, 10))()); - Sout<< "unitType:" << unitType << endl; + Info<< "unitType:" << unitType << endl; // Read lengthscales is.getLine(line); @@ -172,7 +183,7 @@ void readUnits is.getLine(line); tempOffset = readUnvScalar(line.substr(0, 25)); - Sout<< "Unit factors:" << nl + Info<< "Unit factors:" << nl << " Length scale : " << lengthScale << nl << " Force scale : " << forceScale << nl << " Temperature scale : " << tempScale << nl @@ -189,7 +200,7 @@ void readPoints DynamicList