diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C index c92380c989c52f029d0f8a5bb8c3c53ae7d93a9e..ca0e6216e891c15671aa624e67ea92ad721cfe4e 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C @@ -48,10 +48,11 @@ Foam::cyclicFvPatchField<Type>::cyclicFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF, - const dictionary& dict + const dictionary& dict, + const bool valueRequired ) : - coupledFvPatchField<Type>(p, iF, dict, false), + coupledFvPatchField<Type>(p, iF, dict, false), // Pass no valueRequired cyclicPatch_(refCast<const cyclicFvPatch>(p, dict)) { if (!isA<cyclicFvPatch>(p)) @@ -65,7 +66,10 @@ Foam::cyclicFvPatchField<Type>::cyclicFvPatchField << exit(FatalIOError); } - this->evaluate(Pstream::commsTypes::blocking); + if (valueRequired) + { + this->evaluate(Pstream::commsTypes::blocking); + } } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H index 86db576441275bf794a87fb3866e3cf4066f3c27..1678a23251bc4104c7c0ef4a00e443ea27ff4f82 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H @@ -111,7 +111,8 @@ public: ( const fvPatch&, const DimensionedField<Type, volMesh>&, - const dictionary& + const dictionary&, + const bool valueRequired = true ); //- Construct by mapping given cyclicFvPatchField onto a new patch diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C index b078d1dc10d5939682b24768a184409bd8d87eab..312829ed0d7e862ac4097a3ac82c67beec7edda8 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -59,10 +59,11 @@ Foam::jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF, - const dictionary& dict + const dictionary& dict, + const bool valueRequired ) : - cyclicFvPatchField<Type>(p, iF, dict) + cyclicFvPatchField<Type>(p, iF, dict, valueRequired) { // Call this evaluation in derived classes //this->evaluate(Pstream::commsTypes::blocking); diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.H index 431d61aa73eec1a6d947e83ff6c1ac98c662633e..0b0425b1cc6afd9f5c94bf3d347dbf8785bd620e 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.H @@ -82,7 +82,8 @@ public: ( const fvPatch&, const DimensionedField<Type, volMesh>&, - const dictionary& + const dictionary&, + const bool valueRequired = true ); //- Construct by mapping given jumpCyclicFvPatchField onto a new patch diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C index 58a98012952b79885a66964a48d8e0248c070847..0054c3def60aab662adc59fd30f2c0a6a4dc1f4c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation - Copyright (C) 2017-2020 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -67,7 +67,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField const dictionary& dict ) : - uniformJumpFvPatchField<Type>(p, iF, dict), + uniformJumpFvPatchField<Type>(p, iF, dict, false), // Pass no valueRequired phiName_(dict.getOrDefault<word>("phi", "phi")), rhoName_(dict.getOrDefault<word>("rho", "rho")), uniformJump_(dict.getOrDefault("uniformJump", false)), @@ -75,11 +75,29 @@ Foam::fanFvPatchField<Type>::fanFvPatchField rpm_(0), dm_(0) { + // Note that we've not read jumpTable_ etc if (nonDimensional_) { dict.readEntry("rpm", rpm_); dict.readEntry("dm", dm_); } + + if (this->cyclicPatch().owner()) + { + this->jumpTable_ = Function1<Type>::New("jumpTable", dict); + } + + if (dict.found("value")) + { + fvPatchField<Type>::operator= + ( + Field<Type>("value", dict, p.size()) + ); + } + else + { + this->evaluate(Pstream::commsTypes::blocking); + } } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H index 5abbc3545fe84d975d7f3d86b10383c0ba8ebe96..261f572b18f1c3e965e15b74817ab9b3abdaa06f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H @@ -240,14 +240,6 @@ public: template<> void fanFvPatchField<scalar>::calcFanJump(); -template<> -fanFvPatchField<scalar>::fanFvPatchField -( - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const dictionary& -); - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C index 53ec3fac7f612a07b0941e085bc5683a56101560..219864267ab8dea3dce64eb6f19fd5cbd8c40405 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C @@ -86,49 +86,6 @@ void Foam::fanFvPatchField<Foam::scalar>::calcFanJump() } -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<> -Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const dictionary& dict -) -: - uniformJumpFvPatchField<scalar>(p, iF, dict), - phiName_(dict.getOrDefault<word>("phi", "phi")), - rhoName_(dict.getOrDefault<word>("rho", "rho")), - uniformJump_(dict.getOrDefault("uniformJump", false)), - nonDimensional_(dict.getOrDefault("nonDimensional", false)), - rpm_(0), - dm_(0) -{ - if (nonDimensional_) - { - dict.readEntry("rpm", rpm_); - dict.readEntry("dm", dm_); - } - - if (this->cyclicPatch().owner()) - { - this->jumpTable_ = Function1<scalar>::New("jumpTable", dict); - } - - if (dict.found("value")) - { - fvPatchScalarField::operator= - ( - scalarField("value", dict, p.size()) - ); - } - else - { - this->evaluate(Pstream::commsTypes::blocking); - } -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C index d96fe62121335dc6f94de1ea0f5e4f4bce19927c..f25df2e4b06a29b243cf2be661ec394aa522e8fa 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C @@ -69,10 +69,11 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF, - const dictionary& dict + const dictionary& dict, + const bool valueRequired ) : - jumpCyclicFvPatchField<Type>(p, iF, dict), + jumpCyclicFvPatchField<Type>(p, iF, dict, false), // Pass no valueRequired jump_(p.size(), Zero), jump0_(p.size(), Zero), minJump_(dict.getOrDefault<Type>("minJump", pTraits<Type>::min)), @@ -81,7 +82,10 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField { if (this->cyclicPatch().owner()) { - jump_ = Field<Type>("jump", dict, p.size()); + if (valueRequired) + { + jump_ = Field<Type>("jump", dict, p.size()); + } if (dict.found("jump0")) { @@ -89,16 +93,19 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField } } - if (dict.found("value")) - { - fvPatchField<Type>::operator= - ( - Field<Type>("value", dict, p.size()) - ); - } - else + if (valueRequired) { - this->evaluate(Pstream::commsTypes::blocking); + if (dict.found("value")) + { + fvPatchField<Type>::operator= + ( + Field<Type>("value", dict, p.size()) + ); + } + else + { + this->evaluate(Pstream::commsTypes::blocking); + } } } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H index 8c5470782f523850d455846c6b20c904dd869e77..ee758e59283a7a0536bac1221d68270b2bab5b7b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H @@ -127,7 +127,8 @@ public: ( const fvPatch&, const DimensionedField<Type, volMesh>&, - const dictionary& + const dictionary&, + const bool valueRequired = true ); //- Construct by mapping given fixedJumpFvPatchField onto a diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C index 75758640834b61990e897521b0b43c1259dbb648..06ff6d907eaf543f282443e4aa4acdfa68ea2217 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C @@ -60,27 +60,31 @@ Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF, - const dictionary& dict + const dictionary& dict, + const bool valueRequired ) : - fixedJumpFvPatchField<Type>(p, iF, dict), + fixedJumpFvPatchField<Type>(p, iF, dict, false), // Pass no valueRequired jumpTable_() { - if (this->cyclicPatch().owner()) - { - jumpTable_ = Function1<Type>::New("jumpTable", dict); - } - - if (dict.found("value")) - { - fvPatchField<Type>::operator= - ( - Field<Type>("value", dict, p.size()) - ); - } - else + if (valueRequired) { - this->evaluate(Pstream::commsTypes::blocking); + if (this->cyclicPatch().owner()) + { + jumpTable_ = Function1<Type>::New("jumpTable", dict); + } + + if (dict.found("value")) + { + fvPatchField<Type>::operator= + ( + Field<Type>("value", dict, p.size()) + ); + } + else + { + this->evaluate(Pstream::commsTypes::blocking); + } } } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H index a68add222c93678676a22394153490ce021962e5..f54cc9139c565e6db98b68e7b025f3167aacd7e4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H @@ -117,7 +117,8 @@ public: ( const fvPatch&, const DimensionedField<Type, volMesh>&, - const dictionary& + const dictionary&, + const bool valueRequired = true ); //- Construct by mapping given uniformJumpFvPatchField onto a diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/faceAreaWeightAMI/faceAreaWeightAMI.C b/src/meshTools/AMIInterpolation/AMIInterpolation/faceAreaWeightAMI/faceAreaWeightAMI.C index 395b1830f49d26b5268b3573950ff3b23c2d78b0..6163d56812fe3736442985494bfff9b7e01798d9 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/faceAreaWeightAMI/faceAreaWeightAMI.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/faceAreaWeightAMI/faceAreaWeightAMI.C @@ -38,6 +38,17 @@ namespace Foam defineTypeNameAndDebug(faceAreaWeightAMI, 0); addToRunTimeSelectionTable(AMIInterpolation, faceAreaWeightAMI, dict); addToRunTimeSelectionTable(AMIInterpolation, faceAreaWeightAMI, component); + + // Backwards compatibility for pre v2106 versions + // - partialFaceAreaWeightAMI deprecated in v2106 + addNamedToRunTimeSelectionTable + ( + AMIInterpolation, + faceAreaWeightAMI, + dict, + partialFaceAreaWeightAMI + ); + } // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //