From 46e1b00c34217a19fdf4574263c41263be8fea3d Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 15 Mar 2024 19:42:39 +0100 Subject: [PATCH] ENH: handle sub-mesh connectivity by subsetting of adjacency matrix - in renumberMesh replace calculation of a subMesh connectivity with calculation of the full mesh connectivity followed by subsetting of the full adjacency matrix. This should reduce the overall number of operations. (MR !669) --- .../manipulation/renumberMesh/renumberMesh.C | 245 ++++++++++++------ .../renumberMesh/subsetAdjacency.H | 168 ++++++++++++ 2 files changed, 327 insertions(+), 86 deletions(-) create mode 100644 applications/utilities/mesh/manipulation/renumberMesh/subsetAdjacency.H diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C index 64011258c6..3702cfe8ce 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C +++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C @@ -145,6 +145,7 @@ Usage #include "hexRef8Data.H" #include "regionProperties.H" #include "polyMeshTools.H" +#include "subsetAdjacency.H" using namespace Foam; @@ -194,21 +195,56 @@ tmp createScalarField } -// Calculate band of matrix -label getBand(const labelList& owner, const labelList& neighbour) +// Calculate band of mesh +// label getBand(const labelUList& owner, const labelUList& neighbour) +// { +// label bandwidth = 0; +// +// forAll(neighbour, facei) +// { +// const label width = neighbour[facei] - owner[facei]; +// +// if (bandwidth < width) +// { +// bandwidth = width; +// } +// } +// return bandwidth; +// } + + +// Calculate band and profile of matrix. Profile is scalar to avoid overflow +Tuple2 getBand +( + const CompactListList