diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 1041f6e9c1b8f2d08fce09775e78d6a8ae94904b..b2f3dc0a8e6c64b0f8fbbf82e2d5bdf5696b3617 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -129,7 +129,6 @@ $(constraintFvPatchFields)/jumpCyclic/jumpCyclicFvPatchFields.C $(constraintFvPatchFields)/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.C $(constraintFvPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchFields.C $(constraintFvPatchFields)/processor/processorFvPatchFields.C -$(constraintFvPatchFields)/processor/processorFvPatchScalarField.C $(constraintFvPatchFields)/processorCyclic/processorCyclicFvPatchFields.C $(constraintFvPatchFields)/symmetryPlane/symmetryPlaneFvPatchFields.C $(constraintFvPatchFields)/symmetryPlane/symmetryPlaneFvPatchScalarField.C diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.C index 8d21dbb76f590e622b85402cd0c4eec85d85603d..1ebb924dec5ff4888df80f4deb265763f125535d 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -402,11 +402,13 @@ void Foam::processorFvPatchField<Type>::updateInterfaceMatrix // Recv finished so assume sending finished as well. outstandingSendRequest_ = -1; outstandingRecvRequest_ = -1; - // Consume straight from scalarReceiveBuf_ - // Transform according to the transformation tensor - transformCoupleField(scalarReceiveBuf_, cmpt); + if (!std::is_arithmetic<Type>::value) + { + // Transform non-scalar data according to the transformation tensor + transformCoupleField(scalarReceiveBuf_, cmpt); + } // Multiply the field by coefficients and add into the result this->addToInternalField(result, !add, coeffs, scalarReceiveBuf_); @@ -418,8 +420,11 @@ void Foam::processorFvPatchField<Type>::updateInterfaceMatrix procPatch_.compressedReceive<scalar>(commsType, this->size())() ); - // Transform according to the transformation tensor - transformCoupleField(pnf, cmpt); + if (!std::is_arithmetic<Type>::value) + { + // Transform non-scalar data according to the transformation tensor + transformCoupleField(pnf, cmpt); + } // Multiply the field by coefficients and add into the result this->addToInternalField(result, !add, coeffs, pnf); diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchFields.H index ab072a061c0097d3ced53438afa57206734d0a4f..b6e2a72b614c94e612c08e1be2a228ebb8aaedb0 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchFields.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011 OpenFOAM Foundation @@ -28,7 +28,7 @@ License #ifndef processorFvPatchFields_H #define processorFvPatchFields_H -#include "processorFvPatchScalarField.H" +#include "processorFvPatchField.H" #include "fieldTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchScalarField.C deleted file mode 100644 index bb539453b9fbee8234d9fee31ab3e773239bdf9e..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchScalarField.C +++ /dev/null @@ -1,146 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010, 2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2011-2017 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 <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "processorFvPatchScalarField.H" - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template<> -void Foam::processorFvPatchField<Foam::scalar>::initInterfaceMatrixUpdate -( - scalarField&, - const bool add, - const scalarField& psiInternal, - const scalarField&, - const direction, - const Pstream::commsTypes commsType -) const -{ - this->patch().patchInternalField(psiInternal, scalarSendBuf_); - - if - ( - commsType == Pstream::commsTypes::nonBlocking - && !Pstream::floatTransfer - ) - { - // Fast path. - if (debug && !this->ready()) - { - FatalErrorInFunction - << "On patch " << procPatch_.name() - << " outstanding request." - << abort(FatalError); - } - - - scalarReceiveBuf_.setSize(scalarSendBuf_.size()); - outstandingRecvRequest_ = UPstream::nRequests(); - UIPstream::read - ( - Pstream::commsTypes::nonBlocking, - procPatch_.neighbProcNo(), - reinterpret_cast<char*>(scalarReceiveBuf_.begin()), - scalarReceiveBuf_.byteSize(), - procPatch_.tag(), - procPatch_.comm() - ); - - outstandingSendRequest_ = UPstream::nRequests(); - UOPstream::write - ( - Pstream::commsTypes::nonBlocking, - procPatch_.neighbProcNo(), - reinterpret_cast<const char*>(scalarSendBuf_.begin()), - scalarSendBuf_.byteSize(), - procPatch_.tag(), - procPatch_.comm() - ); - } - else - { - procPatch_.compressedSend(commsType, scalarSendBuf_); - } - - const_cast<processorFvPatchField<scalar>&>(*this).updatedMatrix() = false; -} - - -template<> -void Foam::processorFvPatchField<Foam::scalar>::updateInterfaceMatrix -( - scalarField& result, - const bool add, - const scalarField&, - const scalarField& coeffs, - const direction, - const Pstream::commsTypes commsType -) const -{ - if (this->updatedMatrix()) - { - return; - } - - if - ( - commsType == Pstream::commsTypes::nonBlocking - && !Pstream::floatTransfer - ) - { - // Fast path. - if - ( - outstandingRecvRequest_ >= 0 - && outstandingRecvRequest_ < Pstream::nRequests() - ) - { - UPstream::waitRequest(outstandingRecvRequest_); - } - // Recv finished so assume sending finished as well. - outstandingSendRequest_ = -1; - outstandingRecvRequest_ = -1; - - - // Consume straight from scalarReceiveBuf_ - this->addToInternalField(result, !add, coeffs, scalarReceiveBuf_); - } - else - { - scalarField pnf - ( - procPatch_.compressedReceive<scalar>(commsType, this->size())() - ); - - this->addToInternalField(result, !add, coeffs, pnf); - } - - const_cast<processorFvPatchField<scalar>&>(*this).updatedMatrix() = true; -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchScalarField.H deleted file mode 100644 index c4dcf408de4cdf98673b2404e6676dda6adeecbe..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchScalarField.H +++ /dev/null @@ -1,73 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2011-2012 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 <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#ifndef processorFvPatchScalarField_H -#define processorFvPatchScalarField_H - -#include "processorFvPatchField.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template<> -void processorFvPatchField<scalar>::initInterfaceMatrixUpdate -( - scalarField&, - const bool add, - const scalarField&, - const scalarField&, - const direction, - const Pstream::commsTypes commsType -) const; - - -template<> -void processorFvPatchField<scalar>::updateInterfaceMatrix -( - scalarField& result, - const bool add, - const scalarField&, - const scalarField& coeffs, - const direction, - const Pstream::commsTypes commsType -) const; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* //