Commit 01c14532 authored by mattijs's avatar mattijs
Browse files

ENH: checkMesh: write cellZone, faceZone info. See #1543.

parent 1b47034e
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2019 OpenCFD Ltd. Copyright (C) 2015-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -163,7 +163,9 @@ int main(int argc, char *argv[]) ...@@ -163,7 +163,9 @@ int main(int argc, char *argv[])
"minTetVolume", "minTetVolume",
"minPyrVolume", "minPyrVolume",
"cellRegion", "cellRegion",
"wallDistance" "wallDistance",
"cellZone",
"faceZone"
}); });
} }
......
...@@ -586,5 +586,62 @@ void Foam::writeFields ...@@ -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; Info<< endl;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment