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

This commit is contained in:
mattijs
2020-02-06 12:35:22 +00:00
parent 1b47034e24
commit 01c14532bd
2 changed files with 61 additions and 2 deletions

View File

@ -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"
});
}

View File

@ -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;
}