From 3c9c39e92a794614e6c4cad1f706f64c2b6f7620 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 21 Feb 2020 12:32:12 +0100 Subject: [PATCH] STYLE: use data/cdata instead of begin when accessing raw content --- .../IOstreams/Pstreams/combineGatherScatter.C | 10 +++++----- .../db/IOstreams/Pstreams/gatherScatterList.C | 10 +++++----- .../processorCyclicPointPatchField.C | 7 ++++--- .../collatedFileOperation/OFstreamCollator.C | 6 +++--- .../processorGAMGInterfaceField.C | 6 +++--- .../globalMeshData/globalIndexTemplates.C | 18 +++++++++--------- .../mapDistribute/mapDistributeBase.C | 10 +++++----- .../mapDistribute/mapDistributeBaseTemplates.C | 8 ++++---- src/finiteArea/faMesh/faMeshDemandDrivenData.C | 6 +++--- .../processor/processorFvPatchField.C | 16 ++++++++-------- .../calculatedProcessorGAMGInterfaceField.C | 6 +++--- 11 files changed, 52 insertions(+), 51 deletions(-) diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/combineGatherScatter.C b/src/OpenFOAM/db/IOstreams/Pstreams/combineGatherScatter.C index 1aaa1bd63d..da30e43862 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/combineGatherScatter.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/combineGatherScatter.C @@ -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(receivedValues.begin()), + reinterpret_cast(receivedValues.data()), receivedValues.byteSize(), tag, comm @@ -370,7 +370,7 @@ void Foam::Pstream::listCombineGather ( UPstream::commsTypes::scheduled, myComm.above(), - reinterpret_cast(Values.begin()), + reinterpret_cast(Values.cdata()), Values.byteSize(), tag, comm @@ -450,7 +450,7 @@ void Foam::Pstream::listCombineScatter ( UPstream::commsTypes::scheduled, myComm.above(), - reinterpret_cast(Values.begin()), + reinterpret_cast(Values.data()), Values.byteSize(), tag, comm @@ -492,7 +492,7 @@ void Foam::Pstream::listCombineScatter ( UPstream::commsTypes::scheduled, belowID, - reinterpret_cast(Values.begin()), + reinterpret_cast(Values.cdata()), Values.byteSize(), tag, comm diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/gatherScatterList.C b/src/OpenFOAM/db/IOstreams/Pstreams/gatherScatterList.C index 23ea0490be..5e392eba3b 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/gatherScatterList.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/gatherScatterList.C @@ -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(receivedValues.begin()), + reinterpret_cast(receivedValues.data()), receivedValues.byteSize(), tag, comm @@ -160,7 +160,7 @@ void Pstream::gatherList ( UPstream::commsTypes::scheduled, myComm.above(), - reinterpret_cast(sendingValues.begin()), + reinterpret_cast(sendingValues.cdata()), sendingValues.byteSize(), tag, comm @@ -246,7 +246,7 @@ void Pstream::scatterList ( UPstream::commsTypes::scheduled, myComm.above(), - reinterpret_cast(receivedValues.begin()), + reinterpret_cast(receivedValues.data()), receivedValues.byteSize(), tag, comm @@ -302,7 +302,7 @@ void Pstream::scatterList ( UPstream::commsTypes::scheduled, belowID, - reinterpret_cast(sendingValues.begin()), + reinterpret_cast(sendingValues.cdata()), sendingValues.byteSize(), tag, comm diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C index 3ff44c3349..118b720c70 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C @@ -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::initSwapAddSeparated ( commsType, procPatch_.neighbProcNo(), - reinterpret_cast(receiveBuf_.begin()), + reinterpret_cast(receiveBuf_.data()), receiveBuf_.byteSize(), procPatch_.tag(), procPatch_.comm() @@ -132,7 +133,7 @@ void Foam::processorCyclicPointPatchField::initSwapAddSeparated ( commsType, procPatch_.neighbProcNo(), - reinterpret_cast(pf.begin()), + reinterpret_cast(pf.cdata()), pf.byteSize(), procPatch_.tag(), procPatch_.comm() @@ -158,7 +159,7 @@ void Foam::processorCyclicPointPatchField::swapAddSeparated ( commsType, procPatch_.neighbProcNo(), - reinterpret_cast(receiveBuf_.begin()), + reinterpret_cast(receiveBuf_.data()), receiveBuf_.byteSize(), procPatch_.tag(), procPatch_.comm() diff --git a/src/OpenFOAM/global/fileOperations/collatedFileOperation/OFstreamCollator.C b/src/OpenFOAM/global/fileOperations/collatedFileOperation/OFstreamCollator.C index be8f95370a..5fd2e3f69d 100644 --- a/src/OpenFOAM/global/fileOperations/collatedFileOperation/OFstreamCollator.C +++ b/src/OpenFOAM/global/fileOperations/collatedFileOperation/OFstreamCollator.C @@ -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(slaveData[proci].begin()), + reinterpret_cast(slaveData[proci].data()), slaveData[proci].byteSize(), Pstream::msgType(), localComm_ @@ -480,7 +480,7 @@ bool Foam::OFstreamCollator::write ( UPstream::commsTypes::nonBlocking, 0, - reinterpret_cast(slice.begin()), + reinterpret_cast(slice.cdata()), slice.byteSize(), Pstream::msgType(), localComm_ diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.C index 4c0ad0d668..f72e69de5b 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.C @@ -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(scalarReceiveBuf_.begin()), + reinterpret_cast(scalarReceiveBuf_.data()), scalarReceiveBuf_.byteSize(), procInterface_.tag(), comm() @@ -123,7 +123,7 @@ void Foam::processorGAMGInterfaceField::initInterfaceMatrixUpdate ( Pstream::commsTypes::nonBlocking, procInterface_.neighbProcNo(), - reinterpret_cast(scalarSendBuf_.begin()), + reinterpret_cast(scalarSendBuf_.cdata()), scalarSendBuf_.byteSize(), procInterface_.tag(), comm() diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexTemplates.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexTemplates.C index c927b72597..7b995adfa6 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexTemplates.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexTemplates.C @@ -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(procSlot.begin()), + reinterpret_cast(procSlot.data()), procSlot.byteSize(), tag, comm @@ -107,7 +107,7 @@ void Foam::globalIndex::gather ( commsType, procIDs[i], - reinterpret_cast(procSlot.begin()), + reinterpret_cast(procSlot.data()), procSlot.byteSize(), tag, comm @@ -132,7 +132,7 @@ void Foam::globalIndex::gather ( commsType, procIDs[0], - reinterpret_cast(fld.begin()), + reinterpret_cast(fld.cdata()), fld.byteSize(), tag, comm @@ -169,7 +169,7 @@ void Foam::globalIndex::gather ( commsType, procIDs[0], - reinterpret_cast(fld.begin()), + reinterpret_cast(fld.cdata()), fld.byteSize(), tag, comm @@ -318,7 +318,7 @@ void Foam::globalIndex::scatter ( commsType, procIDs[i], - reinterpret_cast(procSlot.begin()), + reinterpret_cast(procSlot.cdata()), procSlot.byteSize(), tag, comm @@ -365,7 +365,7 @@ void Foam::globalIndex::scatter ( commsType, procIDs[i], - reinterpret_cast(procSlot.begin()), + reinterpret_cast(procSlot.cdata()), procSlot.byteSize(), tag, comm @@ -390,7 +390,7 @@ void Foam::globalIndex::scatter ( commsType, procIDs[0], - reinterpret_cast(fld.begin()), + reinterpret_cast(fld.data()), fld.byteSize(), tag, comm @@ -427,7 +427,7 @@ void Foam::globalIndex::scatter ( commsType, procIDs[0], - reinterpret_cast(fld.begin()), + reinterpret_cast(fld.data()), fld.byteSize(), tag, comm diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C index a5af2224a4..5eb53d4214 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C @@ -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(recvFields[domain].begin()), + reinterpret_cast(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(subField.begin()), + reinterpret_cast(subField.cdata()), subField.size()*sizeof(bool), tag ); @@ -1076,7 +1076,7 @@ void Foam::mapDistributeBase::compact ( Pstream::commsTypes::nonBlocking, domain, - reinterpret_cast(recvFields[domain].begin()), + reinterpret_cast(recvFields[domain].data()), recvFields[domain].size()*sizeof(bool), tag ); @@ -1108,7 +1108,7 @@ void Foam::mapDistributeBase::compact ( Pstream::commsTypes::nonBlocking, domain, - reinterpret_cast(subField.begin()), + reinterpret_cast(subField.cdata()), subField.size()*sizeof(bool), tag ); diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBaseTemplates.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBaseTemplates.C index 6f7aebf790..be48461a9f 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBaseTemplates.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBaseTemplates.C @@ -513,7 +513,7 @@ void Foam::mapDistributeBase::distribute ( Pstream::commsTypes::nonBlocking, domain, - reinterpret_cast(subField.begin()), + reinterpret_cast(subField.cdata()), subField.byteSize(), tag ); @@ -535,7 +535,7 @@ void Foam::mapDistributeBase::distribute ( Pstream::commsTypes::nonBlocking, domain, - reinterpret_cast(recvFields[domain].begin()), + reinterpret_cast(recvFields[domain].data()), recvFields[domain].byteSize(), tag ); @@ -1014,7 +1014,7 @@ void Foam::mapDistributeBase::distribute ( Pstream::commsTypes::nonBlocking, domain, - reinterpret_cast(subField.begin()), + reinterpret_cast(subField.cdata()), subField.size()*sizeof(T), tag ); @@ -1036,7 +1036,7 @@ void Foam::mapDistributeBase::distribute ( Pstream::commsTypes::nonBlocking, domain, - reinterpret_cast(recvFields[domain].begin()), + reinterpret_cast(recvFields[domain].data()), recvFields[domain].size()*sizeof(T), tag ); diff --git a/src/finiteArea/faMesh/faMeshDemandDrivenData.C b/src/finiteArea/faMesh/faMeshDemandDrivenData.C index b34a019db8..1c4f775c15 100644 --- a/src/finiteArea/faMesh/faMeshDemandDrivenData.C +++ b/src/finiteArea/faMesh/faMeshDemandDrivenData.C @@ -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(patchPointNormals.begin()), + reinterpret_cast(patchPointNormals.cdata()), patchPointNormals.byteSize() ); } @@ -1105,7 +1105,7 @@ void Foam::faMesh::calcPointAreaNormals() const ( Pstream::commsTypes::blocking, procPatch.neighbProcNo(), - reinterpret_cast(ngbPatchPointNormals.begin()), + reinterpret_cast(ngbPatchPointNormals.data()), ngbPatchPointNormals.byteSize() ); } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.C index 4b1b9697bd..195dcff8a6 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.C @@ -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::initEvaluate ( Pstream::commsTypes::nonBlocking, procPatch_.neighbProcNo(), - reinterpret_cast(this->begin()), + reinterpret_cast(this->data()), this->byteSize(), procPatch_.tag(), procPatch_.comm() @@ -243,8 +243,8 @@ void Foam::processorFvPatchField::initEvaluate ( Pstream::commsTypes::nonBlocking, procPatch_.neighbProcNo(), - reinterpret_cast(sendBuf_.begin()), - this->byteSize(), + reinterpret_cast(sendBuf_.cdata()), + sendBuf_.byteSize(), procPatch_.tag(), procPatch_.comm() ); @@ -343,7 +343,7 @@ void Foam::processorFvPatchField::initInterfaceMatrixUpdate ( Pstream::commsTypes::nonBlocking, procPatch_.neighbProcNo(), - reinterpret_cast(scalarReceiveBuf_.begin()), + reinterpret_cast(scalarReceiveBuf_.data()), scalarReceiveBuf_.byteSize(), procPatch_.tag(), procPatch_.comm() @@ -354,7 +354,7 @@ void Foam::processorFvPatchField::initInterfaceMatrixUpdate ( Pstream::commsTypes::nonBlocking, procPatch_.neighbProcNo(), - reinterpret_cast(scalarSendBuf_.begin()), + reinterpret_cast(scalarSendBuf_.cdata()), scalarSendBuf_.byteSize(), procPatch_.tag(), procPatch_.comm() @@ -473,7 +473,7 @@ void Foam::processorFvPatchField::initInterfaceMatrixUpdate ( Pstream::commsTypes::nonBlocking, procPatch_.neighbProcNo(), - reinterpret_cast(receiveBuf_.begin()), + reinterpret_cast(receiveBuf_.data()), receiveBuf_.byteSize(), procPatch_.tag(), procPatch_.comm() @@ -484,7 +484,7 @@ void Foam::processorFvPatchField::initInterfaceMatrixUpdate ( Pstream::commsTypes::nonBlocking, procPatch_.neighbProcNo(), - reinterpret_cast(sendBuf_.begin()), + reinterpret_cast(sendBuf_.cdata()), sendBuf_.byteSize(), procPatch_.tag(), procPatch_.comm() diff --git a/src/overset/lduPrimitiveProcessorInterface/GAMG/calculatedProcessorGAMGInterfaceField.C b/src/overset/lduPrimitiveProcessorInterface/GAMG/calculatedProcessorGAMGInterfaceField.C index 8fb182201a..daef9e63c9 100644 --- a/src/overset/lduPrimitiveProcessorInterface/GAMG/calculatedProcessorGAMGInterfaceField.C +++ b/src/overset/lduPrimitiveProcessorInterface/GAMG/calculatedProcessorGAMGInterfaceField.C @@ -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(scalarReceiveBuf_.begin()), + reinterpret_cast(scalarReceiveBuf_.data()), scalarReceiveBuf_.byteSize(), procInterface_.tag(), comm() @@ -124,7 +124,7 @@ void Foam::calculatedProcessorGAMGInterfaceField::initInterfaceMatrixUpdate ( Pstream::commsTypes::nonBlocking, procInterface_.neighbProcNo(), - reinterpret_cast(scalarSendBuf_.begin()), + reinterpret_cast(scalarSendBuf_.cdata()), scalarSendBuf_.byteSize(), procInterface_.tag(), comm()