Commit a8686043 authored by mattijs's avatar mattijs
Browse files

BUG: checkMesh: index into surfaceScalarField. Fixes #1771.

parent 9b78472e
...@@ -616,6 +616,17 @@ void Foam::writeFields ...@@ -616,6 +616,17 @@ void Foam::writeFields
} }
if (selectedFields.found("faceZone")) if (selectedFields.found("faceZone"))
{ {
// Determine for each face the zone index (scalar for ease of
// manipulation)
scalarField zoneID(mesh.nFaces(), -1);
const faceZoneMesh& czs = mesh.faceZones();
for (const auto& zone : czs)
{
UIndirectList<scalar>(zoneID, zone) = zone.index();
}
// Split into internal and boundary values
surfaceScalarField faceZone surfaceScalarField faceZone
( (
IOobject IOobject
...@@ -632,10 +643,13 @@ void Foam::writeFields ...@@ -632,10 +643,13 @@ void Foam::writeFields
calculatedFvsPatchScalarField::typeName calculatedFvsPatchScalarField::typeName
); );
const faceZoneMesh& czs = mesh.faceZones(); faceZone.primitiveFieldRef() =
for (const auto& zone : czs) SubField<scalar>(zoneID, mesh.nInternalFaces());
surfaceScalarField::Boundary& bfld = faceZone.boundaryFieldRef();
for (auto& pfld : bfld)
{ {
UIndirectList<scalar>(faceZone, zone) = zone.index(); const fvPatch& fvp = pfld.patch();
pfld == SubField<scalar>(zoneID, fvp.size(), fvp.start());
} }
//faceZone.correctBoundaryConditions(); //faceZone.correctBoundaryConditions();
......
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