Commit f250fab7 authored by mattijs's avatar mattijs
Browse files

ENH: checkMesh: output cellRegion field. Fixes #763.

parent dbe94816
......@@ -150,6 +150,7 @@ int main(int argc, char *argv[])
selectedFields.insert("cellVolume");
selectedFields.insert("cellVolumeRatio");
selectedFields.insert("minTetVolume");
selectedFields.insert("cellRegion");
}
......
......@@ -4,6 +4,7 @@
#include "zeroGradientFvPatchFields.H"
#include "syncTools.H"
#include "tetPointRef.H"
#include "regionSplit.H"
using namespace Foam;
......@@ -424,6 +425,32 @@ void Foam::writeFields
minTetVolume.write();
}
if (selectedFields.found("cellRegion"))
{
volScalarField cellRegion
(
IOobject
(
"cellRegion",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("cellRegion", dimless, 0),
calculatedFvPatchScalarField::typeName
);
regionSplit rs(mesh);
forAll(rs, celli)
{
cellRegion[celli] = rs[celli];
}
cellRegion.correctBoundaryConditions();
Info<< " Writing cell region to " << cellRegion.name() << endl;
cellRegion.write();
}
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