Skip to content
Snippets Groups Projects
Commit 26d3fe81 authored by mark's avatar mark
Browse files

BUG: mesh reader does not preserve physicalType (closes #287)

- was incorrectly writing it as "startFace", which would be
  immediately overwritten anyhow

STYLE: avoid noisy output when adding the boundary 'type' in mesh conversion.
parent f1ab3646
No related branches found
No related tags found
No related merge requests found
...@@ -439,14 +439,26 @@ Foam::meshReader::polyBoundaryPatches(const polyMesh& mesh) ...@@ -439,14 +439,26 @@ Foam::meshReader::polyBoundaryPatches(const polyMesh& mesh)
} }
dictionary& patchDict = patchDicts[patchi]; dictionary& patchDict = patchDicts[patchi];
// add but not overwrite type // Add but not override 'type'
patchDict.add("type", patchTypes_[patchi], false); if (!patchDict.found("type"))
if (patchPhysicalTypes_.size() && patchPhysicalTypes_[patchi].size())
{ {
patchDict.add("startFace", patchPhysicalTypes_[patchi], false); patchDict.add("type", patchTypes_[patchi], false);
} }
// overwrite sizes and start // Add but not override 'physicalType' but only if it differs
// from 'type'
if
(
patchi < patchPhysicalTypes_.size()
&& patchPhysicalTypes_[patchi].size()
&& patchPhysicalTypes_[patchi] != patchTypes_[patchi]
&& !patchDict.found("physicalType")
)
{
patchDict.add("physicalType", patchPhysicalTypes_[patchi], false);
}
// Overwrite sizes and start
patchDict.add("nFaces", patchSizes_[patchi], true); patchDict.add("nFaces", patchSizes_[patchi], true);
patchDict.add("startFace", patchStarts_[patchi], true); patchDict.add("startFace", patchStarts_[patchi], true);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment