diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/cellSets.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/cellSets.H index 86eaa03d887fd0f781c7524328a659d25b391a2d..ff358d78874fa800b7f852d8b1c259eb5c510e8f 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/cellSets.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/cellSets.H @@ -57,7 +57,6 @@ public: labelList prisms; labelList wedges; labelList hexes; - labelList hexesWedges; labelList polys; @@ -77,7 +76,6 @@ public: prisms(nCells), wedges(nCells), hexes(nCells), - hexesWedges(nCells), polys(nCells) {} }; diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C index 8a79f54d969f7b068123cbf1bb8a39d4c929bf52..7ffa7a4ca56eadb0014219828e4b46ed74427453 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C @@ -38,6 +38,32 @@ using namespace Foam; // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // +template<class Type> +Field<Type> map +( + const Field<Type>& vf, + const labelList& map1, + const labelList& map2 +) +{ + Field<Type> mf(map1.size() + map2.size()); + + forAll(map1, i) + { + mf[i] = vf[map1[i]]; + } + + label offset = map1.size(); + + forAll(map2, i) + { + mf[i + offset] = vf[map2[i]]; + } + + return mf; +} + + template<class Type> void writeField ( @@ -274,7 +300,8 @@ void ensightField const labelList& tets = meshCellSets.tets; const labelList& pyrs = meshCellSets.pyrs; const labelList& prisms = meshCellSets.prisms; - const labelList& hexesWedges = meshCellSets.hexesWedges; + const labelList& wedges = meshCellSets.wedges; + const labelList& hexes = meshCellSets.hexes; const labelList& polys = meshCellSets.polys; ensightStream* ensightFilePtr = NULL; @@ -328,7 +355,7 @@ void ensightField writeField ( "hexa8", - Field<Type>(vf, hexesWedges), + map(vf, hexes, wedges), ensightFile ); diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C index cff09a395d6be9a8c42e14e427390acb6284a4cf..77fb706d5670fa639085d4d110bd4d567cd64e62 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C @@ -117,7 +117,6 @@ void Foam::ensightMesh::correct() labelList& prisms = meshCellSets_.prisms; labelList& wedges = meshCellSets_.wedges; labelList& hexes = meshCellSets_.hexes; - labelList& hexesWedges = meshCellSets_.hexesWedges; labelList& polys = meshCellSets_.polys; label nTets = 0; @@ -125,7 +124,6 @@ void Foam::ensightMesh::correct() label nPrisms = 0; label nWedges = 0; label nHexes = 0; - label nHexesWedges = 0; label nPolys = 0; forAll(cellShapes, cellI) @@ -148,12 +146,10 @@ void Foam::ensightMesh::correct() else if (cellModel == wedge) { wedges[nWedges++] = cellI; - hexesWedges[nHexesWedges++] = cellI; } else if (cellModel == hex) { hexes[nHexes++] = cellI; - hexesWedges[nHexesWedges++] = cellI; } else { @@ -166,7 +162,6 @@ void Foam::ensightMesh::correct() prisms.setSize(nPrisms); wedges.setSize(nWedges); hexes.setSize(nHexes); - hexesWedges.setSize(nHexesWedges); polys.setSize(nPolys); meshCellSets_.nTets = nTets; @@ -178,7 +173,7 @@ void Foam::ensightMesh::correct() meshCellSets_.nPrisms = nPrisms; reduce(meshCellSets_.nPrisms, sumOp<label>()); - meshCellSets_.nHexesWedges = nHexesWedges; + meshCellSets_.nHexesWedges = nWedges+nHexes; reduce(meshCellSets_.nHexesWedges, sumOp<label>()); meshCellSets_.nPolys = nPolys;