Commit 55d3950b authored by Mark Olesen's avatar Mark Olesen
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 82f9089b
......@@ -439,14 +439,26 @@ Foam::meshReader::polyBoundaryPatches(const polyMesh& mesh)
dictionary& patchDict = patchDicts[patchi];
// add but not overwrite type
patchDict.add("type", patchTypes_[patchi], false);
if (patchPhysicalTypes_.size() && patchPhysicalTypes_[patchi].size())
// Add but not override 'type'
if (!patchDict.found("type"))
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'
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("startFace", patchStarts_[patchi], true);
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