diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C index aeb380ee89..98b422876f 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C @@ -781,41 +781,24 @@ alphatWallBoilingWallFunctionFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void alphatWallBoilingWallFunctionFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedValueFvPatchScalarField::autoMap(m); - - m(wetFraction_, wetFraction_); - m(dDeparture_, dDeparture_); - m(fDeparture_, fDeparture_); - m(nucleationSiteDensity_, nucleationSiteDensity_); - m(qQuenching_, qQuenching_); - m(qEvaporative_, qEvaporative_); - m(dmdtf_, dmdtf_); -} - - -void alphatWallBoilingWallFunctionFvPatchScalarField::rmap +void alphatWallBoilingWallFunctionFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fixedValueFvPatchScalarField::rmap(ptf, addr); + fixedValueFvPatchScalarField::map(ptf, mapper); const alphatWallBoilingWallFunctionFvPatchScalarField& tiptf = refCast(ptf); - wetFraction_.rmap(tiptf.wetFraction_, addr); - dDeparture_.rmap(tiptf.dDeparture_, addr); - fDeparture_.rmap(tiptf.fDeparture_, addr); - nucleationSiteDensity_.rmap(tiptf.nucleationSiteDensity_, addr); - qQuenching_.rmap(tiptf.qQuenching_, addr); - qEvaporative_.rmap(tiptf.qEvaporative_, addr); - dmdtf_.rmap(tiptf.dmdtf_, addr); + mapper(wetFraction_, tiptf.wetFraction_); + mapper(dDeparture_, tiptf.dDeparture_); + mapper(fDeparture_, tiptf.fDeparture_); + mapper(nucleationSiteDensity_, tiptf.nucleationSiteDensity_); + mapper(qQuenching_, tiptf.qQuenching_); + mapper(qEvaporative_, tiptf.qEvaporative_); + mapper(dmdtf_, tiptf.dmdtf_); } diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H index 879e2c9615..04d5893c6d 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseThermophysicalTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H @@ -400,13 +400,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/applications/solvers/modules/shockFluid/derivedFvPatchFields/T/smoluchowskiJumpTFvPatchScalarField.C b/applications/solvers/modules/shockFluid/derivedFvPatchFields/T/smoluchowskiJumpTFvPatchScalarField.C index 32f506e703..3559f9910e 100644 --- a/applications/solvers/modules/shockFluid/derivedFvPatchFields/T/smoluchowskiJumpTFvPatchScalarField.C +++ b/applications/solvers/modules/shockFluid/derivedFvPatchFields/T/smoluchowskiJumpTFvPatchScalarField.C @@ -135,28 +135,18 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::smoluchowskiJumpTFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - mixedFvPatchScalarField::autoMap(m); - m(Twall_, Twall_); -} - - -void Foam::smoluchowskiJumpTFvPatchScalarField::rmap +void Foam::smoluchowskiJumpTFvPatchScalarField::map ( const fvPatchField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - mixedFvPatchField::rmap(ptf, addr); + mixedFvPatchField::map(ptf, mapper); const smoluchowskiJumpTFvPatchScalarField& ptpsf = refCast(ptf); - Twall_.rmap(ptpsf.Twall_, addr); + mapper(Twall_, ptpsf.Twall_); } diff --git a/applications/solvers/modules/shockFluid/derivedFvPatchFields/T/smoluchowskiJumpTFvPatchScalarField.H b/applications/solvers/modules/shockFluid/derivedFvPatchFields/T/smoluchowskiJumpTFvPatchScalarField.H index 30bf9f946e..27983b35f8 100644 --- a/applications/solvers/modules/shockFluid/derivedFvPatchFields/T/smoluchowskiJumpTFvPatchScalarField.H +++ b/applications/solvers/modules/shockFluid/derivedFvPatchFields/T/smoluchowskiJumpTFvPatchScalarField.H @@ -131,13 +131,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/applications/solvers/modules/shockFluid/derivedFvPatchFields/U/maxwellSlipUFvPatchVectorField.C b/applications/solvers/modules/shockFluid/derivedFvPatchFields/U/maxwellSlipUFvPatchVectorField.C index 4a7a2a302f..b7042c6115 100644 --- a/applications/solvers/modules/shockFluid/derivedFvPatchFields/U/maxwellSlipUFvPatchVectorField.C +++ b/applications/solvers/modules/shockFluid/derivedFvPatchFields/U/maxwellSlipUFvPatchVectorField.C @@ -143,28 +143,18 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::maxwellSlipUFvPatchVectorField::autoMap -( - const fvPatchFieldMapper& m -) -{ - mixedFixedValueSlipFvPatchVectorField::autoMap(m); - m(Uwall_, Uwall_); -} - - -void Foam::maxwellSlipUFvPatchVectorField::rmap +void Foam::maxwellSlipUFvPatchVectorField::map ( const fvPatchVectorField& pvf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - mixedFixedValueSlipFvPatchVectorField::rmap(pvf, addr); + mixedFixedValueSlipFvPatchVectorField::map(pvf, mapper); const maxwellSlipUFvPatchVectorField& mspvf = refCast(pvf); - Uwall_.rmap(mspvf.Uwall_, addr); + mapper(Uwall_, mspvf.Uwall_); } diff --git a/applications/solvers/modules/shockFluid/derivedFvPatchFields/U/maxwellSlipUFvPatchVectorField.H b/applications/solvers/modules/shockFluid/derivedFvPatchFields/U/maxwellSlipUFvPatchVectorField.H index 69e6b842b4..714f783f24 100644 --- a/applications/solvers/modules/shockFluid/derivedFvPatchFields/U/maxwellSlipUFvPatchVectorField.H +++ b/applications/solvers/modules/shockFluid/derivedFvPatchFields/U/maxwellSlipUFvPatchVectorField.H @@ -136,13 +136,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchVectorField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchVectorField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/applications/solvers/modules/shockFluid/derivedFvPatchFields/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C b/applications/solvers/modules/shockFluid/derivedFvPatchFields/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C index 825c640f2f..9835c09ff8 100644 --- a/applications/solvers/modules/shockFluid/derivedFvPatchFields/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C +++ b/applications/solvers/modules/shockFluid/derivedFvPatchFields/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C @@ -86,31 +86,19 @@ Foam::mixedFixedValueSlipFvPatchField::mixedFixedValueSlipFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::mixedFixedValueSlipFvPatchField::autoMap -( - const fvPatchFieldMapper& m -) -{ - m(*this, *this); - m(refValue_, refValue_); - m(valueFraction_, valueFraction_); -} - - -template -void Foam::mixedFixedValueSlipFvPatchField::rmap +void Foam::mixedFixedValueSlipFvPatchField::map ( const fvPatchField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - transformFvPatchField::rmap(ptf, addr); + transformFvPatchField::map(ptf, mapper); const mixedFixedValueSlipFvPatchField& dmptf = refCast>(ptf); - refValue_.rmap(dmptf.refValue_, addr); - valueFraction_.rmap(dmptf.valueFraction_, addr); + mapper(refValue_, dmptf.refValue_); + mapper(valueFraction_, dmptf.valueFraction_); } diff --git a/applications/solvers/modules/shockFluid/derivedFvPatchFields/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.H b/applications/solvers/modules/shockFluid/derivedFvPatchFields/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.H index aa4646761f..3f0a1a5070 100644 --- a/applications/solvers/modules/shockFluid/derivedFvPatchFields/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.H +++ b/applications/solvers/modules/shockFluid/derivedFvPatchFields/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.H @@ -85,7 +85,7 @@ public: ); //- Construct by mapping given mixedFixedValueSlipFvPatchField - //- Onto a new patch + // onto a new patch mixedFixedValueSlipFvPatchField ( const mixedFixedValueSlipFvPatchField&, @@ -132,13 +132,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/applications/solvers/modules/solidDisplacement/derivedFvPatchFields/tractionDisplacement/tractionDisplacementFvPatchVectorField.C b/applications/solvers/modules/solidDisplacement/derivedFvPatchFields/tractionDisplacement/tractionDisplacementFvPatchVectorField.C index 34b2668d5b..20623fee51 100644 --- a/applications/solvers/modules/solidDisplacement/derivedFvPatchFields/tractionDisplacement/tractionDisplacementFvPatchVectorField.C +++ b/applications/solvers/modules/solidDisplacement/derivedFvPatchFields/tractionDisplacement/tractionDisplacementFvPatchVectorField.C @@ -91,28 +91,18 @@ tractionDisplacementFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::tractionDisplacementFvPatchVectorField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedGradientFvPatchVectorField::autoMap(m); - m(traction_, traction_); -} - - -void Foam::tractionDisplacementFvPatchVectorField::rmap +void Foam::tractionDisplacementFvPatchVectorField::map ( const fvPatchVectorField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fixedGradientFvPatchVectorField::rmap(ptf, addr); + fixedGradientFvPatchVectorField::map(ptf, mapper); const tractionDisplacementFvPatchVectorField& dmptf = refCast(ptf); - traction_.rmap(dmptf.traction_, addr); + mapper(traction_, dmptf.traction_); } diff --git a/applications/solvers/modules/solidDisplacement/derivedFvPatchFields/tractionDisplacement/tractionDisplacementFvPatchVectorField.H b/applications/solvers/modules/solidDisplacement/derivedFvPatchFields/tractionDisplacement/tractionDisplacementFvPatchVectorField.H index f373dcd07b..fb5694999c 100644 --- a/applications/solvers/modules/solidDisplacement/derivedFvPatchFields/tractionDisplacement/tractionDisplacementFvPatchVectorField.H +++ b/applications/solvers/modules/solidDisplacement/derivedFvPatchFields/tractionDisplacement/tractionDisplacementFvPatchVectorField.H @@ -141,13 +141,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchVectorField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchVectorField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/applications/utilities/parallelProcessing/reconstructPar/fvFieldReconstructor.H b/applications/utilities/parallelProcessing/reconstructPar/fvFieldReconstructor.H index 436a92fef5..7fb34138fc 100644 --- a/applications/utilities/parallelProcessing/reconstructPar/fvFieldReconstructor.H +++ b/applications/utilities/parallelProcessing/reconstructPar/fvFieldReconstructor.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,7 +40,7 @@ SourceFiles #include "surfaceFields.H" #include "IOobjectList.H" #include "fvPatchFieldMapper.H" -#include "setSizeFieldMapper.H" +#include "setSizeFvPatchFieldMapper.H" #include "labelIOList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -93,24 +93,6 @@ class fvFieldReconstructor public: - //- Mapper for sizing only - does not do any actual mapping. - class fvPatchFieldReconstructor - : - public fvPatchFieldMapper, - public setSizeFieldMapper - { - public: - - // Constructors - - //- Construct given size - fvPatchFieldReconstructor(const label size) - : - setSizeFieldMapper(size) - {} - }; - - // Constructors //- Construct from components diff --git a/applications/utilities/parallelProcessing/reconstructPar/fvFieldReconstructorReconstructFields.C b/applications/utilities/parallelProcessing/reconstructPar/fvFieldReconstructorReconstructFields.C index bbba9cb97f..f55765dbf3 100644 --- a/applications/utilities/parallelProcessing/reconstructPar/fvFieldReconstructorReconstructFields.C +++ b/applications/utilities/parallelProcessing/reconstructPar/fvFieldReconstructorReconstructFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,6 +31,7 @@ License #include "emptyFvPatchField.H" #include "emptyFvsPatchField.H" #include "processorCyclicFvPatch.H" +#include "reverseFvPatchFieldMapper.H" #include "stringOps.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -183,7 +184,7 @@ Foam::fvFieldReconstructor::reconstructFvVolumeField procField.boundaryField()[procPatchi], completeMesh_.boundary()[completePatchi], DimensionedField::null(), - fvPatchFieldReconstructor + setSizeFvPatchFieldMapper ( completeMesh_.boundary()[completePatchi].size() ) @@ -191,10 +192,13 @@ Foam::fvFieldReconstructor::reconstructFvVolumeField ); } - patchFields[completePatchi].rmap + patchFields[completePatchi].map ( procField.boundaryField()[procPatchi], - faceProcAddressingBf_[proci][procPatchi] - 1 + reverseFvPatchFieldMapper + ( + faceProcAddressingBf_[proci][procPatchi] - 1 + ) ); } else if (isA(procPatch)) @@ -230,10 +234,13 @@ Foam::fvFieldReconstructor::reconstructFvVolumeField << exit(FatalError); } - patchFields[completePatchi].rmap + patchFields[completePatchi].map ( procField.boundaryField()[procPatchi], - faceProcAddressingBf_[proci][procPatchi] - 1 + reverseFvPatchFieldMapper + ( + faceProcAddressingBf_[proci][procPatchi] - 1 + ) ); } } @@ -353,7 +360,7 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField procField.boundaryField()[procPatchi], completeMesh_.boundary()[completePatchi], DimensionedField::null(), - fvPatchFieldReconstructor + setSizeFvPatchFieldMapper ( completeMesh_.boundary()[completePatchi].size() ) @@ -361,10 +368,13 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField ); } - patchFields[completePatchi].rmap + patchFields[completePatchi].map ( procField.boundaryField()[procPatchi], - faceProcAddressingBf_[proci][procPatchi] - 1 + reverseFvPatchFieldMapper + ( + faceProcAddressingBf_[proci][procPatchi] - 1 + ) ); } else if (isA(procPatch)) @@ -383,10 +393,13 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField ); } - patchFields[completePatchi].rmap + patchFields[completePatchi].map ( procField.boundaryField()[procPatchi], - faceProcAddressingBf_[proci][procPatchi] - 1 + reverseFvPatchFieldMapper + ( + faceProcAddressingBf_[proci][procPatchi] - 1 + ) ); } else if (isA(procPatch)) diff --git a/applications/utilities/parallelProcessing/reconstructPar/pointFieldReconstructor.H b/applications/utilities/parallelProcessing/reconstructPar/pointFieldReconstructor.H index 33ee725bd5..6f3d282282 100644 --- a/applications/utilities/parallelProcessing/reconstructPar/pointFieldReconstructor.H +++ b/applications/utilities/parallelProcessing/reconstructPar/pointFieldReconstructor.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,7 @@ SourceFiles #include "pointMesh.H" #include "pointFields.H" #include "pointPatchFieldMapper.H" -#include "setSizeFieldMapper.H" +#include "setSizePointPatchFieldMapper.H" #include "IOobjectList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -74,24 +74,6 @@ class pointFieldReconstructor public: - //- Mapper for sizing only - does not do any actual mapping. - class pointPatchFieldReconstructor - : - public pointPatchFieldMapper, - public setSizeFieldMapper - { - public: - - // Constructors - - //- Construct given size - pointPatchFieldReconstructor(const label size) - : - setSizeFieldMapper(size) - {} - }; - - // Constructors //- Construct from components diff --git a/applications/utilities/parallelProcessing/reconstructPar/pointFieldReconstructorReconstructFields.C b/applications/utilities/parallelProcessing/reconstructPar/pointFieldReconstructorReconstructFields.C index aa2c7e2ea0..7d5bd3a87e 100644 --- a/applications/utilities/parallelProcessing/reconstructPar/pointFieldReconstructorReconstructFields.C +++ b/applications/utilities/parallelProcessing/reconstructPar/pointFieldReconstructorReconstructFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ License #include "pointFieldReconstructor.H" #include "fvMesh.H" +#include "reversePointPatchFieldMapper.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -93,14 +94,15 @@ Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject) { if (!patchFields(curBPatch)) { - patchFields.set( + patchFields.set + ( curBPatch, pointPatchField::New ( procField.boundaryField()[patchi], completeMesh_.boundary()[curBPatch], DimensionedField::null(), - pointPatchFieldReconstructor + setSizePointPatchFieldMapper ( completeMesh_.boundary()[curBPatch].size() ) @@ -108,10 +110,13 @@ Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject) ); } - patchFields[curBPatch].rmap + patchFields[curBPatch].map ( procField.boundaryField()[patchi], - patchPointAddressing_[proci][patchi] + reversePointPatchFieldMapper + ( + patchPointAddressing_[proci][patchi] + ) ); } } diff --git a/etc/codeTemplates/BC/BC.C b/etc/codeTemplates/BC/BC.C index 0cbe170448..fafbb47787 100644 --- a/etc/codeTemplates/BC/BC.C +++ b/etc/codeTemplates/BC/BC.C @@ -143,29 +143,18 @@ CONSTRUCT // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::CLASS::autoMap -( - const fvPatchFieldMapper& m -) -{ - PARENT::autoMap(m); - m(fieldData_, fieldData_); -} - - -template -void Foam::CLASS::rmap +void Foam::CLASS::map ( const FVPATCHF& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - PARENT::rmap(ptf, addr); + PARENT::map(ptf, mapper); const CLASS& tiptf = refCast(ptf); - fieldData_.rmap(tiptf.fieldData_, addr); + mapper(fieldData_, tiptf.fieldData_); } diff --git a/etc/codeTemplates/BC/BC.H b/etc/codeTemplates/BC/BC.H index 7f4cbda482..619e224a5a 100644 --- a/etc/codeTemplates/BC/BC.H +++ b/etc/codeTemplates/BC/BC.H @@ -191,13 +191,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const FVPATCHF&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const FVPATCHF&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C index 25a07e411e..0b316e6d01 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -262,30 +262,19 @@ nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void nutURoughWallFunctionFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - nutUWallFunctionFvPatchScalarField::autoMap(m); - m(Ks_, Ks_); - m(Cs_, Cs_); -} - - -void nutURoughWallFunctionFvPatchScalarField::rmap +void nutURoughWallFunctionFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - nutUWallFunctionFvPatchScalarField::rmap(ptf, addr); + nutUWallFunctionFvPatchScalarField::map(ptf, mapper); const nutURoughWallFunctionFvPatchScalarField& nrwfpsf = refCast(ptf); - Ks_.rmap(nrwfpsf.Ks_, addr); - Cs_.rmap(nrwfpsf.Cs_, addr); + mapper(Ks_, nrwfpsf.Ks_); + mapper(Cs_, nrwfpsf.Cs_); } diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H index dd9b1ab792..6c93cafa00 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -197,14 +197,11 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - virtual void rmap + //- Map the given fvPatchField onto this fvPatchField + virtual void map ( const fvPatchScalarField&, - const labelList& + const fvPatchFieldMapper& ); //- Reset the fvPatchField to the given fvPatchField diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C index d2225ab581..6bf8574e0b 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -179,30 +179,19 @@ nutkRoughWallFunctionFvPatchScalarField::nutkRoughWallFunctionFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void nutkRoughWallFunctionFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - nutkWallFunctionFvPatchScalarField::autoMap(m); - m(Ks_, Ks_); - m(Cs_, Cs_); -} - - -void nutkRoughWallFunctionFvPatchScalarField::rmap +void nutkRoughWallFunctionFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - nutkWallFunctionFvPatchScalarField::rmap(ptf, addr); + nutkWallFunctionFvPatchScalarField::map(ptf, mapper); const nutkRoughWallFunctionFvPatchScalarField& nrwfpsf = refCast(ptf); - Ks_.rmap(nrwfpsf.Ks_, addr); - Cs_.rmap(nrwfpsf.Cs_, addr); + mapper(Ks_, nrwfpsf.Ks_); + mapper(Cs_, nrwfpsf.Cs_); } diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H index af297bb56c..f19a5c5272 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -201,14 +201,11 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - virtual void rmap + //- Map the given fvPatchField onto this fvPatchField + virtual void map ( const fvPatchScalarField&, - const labelList& + const fvPatchFieldMapper& ); //- Reset the fvPatchField to the given fvPatchField diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 807ef1c633..07a9ba76d5 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -640,7 +640,9 @@ fields/UniformGeometricFields/uniformGeometricFields.C Fields = fields/Fields $(Fields)/fieldMappers/directFieldMapper/directFieldMapper.C +$(Fields)/fieldMappers/identityFieldMapper/identityFieldMapper.C $(Fields)/fieldMappers/generalFieldMapper/generalFieldMapper.C +$(Fields)/fieldMappers/reverseFieldMapper/reverseFieldMapper.C $(Fields)/fieldMappers/setSizeFieldMapper/setSizeFieldMapper.C $(Fields)/labelField/labelField.C $(Fields)/scalarField/scalarField.C diff --git a/src/OpenFOAM/fields/Fields/fieldMappers/identityFieldMapper/identityFieldMapper.C b/src/OpenFOAM/fields/Fields/fieldMappers/identityFieldMapper/identityFieldMapper.C new file mode 100644 index 0000000000..10f0b200e3 --- /dev/null +++ b/src/OpenFOAM/fields/Fields/fieldMappers/identityFieldMapper/identityFieldMapper.C @@ -0,0 +1,36 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +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 . + +\*---------------------------------------------------------------------------*/ + +#include "identityFieldMapper.H" + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +FOR_ALL_FIELD_TYPES(IMPLEMENT_FIELD_MAPPER_OPERATOR, identityFieldMapper) + + +IMPLEMENT_FIELD_MAPPER_OPERATOR(label, identityFieldMapper) + + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/fieldMappers/identityFieldMapper/identityFieldMapper.H b/src/OpenFOAM/fields/Fields/fieldMappers/identityFieldMapper/identityFieldMapper.H new file mode 100644 index 0000000000..9efb1f24fe --- /dev/null +++ b/src/OpenFOAM/fields/Fields/fieldMappers/identityFieldMapper/identityFieldMapper.H @@ -0,0 +1,107 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +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 . + +Class + Foam::identityFieldMapper + +Description + Identity field mapper + +\*---------------------------------------------------------------------------*/ + +#ifndef identityFieldMapper_H +#define identityFieldMapper_H + +#include "fieldMapper.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class identityFieldMapper Declaration +\*---------------------------------------------------------------------------*/ + +class identityFieldMapper +: + virtual public fieldMapper +{ + // Private Member Functions + + template + void map(Field& f, const Field& mapF) const; + + template + tmp> map(const Field& f) const; + + +public: + + // Constructors + + //- Null constructor + identityFieldMapper() + {} + + + //- Destructor + virtual ~identityFieldMapper() + {} + + + // Member Functions + + //- Are there unmapped values? I.e. do all size() elements get + // get value + virtual bool hasUnmapped() const + { + return false; + } + + + // Member Operators + + //- Map a field + FOR_ALL_FIELD_TYPES(DEFINE_FIELD_MAPPER_OPERATOR, ); + + //- Map a label field + DEFINE_FIELD_MAPPER_OPERATOR(label, ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "identityFieldMapperTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/fieldMappers/identityFieldMapper/identityFieldMapperTemplates.C b/src/OpenFOAM/fields/Fields/fieldMappers/identityFieldMapper/identityFieldMapperTemplates.C new file mode 100644 index 0000000000..fcff0a2587 --- /dev/null +++ b/src/OpenFOAM/fields/Fields/fieldMappers/identityFieldMapper/identityFieldMapperTemplates.C @@ -0,0 +1,51 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +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 . + +\*---------------------------------------------------------------------------*/ + +#include "identityFieldMapper.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +void Foam::identityFieldMapper::map +( + Field& f, + const Field& mapF +) const +{ + f = mapF; +} + + +template +Foam::tmp> Foam::identityFieldMapper::map +( + const Field& mapF +) const +{ + return mapF; +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/fieldMappers/reverseFieldMapper/reverseFieldMapper.C b/src/OpenFOAM/fields/Fields/fieldMappers/reverseFieldMapper/reverseFieldMapper.C new file mode 100644 index 0000000000..96ee1712d3 --- /dev/null +++ b/src/OpenFOAM/fields/Fields/fieldMappers/reverseFieldMapper/reverseFieldMapper.C @@ -0,0 +1,36 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +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 . + +\*---------------------------------------------------------------------------*/ + +#include "reverseFieldMapper.H" + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +FOR_ALL_FIELD_TYPES(IMPLEMENT_FIELD_MAPPER_OPERATOR, reverseFieldMapper) + + +IMPLEMENT_FIELD_MAPPER_OPERATOR(label, reverseFieldMapper) + + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/fieldMappers/reverseFieldMapper/reverseFieldMapper.H b/src/OpenFOAM/fields/Fields/fieldMappers/reverseFieldMapper/reverseFieldMapper.H new file mode 100644 index 0000000000..de34b8b02e --- /dev/null +++ b/src/OpenFOAM/fields/Fields/fieldMappers/reverseFieldMapper/reverseFieldMapper.H @@ -0,0 +1,107 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +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 . + +Class + Foam::reverseFieldMapper + +Description + Reverse field mapper + +\*---------------------------------------------------------------------------*/ + +#ifndef reverseFieldMapper_H +#define reverseFieldMapper_H + +#include "fieldMapper.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class reverseFieldMapper Declaration +\*---------------------------------------------------------------------------*/ + +class reverseFieldMapper +: + virtual public fieldMapper +{ + // Private Member Functions + + template + void map(Field& f, const Field& mapF) const; + + template + tmp> map(const Field& f) const; + + +public: + + // Constructors + + //- Null constructor + reverseFieldMapper() + {} + + + //- Destructor + virtual ~reverseFieldMapper() + {} + + + // Member Functions + + //- Are there unmapped values? I.e. do all size() elements get + // get value + virtual bool hasUnmapped() const = 0; + + //- Access to the reverse map addressing + virtual const labelUList& addressing() const = 0; + + + // Member Operators + + //- Map a field + FOR_ALL_FIELD_TYPES(DEFINE_FIELD_MAPPER_OPERATOR, ); + + //- Map a label field + DEFINE_FIELD_MAPPER_OPERATOR(label, ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "reverseFieldMapperTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/fieldMappers/reverseFieldMapper/reverseFieldMapperTemplates.C b/src/OpenFOAM/fields/Fields/fieldMappers/reverseFieldMapper/reverseFieldMapperTemplates.C new file mode 100644 index 0000000000..d0bbf61632 --- /dev/null +++ b/src/OpenFOAM/fields/Fields/fieldMappers/reverseFieldMapper/reverseFieldMapperTemplates.C @@ -0,0 +1,55 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +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 . + +\*---------------------------------------------------------------------------*/ + +#include "reverseFieldMapper.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +void Foam::reverseFieldMapper::map +( + Field& f, + const Field& mapF +) const +{ + if (notNull(addressing()) && addressing().size()) + { + f.rmap(mapF, addressing()); + } +} + + +template +Foam::tmp> Foam::reverseFieldMapper::map +( + const Field& mapF +) const +{ + NotImplemented; + return tmp>(nullptr); +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/MapGeometricFields.H b/src/OpenFOAM/fields/GeometricFields/GeometricField/MapGeometricFields.H index d4f5cab448..d53ea688d6 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/MapGeometricFields.H +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/MapGeometricFields.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -115,7 +115,11 @@ void MapGeometricFields // from the patch which has already been resized // - bfield[patchi].autoMap(mapper.boundaryMap()[patchi]); + bfield[patchi].map + ( + bfield[patchi], + mapper.boundaryMap()[patchi] + ); } field.instance() = field.time().name(); diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C index ab5a0160d1..616a55798d 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -119,30 +119,16 @@ Foam::valuePointPatchField::valuePointPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::valuePointPatchField::autoMap -( - const pointPatchFieldMapper& m -) -{ - m(*this, *this); -} - - -template -void Foam::valuePointPatchField::rmap +void Foam::valuePointPatchField::map ( const pointPatchField& ptf, - const labelList& addr + const pointPatchFieldMapper& mapper ) { - Field::rmap - ( - refCast> - ( - ptf - ), - addr - ); + const valuePointPatchField& vptf = + refCast>(ptf); + + mapper(*this, vptf); } diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H index 82d30b4894..bfac9241ea 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -81,7 +81,8 @@ public: const bool valueRequired=true ); - //- Construct by mapping given patchField onto a new patch + //- Construct by mapping given valuePointPatchField + // onto a new patch valuePointPatchField ( const valuePointPatchField&, @@ -130,13 +131,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const pointPatchFieldMapper&); - - //- Reverse map the given pointPatchField onto this pointPatchField - // Used to reconstruct fields - virtual void rmap(const pointPatchField&, const labelList&); + //- Map the given pointPatchField onto this pointPatchField + virtual void map + ( + const pointPatchField&, + const pointPatchFieldMapper& + ); //- Reset the pointPatchField to the given pointPatchField // Used for mesh to mesh mapping diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H index 9d23846a64..fa1719e77c 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -164,7 +164,7 @@ public: const dictionary& ); - //- Construct by mapping given patchField onto a new patch + //- Construct by mapping given pointPatchField onto a new patch pointPatchField ( const pointPatchField&, @@ -398,14 +398,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const pointPatchFieldMapper&) - {} - - //- Reverse map the given pointPatchField onto this pointPatchField - // Used to reconstruct fields - virtual void rmap(const pointPatchField&, const labelList&) + //- Map the given pointPatchField onto this pointPatchField + virtual void map + ( + const pointPatchField&, + const pointPatchFieldMapper& + ) {} //- Reset the pointPatchField to the given pointPatchField diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/reversePointPatchFieldMapper.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/reversePointPatchFieldMapper.H new file mode 100644 index 0000000000..ffbc01bb3a --- /dev/null +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/reversePointPatchFieldMapper.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +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 . + +Class + Foam::reversePointPatchFieldMapper + +Description + reverse pointPatchFieldMapper + +\*---------------------------------------------------------------------------*/ + +#ifndef reversePointPatchFieldMapper_H +#define reversePointPatchFieldMapper_H + +#include "pointPatchFieldMapper.H" +#include "reverseFieldMapper.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class reversePointPatchFieldMapper Declaration +\*---------------------------------------------------------------------------*/ + +class reversePointPatchFieldMapper +: + public pointPatchFieldMapper, + public reverseFieldMapper +{ + // Private Data + + //- Addressing from new back to old + const labelUList& addressing_; + + //- Does map contain any unmapped values + bool hasUnmapped_; + + +public: + + // Constructors + + //- Construct given addressing + reversePointPatchFieldMapper(const labelUList& addressing) + : + addressing_(addressing), + hasUnmapped_(false) + { + if (addressing_.size() && min(addressing_) < 0) + { + hasUnmapped_ = true; + } + } + + + //- Destructor + virtual ~reversePointPatchFieldMapper() + {} + + + // Member Functions + + bool hasUnmapped() const + { + return hasUnmapped_; + } + + const labelUList& addressing() const + { + return addressing_; + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/setSizePointPatchFieldMapper.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/setSizePointPatchFieldMapper.H new file mode 100644 index 0000000000..b66b66f41a --- /dev/null +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/setSizePointPatchFieldMapper.H @@ -0,0 +1,77 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +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 . + +Class + Foam::setSizePointPatchFieldMapper + +Description + Set size pointPatchFieldMapper + +\*---------------------------------------------------------------------------*/ + +#ifndef setSizePointPatchFieldMapper_H +#define setSizePointPatchFieldMapper_H + +#include "pointPatchFieldMapper.H" +#include "setSizeFieldMapper.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class setSizePointPatchFieldMapper Declaration +\*---------------------------------------------------------------------------*/ + +class setSizePointPatchFieldMapper +: + public pointPatchFieldMapper, + public setSizeFieldMapper +{ +public: + + // Constructors + + //- Construct + setSizePointPatchFieldMapper(const label size) + : + setSizeFieldMapper(size) + {} + + + //- Destructor + virtual ~setSizePointPatchFieldMapper() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/externalTemperature/externalTemperatureFvPatchScalarField.C b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/externalTemperature/externalTemperatureFvPatchScalarField.C index d7d8a6e076..1e231fb793 100644 --- a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/externalTemperature/externalTemperatureFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/externalTemperature/externalTemperatureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -193,54 +193,30 @@ externalTemperatureFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::externalTemperatureFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - mixedFvPatchScalarField::autoMap(m); - - if (haveq_) - { - m(q_, q_); - } - - if (haveh_) - { - m(h_, h_); - } - - if (qrName_ != word::null) - { - m(qrPrevious_, qrPrevious_); - } -} - - -void Foam::externalTemperatureFvPatchScalarField::rmap +void Foam::externalTemperatureFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - mixedFvPatchScalarField::rmap(ptf, addr); + mixedFvPatchScalarField::map(ptf, mapper); const externalTemperatureFvPatchScalarField& tiptf = refCast(ptf); if (haveq_) { - q_.rmap(tiptf.q_, addr); + mapper(q_, tiptf.q_); } if (haveh_) { - h_.rmap(tiptf.h_, addr); + mapper(h_, tiptf.h_); } if (qrName_ != word::null) { - qrPrevious_.rmap(tiptf.qrPrevious_, addr); + mapper(qrPrevious_, tiptf.qrPrevious_); } } diff --git a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/externalTemperature/externalTemperatureFvPatchScalarField.H b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/externalTemperature/externalTemperatureFvPatchScalarField.H index fb93497455..350610e7ca 100644 --- a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/externalTemperature/externalTemperatureFvPatchScalarField.H +++ b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/externalTemperature/externalTemperatureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -241,13 +241,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C index e5504f45da..b6f4f4643b 100644 --- a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C @@ -259,37 +259,21 @@ tmp thermalBaffle1DFvPatchScalarField::qs() const template -void thermalBaffle1DFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - mixedFvPatchScalarField::autoMap(m); - - if (this->owner()) - { - m(thickness_, thickness_); - m(qs_, qs_); - } -} - - -template -void thermalBaffle1DFvPatchScalarField::rmap +void thermalBaffle1DFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - mixedFvPatchScalarField::rmap(ptf, addr); + mixedFvPatchScalarField::map(ptf, mapper); const thermalBaffle1DFvPatchScalarField& tiptf = refCast(ptf); if (this->owner()) { - thickness_.rmap(tiptf.thickness_, addr); - qs_.rmap(tiptf.qs_, addr); + mapper(thickness_, tiptf.thickness_); + mapper(qs_, tiptf.qs_); } } diff --git a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.H b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.H index 6ddeb352ad..a3cad11d8f 100644 --- a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.H +++ b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -182,8 +182,8 @@ public: const dictionary& ); - //- Construct by mapping given - // thermalBaffle1DFvPatchScalarField onto a new patch + //- Construct by mapping given thermalBaffle1DFvPatchScalarField + // onto a new patch thermalBaffle1DFvPatchScalarField ( const thermalBaffle1DFvPatchScalarField&, @@ -222,13 +222,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C index afa992d561..b098d05d99 100644 --- a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -111,22 +111,13 @@ totalFlowRateAdvectiveDiffusiveFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - m(*this, *this); -} - - -void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::rmap +void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - mixedFvPatchField::rmap(ptf, addr); + mixedFvPatchField::map(ptf, mapper); } diff --git a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.H b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.H index 2a93f8f2b9..f1cf204d7e 100644 --- a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.H +++ b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -134,13 +134,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C index 550a1fc4aa..002bfc8821 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -170,23 +170,15 @@ Foam::atmBoundaryLayer::atmBoundaryLayer(const atmBoundaryLayer& abl) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::atmBoundaryLayer::autoMap(const fvPatchFieldMapper& m) -{ - m(z0_, z0_); - m(zGround_, zGround_); - m(Ustar_, Ustar_); -} - - -void Foam::atmBoundaryLayer::rmap +void Foam::atmBoundaryLayer::map ( const atmBoundaryLayer& blptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - z0_.rmap(blptf.z0_, addr); - zGround_.rmap(blptf.zGround_, addr); - Ustar_.rmap(blptf.Ustar_, addr); + mapper(z0_, blptf.z0_); + mapper(zGround_, blptf.zGround_); + mapper(Ustar_, blptf.Ustar_); } diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.H b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.H index 4e375cdedc..405cf4c3f3 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.H +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -249,12 +249,8 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given atmBoundaryLayer onto this - // atmBoundaryLayer - void rmap(const atmBoundaryLayer&, const labelList&); + //- Map the given atmBoundaryLayer onto this atmBoundaryLayer + void map(const atmBoundaryLayer&, const fvPatchFieldMapper&); //- Reset the atmBoundaryLayer to the given atmBoundaryLayer // Used for mesh to mesh mapping diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C index 3c8370ba21..e057cbaeb9 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -104,28 +104,18 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void atmBoundaryLayerInletEpsilonFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - inletOutletFvPatchScalarField::autoMap(m); - atmBoundaryLayer::autoMap(m); -} - - -void atmBoundaryLayerInletEpsilonFvPatchScalarField::rmap +void atmBoundaryLayerInletEpsilonFvPatchScalarField::map ( const fvPatchScalarField& psf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - inletOutletFvPatchScalarField::rmap(psf, addr); + inletOutletFvPatchScalarField::map(psf, mapper); const atmBoundaryLayerInletEpsilonFvPatchScalarField& blpsf = refCast(psf); - atmBoundaryLayer::rmap(blpsf, addr); + atmBoundaryLayer::map(blpsf, mapper); } diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.H b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.H index 93592971c4..9a5369138d 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.H +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -132,13 +132,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.C b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.C index 22a854f970..82f720b5f9 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.C +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -104,28 +104,18 @@ atmBoundaryLayerInletKFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void atmBoundaryLayerInletKFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - inletOutletFvPatchScalarField::autoMap(m); - atmBoundaryLayer::autoMap(m); -} - - -void atmBoundaryLayerInletKFvPatchScalarField::rmap +void atmBoundaryLayerInletKFvPatchScalarField::map ( const fvPatchScalarField& psf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - inletOutletFvPatchScalarField::rmap(psf, addr); + inletOutletFvPatchScalarField::map(psf, mapper); const atmBoundaryLayerInletKFvPatchScalarField& blpsf = refCast(psf); - atmBoundaryLayer::rmap(blpsf, addr); + atmBoundaryLayer::map(blpsf, mapper); } diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.H b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.H index c0bb20b84f..b5d2b114e7 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.H +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -132,13 +132,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C index 96fa858ffd..7bc6556430 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -104,28 +104,18 @@ atmBoundaryLayerInletVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void atmBoundaryLayerInletVelocityFvPatchVectorField::autoMap -( - const fvPatchFieldMapper& m -) -{ - inletOutletFvPatchVectorField::autoMap(m); - atmBoundaryLayer::autoMap(m); -} - - -void atmBoundaryLayerInletVelocityFvPatchVectorField::rmap +void atmBoundaryLayerInletVelocityFvPatchVectorField::map ( const fvPatchVectorField& pvf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - inletOutletFvPatchVectorField::rmap(pvf, addr); + inletOutletFvPatchVectorField::map(pvf, mapper); const atmBoundaryLayerInletVelocityFvPatchVectorField& blpvf = refCast(pvf); - atmBoundaryLayer::rmap(blpvf, addr); + atmBoundaryLayer::map(blpvf, mapper); } diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H index 43b6116a0c..7fed427577 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -100,7 +100,7 @@ public: ); //- Construct by mapping given - // atmBoundaryLayerInletVelocityFvPatchVectorField onto a new patch + // atmBoundaryLayerInletVelocityFvPatchVectorField onto a new patch atmBoundaryLayerInletVelocityFvPatchVectorField ( const atmBoundaryLayerInletVelocityFvPatchVectorField&, @@ -133,13 +133,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchVectorField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchVectorField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/atmosphericModels/derivedFvPatchFields/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C b/src/atmosphericModels/derivedFvPatchFields/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C index 1f1a7e2bf2..ec5dea1b81 100644 --- a/src/atmosphericModels/derivedFvPatchFields/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C +++ b/src/atmosphericModels/derivedFvPatchFields/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -134,28 +134,18 @@ nutkAtmRoughWallFunctionFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void nutkAtmRoughWallFunctionFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - nutkWallFunctionFvPatchScalarField::autoMap(m); - m(z0_, z0_); -} - - -void nutkAtmRoughWallFunctionFvPatchScalarField::rmap +void nutkAtmRoughWallFunctionFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - nutkWallFunctionFvPatchScalarField::rmap(ptf, addr); + nutkWallFunctionFvPatchScalarField::map(ptf, mapper); const nutkAtmRoughWallFunctionFvPatchScalarField& nrwfpsf = refCast(ptf); - z0_.rmap(nrwfpsf.z0_, addr); + mapper(z0_, nrwfpsf.z0_); } diff --git a/src/atmosphericModels/derivedFvPatchFields/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.H b/src/atmosphericModels/derivedFvPatchFields/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.H index 01ed603a9c..ce4f97854e 100644 --- a/src/atmosphericModels/derivedFvPatchFields/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.H +++ b/src/atmosphericModels/derivedFvPatchFields/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -171,14 +171,11 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - virtual void rmap + //- Map the given fvPatchField onto this fvPatchField + virtual void map ( const fvPatchScalarField&, - const labelList& + const fvPatchFieldMapper& ); //- Reset the fvPatchField to the given fvPatchField diff --git a/src/dynamicMesh/fvMeshAdder/fvMeshAdderTemplates.C b/src/dynamicMesh/fvMeshAdder/fvMeshAdderTemplates.C index 65f5244cee..d6b5f3dcc3 100644 --- a/src/dynamicMesh/fvMeshAdder/fvMeshAdderTemplates.C +++ b/src/dynamicMesh/fvMeshAdder/fvMeshAdderTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,6 +28,8 @@ License #include "pointFields.H" #include "directFvPatchFieldMapper.H" #include "directPointPatchFieldMapper.H" +#include "reverseFvPatchFieldMapper.H" +#include "reversePointPatchFieldMapper.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -236,10 +238,10 @@ void Foam::fvMeshAdder::MapVolField } } - bfld[newPatchi].rmap + bfld[newPatchi].map ( fldToAdd.boundaryField()[patchi], - addedToNew + reverseFvPatchFieldMapper(addedToNew) ); } } @@ -529,10 +531,10 @@ void Foam::fvMeshAdder::MapSurfaceField } } - bfld[newPatchi].rmap + bfld[newPatchi].map ( fldToAdd.boundaryField()[patchi], - addedToNew + reverseFvPatchFieldMapper(addedToNew) ); } } @@ -829,10 +831,10 @@ void Foam::fvMeshAdder::MapPointField } } - bfld[newPatchi].rmap + bfld[newPatchi].map ( fldToAdd.boundaryField()[patchi], - oldToNew + reversePointPatchFieldMapper(oldToNew) ); } } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.C index 1d7d986033..730b3a2a44 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -92,33 +92,20 @@ Foam::directionMixedFvPatchField::directionMixedFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::directionMixedFvPatchField::autoMap -( - const fvPatchFieldMapper& m -) -{ - transformFvPatchField::autoMap(m); - m(refValue_, refValue_); - m(refGrad_, refGrad_); - m(valueFraction_, valueFraction_); -} - - -template -void Foam::directionMixedFvPatchField::rmap +void Foam::directionMixedFvPatchField::map ( const fvPatchField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - transformFvPatchField::rmap(ptf, addr); + transformFvPatchField::map(ptf, mapper); const directionMixedFvPatchField& dmptf = refCast>(ptf); - refValue_.rmap(dmptf.refValue_, addr); - refGrad_.rmap(dmptf.refGrad_, addr); - valueFraction_.rmap(dmptf.valueFraction_, addr); + mapper(refValue_, dmptf.refValue_); + mapper(refGrad_, dmptf.refGrad_); + mapper(valueFraction_, dmptf.valueFraction_); } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.H index 3923767cfc..125372b2a6 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -86,8 +86,8 @@ public: const dictionary& ); - //- Construct by mapping given directionMixedFvPatchField onto - // a new patch + //- Construct by mapping given directionMixedFvPatchField + // onto a new patch directionMixedFvPatchField ( const directionMixedFvPatchField&, @@ -137,13 +137,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C index 4a91cf90c7..0bc5cee587 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -109,29 +109,18 @@ Foam::fixedGradientFvPatchField::fixedGradientFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::fixedGradientFvPatchField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fvPatchField::autoMap(m); - m(gradient_, gradient_); -} - - -template -void Foam::fixedGradientFvPatchField::rmap +void Foam::fixedGradientFvPatchField::map ( const fvPatchField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fvPatchField::rmap(ptf, addr); + fvPatchField::map(ptf, mapper); const fixedGradientFvPatchField& fgptf = refCast>(ptf); - gradient_.rmap(fgptf.gradient_, addr); + mapper(gradient_, fgptf.gradient_); } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.H index 0829e685e6..3f768d3472 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -163,13 +163,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C index b897df4dba..436adabc84 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -129,33 +129,20 @@ Foam::mixedFvPatchField::mixedFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::mixedFvPatchField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fvPatchField::autoMap(m); - m(refValue_, refValue_); - m(refGrad_, refGrad_); - m(valueFraction_, valueFraction_); -} - - -template -void Foam::mixedFvPatchField::rmap +void Foam::mixedFvPatchField::map ( const fvPatchField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fvPatchField::rmap(ptf, addr); + fvPatchField::map(ptf, mapper); const mixedFvPatchField& mptf = refCast>(ptf); - refValue_.rmap(mptf.refValue_, addr); - refGrad_.rmap(mptf.refGrad_, addr); - valueFraction_.rmap(mptf.valueFraction_, addr); + mapper(refValue_, mptf.refValue_); + mapper(refGrad_, mptf.refGrad_); + mapper(valueFraction_, mptf.valueFraction_); } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.H index 28c9f7ed3e..34fcf3d5b2 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -205,13 +205,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.H index df4f0c4139..83b6cf75d2 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -124,14 +124,8 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap( const fvPatchFieldMapper&) - {} - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchField&, const labelList&) + //- Map the given fvPatchField onto this fvPatchField + virtual void map(const fvPatchField&, const labelList&) {} //- Reset the fvPatchField to the given fvPatchField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C index 40d3aa5bc1..632d4f9f29 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -132,44 +132,21 @@ activeBaffleVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::activeBaffleVelocityFvPatchVectorField::autoMap +void Foam::activeBaffleVelocityFvPatchVectorField::map ( - const fvPatchFieldMapper& m + const fvPatchVectorField& ptf, + const fvPatchFieldMapper& mapper ) { - fixedValueFvPatchVectorField::autoMap(m); + fixedValueFvPatchVectorField::map(ptf, mapper); //- Note: cannot map field from cyclic patch anyway so just recalculate - // Areas should be consistent when doing autoMap except in case of - // topo changes. + // Areas should be consistent when doing map except in case of topo + // changes. //- Note: we don't want to use Sf here since triggers rebuilding of // fvMesh::S() which will give problems when mapped (since already // on new mesh) - const vectorField& areas = patch().boundaryMesh().mesh().faceAreas(); - initWallSf_ = patch().patchSlice(areas); - initCyclicSf_ = patch().boundaryMesh() - [ - cyclicPatchLabel_ - ].patchSlice(areas); - nbrCyclicSf_ = refCast - ( - patch().boundaryMesh() - [ - cyclicPatchLabel_ - ] - ).neighbFvPatch().patch().patchSlice(areas); -} - -void Foam::activeBaffleVelocityFvPatchVectorField::rmap -( - const fvPatchVectorField& ptf, - const labelList& addr -) -{ - fixedValueFvPatchVectorField::rmap(ptf, addr); - - // See autoMap. const vectorField& areas = patch().boundaryMesh().mesh().faceAreas(); initWallSf_ = patch().patchSlice(areas); initCyclicSf_ = patch().boundaryMesh() @@ -193,7 +170,7 @@ void Foam::activeBaffleVelocityFvPatchVectorField::reset { fixedValueFvPatchVectorField::reset(ptf); - // See autoMap. + // See rmap. const vectorField& areas = patch().boundaryMesh().mesh().faceAreas(); initWallSf_ = patch().patchSlice(areas); initCyclicSf_ = patch().boundaryMesh() diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.H index d253399383..cdb35a5123 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.H @@ -206,11 +206,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - virtual void rmap(const fvPatchVectorField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchVectorField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C index e94bf90e78..403ec1d44b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -153,54 +153,21 @@ activePressureForceBaffleVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::activePressureForceBaffleVelocityFvPatchVectorField::autoMap +void Foam::activePressureForceBaffleVelocityFvPatchVectorField::map ( - const fvPatchFieldMapper& m + const fvPatchVectorField& ptf, + const fvPatchFieldMapper& mapper ) { - fixedValueFvPatchVectorField::autoMap(m); + fixedValueFvPatchVectorField::map(ptf, mapper); //- Note: cannot map field from cyclic patch anyway so just recalculate - // Areas should be consistent when doing autoMap except in case of - // topo changes. + // Areas should be consistent when doing map except in case of topo + // changes. //- Note: we don't want to use Sf here since triggers rebuilding of // fvMesh::S() which will give problems when mapped (since already // on new mesh) - forAll(patch().boundaryMesh().mesh().faceAreas(), i) - { - if (mag(patch().boundaryMesh().mesh().faceAreas()[i]) == 0) - { - Info << "faceArea[active] "<< i << endl; - } - } - if (patch().size() > 0) - { - const vectorField& areas = patch().boundaryMesh().mesh().faceAreas(); - initWallSf_ = patch().patchSlice(areas); - initCyclicSf_ = patch().boundaryMesh() - [ - cyclicPatchLabel_ - ].patchSlice(areas); - nbrCyclicSf_ = refCast - ( - patch().boundaryMesh() - [ - cyclicPatchLabel_ - ] - ).neighbFvPatch().patch().patchSlice(areas); - } -} - -void Foam::activePressureForceBaffleVelocityFvPatchVectorField::rmap -( - const fvPatchVectorField& ptf, - const labelList& addr -) -{ - fixedValueFvPatchVectorField::rmap(ptf, addr); - - // See autoMap. const vectorField& areas = patch().boundaryMesh().mesh().faceAreas(); initWallSf_ = patch().patchSlice(areas); initCyclicSf_ = patch().boundaryMesh() @@ -224,7 +191,7 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::reset { fixedValueFvPatchVectorField::reset(ptf); - // See autoMap. + // See rmap. const vectorField& areas = patch().boundaryMesh().mesh().faceAreas(); initWallSf_ = patch().patchSlice(areas); initCyclicSf_ = patch().boundaryMesh() diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.H index 651c45c685..a446e3b997 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -178,7 +178,9 @@ public: const dictionary& ); - //- Construct by mapping + //- Construct by mapping given + // activePressureForceBaffleVelocityFvPatchVectorField + // onto a new patch activePressureForceBaffleVelocityFvPatchVectorField ( const activePressureForceBaffleVelocityFvPatchVectorField&, @@ -221,13 +223,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchVectorField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchVectorField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/dynamicPressure/dynamicPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/dynamicPressure/dynamicPressureFvPatchScalarField.C index 232ec2061b..462bba2e36 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/dynamicPressure/dynamicPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/dynamicPressure/dynamicPressureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -183,28 +183,18 @@ Foam::dynamicPressureFvPatchScalarField::dynamicPressureFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::dynamicPressureFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedValueFvPatchScalarField::autoMap(m); - m(p0_, p0_); -} - - -void Foam::dynamicPressureFvPatchScalarField::rmap +void Foam::dynamicPressureFvPatchScalarField::map ( const fvPatchScalarField& psf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fixedValueFvPatchScalarField::rmap(psf, addr); + fixedValueFvPatchScalarField::map(psf, mapper); const dynamicPressureFvPatchScalarField& dpsf = refCast(psf); - p0_.rmap(dpsf.p0_, addr); + mapper(p0_, dpsf.p0_); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/dynamicPressure/dynamicPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/dynamicPressure/dynamicPressureFvPatchScalarField.H index c41e51af65..ce26d124cd 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/dynamicPressure/dynamicPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/dynamicPressure/dynamicPressureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -139,13 +139,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C index a6c2d07b19..6d75e16fcb 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -115,28 +115,17 @@ Foam::tmp> Foam::fixedJumpFvPatchField::jump() const template -void Foam::fixedJumpFvPatchField::autoMap -( - const fvPatchFieldMapper& m -) -{ - jumpCyclicFvPatchField::autoMap(m); - m(jump_, jump_); -} - - -template -void Foam::fixedJumpFvPatchField::rmap +void Foam::fixedJumpFvPatchField::map ( const fvPatchField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - jumpCyclicFvPatchField::rmap(ptf, addr); + jumpCyclicFvPatchField::map(ptf, mapper); const fixedJumpFvPatchField& tiptf = refCast>(ptf); - jump_.rmap(tiptf.jump_, addr); + mapper(jump_, tiptf.jump_); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H index fc4601297a..3959ef175f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -157,13 +157,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C index 5266416779..6cd8979159 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -110,28 +110,18 @@ fixedNormalInletOutletVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::fixedNormalInletOutletVelocityFvPatchVectorField::autoMap -( - const fvPatchFieldMapper& m -) -{ - directionMixedFvPatchVectorField::autoMap(m); - normalVelocity_->autoMap(m); -} - - -void Foam::fixedNormalInletOutletVelocityFvPatchVectorField::rmap +void Foam::fixedNormalInletOutletVelocityFvPatchVectorField::map ( const fvPatchVectorField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - directionMixedFvPatchVectorField::rmap(ptf, addr); + directionMixedFvPatchVectorField::map(ptf, mapper); const fixedNormalInletOutletVelocityFvPatchVectorField& fniovptf = refCast(ptf); - normalVelocity_->rmap(fniovptf.normalVelocity(), addr); + mapper(normalVelocity_.ref(), fniovptf.normalVelocity()); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.H index 50ac5cef8f..e722d83616 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -210,13 +210,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchVectorField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchVectorField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.C index 7a46bbb18d..37fd2a94f4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,29 +85,18 @@ Foam::fixedNormalSlipFvPatchField::fixedNormalSlipFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::fixedNormalSlipFvPatchField::autoMap -( - const fvPatchFieldMapper& m -) -{ - transformFvPatchField::autoMap(m); - m(fixedValue_, fixedValue_); -} - - -template -void Foam::fixedNormalSlipFvPatchField::rmap +void Foam::fixedNormalSlipFvPatchField::map ( const fvPatchField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - transformFvPatchField::rmap(ptf, addr); + transformFvPatchField::map(ptf, mapper); const fixedNormalSlipFvPatchField& dmptf = refCast>(ptf); - fixedValue_.rmap(dmptf.fixedValue_, addr); + mapper(fixedValue_, dmptf.fixedValue_); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.H index 51415f61ba..904fa6979d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -147,13 +147,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C index 6aeb1c6151..68bed20524 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -266,34 +266,20 @@ flowRateInletVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::flowRateInletVelocityFvPatchVectorField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedValueFvPatchVectorField::autoMap(m); - - if (canEvaluate()) - { - setWallDist(); - } -} - - -void Foam::flowRateInletVelocityFvPatchVectorField::rmap +void Foam::flowRateInletVelocityFvPatchVectorField::map ( const fvPatchVectorField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fixedValueFvPatchVectorField::rmap(ptf, addr); + fixedValueFvPatchVectorField::map(ptf, mapper); const flowRateInletVelocityFvPatchVectorField& tiptf = refCast(ptf); if (profile_.valid() && canEvaluate()) { - y_.rmap(tiptf.y_, addr); + mapper(y_, tiptf.y_); } } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H index f8cd87cc50..ca2bc53880 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -251,23 +251,30 @@ public: // Member Functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); + // Mapping functions - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchVectorField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchVectorField&, + const fvPatchFieldMapper& + ); - //- Reset the fvPatchField to the given fvPatchField - // Used for mesh to mesh mapping - virtual void reset(const fvPatchVectorField&); + //- Reset the fvPatchField to the given fvPatchField + // Used for mesh to mesh mapping + virtual void reset(const fvPatchVectorField&); - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - //- Write - virtual void write(Ostream&) const; + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + // I-O + + //- Write + virtual void write(Ostream&) const; }; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C index 56b0648aaf..d752127033 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -118,28 +118,18 @@ inletOutletTotalTemperatureFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::inletOutletTotalTemperatureFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - inletOutletFvPatchScalarField::autoMap(m); - m(T0_, T0_); -} - - -void Foam::inletOutletTotalTemperatureFvPatchScalarField::rmap +void Foam::inletOutletTotalTemperatureFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - inletOutletFvPatchScalarField::rmap(ptf, addr); + inletOutletFvPatchScalarField::map(ptf, mapper); const inletOutletTotalTemperatureFvPatchScalarField& tiptf = refCast(ptf); - T0_.rmap(tiptf.T0_, addr); + mapper(T0_, tiptf.T0_); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.H index aa3a5a97dc..9d747d3049 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -174,13 +174,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.C index cda08a4f2a..250cf30c85 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -88,28 +88,18 @@ interstitialInletVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::interstitialInletVelocityFvPatchVectorField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedValueFvPatchVectorField::autoMap(m); - m(inletVelocity_, inletVelocity_); -} - - -void Foam::interstitialInletVelocityFvPatchVectorField::rmap +void Foam::interstitialInletVelocityFvPatchVectorField::map ( const fvPatchVectorField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fixedValueFvPatchVectorField::rmap(ptf, addr); + fixedValueFvPatchVectorField::map(ptf, mapper); const interstitialInletVelocityFvPatchVectorField& tiptf = refCast(ptf); - inletVelocity_.rmap(tiptf.inletVelocity_, addr); + mapper(inletVelocity_, tiptf.inletVelocity_); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.H index ac847bcfb9..77dba1a79f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -134,13 +134,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchVectorField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchVectorField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedInternalValue/mappedInternalValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedInternalValue/mappedInternalValueFvPatchField.C index b8e0149c7c..1c3388924f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedInternalValue/mappedInternalValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedInternalValue/mappedInternalValueFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -149,28 +149,13 @@ mappedInternalValueFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::mappedInternalValueFvPatchField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedValueFvPatchField::autoMap(m); - - if (mapperPtr_.valid()) - { - mapperPtr_->clearOut(); - } -} - - -template -void Foam::mappedInternalValueFvPatchField::rmap +void Foam::mappedInternalValueFvPatchField::map ( const fvPatchField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fixedValueFvPatchField::rmap(ptf, addr); + fixedValueFvPatchField::map(ptf, mapper); if (mapperPtr_.valid()) { diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedInternalValue/mappedInternalValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedInternalValue/mappedInternalValueFvPatchField.H index 1dcb6978dd..522d393f51 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedInternalValue/mappedInternalValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedInternalValue/mappedInternalValueFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -177,13 +177,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedValue/mappedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedValue/mappedValueFvPatchField.C index 6ba32761d6..b362db7ebe 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedValue/mappedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedValue/mappedValueFvPatchField.C @@ -207,28 +207,13 @@ Foam::mappedValueFvPatchField::mappedValueFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::mappedValueFvPatchField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedValueFvPatchField::autoMap(m); - - if (mapperPtr_.valid()) - { - mapperPtr_->clearOut(); - } -} - - -template -void Foam::mappedValueFvPatchField::rmap +void Foam::mappedValueFvPatchField::map ( const fvPatchField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fixedValueFvPatchField::rmap(ptf, addr); + fixedValueFvPatchField::map(ptf, mapper); if (mapperPtr_.valid()) { diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedValue/mappedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedValue/mappedValueFvPatchField.H index 56c93368b1..41ce46cdca 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedValue/mappedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedValue/mappedValueFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -179,13 +179,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.C index 5ca4004ed6..2a626827b8 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,29 +84,18 @@ Foam::partialSlipFvPatchField::partialSlipFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::partialSlipFvPatchField::autoMap -( - const fvPatchFieldMapper& m -) -{ - transformFvPatchField::autoMap(m); - m(valueFraction_, valueFraction_); -} - - -template -void Foam::partialSlipFvPatchField::rmap +void Foam::partialSlipFvPatchField::map ( const fvPatchField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - transformFvPatchField::rmap(ptf, addr); + transformFvPatchField::map(ptf, mapper); const partialSlipFvPatchField& dmptf = refCast>(ptf); - valueFraction_.rmap(dmptf.valueFraction_, addr); + mapper(valueFraction_, dmptf.valueFraction_); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.H index e185218c60..3e89444808 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -145,13 +145,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressure/pressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressure/pressureFvPatchScalarField.C index 8b21cc4c1e..5f4ea97261 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressure/pressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressure/pressureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -92,28 +92,18 @@ Foam::pressureFvPatchScalarField::pressureFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::pressureFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedValueFvPatchScalarField::autoMap(m); - m(p_, p_); -} - - -void Foam::pressureFvPatchScalarField::rmap +void Foam::pressureFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fixedValueFvPatchScalarField::rmap(ptf, addr); + fixedValueFvPatchScalarField::map(ptf, mapper); const pressureFvPatchScalarField& tiptf = refCast(ptf); - p_.rmap(tiptf.p_, addr); + mapper(p_, tiptf.p_); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressure/pressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressure/pressureFvPatchScalarField.H index 906e4dc4f4..ef6e8e23c5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressure/pressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressure/pressureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -157,13 +157,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C index a5d05c2280..299a7598ab 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -101,29 +101,19 @@ pressureDirectedInletOutletVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::autoMap -( - const fvPatchFieldMapper& m -) -{ - mixedFvPatchVectorField::autoMap(m); - m(inletDir_, inletDir_); -} - - -void Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::rmap +void Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::map ( const fvPatchVectorField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - mixedFvPatchVectorField::rmap(ptf, addr); + mixedFvPatchVectorField::map(ptf, mapper); const pressureDirectedInletOutletVelocityFvPatchVectorField& tiptf = refCast (ptf); - inletDir_.rmap(tiptf.inletDir_, addr); + mapper(inletDir_, tiptf.inletDir_); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.H index f0056a2d89..ed5446c236 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -199,13 +199,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchVectorField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchVectorField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C index 5f7c24bf28..77351db161 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -93,28 +93,18 @@ pressureDirectedInletVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::pressureDirectedInletVelocityFvPatchVectorField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedValueFvPatchVectorField::autoMap(m); - m(inletDir_, inletDir_); -} - - -void Foam::pressureDirectedInletVelocityFvPatchVectorField::rmap +void Foam::pressureDirectedInletVelocityFvPatchVectorField::map ( const fvPatchVectorField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fixedValueFvPatchVectorField::rmap(ptf, addr); + fixedValueFvPatchVectorField::map(ptf, mapper); const pressureDirectedInletVelocityFvPatchVectorField& tiptf = refCast(ptf); - inletDir_.rmap(tiptf.inletDir_, addr); + mapper(inletDir_, tiptf.inletDir_); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.H index 997cec1290..1681244d41 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -196,13 +196,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchVectorField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchVectorField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C index 235df41214..771080e507 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -92,28 +92,18 @@ surfaceNormalFixedValueFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::surfaceNormalFixedValueFvPatchVectorField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedValueFvPatchVectorField::autoMap(m); - m(refValue_, refValue_); -} - - -void Foam::surfaceNormalFixedValueFvPatchVectorField::rmap +void Foam::surfaceNormalFixedValueFvPatchVectorField::map ( const fvPatchVectorField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fixedValueFvPatchVectorField::rmap(ptf, addr); + fixedValueFvPatchVectorField::map(ptf, mapper); const surfaceNormalFixedValueFvPatchVectorField& tiptf = refCast(ptf); - refValue_.rmap(tiptf.refValue_, addr); + mapper(refValue_, tiptf.refValue_); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H index 71b1cb01d6..02b37dcc93 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -149,13 +149,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchVectorField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchVectorField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C index 14fb73a79b..9c75abe7c7 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -99,31 +99,18 @@ timeVaryingMappedFixedValueFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::timeVaryingMappedFixedValueFvPatchField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedValueFvPatchField::autoMap(m); - fieldMapper_.autoMap(m); -} - - -template -void Foam::timeVaryingMappedFixedValueFvPatchField::rmap +void Foam::timeVaryingMappedFixedValueFvPatchField::map ( const fvPatchField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fixedValueFvPatchField::rmap(ptf, addr); - fieldMapper_.rmap + fixedValueFvPatchField::map(ptf, mapper); + fieldMapper_.map ( - refCast - < - const timeVaryingMappedFixedValueFvPatchField - >(ptf).fieldMapper_, - addr + refCast>(ptf) + .fieldMapper_, + mapper ); } @@ -137,10 +124,8 @@ void Foam::timeVaryingMappedFixedValueFvPatchField::reset fixedValueFvPatchField::reset(ptf); fieldMapper_.reset ( - refCast - < - const timeVaryingMappedFixedValueFvPatchField - >(ptf).fieldMapper_ + refCast>(ptf) + .fieldMapper_ ); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H index 380aa96638..04fc73c9fd 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -185,13 +185,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMappedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMappedFvPatchField.C index 9ec5552f05..58f0fee11a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMappedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMappedFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -383,32 +383,14 @@ timeVaryingMappedFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::timeVaryingMappedFvPatchField::autoMap -( - const fvPatchFieldMapper& m -) -{ - if (startSampledValues_.size()) - { - m(startSampledValues_, startSampledValues_); - m(endSampledValues_, endSampledValues_); - } - // Clear interpolator - mapperPtr_.clear(); - startSampleTime_ = -1; - endSampleTime_ = -1; -} - - -template -void Foam::timeVaryingMappedFvPatchField::rmap +void Foam::timeVaryingMappedFvPatchField::map ( const timeVaryingMappedFvPatchField& tiptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - startSampledValues_.rmap(tiptf.startSampledValues_, addr); - endSampledValues_.rmap(tiptf.endSampledValues_, addr); + mapper(startSampledValues_, tiptf.startSampledValues_); + mapper(endSampledValues_, tiptf.endSampledValues_); // Clear interpolator mapperPtr_.clear(); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMappedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMappedFvPatchField.H index dfbb58f6a1..a089adc4dc 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMappedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMappedFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -215,15 +215,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given timeVaryingMappedFvPatchField + //- Map the given timeVaryingMappedFvPatchField // onto this timeVaryingMappedFvPatchField - void rmap + void map ( const timeVaryingMappedFvPatchField&, - const labelList& + const fvPatchFieldMapper& ); //- Reset the fvPatchField to the given fvPatchField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C index eb21d85ccf..73e50c5861 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -108,28 +108,18 @@ Foam::totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::totalTemperatureFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedValueFvPatchScalarField::autoMap(m); - m(T0_, T0_); -} - - -void Foam::totalTemperatureFvPatchScalarField::rmap +void Foam::totalTemperatureFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fixedValueFvPatchScalarField::rmap(ptf, addr); + fixedValueFvPatchScalarField::map(ptf, mapper); const totalTemperatureFvPatchScalarField& tiptf = refCast(ptf); - T0_.rmap(tiptf.T0_, addr); + mapper(T0_, tiptf.T0_); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H index 4209eb4321..93ef819e61 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -168,13 +168,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/transonicEntrainmentPressure/transonicEntrainmentPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/transonicEntrainmentPressure/transonicEntrainmentPressureFvPatchScalarField.C index 59dc59ec02..25786385dd 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/transonicEntrainmentPressure/transonicEntrainmentPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/transonicEntrainmentPressure/transonicEntrainmentPressureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -118,28 +118,18 @@ transonicEntrainmentPressureFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::transonicEntrainmentPressureFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - mixedFvPatchScalarField::autoMap(m); - m(p0_, p0_); -} - - -void Foam::transonicEntrainmentPressureFvPatchScalarField::rmap +void Foam::transonicEntrainmentPressureFvPatchScalarField::map ( const fvPatchScalarField& psf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - mixedFvPatchScalarField::rmap(psf, addr); + mixedFvPatchScalarField::map(psf, mapper); const transonicEntrainmentPressureFvPatchScalarField& toppsf = refCast(psf); - p0_.rmap(toppsf.p0_, addr); + mapper(p0_, toppsf.p0_); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/transonicEntrainmentPressure/transonicEntrainmentPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/transonicEntrainmentPressure/transonicEntrainmentPressureFvPatchScalarField.H index 31b57b1b18..622c142414 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/transonicEntrainmentPressure/transonicEntrainmentPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/transonicEntrainmentPressure/transonicEntrainmentPressureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -161,13 +161,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.C index efea34eedd..9d7f6b787a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -109,29 +109,18 @@ Foam::turbulentInletFvPatchField::turbulentInletFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::turbulentInletFvPatchField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedValueFvPatchField::autoMap(m); - m(referenceField_, referenceField_); -} - - -template -void Foam::turbulentInletFvPatchField::rmap +void Foam::turbulentInletFvPatchField::map ( const fvPatchField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fixedValueFvPatchField::rmap(ptf, addr); + fixedValueFvPatchField::map(ptf, mapper); const turbulentInletFvPatchField& tiptf = refCast>(ptf); - referenceField_.rmap(tiptf.referenceField_, addr); + mapper(referenceField_, tiptf.referenceField_); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.H index e9433055f1..3e7c2059ac 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -198,13 +198,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.C index e185113dea..a6028f0d0c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -156,27 +156,13 @@ void Foam::uniformInletOutletFvPatchField::write(Ostream& os) const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template -void Foam::uniformInletOutletFvPatchField::autoMap -( - const fvPatchFieldMapper& m -) -{ - mixedFvPatchField::autoMap(m); - - // Override - this->refValue() = - uniformInletValue_->value(this->db().time().userTimeValue()); -} - - -template -void Foam::uniformInletOutletFvPatchField::rmap +void Foam::uniformInletOutletFvPatchField::map ( const fvPatchField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - mixedFvPatchField::rmap(ptf, addr); + mixedFvPatchField::map(ptf, mapper); // Override this->refValue() = diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.H index cbc9efbd43..fb1408c05b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -166,13 +166,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C index eed5fff6f4..09d64b7fdf 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -188,23 +188,13 @@ void Foam::fvPatchField::patchInternalField(Field& pif) const template -void Foam::fvPatchField::autoMap +void Foam::fvPatchField::map ( + const fvPatchField& ptf, const fvPatchFieldMapper& mapper ) { - mapper(*this, *this); -} - - -template -void Foam::fvPatchField::rmap -( - const fvPatchField& ptf, - const labelList& addr -) -{ - Field::rmap(ptf, addr); + mapper(*this, ptf); } diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index 6d28094b21..9fccc1d362 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -385,13 +385,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/identityFvPatchFieldMapper.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/identityFvPatchFieldMapper.H new file mode 100644 index 0000000000..2429dbcce5 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/identityFvPatchFieldMapper.H @@ -0,0 +1,83 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +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 . + +Class + Foam::identityFvPatchFieldMapper + +Description + identity fvPatchFieldMapper + +\*---------------------------------------------------------------------------*/ + +#ifndef identityFvPatchFieldMapper_H +#define identityFvPatchFieldMapper_H + +#include "fvPatchFieldMapper.H" +#include "identityFieldMapper.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class identityFvPatchFieldMapper Declaration +\*---------------------------------------------------------------------------*/ + +class identityFvPatchFieldMapper +: + public fvPatchFieldMapper, + public identityFieldMapper +{ +public: + + // Constructors + + //- Construct + identityFvPatchFieldMapper() + {} + + + //- Destructor + virtual ~identityFvPatchFieldMapper() + {} + + + // Member Functions + + virtual bool hasUnmapped() const + { + return false; + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/reverseFvPatchFieldMapper.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/reverseFvPatchFieldMapper.H new file mode 100644 index 0000000000..8b211502ef --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/reverseFvPatchFieldMapper.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +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 . + +Class + Foam::reverseFvPatchFieldMapper + +Description + reverse fvPatchFieldMapper + +\*---------------------------------------------------------------------------*/ + +#ifndef reverseFvPatchFieldMapper_H +#define reverseFvPatchFieldMapper_H + +#include "fvPatchFieldMapper.H" +#include "reverseFieldMapper.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class reverseFvPatchFieldMapper Declaration +\*---------------------------------------------------------------------------*/ + +class reverseFvPatchFieldMapper +: + public fvPatchFieldMapper, + public reverseFieldMapper +{ + // Private Data + + //- Addressing from new back to old + const labelUList& addressing_; + + //- Does map contain any unmapped values + bool hasUnmapped_; + + +public: + + // Constructors + + //- Construct given addressing + reverseFvPatchFieldMapper(const labelUList& addressing) + : + addressing_(addressing), + hasUnmapped_(false) + { + if (addressing_.size() && min(addressing_) < 0) + { + hasUnmapped_ = true; + } + } + + + //- Destructor + virtual ~reverseFvPatchFieldMapper() + {} + + + // Member Functions + + virtual bool hasUnmapped() const + { + return hasUnmapped_; + } + + virtual const labelUList& addressing() const + { + return addressing_; + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/setSizeFvPatchFieldMapper.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/setSizeFvPatchFieldMapper.H new file mode 100644 index 0000000000..90bafa181b --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/setSizeFvPatchFieldMapper.H @@ -0,0 +1,77 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +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 . + +Class + Foam::setSizeFvPatchFieldMapper + +Description + Set size fvPatchFieldMapper + +\*---------------------------------------------------------------------------*/ + +#ifndef setSizeFvPatchFieldMapper_H +#define setSizeFvPatchFieldMapper_H + +#include "fvPatchFieldMapper.H" +#include "setSizeFieldMapper.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class setSizeFvPatchFieldMapper Declaration +\*---------------------------------------------------------------------------*/ + +class setSizeFvPatchFieldMapper +: + public fvPatchFieldMapper, + public setSizeFieldMapper +{ +public: + + // Constructors + + //- Construct + setSizeFvPatchFieldMapper(const label size) + : + setSizeFieldMapper(size) + {} + + + //- Destructor + virtual ~setSizeFvPatchFieldMapper() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.H index 6437e502c6..b0ce87dbeb 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -112,14 +112,8 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&) - {} - - //- Reverse map the given fvsPatchField onto this fvsPatchField - // Used to reconstruct fields - virtual void rmap(const fvsPatchField&, const labelList&) + //- Map the given fvsPatchField onto this fvsPatchField + virtual void map(const fvsPatchField&, const labelList&) {} //- Reset the fvsPatchField to the given fvsPatchField diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C index f4f6b0e056..0a5df75a3c 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -137,23 +137,13 @@ void Foam::fvsPatchField::check(const fvsPatchField& ptf) const template -void Foam::fvsPatchField::autoMap -( - const fvPatchFieldMapper& m -) -{ - m(*this, *this); -} - - -template -void Foam::fvsPatchField::rmap +void Foam::fvsPatchField::map ( const fvsPatchField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - Field::rmap(ptf, addr); + mapper(*this, ptf); } diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H index 1ff92700cd..f137bedcfc 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -380,13 +380,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvsPatchField onto this fvsPatchField - // Used to reconstruct fields - virtual void rmap(const fvsPatchField&, const labelList&); + //- Map the given fvsPatchField onto this fvsPatchField + virtual void map + ( + const fvsPatchField&, + const fvPatchFieldMapper& + ); //- Reset the fvsPatchField to the given fvsPatchField // Used for mesh to mesh mapping diff --git a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcherTemplates.C b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcherTemplates.C index a404c2d210..afd153acc6 100644 --- a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcherTemplates.C +++ b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcherTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,7 +30,7 @@ Description #include "surfaceFields.H" #include "fvPatchFieldMapper.H" #include "fvMeshStitcher.H" -#include "setSizeFieldMapper.H" +#include "setSizeFvPatchFieldMapper.H" #include "nonConformalBoundary.H" #include "nonConformalCyclicFvPatch.H" #include "nonConformalProcessorCyclicFvPatch.H" @@ -43,17 +43,6 @@ Description template class GeoField> void Foam::fvMeshStitcher::resizePatchFields() { - struct fvPatchFieldSetSizer - : - public fvPatchFieldMapper, - public setSizeFieldMapper - { - fvPatchFieldSetSizer(const label size) - : - setSizeFieldMapper(size) - {} - }; - HashTable*> fields(mesh_.lookupClass>()); forAllIter(typename HashTable*>, fields, iter) { @@ -64,7 +53,7 @@ void Foam::fvMeshStitcher::resizePatchFields() if (isA(pf.patch())) { - pf.autoMap(fvPatchFieldSetSizer(pf.patch().size())); + pf.map(pf, setSizeFvPatchFieldMapper(pf.patch().size())); } } } @@ -327,24 +316,14 @@ void Foam::fvMeshStitcher::resizeBoundaryFieldPatchFields GeoBoundaryField& fieldBf ) { - struct fvPatchFieldSetSizer - : - public fvPatchFieldMapper, - public setSizeFieldMapper - { - fvPatchFieldSetSizer(const label size) - : - setSizeFieldMapper(size) - {} - }; - forAll(polyFacesBf, nccPatchi) { if (isA(polyFacesBf[nccPatchi].patch())) { - fieldBf[nccPatchi].autoMap + fieldBf[nccPatchi].map ( - fvPatchFieldSetSizer(polyFacesBf[nccPatchi].size()) + fieldBf[nccPatchi], + setSizeFvPatchFieldMapper(polyFacesBf[nccPatchi].size()) ); } } diff --git a/src/finiteVolume/fvMeshToFvMesh/fvMeshToFvMeshTemplates.C b/src/finiteVolume/fvMeshToFvMesh/fvMeshToFvMeshTemplates.C index eddcbd43ca..252fe70bb7 100644 --- a/src/finiteVolume/fvMeshToFvMesh/fvMeshToFvMeshTemplates.C +++ b/src/finiteVolume/fvMeshToFvMesh/fvMeshToFvMeshTemplates.C @@ -25,6 +25,7 @@ License #include "fvMeshToFvMesh.H" #include "directFvPatchFieldMapper.H" +#include "identityFvPatchFieldMapper.H" #include "patchToPatchFvPatchFieldMapper.H" // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // @@ -49,7 +50,7 @@ void Foam::fvMeshToFvMesh::mapSrcToTgt const fvPatchField& srcField = field.boundaryField()[srcPatchi]; fvPatchField& tgtField = resultBf[tgtPatchi]; - // Clone and map (since rmap does not do general mapping) + // Clone and map tmp> tnewTgt ( fvPatchField::New @@ -67,7 +68,7 @@ void Foam::fvMeshToFvMesh::mapSrcToTgt // Transfer all mapped quantities (value and e.g. gradient) onto // tgtField. Value will get overwritten below. - tgtField.rmap(tnewTgt(), identityMap(tgtField.size())); + tgtField.map(tnewTgt(), identityFvPatchFieldMapper()); } forAll(tgtCuttingPatchIDs(), i) diff --git a/src/fvMeshTopoChangers/meshToMesh/MeshToMeshMapGeometricFields.H b/src/fvMeshTopoChangers/meshToMesh/MeshToMeshMapGeometricFields.H index a3502e177f..15fafcb175 100644 --- a/src/fvMeshTopoChangers/meshToMesh/MeshToMeshMapGeometricFields.H +++ b/src/fvMeshTopoChangers/meshToMesh/MeshToMeshMapGeometricFields.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -227,7 +227,7 @@ template class Type, template class PatchField, class GeoMesh, - class PatchMapper + class SetSizePatchFieldMapper > void NaNGeometricFields ( @@ -237,23 +237,6 @@ void NaNGeometricFields { typedef GeometricField GField; - //- Mapper for sizing only - does not do any actual mapping. - class patchFieldResizeMapper - : - public PatchMapper, - public setSizeFieldMapper - { - public: - - // Constructors - - //- Construct given size - patchFieldResizeMapper(const label size) - : - setSizeFieldMapper(size) - {} - }; - HashTable fields ( mesh.objectRegistry::template lookupClass() @@ -321,7 +304,7 @@ void NaNGeometricFields else { typename GField::Patch& pf = field.boundaryFieldRef()[patchi]; - pf.autoMap(patchFieldResizeMapper(pf.patch().size())); + pf.map(pf, SetSizePatchFieldMapper(pf.patch().size())); } field.boundaryFieldRef()[patchi] == NaN; diff --git a/src/fvMeshTopoChangers/meshToMesh/fvMeshTopoChangersMeshToMesh.C b/src/fvMeshTopoChangers/meshToMesh/fvMeshTopoChangersMeshToMesh.C index 9dbcd29105..65871da7ea 100644 --- a/src/fvMeshTopoChangers/meshToMesh/fvMeshTopoChangersMeshToMesh.C +++ b/src/fvMeshTopoChangers/meshToMesh/fvMeshTopoChangersMeshToMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,6 +35,8 @@ License #include "MeshToMeshMapGeometricFields.H" #include "polyMeshMap.H" #include "processorPolyPatch.H" +#include "setSizeFvPatchFieldMapper.H" +#include "setSizePointPatchFieldMapper.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -218,14 +220,14 @@ bool Foam::fvMeshTopoChangers::meshToMesh::update() // Set all the surfaceFields in the objectRegistry to NaN #define NaNSurfaceFieldType(Type, nullArg) \ NaNGeometricFields \ - \ + \ (mesh(), mapper); FOR_ALL_FIELD_TYPES(NaNSurfaceFieldType); // Set all the pointFields in the objectRegistry to NaN #define NaNPointFieldType(Type, nullArg) \ NaNGeometricFields \ - \ + \ (mesh(), mapper); FOR_ALL_FIELD_TYPES(NaNPointFieldType); diff --git a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C index bf6fe21696..b9b9a54948 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -122,29 +122,18 @@ angularOscillatingDisplacementPointPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void angularOscillatingDisplacementPointPatchVectorField::autoMap -( - const pointPatchFieldMapper& m -) -{ - fixedValuePointPatchField::autoMap(m); - - m(p0_, p0_); -} - - -void angularOscillatingDisplacementPointPatchVectorField::rmap +void angularOscillatingDisplacementPointPatchVectorField::map ( const pointPatchField& ptf, - const labelList& addr + const pointPatchFieldMapper& mapper ) { const angularOscillatingDisplacementPointPatchVectorField& aODptf = refCast(ptf); - fixedValuePointPatchField::rmap(aODptf, addr); + fixedValuePointPatchField::map(aODptf, mapper); - p0_.rmap(aODptf.p0_, addr); + mapper(p0_, aODptf.p0_); } diff --git a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.H index 38d859f697..02a2e32f85 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,7 +84,9 @@ public: const dictionary& ); - //- Construct by mapping given patchField onto a new patch + //- Construct by mapping given + // angularOscillatingDisplacementPointPatchVectorField + // onto a new patch angularOscillatingDisplacementPointPatchVectorField ( const angularOscillatingDisplacementPointPatchVectorField&, @@ -121,13 +123,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const pointPatchFieldMapper&); - - //- Reverse map the given pointPatchField onto this pointPatchField - // Used to reconstruct fields - virtual void rmap(const pointPatchField&, const labelList&); + //- Map the given pointPatchField onto this pointPatchField + virtual void map + ( + const pointPatchField&, + const pointPatchFieldMapper& + ); //- Reset the pointPatchField to the given pointPatchField // Used for mesh to mesh mapping diff --git a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C index 5d40261589..2cd9b92b42 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -122,29 +122,18 @@ angularOscillatingVelocityPointPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void angularOscillatingVelocityPointPatchVectorField::autoMap -( - const pointPatchFieldMapper& m -) -{ - fixedValuePointPatchField::autoMap(m); - - m(p0_, p0_); -} - - -void angularOscillatingVelocityPointPatchVectorField::rmap +void angularOscillatingVelocityPointPatchVectorField::map ( const pointPatchField& ptf, - const labelList& addr + const pointPatchFieldMapper& mapper ) { const angularOscillatingVelocityPointPatchVectorField& aOVptf = refCast(ptf); - fixedValuePointPatchField::rmap(aOVptf, addr); + fixedValuePointPatchField::map(aOVptf, mapper); - p0_.rmap(aOVptf.p0_, addr); + mapper(p0_, aOVptf.p0_); } diff --git a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.H index 6ee1f9e666..57589b0282 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,7 +84,9 @@ public: const dictionary& ); - //- Construct by mapping given patchField onto a new patch + //- Construct by mapping given + // angularOscillatingVelocityPointPatchVectorField + // onto a new patch angularOscillatingVelocityPointPatchVectorField ( const angularOscillatingVelocityPointPatchVectorField&, @@ -121,13 +123,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const pointPatchFieldMapper&); - - //- Reverse map the given pointPatchField onto this pointPatchField - // Used to reconstruct fields - virtual void rmap(const pointPatchField&, const labelList&); + //- Map the given pointPatchField onto this pointPatchField + virtual void map + ( + const pointPatchField&, + const pointPatchFieldMapper& + ); //- Reset the pointPatchField to the given pointPatchField // Used for mesh to mesh mapping diff --git a/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C index ae0d777627..0766ff2423 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -110,29 +110,18 @@ oscillatingVelocityPointPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void oscillatingVelocityPointPatchVectorField::autoMap -( - const pointPatchFieldMapper& m -) -{ - fixedValuePointPatchField::autoMap(m); - - m(p0_, p0_); -} - - -void oscillatingVelocityPointPatchVectorField::rmap +void oscillatingVelocityPointPatchVectorField::map ( const pointPatchField& ptf, - const labelList& addr + const pointPatchFieldMapper& mapper ) { const oscillatingVelocityPointPatchVectorField& oVptf = refCast(ptf); - fixedValuePointPatchField::rmap(oVptf, addr); + fixedValuePointPatchField::map(oVptf, mapper); - p0_.rmap(oVptf.p0_, addr); + mapper(p0_, oVptf.p0_); } diff --git a/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.H index 596d8246d4..e2e769eb1f 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -81,7 +81,9 @@ public: const dictionary& ); - //- Construct by mapping given patchField onto a new patch + //- Construct by mapping given + // oscillatingVelocityPointPatchVectorField + // onto a new patch oscillatingVelocityPointPatchVectorField ( const oscillatingVelocityPointPatchVectorField&, @@ -118,13 +120,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const pointPatchFieldMapper&); - - //- Reverse map the given pointPatchField onto this pointPatchField - // Used to reconstruct fields - virtual void rmap(const pointPatchField&, const labelList&); + //- Map the given pointPatchField onto this pointPatchField + virtual void map + ( + const pointPatchField&, + const pointPatchFieldMapper& + ); //- Reset the pointPatchField to the given pointPatchField // Used for mesh to mesh mapping diff --git a/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C b/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C index fc2af088ae..a6c00603af 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -178,38 +178,19 @@ timeVaryingMappedFixedValuePointPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::timeVaryingMappedFixedValuePointPatchField::autoMap -( - const pointPatchFieldMapper& m -) -{ - fixedValuePointPatchField::autoMap(m); - if (startSampledValues_.size()) - { - m(startSampledValues_, startSampledValues_); - m(endSampledValues_, endSampledValues_); - } - // Clear interpolator - mapperPtr_.clear(); - startSampleTime_ = -1; - endSampleTime_ = -1; -} - - -template -void Foam::timeVaryingMappedFixedValuePointPatchField::rmap +void Foam::timeVaryingMappedFixedValuePointPatchField::map ( const pointPatchField& ptf, - const labelList& addr + const pointPatchFieldMapper& mapper ) { - fixedValuePointPatchField::rmap(ptf, addr); + fixedValuePointPatchField::map(ptf, mapper); const timeVaryingMappedFixedValuePointPatchField& tiptf = refCast>(ptf); - startSampledValues_.rmap(tiptf.startSampledValues_, addr); - endSampledValues_.rmap(tiptf.endSampledValues_, addr); + mapper(startSampledValues_, tiptf.startSampledValues_); + mapper(endSampledValues_, tiptf.endSampledValues_); // Clear interpolator mapperPtr_.clear(); diff --git a/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.H b/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.H index be6bdceda4..65aeb1cf26 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -122,7 +122,9 @@ public: const dictionary& ); - //- Construct by mapping given patch field onto a new patch + //- Construct by mapping given + // timeVaryingMappedFixedValuePointPatchField + // onto a new patch timeVaryingMappedFixedValuePointPatchField ( const timeVaryingMappedFixedValuePointPatchField&, @@ -167,13 +169,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const pointPatchFieldMapper&); - - //- Reverse map the given pointPatchField onto this pointPatchField - // Used to reconstruct fields - virtual void rmap(const pointPatchField&, const labelList&); + //- Map the given pointPatchField onto this pointPatchField + virtual void map + ( + const pointPatchField&, + const pointPatchFieldMapper& + ); //- Reset the pointPatchField to the given pointPatchField // Used for mesh to mesh mapping diff --git a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C index 837fd26503..a2f16ddc6b 100644 --- a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C +++ b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -517,73 +517,13 @@ Foam::genericFvPatchField::genericFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::genericFvPatchField::autoMap -( - const fvPatchFieldMapper& m -) -{ - calculatedFvPatchField::autoMap(m); - - forAllIter - ( - HashPtrTable, - scalarFields_, - iter - ) - { - m(*iter(), *iter()); - } - - forAllIter - ( - HashPtrTable, - vectorFields_, - iter - ) - { - m(*iter(), *iter()); - } - - forAllIter - ( - HashPtrTable, - sphericalTensorFields_, - iter - ) - { - m(*iter(), *iter()); - } - - forAllIter - ( - HashPtrTable, - symmTensorFields_, - iter - ) - { - m(*iter(), *iter()); - } - - forAllIter - ( - HashPtrTable, - tensorFields_, - iter - ) - { - m(*iter(), *iter()); - } -} - - -template -void Foam::genericFvPatchField::rmap +void Foam::genericFvPatchField::map ( const fvPatchField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - calculatedFvPatchField::rmap(ptf, addr); + calculatedFvPatchField::map(ptf, mapper); const genericFvPatchField& dptf = refCast>(ptf); @@ -600,7 +540,7 @@ void Foam::genericFvPatchField::rmap if (dptfIter != dptf.scalarFields_.end()) { - iter()->rmap(*dptfIter(), addr); + mapper(*iter(), *dptfIter()); } } @@ -616,7 +556,7 @@ void Foam::genericFvPatchField::rmap if (dptfIter != dptf.vectorFields_.end()) { - iter()->rmap(*dptfIter(), addr); + mapper(*iter(), *dptfIter()); } } @@ -632,7 +572,7 @@ void Foam::genericFvPatchField::rmap if (dptfIter != dptf.sphericalTensorFields_.end()) { - iter()->rmap(*dptfIter(), addr); + mapper(*iter(), *dptfIter()); } } @@ -648,7 +588,7 @@ void Foam::genericFvPatchField::rmap if (dptfIter != dptf.symmTensorFields_.end()) { - iter()->rmap(*dptfIter(), addr); + mapper(*iter(), *dptfIter()); } } @@ -664,7 +604,7 @@ void Foam::genericFvPatchField::rmap if (dptfIter != dptf.tensorFields_.end()) { - iter()->rmap(*dptfIter(), addr); + mapper(*iter(), *dptfIter()); } } } diff --git a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H index 4374e2865c..969d1d58f0 100644 --- a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H +++ b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -93,7 +93,7 @@ public: const dictionary& ); - //- Construct by mapping given patchField onto a new patch + //- Construct by mapping given genericFvPatchField onto a new patch genericFvPatchField ( const genericFvPatchField&, @@ -129,13 +129,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/genericPatchFields/genericPointPatchField/genericPointPatchField.C b/src/genericPatchFields/genericPointPatchField/genericPointPatchField.C index 31bb938355..5ae0d1017e 100644 --- a/src/genericPatchFields/genericPointPatchField/genericPointPatchField.C +++ b/src/genericPatchFields/genericPointPatchField/genericPointPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -408,68 +408,10 @@ Foam::genericPointPatchField::genericPointPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::genericPointPatchField::autoMap -( - const pointPatchFieldMapper& m -) -{ - forAllIter - ( - HashPtrTable, - scalarFields_, - iter - ) - { - m(*iter(), *iter()); - } - - forAllIter - ( - HashPtrTable, - vectorFields_, - iter - ) - { - m(*iter(), *iter()); - } - - forAllIter - ( - HashPtrTable, - sphericalTensorFields_, - iter - ) - { - m(*iter(), *iter()); - } - - forAllIter - ( - HashPtrTable, - symmTensorFields_, - iter - ) - { - m(*iter(), *iter()); - } - - forAllIter - ( - HashPtrTable, - tensorFields_, - iter - ) - { - m(*iter(), *iter()); - } -} - - -template -void Foam::genericPointPatchField::rmap +void Foam::genericPointPatchField::map ( const pointPatchField& ptf, - const labelList& addr + const pointPatchFieldMapper& mapper ) { const genericPointPatchField& dptf = @@ -487,7 +429,7 @@ void Foam::genericPointPatchField::rmap if (dptfIter != scalarFields_.end()) { - iter()->rmap(*dptfIter(), addr); + mapper(*iter(), *dptfIter()); } } @@ -503,7 +445,7 @@ void Foam::genericPointPatchField::rmap if (dptfIter != vectorFields_.end()) { - iter()->rmap(*dptfIter(), addr); + mapper(*iter(), *dptfIter()); } } @@ -519,7 +461,7 @@ void Foam::genericPointPatchField::rmap if (dptfIter != sphericalTensorFields_.end()) { - iter()->rmap(*dptfIter(), addr); + mapper(*iter(), *dptfIter()); } } @@ -535,7 +477,7 @@ void Foam::genericPointPatchField::rmap if (dptfIter != symmTensorFields_.end()) { - iter()->rmap(*dptfIter(), addr); + mapper(*iter(), *dptfIter()); } } @@ -551,7 +493,7 @@ void Foam::genericPointPatchField::rmap if (dptfIter != tensorFields_.end()) { - iter()->rmap(*dptfIter(), addr); + mapper(*iter(), *dptfIter()); } } } diff --git a/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H b/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H index 20576dd885..6ee5f23a5e 100644 --- a/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H +++ b/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -89,7 +89,7 @@ public: const dictionary& ); - //- Construct by mapping given patchField onto a new patch + //- Construct by mapping given genericPointPatchField onto a new patch genericPointPatchField ( const genericPointPatchField&, @@ -126,13 +126,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const pointPatchFieldMapper&); - - //- Reverse map the given pointPatchField onto this pointPatchField - // Used to reconstruct fields - virtual void rmap(const pointPatchField&, const labelList&); + //- Map the given pointPatchField onto this pointPatchField + virtual void map + ( + const pointPatchField&, + const pointPatchFieldMapper& + ); //- Reset the pointPatchField to the given pointPatchField // Used for mesh to mesh mapping diff --git a/src/lagrangian/parcel/submodels/CloudFunctionObjects/PatchCollisionDensity/PatchCollisionDensity.C b/src/lagrangian/parcel/submodels/CloudFunctionObjects/PatchCollisionDensity/PatchCollisionDensity.C index d2dcbdb011..5f9d10dbfa 100644 --- a/src/lagrangian/parcel/submodels/CloudFunctionObjects/PatchCollisionDensity/PatchCollisionDensity.C +++ b/src/lagrangian/parcel/submodels/CloudFunctionObjects/PatchCollisionDensity/PatchCollisionDensity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,7 +30,7 @@ License #include "ListListOps.H" #include "nonConformalFvPatch.H" #include "fvPatchFieldMapper.H" -#include "setSizeFieldMapper.H" +#include "setSizeFvPatchFieldMapper.H" // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // @@ -246,23 +246,28 @@ void Foam::PatchCollisionDensity::preEvolve() if (isA(fvp)) { - struct fvPatchFieldSetSizer - : - public fvPatchFieldMapper, - public setSizeFieldMapper - { - fvPatchFieldSetSizer(const label size) - : - setSizeFieldMapper(size) - {} - }; + const setSizeFvPatchFieldMapper mapper(fvp.size()); - const fvPatchFieldSetSizer mapper(fvp.size()); - - numberCollisionDensity_[patchi].autoMap(mapper); - numberCollisionDensity0_[patchi].autoMap(mapper); - massCollisionDensity_[patchi].autoMap(mapper); - massCollisionDensity0_[patchi].autoMap(mapper); + numberCollisionDensity_[patchi].map + ( + numberCollisionDensity_[patchi], + mapper + ); + numberCollisionDensity0_[patchi].map + ( + numberCollisionDensity0_[patchi], + mapper + ); + massCollisionDensity_[patchi].map + ( + massCollisionDensity_[patchi], + mapper + ); + massCollisionDensity0_[patchi].map + ( + massCollisionDensity0_[patchi], + mapper + ); numberCollisionDensity_[patchi] == 0; numberCollisionDensity0_[patchi] == 0; diff --git a/src/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C b/src/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C index 82fffcf520..6be631a9d3 100644 --- a/src/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C +++ b/src/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -116,24 +116,14 @@ Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::MarshakRadiationFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - mixedFvPatchScalarField::autoMap(m); - radiationCoupledBase::autoMap(m); -} - - -void Foam::MarshakRadiationFvPatchScalarField::rmap +void Foam::MarshakRadiationFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - mixedFvPatchScalarField::rmap(ptf, addr); - radiationCoupledBase::rmap(ptf, addr); + mixedFvPatchScalarField::map(ptf, mapper); + radiationCoupledBase::map(ptf, mapper); } diff --git a/src/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.H b/src/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.H index b279eff1c9..68259d2ce1 100644 --- a/src/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.H +++ b/src/radiationModels/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -162,13 +162,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/radiationModels/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.C b/src/radiationModels/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.C index 70377f8b03..90cea7ffd3 100644 --- a/src/radiationModels/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.C +++ b/src/radiationModels/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -114,29 +114,18 @@ MarshakRadiationFixedTemperatureFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::MarshakRadiationFixedTemperatureFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - mixedFvPatchScalarField::autoMap(m); - radiationCoupledBase::autoMap(m); - m(Trad_, Trad_); -} - - -void Foam::MarshakRadiationFixedTemperatureFvPatchScalarField::rmap +void Foam::MarshakRadiationFixedTemperatureFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - mixedFvPatchScalarField::rmap(ptf, addr); - radiationCoupledBase::rmap(ptf, addr); + mixedFvPatchScalarField::map(ptf, mapper); + radiationCoupledBase::map(ptf, mapper); const MarshakRadiationFixedTemperatureFvPatchScalarField& mrptf = refCast(ptf); - Trad_.rmap(mrptf.Trad_, addr); + mapper(Trad_, mrptf.Trad_); } diff --git a/src/radiationModels/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.H b/src/radiationModels/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.H index 160cf9a20e..578c5b6d97 100644 --- a/src/radiationModels/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.H +++ b/src/radiationModels/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -166,13 +166,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C b/src/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C index e2d95b3bf7..dcd49768cc 100644 --- a/src/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -127,24 +127,14 @@ greyDiffusiveRadiationMixedFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::greyDiffusiveRadiationMixedFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - mixedFvPatchScalarField::autoMap(m); - radiationCoupledBase::autoMap(m); -} - - -void Foam::greyDiffusiveRadiationMixedFvPatchScalarField::rmap +void Foam::greyDiffusiveRadiationMixedFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - mixedFvPatchScalarField::rmap(ptf, addr); - radiationCoupledBase::rmap(ptf, addr); + mixedFvPatchScalarField::map(ptf, mapper); + radiationCoupledBase::map(ptf, mapper); } diff --git a/src/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H b/src/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H index f710c340a7..0231002625 100644 --- a/src/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/radiationModels/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -164,13 +164,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/radiationModels/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C b/src/radiationModels/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C index e38690cc95..28f7d519ee 100644 --- a/src/radiationModels/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C +++ b/src/radiationModels/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -112,29 +112,18 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::greyDiffusiveViewFactorFixedValueFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedValueFvPatchScalarField::autoMap(m); - radiationCoupledBase::autoMap(m); - m(qro_, qro_); -} - - -void Foam::greyDiffusiveViewFactorFixedValueFvPatchScalarField::rmap +void Foam::greyDiffusiveViewFactorFixedValueFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fixedValueFvPatchScalarField::rmap(ptf, addr); - radiationCoupledBase::rmap(ptf, addr); + fixedValueFvPatchScalarField::map(ptf, mapper); + radiationCoupledBase::map(ptf, mapper); const greyDiffusiveViewFactorFixedValueFvPatchScalarField& mrptf = refCast(ptf); - qro_.rmap(mrptf.qro_, addr); + mapper(qro_, mrptf.qro_); } diff --git a/src/radiationModels/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.H b/src/radiationModels/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.H index ac994680c0..918f2ad044 100644 --- a/src/radiationModels/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.H +++ b/src/radiationModels/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -107,7 +107,7 @@ public: ); //- Construct by mapping given a - // greyDiffusiveViewFactorFixedValueFvPatchScalarField onto a new patch + // greyDiffusiveViewFactorFixedValueFvPatchScalarField onto a new patch greyDiffusiveViewFactorFixedValueFvPatchScalarField ( const greyDiffusiveViewFactorFixedValueFvPatchScalarField&, @@ -159,13 +159,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/radiationModels/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C b/src/radiationModels/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C index e7c422c862..4676f28cc3 100644 --- a/src/radiationModels/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C +++ b/src/radiationModels/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C @@ -177,22 +177,16 @@ Foam::tmp Foam::radiationCoupledBase::emissivity() const } -void Foam::radiationCoupledBase::autoMap(const fvPatchFieldMapper& m) -{ - m(emissivity_, emissivity_); -} - - -void Foam::radiationCoupledBase::rmap +void Foam::radiationCoupledBase::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { const radiationCoupledBase& mrptf = refCast(ptf); - emissivity_.rmap(mrptf.emissivity_, addr); + mapper(emissivity_, mrptf.emissivity_); } diff --git a/src/radiationModels/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.H b/src/radiationModels/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.H index e01230bdd3..c367716e2c 100644 --- a/src/radiationModels/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.H +++ b/src/radiationModels/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -142,13 +142,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C b/src/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C index ff4878c5ab..c13eef6af1 100644 --- a/src/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -131,24 +131,14 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::wideBandDiffusiveRadiationMixedFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - mixedFvPatchScalarField::autoMap(m); - radiationCoupledBase::autoMap(m); -} - - -void Foam::wideBandDiffusiveRadiationMixedFvPatchScalarField::rmap +void Foam::wideBandDiffusiveRadiationMixedFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - mixedFvPatchScalarField::rmap(ptf, addr); - radiationCoupledBase::rmap(ptf, addr); + mixedFvPatchScalarField::map(ptf, mapper); + radiationCoupledBase::map(ptf, mapper); } diff --git a/src/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H b/src/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H index c12d0a6c28..238aed60d6 100644 --- a/src/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -157,13 +157,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/specieTransfer/derivedFvPatchFields/specieTransferMassFraction/specieTransferMassFractionFvPatchScalarField.C b/src/specieTransfer/derivedFvPatchFields/specieTransferMassFraction/specieTransferMassFractionFvPatchScalarField.C index de45fa3d36..cf4e1459d3 100644 --- a/src/specieTransfer/derivedFvPatchFields/specieTransferMassFraction/specieTransferMassFractionFvPatchScalarField.C +++ b/src/specieTransfer/derivedFvPatchFields/specieTransferMassFraction/specieTransferMassFractionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -159,29 +159,18 @@ specieTransferMassFractionFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::specieTransferMassFractionFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - mixedFvPatchScalarField::autoMap(m); - - m(phiYp_, phiYp_); -} - - -void Foam::specieTransferMassFractionFvPatchScalarField::rmap +void Foam::specieTransferMassFractionFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - mixedFvPatchScalarField::rmap(ptf, addr); + mixedFvPatchScalarField::map(ptf, mapper); const specieTransferMassFractionFvPatchScalarField& tiptf = refCast(ptf); - phiYp_.rmap(tiptf.phiYp_, addr); + mapper(phiYp_, tiptf.phiYp_); } diff --git a/src/specieTransfer/derivedFvPatchFields/specieTransferMassFraction/specieTransferMassFractionFvPatchScalarField.H b/src/specieTransfer/derivedFvPatchFields/specieTransferMassFraction/specieTransferMassFractionFvPatchScalarField.H index 7bc99a9685..91aebcab61 100644 --- a/src/specieTransfer/derivedFvPatchFields/specieTransferMassFraction/specieTransferMassFractionFvPatchScalarField.H +++ b/src/specieTransfer/derivedFvPatchFields/specieTransferMassFraction/specieTransferMassFractionFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -128,7 +128,8 @@ public: const dictionary& ); - //- Construct by mapping given fixedValueTypeFvPatchField + //- Construct by mapping given + // specieTransferMassFractionFvPatchScalarField // onto a new patch specieTransferMassFractionFvPatchScalarField ( @@ -156,13 +157,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyCalculatedTemperatureFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyCalculatedTemperatureFvPatchScalarField.C index fedf6fa8bd..26b1e4937b 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyCalculatedTemperatureFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyCalculatedTemperatureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,23 +94,13 @@ gradientEnergyCalculatedTemperatureFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::gradientEnergyCalculatedTemperatureFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - calculatedFvPatchScalarField::autoMap(m); - m(heGradient_, heGradient_); -} - - -void Foam::gradientEnergyCalculatedTemperatureFvPatchScalarField::rmap +void Foam::gradientEnergyCalculatedTemperatureFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - calculatedFvPatchScalarField::rmap(ptf, addr); + calculatedFvPatchScalarField::map(ptf, mapper); const gradientEnergyCalculatedTemperatureFvPatchScalarField& mptf = refCast @@ -118,7 +108,7 @@ void Foam::gradientEnergyCalculatedTemperatureFvPatchScalarField::rmap ptf ); - heGradient_.rmap(mptf.heGradient_, addr); + mapper(heGradient_, mptf.heGradient_); } diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyCalculatedTemperatureFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyCalculatedTemperatureFvPatchScalarField.H index 95cd03ea44..3c63e9c182 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyCalculatedTemperatureFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyCalculatedTemperatureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -82,7 +82,8 @@ public: const dictionary& ); - //- Construct by mapping given fixedValueTypeFvPatchField + //- Construct by mapping given + // gradientEnergyCalculatedTemperatureFvPatchScalarField // onto a new patch gradientEnergyCalculatedTemperatureFvPatchScalarField ( @@ -147,13 +148,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyCalculatedTemperatureFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyCalculatedTemperatureFvPatchScalarField.C index 92ce3468fd..7175add350 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyCalculatedTemperatureFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyCalculatedTemperatureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -102,32 +102,20 @@ mixedEnergyCalculatedTemperatureFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::mixedEnergyCalculatedTemperatureFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - calculatedFvPatchScalarField::autoMap(m); - m(heRefValue_, heRefValue_); - m(heRefGrad_, heRefGrad_); - m(heValueFraction_, heValueFraction_); -} - - -void Foam::mixedEnergyCalculatedTemperatureFvPatchScalarField::rmap +void Foam::mixedEnergyCalculatedTemperatureFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - calculatedFvPatchScalarField::rmap(ptf, addr); + calculatedFvPatchScalarField::map(ptf, mapper); const mixedEnergyCalculatedTemperatureFvPatchScalarField& mptf = refCast(ptf); - heRefValue_.rmap(mptf.heRefValue_, addr); - heRefGrad_.rmap(mptf.heRefGrad_, addr); - heValueFraction_.rmap(mptf.heValueFraction_, addr); + mapper(heRefValue_, mptf.heRefValue_); + mapper(heRefGrad_, mptf.heRefGrad_); + mapper(heValueFraction_, mptf.heValueFraction_); } diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyCalculatedTemperatureFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyCalculatedTemperatureFvPatchScalarField.H index 24423a96d1..a87c685834 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyCalculatedTemperatureFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyCalculatedTemperatureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -88,7 +88,8 @@ public: const dictionary& ); - //- Construct by mapping given fixedValueTypeFvPatchField + //- Construct by mapping given + // mixedEnergyCalculatedTemperatureFvPatchScalarField // onto a new patch mixedEnergyCalculatedTemperatureFvPatchScalarField ( @@ -177,13 +178,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping diff --git a/src/twoPhaseModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C b/src/twoPhaseModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C index 7bc6edafc3..14548b9b99 100644 --- a/src/twoPhaseModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C +++ b/src/twoPhaseModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -97,28 +97,18 @@ alphaFixedPressureFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::alphaFixedPressureFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - m(*this, *this); - m(p_, p_); -} - - -void Foam::alphaFixedPressureFvPatchScalarField::rmap +void Foam::alphaFixedPressureFvPatchScalarField::map ( const fvPatchScalarField& ptf, - const labelList& addr + const fvPatchFieldMapper& mapper ) { - fixedValueFvPatchScalarField::rmap(ptf, addr); + fixedValueFvPatchScalarField::map(ptf, mapper); const alphaFixedPressureFvPatchScalarField& tiptf = refCast(ptf); - p_.rmap(tiptf.p_, addr); + mapper(p_, tiptf.p_); } diff --git a/src/twoPhaseModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H b/src/twoPhaseModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H index 2bf8638111..8ebd317f8b 100644 --- a/src/twoPhaseModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H +++ b/src/twoPhaseModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -134,13 +134,12 @@ public: // Mapping functions - //- Map (and resize as needed) from self given a mapping object - // Used to update fields following mesh topology change - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - // Used to reconstruct fields - virtual void rmap(const fvPatchScalarField&, const labelList&); + //- Map the given fvPatchField onto this fvPatchField + virtual void map + ( + const fvPatchScalarField&, + const fvPatchFieldMapper& + ); //- Reset the fvPatchField to the given fvPatchField // Used for mesh to mesh mapping