diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/meshSubsetHelper.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/meshSubsetHelper.C
new file mode 100644
index 0000000000..05bdc9420b
--- /dev/null
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/meshSubsetHelper.C
@@ -0,0 +1,91 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2016 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "meshSubsetHelper.H"
+
+#include "cellSet.H"
+#include "cellZone.H"
+#include "Time.H"
+#include "IOstreams.H"
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+Foam::meshSubsetHelper::meshSubsetHelper
+(
+ fvMesh& baseMesh,
+ const word& name,
+ const bool isCellSet
+)
+:
+ baseMesh_(baseMesh),
+ subsetter_(baseMesh),
+ name_(name),
+ type_(name_.empty() ? 0 : isCellSet ? 1 : 2)
+{
+ correct();
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+void Foam::meshSubsetHelper::correct(bool verbose)
+{
+ if (type_ == 1)
+ {
+ if (verbose)
+ {
+ Info<< "Subsetting mesh based on cellSet " << name_ << endl;
+ }
+
+ cellSet subset(baseMesh_, name_);
+ subsetter_.setLargeCellSubset(subset);
+ }
+ else if (type_ == 2)
+ {
+ if (verbose)
+ {
+ Info<< "Subsetting mesh based on cellZone " << name_ << endl;
+ }
+
+ labelHashSet subset(baseMesh_.cellZones()[name_]);
+ subsetter_.setLargeCellSubset(subset, 0);
+ }
+}
+
+
+Foam::polyMesh::readUpdateState Foam::meshSubsetHelper::readUpdate()
+{
+ polyMesh::readUpdateState meshState = baseMesh_.readUpdate();
+
+ if (meshState != polyMesh::UNCHANGED)
+ {
+ correct(true);
+ }
+
+ return meshState;
+}
+
+
+// ************************************************************************* //
diff --git a/src/fileFormats/ensight/part/ensightCells.C b/src/fileFormats/ensight/part/ensightCells.C
index 5e17013314..8db55a927a 100644
--- a/src/fileFormats/ensight/part/ensightCells.C
+++ b/src/fileFormats/ensight/part/ensightCells.C
@@ -43,7 +43,7 @@ namespace Foam
>::names[] = { "tetra4", "pyramid5", "penta6", "hexa8", "nfaced" };
}
-const Foam::NamedEnum
+const Foam::NamedEnum
Foam::ensightCells::elemEnum;
@@ -73,7 +73,7 @@ void Foam::ensightCells::resize()
{
n += sizes_[typeI];
}
- address_.setSize(n, 0);
+ address_.setSize(n, Zero);
// assign corresponding sub-lists
n = 0;
@@ -94,7 +94,7 @@ Foam::ensightCells::ensightCells(const label partIndex)
:
index_(partIndex),
address_(),
- sizes_(0),
+ sizes_(Zero),
lists_()
{
// Ensure sub-lists are properly initialized to nullptr
@@ -111,7 +111,7 @@ Foam::ensightCells::ensightCells(const ensightCells& obj)
:
index_(obj.index_),
address_(obj.address_),
- sizes_(0),
+ sizes_(),
lists_()
{
// Ensure sub-lists are properly initialized to nullptr
@@ -137,7 +137,6 @@ Foam::ensightCells::ensightCells(const ensightCells& obj)
Foam::ensightCells::~ensightCells()
{
- sizes_ = 0;
forAll(lists_, typeI)
{
deleteDemandDrivenData(lists_[typeI]);
@@ -153,7 +152,7 @@ Foam::FixedList Foam::ensightCells::sizes() const
FixedList