diff --git a/applications/test/Dictionary/Make/files b/applications/test/Dictionary/Make/files deleted file mode 100644 index 7545aeb55f..0000000000 --- a/applications/test/Dictionary/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -Test-Dictionary.C - -EXE = $(FOAM_USER_APPBIN)/Test-Dictionary diff --git a/applications/test/PtrDictionary1/Make/files b/applications/test/PtrDictionary1/Make/files new file mode 100644 index 0000000000..9ced445619 --- /dev/null +++ b/applications/test/PtrDictionary1/Make/files @@ -0,0 +1,3 @@ +Test-PtrDictionary1.C + +EXE = $(FOAM_USER_APPBIN)/Test-PtrDictionary1 diff --git a/applications/test/Dictionary/Make/options b/applications/test/PtrDictionary1/Make/options similarity index 100% rename from applications/test/Dictionary/Make/options rename to applications/test/PtrDictionary1/Make/options diff --git a/applications/test/Dictionary/Test-Dictionary.C b/applications/test/PtrDictionary1/Test-PtrDictionary1.C similarity index 98% rename from applications/test/Dictionary/Test-Dictionary.C rename to applications/test/PtrDictionary1/Test-PtrDictionary1.C index fae3a14337..3f407568bc 100644 --- a/applications/test/Dictionary/Test-Dictionary.C +++ b/applications/test/PtrDictionary1/Test-PtrDictionary1.C @@ -25,10 +25,10 @@ License along with OpenFOAM. If not, see . Application - Test-Dictionary + Test-PtrDictionary1 Description - Tests for Dictionary (not dictionary) + Tests for Dictionary (not dictionary) and PtrDictionary \*---------------------------------------------------------------------------*/ diff --git a/src/OpenFOAM/compat/Scalar.C b/src/OpenFOAM/compat/Scalar.C deleted file mode 100644 index 7cec1b4541..0000000000 --- a/src/OpenFOAM/compat/Scalar.C +++ /dev/null @@ -1 +0,0 @@ -#warning File removed - left for old dependency check only diff --git a/src/OpenFOAM/compat/Scalar.H b/src/OpenFOAM/compat/Scalar.H deleted file mode 100644 index 7cec1b4541..0000000000 --- a/src/OpenFOAM/compat/Scalar.H +++ /dev/null @@ -1 +0,0 @@ -#warning File removed - left for old dependency check only diff --git a/src/OpenFOAM/compat/Swap.H b/src/OpenFOAM/compat/Swap.H deleted file mode 100644 index b1817d8565..0000000000 --- a/src/OpenFOAM/compat/Swap.H +++ /dev/null @@ -1,10 +0,0 @@ -// Compatibility include. For v2112 and earlier - -#ifndef FoamCompat_Swap_H -#define FoamCompat_Swap_H - -#include "stdFoam.H" - -#endif - -// ************************************************************************* // diff --git a/src/OpenFOAM/compat/endian.H b/src/OpenFOAM/compat/endian.H deleted file mode 100644 index d173f7cc3d..0000000000 --- a/src/OpenFOAM/compat/endian.H +++ /dev/null @@ -1,11 +0,0 @@ -// ************************************************************************* // -// Compatibility include - -#ifndef FoamCompat_endian_H -#define FoamCompat_endian_H - -#include "foamEndian.H" - -#endif - -// ************************************************************************* // diff --git a/src/OpenFOAM/containers/Bits/PackedList/PackedListCore.H b/src/OpenFOAM/containers/Bits/PackedList/PackedListCore.H deleted file mode 100644 index 7cec1b4541..0000000000 --- a/src/OpenFOAM/containers/Bits/PackedList/PackedListCore.H +++ /dev/null @@ -1 +0,0 @@ -#warning File removed - left for old dependency check only diff --git a/src/OpenFOAM/containers/Dictionaries/Dictionary/Dictionary.C b/src/OpenFOAM/containers/Dictionaries/Dictionary/Dictionary.C deleted file mode 100644 index 7cec1b4541..0000000000 --- a/src/OpenFOAM/containers/Dictionaries/Dictionary/Dictionary.C +++ /dev/null @@ -1 +0,0 @@ -#warning File removed - left for old dependency check only diff --git a/src/OpenFOAM/containers/Dictionaries/PtrDictionary/PtrDictionary.H b/src/OpenFOAM/containers/Dictionaries/PtrDictionary.H similarity index 100% rename from src/OpenFOAM/containers/Dictionaries/PtrDictionary/PtrDictionary.H rename to src/OpenFOAM/containers/Dictionaries/PtrDictionary.H diff --git a/src/OpenFOAM/containers/Dictionaries/PtrListDictionary/PtrListDictionary.H b/src/OpenFOAM/containers/Dictionaries/PtrListDictionary.H similarity index 74% rename from src/OpenFOAM/containers/Dictionaries/PtrListDictionary/PtrListDictionary.H rename to src/OpenFOAM/containers/Dictionaries/PtrListDictionary.H index 9660e5c0e6..ed5bdc7d01 100644 --- a/src/OpenFOAM/containers/Dictionaries/PtrListDictionary/PtrListDictionary.H +++ b/src/OpenFOAM/containers/Dictionaries/PtrListDictionary.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015-2016 OpenFOAM Foundation + Copyright (C) 2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -65,30 +66,60 @@ public: // Constructors + //- Default construct: empty without allocation (capacity=0). + PtrListDictionary() = default; + //- Construct given initial list size - explicit PtrListDictionary(const label size); + explicit PtrListDictionary(const label len) + { + dict_type(2*len); + PtrList::resize(len); + } //- Copy construct - PtrListDictionary(const PtrListDictionary& dict); + PtrListDictionary(const PtrListDictionary& dict) = default; //- Construct from Istream using given Istream constructor class template - PtrListDictionary(Istream& is, const INew& inew); + PtrListDictionary(Istream& is, const INew& inew) + : + dict_type(is, inew) + {} //- Construct from Istream - explicit PtrListDictionary(Istream& is); + explicit PtrListDictionary(Istream& is) + : + dict_type(is) + {} - // Member functions + // Member Functions //- Set element to pointer provided and return old element - autoPtr set(const label i, const word& key, T* ptr); + autoPtr set(const label i, const word& key, T* ptr) + { + autoPtr old(PtrList::set(i, ptr)); + + if (!dict_type::addHashEntry(key, ptr)) + { + FatalErrorInFunction + << "Cannot insert '" << key << "' into hash-table" + << Foam::abort(FatalError); + } + return old; + } //- Set element to autoPtr value provided and return old element - autoPtr set(const label i, const word& key, autoPtr& ptr); + autoPtr set(const label i, const word& key, autoPtr& ptr) + { + return this->set(i, key, ptr.release()); + } //- Set element to tmp value provided and return old element - autoPtr set(const label i, const word& key, tmp& ptr); + autoPtr set(const label i, const word& key, tmp& ptr) + { + return this->set(i, key, ptr.ptr()); // release or clone + } // Member Operators @@ -115,12 +146,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifdef NoRepository - #include "PtrListDictionary.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/src/OpenFOAM/containers/Dictionaries/PtrListDictionary/PtrListDictionary.C b/src/OpenFOAM/containers/Dictionaries/PtrListDictionary/PtrListDictionary.C deleted file mode 100644 index e42946da7d..0000000000 --- a/src/OpenFOAM/containers/Dictionaries/PtrListDictionary/PtrListDictionary.C +++ /dev/null @@ -1,110 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | www.openfoam.com - \\/ M anipulation | -------------------------------------------------------------------------------- - Copyright (C) 2015 OpenFOAM Foundation -------------------------------------------------------------------------------- -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 . - -\*---------------------------------------------------------------------------*/ - -#include "PtrListDictionary.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::PtrListDictionary::PtrListDictionary(const label size) -: - dict_type(2*size) -{ - PtrList::resize(size); -} - - -template -Foam::PtrListDictionary::PtrListDictionary(const PtrListDictionary& dict) -: - dict_type(dict) -{} - - -template -template -Foam::PtrListDictionary::PtrListDictionary(Istream& is, const INew& iNew) -: - dict_type(is, iNew) -{} - - -template -Foam::PtrListDictionary::PtrListDictionary(Istream& is) -: - dict_type(is) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -inline Foam::autoPtr Foam::PtrListDictionary::set -( - const label i, - const word& key, - T* ptr -) -{ - autoPtr old(PtrList::set(i, ptr)); - - if (!dict_type::addHashEntry(key, ptr)) - { - FatalErrorInFunction - << "Cannot insert with key '" << key << "' into hash-table" - << abort(FatalError); - } - - return old; -} - - -template -inline Foam::autoPtr Foam::PtrListDictionary::set -( - const label i, - const word& key, - autoPtr& ptr -) -{ - return this->set(i, key, ptr.release()); -} - - -template -inline Foam::autoPtr Foam::PtrListDictionary::set -( - const label i, - const word& key, - tmp& ptr -) -{ - return this->set(i, key, ptr.ptr()); // release or clone -} - - -// ************************************************************************* // diff --git a/src/OpenFOAM/containers/Dictionaries/UDictionary/UDictionary.H b/src/OpenFOAM/containers/Dictionaries/UDictionary.H similarity index 100% rename from src/OpenFOAM/containers/Dictionaries/UDictionary/UDictionary.H rename to src/OpenFOAM/containers/Dictionaries/UDictionary.H diff --git a/src/OpenFOAM/containers/Dictionaries/UPtrDictionary/UPtrDictionary.H b/src/OpenFOAM/containers/Dictionaries/UPtrDictionary.H similarity index 100% rename from src/OpenFOAM/containers/Dictionaries/UPtrDictionary/UPtrDictionary.H rename to src/OpenFOAM/containers/Dictionaries/UPtrDictionary.H diff --git a/src/OpenFOAM/containers/Identifiers/LabelledItem/LabelledItem.H b/src/OpenFOAM/containers/Identifiers/LabelledItem/LabelledItem.H index aae274df6d..5e06be94dd 100644 --- a/src/OpenFOAM/containers/Identifiers/LabelledItem/LabelledItem.H +++ b/src/OpenFOAM/containers/Identifiers/LabelledItem/LabelledItem.H @@ -36,7 +36,6 @@ SeeAlso Foam::PointIndexHit SourceFiles - LabelledItemI.H \*---------------------------------------------------------------------------*/ diff --git a/src/OpenFOAM/meshes/primitiveShapes/objectHit/compat/PointHit.H b/src/OpenFOAM/meshes/primitiveShapes/objectHit/compat/PointHit.H deleted file mode 100644 index 66ac51fad3..0000000000 --- a/src/OpenFOAM/meshes/primitiveShapes/objectHit/compat/PointHit.H +++ /dev/null @@ -1,11 +0,0 @@ -// Compatibility include. -// PointHit template combined into pointHit.H (OCT-2022) - -#ifndef FoamCompat_PointHit_H -#define FoamCompat_PointHit_H - -#include "pointHit.H" - -#endif - -// ************************************************************************* // diff --git a/src/OpenFOAM/meshes/primitiveShapes/objectHit/compat/PointIndexHit.H b/src/OpenFOAM/meshes/primitiveShapes/objectHit/compat/PointIndexHit.H deleted file mode 100644 index 1d0930d8e1..0000000000 --- a/src/OpenFOAM/meshes/primitiveShapes/objectHit/compat/PointIndexHit.H +++ /dev/null @@ -1,11 +0,0 @@ -// Compatibility include. -// PointIndexHit template combined into pointIndexHit.H (OCT-2022) - -#ifndef FoamCompat_PointIndexHit_H -#define FoamCompat_PointIndexHit_H - -#include "pointIndexHit.H" - -#endif - -// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/ranges/scalarRange/scalarRangesI.H b/src/OpenFOAM/primitives/ranges/scalarRange/scalarRangesI.H deleted file mode 100644 index 7cec1b4541..0000000000 --- a/src/OpenFOAM/primitives/ranges/scalarRange/scalarRangesI.H +++ /dev/null @@ -1 +0,0 @@ -#warning File removed - left for old dependency check only diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Gravity/GravityForceI.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Gravity/GravityForceI.H deleted file mode 100644 index 7cec1b4541..0000000000 --- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Gravity/GravityForceI.H +++ /dev/null @@ -1 +0,0 @@ -#warning File removed - left for old dependency check only diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/NonInertialFrame/NonInertialFrameForceI.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/NonInertialFrame/NonInertialFrameForceI.H deleted file mode 100644 index 7cec1b4541..0000000000 --- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/NonInertialFrame/NonInertialFrameForceI.H +++ /dev/null @@ -1 +0,0 @@ -#warning File removed - left for old dependency check only diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Paramagnetic/ParamagneticForceI.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Paramagnetic/ParamagneticForceI.H deleted file mode 100644 index 7cec1b4541..0000000000 --- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Paramagnetic/ParamagneticForceI.H +++ /dev/null @@ -1 +0,0 @@ -#warning File removed - left for old dependency check only diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceI.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceI.H deleted file mode 100644 index 7cec1b4541..0000000000 --- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceI.H +++ /dev/null @@ -1 +0,0 @@ -#warning File removed - left for old dependency check only diff --git a/src/lagrangian/solidParticle/solidParticleCloudI.H b/src/lagrangian/solidParticle/solidParticleCloudI.H deleted file mode 100644 index 7cec1b4541..0000000000 --- a/src/lagrangian/solidParticle/solidParticleCloudI.H +++ /dev/null @@ -1 +0,0 @@ -#warning File removed - left for old dependency check only diff --git a/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForceI.H b/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForceI.H deleted file mode 100644 index 7cec1b4541..0000000000 --- a/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForceI.H +++ /dev/null @@ -1 +0,0 @@ -#warning File removed - left for old dependency check only