COMP: label64: fixes #1297.

This commit is contained in:
mattijs
2019-04-29 14:23:05 +01:00
committed by Andrew Heather
parent 897528da1a
commit 25e0182fca
7 changed files with 28 additions and 28 deletions

View File

@ -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

View File

@ -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(),

View File

@ -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,

View File

@ -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
{}

View File

@ -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
{}