diff --git a/src/Allwmake b/src/Allwmake index 43458cfc6211f8541fe70653c7205b1476f4620d..354aee075d608b0aeee05a94631b7e2b8969c897 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -38,6 +38,8 @@ wmake libso genericPatchFields # Build the proper scotchDecomp, metisDecomp etc. parallel/Allwmake +wmake libso conversion + wmake libso sampling wmake libso dynamicMesh @@ -53,7 +55,6 @@ turbulenceModels/Allwmake wmake libso surfaceFilmModels lagrangian/Allwmake postProcessing/Allwmake -conversion/Allwmake mesh/Allwmake wmake libso errorEstimation diff --git a/src/conversion/Make/files b/src/conversion/Make/files index 7c5a0aa91c070a5903667e22ed7a76f864bfee0e..563d177682b741fc44e7cb34b3dd3fd5db023281 100644 --- a/src/conversion/Make/files +++ b/src/conversion/Make/files @@ -4,6 +4,7 @@ ensight/part/ensightPart.C ensight/part/ensightPartIO.C ensight/part/ensightPartCells.C ensight/part/ensightPartFaces.C +ensight/part/ensightPartNonMeshFaces.C ensight/part/ensightParts.C meshTables/boundaryRegion.C diff --git a/src/conversion/ensight/part/ensightPart.H b/src/conversion/ensight/part/ensightPart.H index 9f1fa0013e59e9d9d180bba75940959e115299e8..7f674b595a99cb19cedd44513a422b88d136cf66 100644 --- a/src/conversion/ensight/part/ensightPart.H +++ b/src/conversion/ensight/part/ensightPart.H @@ -267,6 +267,12 @@ public: matId_ = value; } + //- simple labelList with a name + const labelListList& elemLists() const + { + return elemLists_; + } + //- offset for element ids label offset() const { @@ -285,8 +291,12 @@ public: //- write reconstruction information for the object bool writeData(Ostream&) const; - //- write geometry - void writeGeometry(ensightGeoFile&) const; + //- Write geometry + virtual void writeGeometry(ensightGeoFile&) const + {} + + //- Helper: write geometry given the pointField + void writeGeometry(ensightGeoFile&, const pointField& points) const; //- write scalar field void writeScalarField diff --git a/src/conversion/ensight/part/ensightPartCells.C b/src/conversion/ensight/part/ensightPartCells.C index 2cf06a5a98b9a6b85e13e7d56cf32cc7df76742e..d80995728e9364ca048da51052efa46ebe6359bf 100644 --- a/src/conversion/ensight/part/ensightPartCells.C +++ b/src/conversion/ensight/part/ensightPartCells.C @@ -427,4 +427,11 @@ void Foam::ensightPartCells::writeConnectivity } +void Foam::ensightPartCells::writeGeometry(ensightGeoFile& os) const +{ + const polyMesh& mesh = *meshPtr_; + ensightPart::writeGeometry(os, mesh.points()); +} + + // ************************************************************************* // diff --git a/src/conversion/ensight/part/ensightPartCells.H b/src/conversion/ensight/part/ensightPartCells.H index 949dac777cd36240c7e5cb2e90fb1fffdc04a311..a79b7428137c9c014656d05a620b7dd9b50da9a7 100644 --- a/src/conversion/ensight/part/ensightPartCells.H +++ b/src/conversion/ensight/part/ensightPartCells.H @@ -74,6 +74,9 @@ class ensightPartCells const labelList& pointMap ) const; + //- write geometry + virtual void writeGeometry(ensightGeoFile& os) const; + protected: diff --git a/src/conversion/ensight/part/ensightPartFaces.C b/src/conversion/ensight/part/ensightPartFaces.C index fb77cc83de640e9825830f6ef0d9dd27d3293022..49cab8bd6bc419c6fc9adbcebf13eefebe6f26b7 100644 --- a/src/conversion/ensight/part/ensightPartFaces.C +++ b/src/conversion/ensight/part/ensightPartFaces.C @@ -47,41 +47,18 @@ Foam::List<Foam::word> Foam::ensightPartFaces::elemTypes_ ); -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -Foam::ensightPartFaces::ensightPartFaces -( - label partNumber, - const string& partDescription -) -: - ensightPart(partNumber, partDescription) +void Foam::ensightPartFaces::binShapes(const faceList& faces) { - isCellData_ = false; -} - - -Foam::ensightPartFaces::ensightPartFaces -( - label partNumber, - const polyMesh& pMesh, - const polyPatch& pPatch -) -: - ensightPart(partNumber, pPatch.name(), pMesh) -{ - isCellData_ = false; - offset_ = pPatch.start(); - size_ = pPatch.size(); - // count the shapes label nTri = 0; label nQuad = 0; label nPoly = 0; - forAll(pPatch, patchfaceI) + forAll(faces, faceI) { - const face& f = pMesh.faces()[patchfaceI + offset_]; + const face& f = faces[faceI]; if (f.size() == 3) { @@ -108,21 +85,21 @@ Foam::ensightPartFaces::ensightPartFaces nPoly = 0; // classify the shapes - forAll(pPatch, patchfaceI) + forAll(faces, faceI) { - const face& f = pMesh.faces()[patchfaceI + offset_]; + const face& f = faces[faceI]; if (f.size() == 3) { - triCells[nTri++] = patchfaceI; + triCells[nTri++] = faceI; } else if (f.size() == 4) { - quadCells[nQuad++] = patchfaceI; + quadCells[nQuad++] = faceI; } else { - polygonCells[nPoly++] = patchfaceI; + polygonCells[nPoly++] = faceI; } } @@ -133,10 +110,45 @@ Foam::ensightPartFaces::ensightPartFaces elemLists_[tria3Elements].transfer( triCells ); elemLists_[quad4Elements].transfer( quadCells ); elemLists_[nsidedElements].transfer( polygonCells ); + + size_ = faces.size(); } -Foam::ensightPartFaces::ensightPartFaces(const ensightPartFaces &part) +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::ensightPartFaces::ensightPartFaces +( + label partNumber, + const string& partDescription +) +: + ensightPart(partNumber, partDescription) +{ + isCellData_ = false; + offset_ = 0; + size_ = 0; +} + + +Foam::ensightPartFaces::ensightPartFaces +( + label partNumber, + const polyMesh& pMesh, + const polyPatch& pPatch +) +: + ensightPart(partNumber, pPatch.name(), pMesh) +{ + isCellData_ = false; + offset_ = pPatch.start(); + + // count the shapes + binShapes(pPatch); +} + + +Foam::ensightPartFaces::ensightPartFaces(const ensightPartFaces& part) : ensightPart(part) {} @@ -206,6 +218,7 @@ void Foam::ensightPartFaces::writeConnectivity ( ensightGeoFile& os, const word& key, + const faceList& faces, const labelList& idList, const labelList& pointMap ) const @@ -214,8 +227,6 @@ void Foam::ensightPartFaces::writeConnectivity os.write(idList.size()); os.newline(); - const faceList& meshFaces = meshPtr_->faces(); - // write (polygon) face sizes if (key == "nsided") { @@ -223,7 +234,7 @@ void Foam::ensightPartFaces::writeConnectivity forAll(idList, i) { label id = idList[i] + offset_; - const face& f = meshFaces[id]; + const face& f = faces[id]; os.write( f.size() ); os.newline(); @@ -234,7 +245,7 @@ void Foam::ensightPartFaces::writeConnectivity forAll(idList, i) { label id = idList[i] + offset_; - const face& f = meshFaces[id]; + const face& f = faces[id]; // convert global -> local index // (note: Ensight indices start with 1) @@ -247,4 +258,31 @@ void Foam::ensightPartFaces::writeConnectivity } +void Foam::ensightPartFaces::writeConnectivity +( + ensightGeoFile& os, + const word& key, + const labelList& idList, + const labelList& pointMap +) const +{ + writeConnectivity + ( + os, + key, + meshPtr_->faces(), + idList, + pointMap + ); +} + + +void Foam::ensightPartFaces::writeGeometry(ensightGeoFile& os) const +{ + const polyMesh& mesh = *meshPtr_; + const pointField& points = mesh.points(); + ensightPart::writeGeometry(os, points); +} + + // ************************************************************************* // diff --git a/src/conversion/ensight/part/ensightPartFaces.H b/src/conversion/ensight/part/ensightPartFaces.H index e0891c9b7f74b9797cbc2bc243aabcfb6f48c8fa..8683c7d9771041d2b00bc43dbf60da958576771a 100644 --- a/src/conversion/ensight/part/ensightPartFaces.H +++ b/src/conversion/ensight/part/ensightPartFaces.H @@ -67,6 +67,9 @@ class ensightPartFaces const labelList& pointMap ) const; + //- write geometry + virtual void writeGeometry(ensightGeoFile& os) const; + protected: @@ -81,6 +84,19 @@ protected: // Static data members static List<word> elemTypes_; + //- Divide the shapes, set elemLists. + void binShapes(const faceList& faces); + + //- Helper: write connectivity + void writeConnectivity + ( + ensightGeoFile& os, + const word& key, + const faceList& faces, + const labelList& idList, + const labelList& pointMap + ) const; + public: diff --git a/src/conversion/ensight/part/ensightPartIO.C b/src/conversion/ensight/part/ensightPartIO.C index c3866cdd36f6f799eaa2c22e6f9eed2468ec8fa6..264cf2beb7e068dee9205ec2316f423eabcf4116 100644 --- a/src/conversion/ensight/part/ensightPartIO.C +++ b/src/conversion/ensight/part/ensightPartIO.C @@ -118,15 +118,16 @@ bool Foam::ensightPart::writeData(Ostream& os) const } -void Foam::ensightPart::writeGeometry(ensightGeoFile& os) const +void Foam::ensightPart::writeGeometry +( + ensightGeoFile& os, + const pointField& points +) const { - if (size() && meshPtr_) + if (size()) { - const polyMesh& mesh = *meshPtr_; - const pointField& meshPoints = mesh.points(); - - localPoints ptList = calcLocalPoints(); - labelList& pointMap = ptList.list; + const localPoints ptList = calcLocalPoints(); + const labelList& pointMap = ptList.list; writeHeader(os, true); @@ -141,7 +142,7 @@ void Foam::ensightPart::writeGeometry(ensightGeoFile& os) const { if (pointMap[ptI] > -1) { - os.write( meshPoints[ptI].component(cmpt) ); + os.write( points[ptI].component(cmpt) ); os.newline(); } } diff --git a/src/conversion/ensight/part/ensightPartNonMeshFaces.C b/src/conversion/ensight/part/ensightPartNonMeshFaces.C new file mode 100644 index 0000000000000000000000000000000000000000..2c68a0d6c1f64e2c8d8a32f9ab45016bbcdfdd0d --- /dev/null +++ b/src/conversion/ensight/part/ensightPartNonMeshFaces.C @@ -0,0 +1,122 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "ensightPartNonMeshFaces.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(ensightPartNonMeshFaces, 0); + addToRunTimeSelectionTable(ensightPart, ensightPartNonMeshFaces, istream); +} + + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +Foam::ensightPart::localPoints +Foam::ensightPartNonMeshFaces::calcLocalPoints() const +{ + localPoints ptList; + ptList.list = identity(points_.size()); + ptList.nPoints = points_.size(); + return ptList; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::ensightPartNonMeshFaces::ensightPartNonMeshFaces +( + label partNumber, + const string& partDescription, + const faceList& faces, + const pointField& points +) +: + ensightPartFaces(partNumber, partDescription), + faces_(faces), + points_(points) +{ + binShapes(faces); +} + + +//- Construct as copy +Foam::ensightPartNonMeshFaces::ensightPartNonMeshFaces +( + const ensightPartNonMeshFaces& part +) +: + ensightPartFaces(part), + faces_(part.faces_), + points_(part.points_) +{} + + +//- Construct from Istream +Foam::ensightPartNonMeshFaces::ensightPartNonMeshFaces(Istream& is) +: + ensightPartFaces(is), + faces_(is), + points_(is) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::ensightPartNonMeshFaces::~ensightPartNonMeshFaces() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::ensightPartNonMeshFaces::writeConnectivity +( + ensightGeoFile& os, + const word& key, + const labelList& idList, + const labelList& pointMap +) const +{ + ensightPartFaces::writeConnectivity + ( + os, + key, + faces_, + idList, + pointMap + ); +} + + +void Foam::ensightPartNonMeshFaces::writeGeometry(ensightGeoFile& os) const +{ + ensightPart::writeGeometry(os, points_); +} + + +// ************************************************************************* // diff --git a/src/conversion/ensight/part/ensightPartNonMeshFaces.H b/src/conversion/ensight/part/ensightPartNonMeshFaces.H new file mode 100644 index 0000000000000000000000000000000000000000..86178b7eafdd088320eed46d926c9c184e8831e8 --- /dev/null +++ b/src/conversion/ensight/part/ensightPartNonMeshFaces.H @@ -0,0 +1,131 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::ensightPartNonMeshFaces + +Description + An implementation of ensightPart to work on self-contained faces and points + (without a mesh). + +SourceFiles + ensightPartNonMeshFaces.C + +\*---------------------------------------------------------------------------*/ + +#ifndef ensightPartNonMeshFaces_H +#define ensightPartNonMeshFaces_H + +#include "ensightPartFaces.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class ensightPartNonMeshFaces Declaration +\*---------------------------------------------------------------------------*/ + +class ensightPartNonMeshFaces +: + public ensightPartFaces +{ + // Private data + + //- faces (reference) + const faceList& faces_; + + //- points (reference) + const pointField& points_; + + + // Private Member Functions + + //- Disallow default bitwise assignment + void operator=(const ensightPartNonMeshFaces&); + + //- track points used + virtual localPoints calcLocalPoints() const; + +public: + + //- Runtime type information + TypeName("ensightNonMeshFaces"); + + // Constructors + + //- Construct from faces and points + ensightPartNonMeshFaces + ( + label partNumber, + const string& partDescription, + const faceList& faces, + const pointField& points + ); + + //- Construct as copy + ensightPartNonMeshFaces(const ensightPartNonMeshFaces& part); + + //- Construct from Istream + ensightPartNonMeshFaces(Istream& is); + + //- Construct on freestore from Istream + static autoPtr<ensightPartNonMeshFaces> New(Istream& is) + { + return autoPtr<ensightPartNonMeshFaces> + ( + new ensightPartNonMeshFaces(is) + ); + } + + + //- Destructor + virtual ~ensightPartNonMeshFaces(); + + + // Member Functions + + //- element connectivity + virtual void writeConnectivity + ( + ensightGeoFile& os, + const word& key, + const labelList& idList, + const labelList& pointMap + ) const; + + virtual void writeGeometry(ensightGeoFile& os) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/sampling/Make/options b/src/sampling/Make/options index 0e2c6780d2b4052888e065a1c709958c652c52b6..9a82299c41d4caa933e8a4324de15c3d41577c14 100644 --- a/src/sampling/Make/options +++ b/src/sampling/Make/options @@ -3,6 +3,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude \ + -I$(LIB_SRC)/conversion/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude LIB_LIBS = \ @@ -10,4 +11,5 @@ LIB_LIBS = \ -lmeshTools \ -lsurfMesh \ -ltriSurface \ + -lconversion \ -llagrangian diff --git a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C index 81eb8510fab382598919d37ea9ce2cb0f8ebebf4..dc87c8247a23e3c30e3918bebcf889d8cb227258 100644 --- a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C +++ b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C @@ -28,119 +28,11 @@ License #include "OFstream.H" #include "OSspecific.H" #include "IOmanip.H" +#include "ensightGeoFile.H" +#include "ensightPartNonMeshFaces.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -template<class Type> -void Foam::ensightSurfaceWriter<Type>::binShapes -( - const pointField& points, - const faceList& faces, - DynamicList<label>& tris, - DynamicList<label>& quads, - DynamicList<label>& polys -) -{ - tris.setCapacity(faces.size()); - quads.setCapacity(faces.size()); - polys.setCapacity(faces.size()); - - forAll(faces, i) - { - const face& f = faces[i]; - if (f.size() == 3) - { - tris.append(i); - } - else if (f.size() == 4) - { - quads.append(i); - } - else - { - polys.append(i); - } - } -} - - -template<class Type> -void Foam::ensightSurfaceWriter<Type>::writeGeometry -( - const fileName& surfaceName, - Ostream& os, - const pointField& points, - const faceList& faces, - const DynamicList<label>& tris, - const DynamicList<label>& quads, - const DynamicList<label>& polys -) -{ - os << "EnSight Geometry File" << nl - << (string("written by OpenFOAM-") + Foam::FOAMversion).c_str() << nl - << "node id assign" << nl - << "element id assign" << nl - << "part" << nl - << setw(10) << 1 << nl - << surfaceName.c_str() << nl; - - os << "coordinates" << nl - << setw(10) << points.size() << nl; - for (direction cmpt = 0; cmpt < vector::nComponents; cmpt++) - { - scalarField v = points.component(cmpt); - forAll(v, i) - { - os << v[i] << nl; - } - } - - - if (tris.size()) - { - os << "tria3" << nl - << setw(10) << tris.size() << nl; - forAll(tris, i) - { - const face& f = faces[tris[i]]; - forAll(f, fp) - { - os << setw(10) << f[fp]+1; - } - os << nl; - } - } - if (quads.size()) - { - os << "quad4" << nl - << setw(10) << quads.size() << nl; - forAll(quads, i) - { - const face& f = faces[quads[i]]; - forAll(f, fp) - { - os << setw(10) << f[fp]+1; - } - os << nl; - } - } - if (polys.size()) - { - os << "nsided" << nl - << setw(10) << polys.size() << nl; - forAll(polys, i) - { - const face& f = faces[polys[i]]; - forAll(f, fp) - { - os << setw(10) << f[fp]+1; - } - os << nl; - } - } -} - - namespace Foam { @@ -233,7 +125,11 @@ void Foam::ensightSurfaceWriter<Type>::write OFstream caseStr(outputDir/surfaceName + ".case"); - OFstream geomStr(outputDir/surfaceName + ".***.mesh"); + ensightGeoFile geomStr + ( + outputDir/surfaceName + ".000.mesh", + IOstream::ASCII + ); if (verbose) { @@ -256,12 +152,8 @@ void Foam::ensightSurfaceWriter<Type>::write << timeValue << nl << nl; - DynamicList<label> tris; - DynamicList<label> quads; - DynamicList<label> polys; - binShapes(points, faces, tris, quads, polys); - - writeGeometry(surfaceName, geomStr, points, faces, tris, quads, polys); + ensightPartNonMeshFaces faceWriter(0, geomStr.name().name(), faces, points); + faceWriter.writeGeometry(geomStr); } @@ -288,8 +180,16 @@ void Foam::ensightSurfaceWriter<Type>::write OFstream caseStr(outputDir/fieldName/surfaceName + ".case"); - OFstream geomStr(outputDir/fieldName/surfaceName + ".000.mesh"); - OFstream fieldStr(outputDir/fieldName/surfaceName + ".000." + fieldName); + ensightGeoFile geomStr + ( + outputDir/fieldName/surfaceName + ".000.mesh", + IOstream::ASCII + ); + ensightFile fieldStr + ( + outputDir/fieldName/surfaceName + ".000." + fieldName, + IOstream::ASCII + ); if (verbose) { @@ -308,15 +208,15 @@ void Foam::ensightSurfaceWriter<Type>::write { caseStr << pTraits<Type>::typeName << " per node:" << setw(10) << 1 - << " " << fieldName - << " " << surfaceName.c_str() << ".***." << fieldName << nl; + << " " << fieldName + << " " << surfaceName.c_str() << ".***." << fieldName << nl; } else { caseStr << pTraits<Type>::typeName << " per element:" << setw(10) << 1 - << " " << fieldName - << " " << surfaceName.c_str() << ".***." << fieldName << nl; + << " " << fieldName + << " " << surfaceName.c_str() << ".***." << fieldName << nl; } caseStr @@ -330,12 +230,8 @@ void Foam::ensightSurfaceWriter<Type>::write << timeValue << nl << nl; - DynamicList<label> tris; - DynamicList<label> quads; - DynamicList<label> polys; - binShapes(points, faces, tris, quads, polys); - - writeGeometry(surfaceName, geomStr, points, faces, tris, quads, polys); + ensightPartNonMeshFaces faceWriter(0, geomStr.name().name(), faces, points); + faceWriter.writeGeometry(geomStr); // Write field fieldStr @@ -350,20 +246,22 @@ void Foam::ensightSurfaceWriter<Type>::write } else { - if (tris.size()) - { - fieldStr << "tria3" << nl; - writeData(fieldStr, Field<Type>(values, tris)); - } - if (quads.size()) + //faceWriter.writeField(fieldStr, values); + forAll(faceWriter.elementTypes(), elemI) { - fieldStr << "quad4" << nl; - writeData(fieldStr, Field<Type>(values, quads)); - } - if (polys.size()) - { - fieldStr << "nsided" << nl; - writeData(fieldStr, Field<Type>(values, polys)); + if (faceWriter.elemLists()[elemI].size()) + { + fieldStr.writeKeyword(faceWriter.elementTypes()[elemI]); + writeData + ( + fieldStr, + Field<Type> + ( + values, + faceWriter.elemLists()[elemI] + ) + ); + } } } } diff --git a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.H b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.H index adb974f133afe63a5b6b4e564c43b66858be278b..d2f01c6479be562a6b2c5a6f7cca41952b4067d7 100644 --- a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.H +++ b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.H @@ -41,6 +41,8 @@ SourceFiles namespace Foam { +class ensightGeoFile; + /*---------------------------------------------------------------------------*\ Class ensightSurfaceWriter Declaration \*---------------------------------------------------------------------------*/ @@ -50,27 +52,16 @@ class ensightSurfaceWriter : public surfaceWriter<Type> { - // Private Member Functions + // Private data - static void binShapes - ( - const pointField& points, - const faceList& faces, - DynamicList<label>& tris, - DynamicList<label>& quads, - DynamicList<label>& polys - ); + fileName caseFileName_; + fileName surfaceName_; + fileName geomName_; + DynamicList<word> varNames_; + DynamicList<fileName> varFileNames_; - static void writeGeometry - ( - const fileName&, - Ostream&, - const pointField&, - const faceList&, - const DynamicList<label>&, - const DynamicList<label>&, - const DynamicList<label>& - ); + + // Private Member Functions static void writeData(Ostream&, const Field<Type>& values);