STYLE: use data/cdata instead of begin when accessing raw content

This commit is contained in:
Mark Olesen 2020-02-21 12:32:12 +01:00
parent a054f31857
commit 3c9c39e92a
11 changed files with 52 additions and 51 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -313,7 +313,7 @@ void Foam::Pstream::listCombineGather
(
UPstream::commsTypes::scheduled,
belowID,
reinterpret_cast<char*>(receivedValues.begin()),
reinterpret_cast<char*>(receivedValues.data()),
receivedValues.byteSize(),
tag,
comm
@ -370,7 +370,7 @@ void Foam::Pstream::listCombineGather
(
UPstream::commsTypes::scheduled,
myComm.above(),
reinterpret_cast<const char*>(Values.begin()),
reinterpret_cast<const char*>(Values.cdata()),
Values.byteSize(),
tag,
comm
@ -450,7 +450,7 @@ void Foam::Pstream::listCombineScatter
(
UPstream::commsTypes::scheduled,
myComm.above(),
reinterpret_cast<char*>(Values.begin()),
reinterpret_cast<char*>(Values.data()),
Values.byteSize(),
tag,
comm
@ -492,7 +492,7 @@ void Foam::Pstream::listCombineScatter
(
UPstream::commsTypes::scheduled,
belowID,
reinterpret_cast<const char*>(Values.begin()),
reinterpret_cast<const char*>(Values.cdata()),
Values.byteSize(),
tag,
comm

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2019 OpenCFD Ltd.
Copyright (C) 2015-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -84,7 +84,7 @@ void Pstream::gatherList
(
UPstream::commsTypes::scheduled,
belowID,
reinterpret_cast<char*>(receivedValues.begin()),
reinterpret_cast<char*>(receivedValues.data()),
receivedValues.byteSize(),
tag,
comm
@ -160,7 +160,7 @@ void Pstream::gatherList
(
UPstream::commsTypes::scheduled,
myComm.above(),
reinterpret_cast<const char*>(sendingValues.begin()),
reinterpret_cast<const char*>(sendingValues.cdata()),
sendingValues.byteSize(),
tag,
comm
@ -246,7 +246,7 @@ void Pstream::scatterList
(
UPstream::commsTypes::scheduled,
myComm.above(),
reinterpret_cast<char*>(receivedValues.begin()),
reinterpret_cast<char*>(receivedValues.data()),
receivedValues.byteSize(),
tag,
comm
@ -302,7 +302,7 @@ void Pstream::scatterList
(
UPstream::commsTypes::scheduled,
belowID,
reinterpret_cast<const char*>(sendingValues.begin()),
reinterpret_cast<const char*>(sendingValues.cdata()),
sendingValues.byteSize(),
tag,
comm

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -122,7 +123,7 @@ void Foam::processorCyclicPointPatchField<Type>::initSwapAddSeparated
(
commsType,
procPatch_.neighbProcNo(),
reinterpret_cast<char*>(receiveBuf_.begin()),
reinterpret_cast<char*>(receiveBuf_.data()),
receiveBuf_.byteSize(),
procPatch_.tag(),
procPatch_.comm()
@ -132,7 +133,7 @@ void Foam::processorCyclicPointPatchField<Type>::initSwapAddSeparated
(
commsType,
procPatch_.neighbProcNo(),
reinterpret_cast<const char*>(pf.begin()),
reinterpret_cast<const char*>(pf.cdata()),
pf.byteSize(),
procPatch_.tag(),
procPatch_.comm()
@ -158,7 +159,7 @@ void Foam::processorCyclicPointPatchField<Type>::swapAddSeparated
(
commsType,
procPatch_.neighbProcNo(),
reinterpret_cast<char*>(receiveBuf_.begin()),
reinterpret_cast<char*>(receiveBuf_.data()),
receiveBuf_.byteSize(),
procPatch_.tag(),
procPatch_.comm()

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2018 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -465,7 +465,7 @@ bool Foam::OFstreamCollator::write
(
UPstream::commsTypes::nonBlocking,
proci,
reinterpret_cast<char*>(slaveData[proci].begin()),
reinterpret_cast<char*>(slaveData[proci].data()),
slaveData[proci].byteSize(),
Pstream::msgType(),
localComm_
@ -480,7 +480,7 @@ bool Foam::OFstreamCollator::write
(
UPstream::commsTypes::nonBlocking,
0,
reinterpret_cast<const char*>(slice.begin()),
reinterpret_cast<const char*>(slice.cdata()),
slice.byteSize(),
Pstream::msgType(),
localComm_

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -112,7 +112,7 @@ void Foam::processorGAMGInterfaceField::initInterfaceMatrixUpdate
(
Pstream::commsTypes::nonBlocking,
procInterface_.neighbProcNo(),
reinterpret_cast<char*>(scalarReceiveBuf_.begin()),
reinterpret_cast<char*>(scalarReceiveBuf_.data()),
scalarReceiveBuf_.byteSize(),
procInterface_.tag(),
comm()
@ -123,7 +123,7 @@ void Foam::processorGAMGInterfaceField::initInterfaceMatrixUpdate
(
Pstream::commsTypes::nonBlocking,
procInterface_.neighbProcNo(),
reinterpret_cast<const char*>(scalarSendBuf_.begin()),
reinterpret_cast<const char*>(scalarSendBuf_.cdata()),
scalarSendBuf_.byteSize(),
procInterface_.tag(),
comm()

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -65,7 +65,7 @@ void Foam::globalIndex::gather
(
commsType,
procIDs[i],
reinterpret_cast<char*>(procSlot.begin()),
reinterpret_cast<char*>(procSlot.data()),
procSlot.byteSize(),
tag,
comm
@ -107,7 +107,7 @@ void Foam::globalIndex::gather
(
commsType,
procIDs[i],
reinterpret_cast<char*>(procSlot.begin()),
reinterpret_cast<char*>(procSlot.data()),
procSlot.byteSize(),
tag,
comm
@ -132,7 +132,7 @@ void Foam::globalIndex::gather
(
commsType,
procIDs[0],
reinterpret_cast<const char*>(fld.begin()),
reinterpret_cast<const char*>(fld.cdata()),
fld.byteSize(),
tag,
comm
@ -169,7 +169,7 @@ void Foam::globalIndex::gather
(
commsType,
procIDs[0],
reinterpret_cast<const char*>(fld.begin()),
reinterpret_cast<const char*>(fld.cdata()),
fld.byteSize(),
tag,
comm
@ -318,7 +318,7 @@ void Foam::globalIndex::scatter
(
commsType,
procIDs[i],
reinterpret_cast<const char*>(procSlot.begin()),
reinterpret_cast<const char*>(procSlot.cdata()),
procSlot.byteSize(),
tag,
comm
@ -365,7 +365,7 @@ void Foam::globalIndex::scatter
(
commsType,
procIDs[i],
reinterpret_cast<const char*>(procSlot.begin()),
reinterpret_cast<const char*>(procSlot.cdata()),
procSlot.byteSize(),
tag,
comm
@ -390,7 +390,7 @@ void Foam::globalIndex::scatter
(
commsType,
procIDs[0],
reinterpret_cast<char*>(fld.begin()),
reinterpret_cast<char*>(fld.data()),
fld.byteSize(),
tag,
comm
@ -427,7 +427,7 @@ void Foam::globalIndex::scatter
(
commsType,
procIDs[0],
reinterpret_cast<char*>(fld.begin()),
reinterpret_cast<char*>(fld.data()),
fld.byteSize(),
tag,
comm

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015-2017 OpenFOAM Foundation
Copyright (C) 2015-2019 OpenCFD Ltd.
Copyright (C) 2015-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -909,7 +909,7 @@ void Foam::mapDistributeBase::compact(const boolList& elemIsUsed, const int tag)
(
Pstream::commsTypes::nonBlocking,
domain,
reinterpret_cast<char*>(recvFields[domain].begin()),
reinterpret_cast<char*>(recvFields[domain].data()),
recvFields[domain].size()*sizeof(bool),
tag
);
@ -942,7 +942,7 @@ void Foam::mapDistributeBase::compact(const boolList& elemIsUsed, const int tag)
(
Pstream::commsTypes::nonBlocking,
domain,
reinterpret_cast<const char*>(subField.begin()),
reinterpret_cast<const char*>(subField.cdata()),
subField.size()*sizeof(bool),
tag
);
@ -1076,7 +1076,7 @@ void Foam::mapDistributeBase::compact
(
Pstream::commsTypes::nonBlocking,
domain,
reinterpret_cast<char*>(recvFields[domain].begin()),
reinterpret_cast<char*>(recvFields[domain].data()),
recvFields[domain].size()*sizeof(bool),
tag
);
@ -1108,7 +1108,7 @@ void Foam::mapDistributeBase::compact
(
Pstream::commsTypes::nonBlocking,
domain,
reinterpret_cast<const char*>(subField.begin()),
reinterpret_cast<const char*>(subField.cdata()),
subField.size()*sizeof(bool),
tag
);

View File

@ -513,7 +513,7 @@ void Foam::mapDistributeBase::distribute
(
Pstream::commsTypes::nonBlocking,
domain,
reinterpret_cast<const char*>(subField.begin()),
reinterpret_cast<const char*>(subField.cdata()),
subField.byteSize(),
tag
);
@ -535,7 +535,7 @@ void Foam::mapDistributeBase::distribute
(
Pstream::commsTypes::nonBlocking,
domain,
reinterpret_cast<char*>(recvFields[domain].begin()),
reinterpret_cast<char*>(recvFields[domain].data()),
recvFields[domain].byteSize(),
tag
);
@ -1014,7 +1014,7 @@ void Foam::mapDistributeBase::distribute
(
Pstream::commsTypes::nonBlocking,
domain,
reinterpret_cast<const char*>(subField.begin()),
reinterpret_cast<const char*>(subField.cdata()),
subField.size()*sizeof(T),
tag
);
@ -1036,7 +1036,7 @@ void Foam::mapDistributeBase::distribute
(
Pstream::commsTypes::nonBlocking,
domain,
reinterpret_cast<char*>(recvFields[domain].begin()),
reinterpret_cast<char*>(recvFields[domain].data()),
recvFields[domain].size()*sizeof(T),
tag
);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -1089,7 +1089,7 @@ void Foam::faMesh::calcPointAreaNormals() const
(
Pstream::commsTypes::blocking,
procPatch.neighbProcNo(),
reinterpret_cast<const char*>(patchPointNormals.begin()),
reinterpret_cast<const char*>(patchPointNormals.cdata()),
patchPointNormals.byteSize()
);
}
@ -1105,7 +1105,7 @@ void Foam::faMesh::calcPointAreaNormals() const
(
Pstream::commsTypes::blocking,
procPatch.neighbProcNo(),
reinterpret_cast<char*>(ngbPatchPointNormals.begin()),
reinterpret_cast<char*>(ngbPatchPointNormals.data()),
ngbPatchPointNormals.byteSize()
);
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -232,7 +232,7 @@ void Foam::processorFvPatchField<Type>::initEvaluate
(
Pstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
reinterpret_cast<char*>(this->begin()),
reinterpret_cast<char*>(this->data()),
this->byteSize(),
procPatch_.tag(),
procPatch_.comm()
@ -243,8 +243,8 @@ void Foam::processorFvPatchField<Type>::initEvaluate
(
Pstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
reinterpret_cast<const char*>(sendBuf_.begin()),
this->byteSize(),
reinterpret_cast<const char*>(sendBuf_.cdata()),
sendBuf_.byteSize(),
procPatch_.tag(),
procPatch_.comm()
);
@ -343,7 +343,7 @@ void Foam::processorFvPatchField<Type>::initInterfaceMatrixUpdate
(
Pstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
reinterpret_cast<char*>(scalarReceiveBuf_.begin()),
reinterpret_cast<char*>(scalarReceiveBuf_.data()),
scalarReceiveBuf_.byteSize(),
procPatch_.tag(),
procPatch_.comm()
@ -354,7 +354,7 @@ void Foam::processorFvPatchField<Type>::initInterfaceMatrixUpdate
(
Pstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
reinterpret_cast<const char*>(scalarSendBuf_.begin()),
reinterpret_cast<const char*>(scalarSendBuf_.cdata()),
scalarSendBuf_.byteSize(),
procPatch_.tag(),
procPatch_.comm()
@ -473,7 +473,7 @@ void Foam::processorFvPatchField<Type>::initInterfaceMatrixUpdate
(
Pstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
reinterpret_cast<char*>(receiveBuf_.begin()),
reinterpret_cast<char*>(receiveBuf_.data()),
receiveBuf_.byteSize(),
procPatch_.tag(),
procPatch_.comm()
@ -484,7 +484,7 @@ void Foam::processorFvPatchField<Type>::initInterfaceMatrixUpdate
(
Pstream::commsTypes::nonBlocking,
procPatch_.neighbProcNo(),
reinterpret_cast<const char*>(sendBuf_.begin()),
reinterpret_cast<const char*>(sendBuf_.cdata()),
sendBuf_.byteSize(),
procPatch_.tag(),
procPatch_.comm()

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -113,7 +113,7 @@ void Foam::calculatedProcessorGAMGInterfaceField::initInterfaceMatrixUpdate
(
Pstream::commsTypes::nonBlocking,
procInterface_.neighbProcNo(),
reinterpret_cast<char*>(scalarReceiveBuf_.begin()),
reinterpret_cast<char*>(scalarReceiveBuf_.data()),
scalarReceiveBuf_.byteSize(),
procInterface_.tag(),
comm()
@ -124,7 +124,7 @@ void Foam::calculatedProcessorGAMGInterfaceField::initInterfaceMatrixUpdate
(
Pstream::commsTypes::nonBlocking,
procInterface_.neighbProcNo(),
reinterpret_cast<const char*>(scalarSendBuf_.begin()),
reinterpret_cast<const char*>(scalarSendBuf_.cdata()),
scalarSendBuf_.byteSize(),
procInterface_.tag(),
comm()