/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2016-2025 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . Application renumberMesh Group grpMeshManipulationUtilities Description Renumbers the cell list in order to reduce the bandwidth, reading and renumbering all fields from all the time directories. By default uses bandCompression (Cuthill-McKee) or the method specified by the -renumber-method option, but will read system/renumberMeshDict if -dict option is present Usage \b renumberMesh [OPTIONS] Options: - \par -allRegions Use all regions in regionProperties - \par -case \ Specify case directory to use (instead of the cwd). - \par -constant Include the 'constant/' dir in the times list. - \par -decompose Aggregate initially with a decomposition method (serial only) - \par -decomposeParDict \ Use specified file for decomposePar dictionary. - \par -dict \ Use specified file for renumberMeshDict dictionary. - \par -dry-run Test only - \par -frontWidth Calculate the rms of the front-width - \par -latestTime Select the latest time. - \par -lib \ Additional library or library list to load (can be used multiple times). - \par -no-fields Suppress renumber of fields - \par -noZero Exclude the \a 0 dir from the times list. - \par -overwrite Overwrite existing mesh/results files - \par -parallel Run in parallel - \par -region \ Renumber named region. - \par -regions \ Renumber named regions. - \par -renumber-coeffs \ String to create renumber dictionary contents. - \par -renumber-method \ Specify renumber method (default: CuthillMcKee) without dictionary - \par -time \ Specify time to select - \par -verbose Additional verbosity. - \par -doc Display documentation in browser. - \par -doc-source Display source code in browser. - \par -help Display short help and exit. - \par -help-man Display full help (manpage format) and exit. - \par -help-notes Display help notes (description) and exit. - \par -help-full Display full help and exit. \*---------------------------------------------------------------------------*/ #include "argList.H" #include "clockTime.H" #include "timeSelector.H" #include "IOobjectList.H" #include "fvMesh.H" #include "polyTopoChange.H" #include "ReadFields.H" #include "volFields.H" #include "surfaceFields.H" #include "SortableList.H" #include "decompositionMethod.H" #include "decompositionModel.H" #include "renumberMethod.H" #include "foamVtkInternalMeshWriter.H" #include "CuthillMcKeeRenumber.H" #include "fvMeshSubset.H" #include "cellSet.H" #include "faceSet.H" #include "pointSet.H" #include "processorMeshes.H" #include "hexRef8Data.H" #include "regionProperties.H" #include "polyMeshTools.H" #include "subsetAdjacency.H" using namespace Foam; // Slightly messy way of handling timing, but since the timing points // are scattered between 'main()' and other local functions... clockTime timer; // Timing categories enum TimingType { READ_MESH, // Reading mesh READ_FIELDS, // Reading fields DECOMPOSE, // Domain decomposition (if any) CELL_CELLS, // globalMeshData::calcCellCells RENUMBER, // The renumberMethod REORDER, // Mesh reordering (topoChange) WRITING, // Writing mesh/fields }; FixedList timings; // Create named field from labelList for post-processing tmp createScalarField ( const fvMesh& mesh, const word& name, const labelUList& elems ) { auto tfld = volScalarField::New ( name, mesh, dimensionedScalar(word::null, dimless, -1), fvPatchFieldBase::zeroGradientType() ); auto& fld = tfld.ref(); forAll(elems, celli) { fld[celli] = elems[celli]; } fld.correctBoundaryConditions(); return tfld; } // 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