From 1a86fe8471ddd902aeddb612b2300825298dae30 Mon Sep 17 00:00:00 2001 From: mattijs <mattijs> Date: Mon, 29 Apr 2019 14:23:05 +0100 Subject: [PATCH] COMP: label64: fixes #1297. --- .../test/globalIndex/Test-globalIndex.C | 2 +- modules/avalanche | 2 +- modules/catalyst | 2 +- .../polyMesh/globalMeshData/globalIndex.H | 24 +++++++++---------- .../globalMeshData/globalIndexTemplates.C | 18 +++++++------- .../primitives/ranges/sliceRange/sliceRange.C | 4 ++-- .../ranges/sliceRange/sliceRangeI.H | 4 ++-- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/applications/test/globalIndex/Test-globalIndex.C b/applications/test/globalIndex/Test-globalIndex.C index d6785e8f640..fb48e6b52ec 100644 --- a/applications/test/globalIndex/Test-globalIndex.C +++ b/applications/test/globalIndex/Test-globalIndex.C @@ -173,7 +173,7 @@ int main(int argc, char *argv[]) DynamicList<label> globalIDs; for (label i = 0; i < 100; i++) { - globalIDs.append(rndGen.position(0, nTotalCells-1)); + globalIDs.append(rndGen.position(label(0), nTotalCells-1)); } // Get the cell centres at those cell indices diff --git a/modules/avalanche b/modules/avalanche index 3e147ba27a5..fdf0f40d7a2 160000 --- a/modules/avalanche +++ b/modules/avalanche @@ -1 +1 @@ -Subproject commit 3e147ba27a59e6dc008c7d32cbebfd29f58b5a36 +Subproject commit fdf0f40d7a24c7b08c255ba2ee05ecbb847cc264 diff --git a/modules/catalyst b/modules/catalyst index de0f98f42f1..566968cae35 160000 --- a/modules/catalyst +++ b/modules/catalyst @@ -1 +1 @@ -Subproject commit de0f98f42f1c6fd648689fb10176657e3ff4e87c +Subproject commit 566968cae355bd15bdfcc133a04c886af604075f diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H index 33216edf3c1..d61cd5b4920 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H @@ -226,12 +226,12 @@ public: //- Collect data in processor order on master (== procIDs[0]). // Needs offsets only on master. - template<class Type> + template<class Container, class Type> static void gather ( const labelUList& offsets, const label comm, - const labelList& procIDs, + const Container& procIDs, const UList<Type>& fld, List<Type>& allFld, const int tag = UPstream::msgType(), @@ -241,11 +241,11 @@ public: //- Collect data in processor order on master (== procIDs[0]). // Needs offsets only on master. - template<class Type> + template<class Container, class Type> void gather ( const label comm, - const labelList& procIDs, + const Container& procIDs, const UList<Type>& fld, List<Type>& allFld, const int tag = UPstream::msgType(), @@ -283,12 +283,12 @@ public: //- Inplace collect in processor order on master (== procIDs[0]). //- Needs offsets only on master. - template<class Type> + template<class Container, class Type> static void gather ( const labelUList& offsets, const label comm, - const labelList& procIDs, + const Container& procIDs, List<Type>& fld, const int tag = UPstream::msgType(), const Pstream::commsTypes commsType = @@ -297,11 +297,11 @@ public: //- Inplace collect in processor order on master (== procIDs[0]). //- Needs offsets only on master. - template<class Type> + template<class Container, class Type> void gather ( const label comm, - const labelList& procIDs, + const Container& procIDs, List<Type>& fld, const int tag = UPstream::msgType(), const Pstream::commsTypes commsType = @@ -337,12 +337,12 @@ public: //- Distribute data in processor order. Requires fld to be sized! - template<class Type> + template<class Container, class Type> static void scatter ( const labelUList& offsets, const label comm, - const labelList& procIDs, + const Container& procIDs, const UList<Type>& allFld, UList<Type>& fld, const int tag = UPstream::msgType(), @@ -351,11 +351,11 @@ public: ); //- Distribute data in processor order. Requires fld to be sized! - template<class Type> + template<class Container, class Type> void scatter ( const label comm, - const labelList& procIDs, + const Container& procIDs, const UList<Type>& allFld, UList<Type>& fld, const int tag = UPstream::msgType(), diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexTemplates.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexTemplates.C index 67eb12d02d5..752f32bfbfe 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexTemplates.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexTemplates.C @@ -29,12 +29,12 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template<class Type> +template<class Container, class Type> void Foam::globalIndex::gather ( const labelUList& off, const label comm, - const labelList& procIDs, + const Container& procIDs, const UList<Type>& fld, List<Type>& allFld, const int tag, @@ -193,7 +193,7 @@ void Foam::globalIndex::gather gather ( UPstream::worldComm, - identity(Pstream::nProcs(UPstream::worldComm)), + UPstream::procID(UPstream::worldComm), fld, allFld, tag, @@ -215,12 +215,12 @@ void Foam::globalIndex::gatherOp } -template<class Type> +template<class Container, class Type> void Foam::globalIndex::gather ( const labelUList& off, const label comm, - const labelList& procIDs, + const Container& procIDs, List<Type>& fld, const int tag, const Pstream::commsTypes commsType @@ -250,7 +250,7 @@ void Foam::globalIndex::gather gather ( UPstream::worldComm, - identity(Pstream::master(UPstream::worldComm)), + UPstream::procID(UPstream::worldComm), fld, allFld, tag, @@ -280,12 +280,12 @@ void Foam::globalIndex::gatherOp } -template<class Type> +template<class Container, class Type> void Foam::globalIndex::scatter ( const labelUList& off, const label comm, - const labelList& procIDs, + const Container& procIDs, const UList<Type>& allFld, UList<Type>& fld, const int tag, @@ -452,7 +452,7 @@ void Foam::globalIndex::scatter ( offsets_, UPstream::worldComm, - identity(Pstream::nProcs(UPstream::worldComm)), + UPstream::procID(UPstream::worldComm), allFld, fld, tag, diff --git a/src/OpenFOAM/primitives/ranges/sliceRange/sliceRange.C b/src/OpenFOAM/primitives/ranges/sliceRange/sliceRange.C index 0a39749b267..d297f8fed6e 100644 --- a/src/OpenFOAM/primitives/ranges/sliceRange/sliceRange.C +++ b/src/OpenFOAM/primitives/ranges/sliceRange/sliceRange.C @@ -34,8 +34,8 @@ License Foam::sliceRange::sliceRange(const FixedList<label,3>& coeffs) : start_(coeffs[0]), - size_(std::max(0,coeffs[1])), // No negative size - stride_(std::max(0,coeffs[2])) // No negative stride + size_(std::max(label(0),coeffs[1])), // No negative size + stride_(std::max(label(0),coeffs[2])) // No negative stride {} diff --git a/src/OpenFOAM/primitives/ranges/sliceRange/sliceRangeI.H b/src/OpenFOAM/primitives/ranges/sliceRange/sliceRangeI.H index e5d8780c5b7..e4982921f7d 100644 --- a/src/OpenFOAM/primitives/ranges/sliceRange/sliceRangeI.H +++ b/src/OpenFOAM/primitives/ranges/sliceRange/sliceRangeI.H @@ -43,8 +43,8 @@ inline Foam::sliceRange::sliceRange ) noexcept : start_(start), - size_(std::max(0,size)), // No negative size - stride_(std::max(0,stride)) // No negative stride + size_(std::max(label(0),size)), // No negative size + stride_(std::max(label(0),stride)) // No negative stride {} -- GitLab