diff --git a/applications/utilities/mesh/manipulation/setSet/setSet.C b/applications/utilities/mesh/manipulation/setSet/setSet.C index 73a5727663..b717e9f152 100644 --- a/applications/utilities/mesh/manipulation/setSet/setSet.C +++ b/applications/utilities/mesh/manipulation/setSet/setSet.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2018 OpenFOAM Foundation - Copyright (C) 2017-2022 OpenCFD Ltd. + Copyright (C) 2017-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -158,7 +158,7 @@ void printSets(Ostream& os, const IOobjectList& objects) { label n = 0; - for (const IOobject& io : objects.sorted()) + for (const IOobject& io : objects.csorted()) { SetType set(io); if (!n++) os << SetType::typeName << "s:" << nl; diff --git a/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C b/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C index e5b86055dd..a42a9ec7ee 100644 --- a/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C +++ b/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2021-2022 OpenCFD Ltd. + Copyright (C) 2021-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) << endl; - for (const IOobject& io : objects.sorted()) + for (const IOobject& io : objects.csorted()) { // Not in memory. Load it. pointSet set(io); @@ -137,7 +137,7 @@ int main(int argc, char *argv[]) wordHashSet slaveCellSets; - for (const IOobject& io : objects.sorted()) + for (const IOobject& io : objects.csorted()) { // Not in memory. Load it. faceSet set(io); @@ -259,7 +259,7 @@ int main(int argc, char *argv[]) - for (const IOobject& io : objects.sorted()) + for (const IOobject& io : objects.csorted()) { if (!slaveCellSets.found(io.name())) { diff --git a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C index 7398cb581d..1ae4fb4ca8 100644 --- a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C +++ b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2015-2022 OpenCFD Ltd. + Copyright (C) 2015-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -653,7 +653,7 @@ int main(int argc, char *argv[]) const labelList& cellMap = procMeshes.cellProcAddressing()[proci]; - for (const IOobject& io : objects.sorted()) + for (const IOobject& io : objects.csorted()) { // Load cellSet const cellSet procSet(io); @@ -684,7 +684,7 @@ int main(int argc, char *argv[]) const labelList& faceMap = procMeshes.faceProcAddressing()[proci]; - for (const IOobject& io : objects.sorted()) + for (const IOobject& io : objects.csorted()) { // Load faceSet const faceSet procSet(io); @@ -714,7 +714,7 @@ int main(int argc, char *argv[]) const labelList& pointMap = procMeshes.pointProcAddressing()[proci]; - for (const IOobject& io : objects.sorted()) + for (const IOobject& io : objects.csorted()) { // Load pointSet const pointSet procSet(io); diff --git a/applications/utilities/parallelProcessing/redistributePar/parPointFieldDistributorTemplates.C b/applications/utilities/parallelProcessing/redistributePar/parPointFieldDistributorTemplates.C index e048bed283..4c1964f076 100644 --- a/applications/utilities/parallelProcessing/redistributePar/parPointFieldDistributorTemplates.C +++ b/applications/utilities/parallelProcessing/redistributePar/parPointFieldDistributorTemplates.C @@ -185,11 +185,11 @@ Foam::label Foam::parPointFieldDistributor::distributePointFields { typedef GeometricField fieldType; - UPtrList fieldObjects + const UPtrList fieldObjects ( selectedFields.empty() - ? objects.sorted() - : objects.sorted(selectedFields) + ? objects.csorted() + : objects.csorted(selectedFields) ); label nFields = 0; diff --git a/src/OpenFOAM/parallel/fieldsDistributor/fieldsDistributorTemplates.C b/src/OpenFOAM/parallel/fieldsDistributor/fieldsDistributorTemplates.C index f070fe8b16..8bddfe9130 100644 --- a/src/OpenFOAM/parallel/fieldsDistributor/fieldsDistributorTemplates.C +++ b/src/OpenFOAM/parallel/fieldsDistributor/fieldsDistributorTemplates.C @@ -65,7 +65,7 @@ void Foam::fieldsDistributor::readFields typedef GeometricField GeoField; // GeoField fields - sorted for consistent order on all processors - UPtrList fieldObjects(objects.sorted()); + const UPtrList fieldObjects(objects.csorted()); // Construct the fields fields.resize(fieldObjects.size()); @@ -86,7 +86,7 @@ void Foam::fieldsDistributor::readFields ) { // GeoField fields - sorted for consistent order on all processors - UPtrList fieldObjects(objects.sorted()); + const UPtrList fieldObjects(objects.csorted()); // Construct the fields fields.resize(fieldObjects.size()); diff --git a/src/finiteArea/distributed/faMeshDistributorTemplates.C b/src/finiteArea/distributed/faMeshDistributorTemplates.C index 26d2da28f5..19ddc49404 100644 --- a/src/finiteArea/distributed/faMeshDistributorTemplates.C +++ b/src/finiteArea/distributed/faMeshDistributorTemplates.C @@ -310,8 +310,8 @@ Foam::label Foam::faMeshDistributor::distributeAreaFields const IOobject& io : ( selectedFields.empty() - ? objects.sorted() - : objects.sorted(selectedFields) + ? objects.csorted() + : objects.csorted(selectedFields) ) ) { @@ -368,8 +368,8 @@ Foam::label Foam::faMeshDistributor::distributeEdgeFields const IOobject& io : ( selectedFields.empty() - ? objects.sorted() - : objects.sorted(selectedFields) + ? objects.csorted() + : objects.csorted(selectedFields) ) ) { diff --git a/src/functionObjects/forces/forceCoeffs/forceCoeffs.C b/src/functionObjects/forces/forceCoeffs/forceCoeffs.C index a80062e501..b749dcf81b 100644 --- a/src/functionObjects/forces/forceCoeffs/forceCoeffs.C +++ b/src/functionObjects/forces/forceCoeffs/forceCoeffs.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2015-2022 OpenCFD Ltd. + Copyright (C) 2015-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -236,7 +236,7 @@ void Foam::functionObjects::forceCoeffs::writeIntegratedDataFileHeader writeHeader(os, ""); writeCommented(os, "Time"); - for (const auto& iter : coeffs_.sorted()) + for (const auto& iter : coeffs_.csorted()) { const auto& coeff = iter.val(); @@ -255,7 +255,7 @@ void Foam::functionObjects::forceCoeffs::writeIntegratedDataFile() writeCurrentTime(os); - for (const auto& iter : coeffs_.sorted()) + for (const auto& iter : coeffs_.csorted()) { const auto& coeff = iter.val(); @@ -359,16 +359,16 @@ bool Foam::functionObjects::forceCoeffs::read(const dictionary& dict) for (const word& key : coeffs) { - auto coeffIter = coeffs_.find(key); + auto iter = coeffs_.find(key); - if (!coeffIter.good()) + if (!iter.good()) { FatalIOErrorInFunction(dict) << "Unknown coefficient type " << key << " . Valid entries are : " << coeffs_.sortedToc() << exit(FatalIOError); } - auto& coeff = coeffIter.val(); + auto& coeff = iter.val(); coeff.active_ = true; Info<< " - " << coeff << nl; } @@ -412,7 +412,7 @@ bool Foam::functionObjects::forceCoeffs::execute() }; // Always setting all results - for (const auto& iter : coeffs_.sorted()) + for (const auto& iter : coeffs_.csorted()) { const word& coeffName = iter.key(); const auto& coeff = iter.val(); diff --git a/src/functionObjects/utilities/ensightWrite/ensightWriteImpl.C b/src/functionObjects/utilities/ensightWrite/ensightWriteImpl.C index 1a7096b1a9..b55c4f19b3 100644 --- a/src/functionObjects/utilities/ensightWrite/ensightWriteImpl.C +++ b/src/functionObjects/utilities/ensightWrite/ensightWriteImpl.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2016-2022 OpenCFD Ltd. + Copyright (C) 2016-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -46,7 +46,7 @@ Foam::label Foam::functionObjects::ensightWrite::writeVolFieldsImpl for ( const GeoField& origField - : baseMesh.sorted(candidateNames) + : baseMesh.csorted(candidateNames) ) { const word& fieldName = origField.name(); diff --git a/src/functionObjects/utilities/vtkWrite/vtkWriteImpl.C b/src/functionObjects/utilities/vtkWrite/vtkWriteImpl.C index 9d3c60ac3e..0e6dfd2f15 100644 --- a/src/functionObjects/utilities/vtkWrite/vtkWriteImpl.C +++ b/src/functionObjects/utilities/vtkWrite/vtkWriteImpl.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -43,7 +43,7 @@ Foam::label Foam::functionObjects::vtkWrite::writeVolFieldsImpl for ( const GeoField& origField - : baseMesh.sorted(candidateNames) + : baseMesh.csorted(candidateNames) ) { bool ok = false; @@ -110,7 +110,7 @@ Foam::label Foam::functionObjects::vtkWrite::writeVolFieldsImpl for ( const GeoField& origField - : baseMesh.sorted(candidateNames) + : baseMesh.csorted(candidateNames) ) { bool ok = false; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/KinematicSurfaceFilm/KinematicSurfaceFilm.C b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/KinematicSurfaceFilm/KinematicSurfaceFilm.C index e3fb81f101..2d471effaf 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/KinematicSurfaceFilm/KinematicSurfaceFilm.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/KinematicSurfaceFilm/KinematicSurfaceFilm.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2021-2022 OpenCFD Ltd. + Copyright (C) 2021-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -114,14 +114,13 @@ void Foam::KinematicSurfaceFilm::initFilmModels() // Set up area films if (areaFilms_.empty()) { - UPtrList models + for ( - mesh.time().objectRegistry::template sorted() - ); - - for (const auto& model : models) + const areaFilm& regionFa + : mesh.time().objectRegistry::template csorted() + ) { - areaFilms_.append(const_cast(&model)); + areaFilms_.push_back(const_cast(®ionFa)); } } } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C index e097e5d3fb..d8c4743582 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C @@ -288,7 +288,7 @@ void Foam::SurfaceFilmModel::inject(TrackCloudType& cloud) for ( const areaFilm& regionFa - : mesh.time().objectRegistry::template sorted() + : mesh.time().objectRegistry::template csorted() ) { if (regionFa.active()) diff --git a/src/parallel/decompose/decompose/lagrangianFieldDecomposerReadFields.C b/src/parallel/decompose/decompose/lagrangianFieldDecomposerReadFields.C index f3534f2d9d..9a62cb0e2b 100644 --- a/src/parallel/decompose/decompose/lagrangianFieldDecomposerReadFields.C +++ b/src/parallel/decompose/decompose/lagrangianFieldDecomposerReadFields.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2022 OpenCFD Ltd. + Copyright (C) 2022-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,9 +40,9 @@ void Foam::lagrangianFieldDecomposer::readFields ) { // List of lagrangian field objects - UPtrList fieldObjects + const UPtrList fieldObjects ( - lagrangianObjects.sorted>() + lagrangianObjects.csorted>() ); auto& cloudFields = @@ -66,12 +66,12 @@ void Foam::lagrangianFieldDecomposer::readFieldFields // List of lagrangian field objects UPtrList fieldObjects ( - lagrangianObjects.sorted>>() + lagrangianObjects.cobjects>>() ); fieldObjects.push_back ( - lagrangianObjects.sorted, Type>>() + lagrangianObjects.cobjects, Type>>() ); Foam::sort(fieldObjects, nameOp()); diff --git a/src/parallel/reconstruct/faReconstruct/faFieldReconstructorTemplates.C b/src/parallel/reconstruct/faReconstruct/faFieldReconstructorTemplates.C index d9cf4a297f..e5c27951ff 100644 --- a/src/parallel/reconstruct/faReconstruct/faFieldReconstructorTemplates.C +++ b/src/parallel/reconstruct/faReconstruct/faFieldReconstructorTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016-2017 Wikki Ltd - Copyright (C) 2018-2022 OpenCFD Ltd. + Copyright (C) 2018-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -697,8 +697,8 @@ Foam::label Foam::faFieldReconstructor::reconstructAreaFields ( ( selectedFields.empty() - ? objects.sorted() - : objects.sorted(selectedFields) + ? objects.csorted() + : objects.csorted(selectedFields) ) ); } @@ -717,8 +717,8 @@ Foam::label Foam::faFieldReconstructor::reconstructEdgeFields ( ( selectedFields.empty() - ? objects.sorted() - : objects.sorted(selectedFields) + ? objects.csorted() + : objects.csorted(selectedFields) ) ); } diff --git a/src/parallel/reconstruct/reconstruct/fvFieldReconstructorTemplates.C b/src/parallel/reconstruct/reconstruct/fvFieldReconstructorTemplates.C index 060238bfde..70a31ea8cc 100644 --- a/src/parallel/reconstruct/reconstruct/fvFieldReconstructorTemplates.C +++ b/src/parallel/reconstruct/reconstruct/fvFieldReconstructorTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018-2022 OpenCFD Ltd. + Copyright (C) 2018-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -707,8 +707,8 @@ Foam::label Foam::fvFieldReconstructor::reconstructInternalFields ( ( selectedFields.empty() - ? objects.sorted() - : objects.sorted(selectedFields) + ? objects.csorted() + : objects.csorted(selectedFields) ) ); } @@ -727,8 +727,8 @@ Foam::label Foam::fvFieldReconstructor::reconstructVolumeFields ( ( selectedFields.empty() - ? objects.sorted() - : objects.sorted(selectedFields) + ? objects.csorted() + : objects.csorted(selectedFields) ) ); } @@ -747,8 +747,8 @@ Foam::label Foam::fvFieldReconstructor::reconstructSurfaceFields ( ( selectedFields.empty() - ? objects.sorted() - : objects.sorted(selectedFields) + ? objects.csorted() + : objects.csorted(selectedFields) ) ); } diff --git a/src/parallel/reconstruct/reconstruct/lagrangianReconstructorTemplates.C b/src/parallel/reconstruct/reconstruct/lagrangianReconstructorTemplates.C index 2789f67282..ef025f22de 100644 --- a/src/parallel/reconstruct/reconstruct/lagrangianReconstructorTemplates.C +++ b/src/parallel/reconstruct/reconstruct/lagrangianReconstructorTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -199,8 +199,8 @@ Foam::label Foam::lagrangianReconstructor::reconstructFields cloudName, ( selectedFields.empty() - ? objects.sorted() - : objects.sorted(selectedFields) + ? objects.csorted() + : objects.csorted(selectedFields) ) ); } @@ -221,13 +221,13 @@ Foam::label Foam::lagrangianReconstructor::reconstructFieldFields if (selectedFields.empty()) { - fieldObjects.append(objects.sorted()); - fieldObjects.append(objects.sorted()); + fieldObjects.push_back(objects.csorted()); + fieldObjects.push_back(objects.csorted()); } else { - fieldObjects.append(objects.sorted(selectedFields)); - fieldObjects.append(objects.sorted(selectedFields)); + fieldObjects.push_back(objects.csorted(selectedFields)); + fieldObjects.push_back(objects.csorted(selectedFields)); } Foam::sort(fieldObjects, nameOp()); diff --git a/src/parallel/reconstruct/reconstruct/pointFieldReconstructorTemplates.C b/src/parallel/reconstruct/reconstruct/pointFieldReconstructorTemplates.C index 01e26fe6c7..ae49e24b1b 100644 --- a/src/parallel/reconstruct/reconstruct/pointFieldReconstructorTemplates.C +++ b/src/parallel/reconstruct/reconstruct/pointFieldReconstructorTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018-2022 OpenCFD Ltd. + Copyright (C) 2018-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -212,8 +212,8 @@ Foam::label Foam::pointFieldReconstructor::reconstructPointFields ( ( selectedFields.empty() - ? objects.sorted() - : objects.sorted(selectedFields) + ? objects.csorted() + : objects.csorted(selectedFields) ) ); }