diff --git a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L index ddd97c3a05..c49dc5db31 100644 --- a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L +++ b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L @@ -475,7 +475,7 @@ int main(int argc, char *argv[]) {-1, -1, -1, -1, -1, -1}, // 1 {-1, -1, -1, -1, -1, -1}, // 2 {-1, -1, -1, -1, -1, -1}, // 3 - {-1, 2, 0, 3, 1, -1}, // tet (version 2.0) + { 3, 2, 0, -1, 1, -1}, // tet (version 2.0) { 0, 4, 3, -1, 2, 1}, // prism { 4, 2, 1, 3, 0, 5}, // hex }; @@ -500,12 +500,14 @@ int main(int argc, char *argv[]) ++cellIter, ++faceIter ) { + const cellShape& shape = cellShapes[cellMap[cellIter()]]; + patchFaces.append ( - cellShapes[cellMap[cellIter()] ].faces() + shape.faces() [ faceIndex - [cellShapes[cellMap[cellIter()] ].nFaces()] + [shape.nFaces()] [faceIter()-1] ] ); diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/cellSets.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/cellSets.H index a4447108ab..86eaa03d88 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/cellSets.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/cellSets.H @@ -46,10 +46,10 @@ class cellSets { public: - label nHexesWedges; - label nPrisms; - label nPyrs; label nTets; + label nPyrs; + label nPrisms; + label nHexesWedges; label nPolys; labelList tets; @@ -57,6 +57,7 @@ public: labelList prisms; labelList wedges; labelList hexes; + labelList hexesWedges; labelList polys; @@ -65,10 +66,10 @@ public: //- Construct given the number ov cells cellSets(const label nCells) : - nHexesWedges(0), - nPrisms(0), - nPyrs(0), nTets(0), + nPyrs(0), + nPrisms(0), + nHexesWedges(0), nPolys(0), tets(nCells), @@ -76,6 +77,7 @@ public: prisms(nCells), wedges(nCells), hexes(nCells), + hexesWedges(nCells), polys(nCells) {} }; diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H index 2230b75b24..9a7f53e6b3 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H @@ -94,6 +94,11 @@ public: // Member Functions + virtual bool ascii() const + { + return true; + } + virtual void write(const char* c) { str_ << c << nl; diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightBinaryStream.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightBinaryStream.H index b4f1421e4a..749b47b702 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightBinaryStream.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightBinaryStream.H @@ -90,6 +90,11 @@ public: // Member Functions + virtual bool ascii() const + { + return false; + } + virtual void write(const char* val) { char buffer[80] = {0}; diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C index 22bd164e92..8a79f54d96 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C @@ -32,68 +32,21 @@ License #include "volPointInterpolation.H" #include "ensightBinaryStream.H" #include "ensightAsciiStream.H" +#include "globalIndex.H" using namespace Foam; // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // template -scalarField map -( - const Field& vf, - const labelList& map, - const label cmpt -) -{ - scalarField mf(map.size()); - - forAll(map, i) - { - mf[i] = component(vf[map[i]], cmpt); - } - - return mf; -} - - -template -scalarField map -( - const Field& vf, - const labelList& map1, - const labelList& map2, - const label cmpt -) -{ - scalarField mf(map1.size() + map2.size()); - - forAll(map1, i) - { - mf[i] = component(vf[map1[i]], cmpt); - } - - label offset = map1.size(); - - forAll(map2, i) - { - mf[i + offset] = component(vf[map2[i]], cmpt); - } - - return mf; -} - - -template -void writeAllData +void writeField ( const char* key, const Field& vf, - const labelList& prims, - const label nPrims, ensightStream& ensightFile ) { - if (nPrims) + if (returnReduce(vf.size(), sumOp