diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C index 216e2b1ce473235c76a2585023189cbe563d75ce..46869bd38ba6db5d72be1b29cb9ac459e3b91b84 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2015-2019 OpenCFD Ltd. + Copyright (C) 2015-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -163,7 +163,9 @@ int main(int argc, char *argv[]) "minTetVolume", "minPyrVolume", "cellRegion", - "wallDistance" + "wallDistance", + "cellZone", + "faceZone" }); } diff --git a/applications/utilities/mesh/manipulation/checkMesh/writeFields.C b/applications/utilities/mesh/manipulation/checkMesh/writeFields.C index 7f86c28bd9b25d772c6d61127ebc36da5d26c0bf..f58db28de7db08ab8921444f77a4c54d3ce5d861 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/writeFields.C +++ b/applications/utilities/mesh/manipulation/checkMesh/writeFields.C @@ -586,5 +586,62 @@ void Foam::writeFields } } + if (selectedFields.found("cellZone")) + { + volScalarField cellZone + ( + IOobject + ( + "cellZone", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE, + false + ), + mesh, + dimensionedScalar(scalar(-1)), + calculatedFvPatchScalarField::typeName + ); + + const cellZoneMesh& czs = mesh.cellZones(); + for (const auto& zone : czs) + { + UIndirectList<scalar>(cellZone, zone) = zone.index(); + } + + cellZone.correctBoundaryConditions(); + Info<< " Writing cell zoning to " << cellZone.name() << endl; + cellZone.write(); + } + if (selectedFields.found("faceZone")) + { + surfaceScalarField faceZone + ( + IOobject + ( + "faceZone", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE, + false + ), + mesh, + dimensionedScalar(scalar(-1)), + calculatedFvsPatchScalarField::typeName + ); + + const faceZoneMesh& czs = mesh.faceZones(); + for (const auto& zone : czs) + { + UIndirectList<scalar>(faceZone, zone) = zone.index(); + } + + //faceZone.correctBoundaryConditions(); + Info<< " Writing face zoning to " << faceZone.name() << endl; + faceZone.write(); + } + Info<< endl; }