From 9c86fec6e3e31b5d17d928c64ab0e0435f17ee49 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 8 Sep 2009 17:39:47 +0100 Subject: [PATCH] protect against illegal number of layers --- .../autoHexMeshDriver/autoLayerDriver.C | 48 +++++++++++++------ 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C index 27ca388fe3..3d0274bc33 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C @@ -2661,10 +2661,22 @@ void Foam::autoLayerDriver::addLayers { const polyBoundaryMesh& patches = mesh.boundaryMesh(); - Info<< nl - << "patch faces layers avg thickness[m]" << nl - << " near-wall overall" << nl - << "----- ----- ------ --------- -------" << endl; + // Find maximum length of a patch name, for a nicer output + label maxPatchNameLen = 0; + forAll(meshMover.adaptPatchIDs(), i) + { + label patchI = meshMover.adaptPatchIDs()[i]; + word patchName = patches[patchI].name(); + maxPatchNameLen = max(maxPatchNameLen,label(patchName.size())); + } + + Info<< nl + << setf(ios_base::left) << setw(maxPatchNameLen) << "patch" + << setw(0) << " faces layers avg thickness[m]" << nl + << setf(ios_base::left) << setw(maxPatchNameLen) << " " + << setw(0) << " near-wall overall" << nl + << setf(ios_base::left) << setw(maxPatchNameLen) << "-----" + << setw(0) << " ----- ------ --------- -------" << endl; forAll(meshMover.adaptPatchIDs(), i) { @@ -2704,18 +2716,24 @@ void Foam::autoLayerDriver::addLayers label totNPoints = returnReduce(meshPoints.size(), sumOp