fieldMapper: Simplification

The patch-specific mapper interfaces, fvPatchFieldMapper and
pointPatchFieldMapper, have been removed as they did not do anything.
Patch mapping constructors and functions now take a basic fieldMapper
reference.

An fvPatchFieldMapper.H header has been provided to aid backwards
compatability so that existing custom boundary conditions continue to
compile.
This commit is contained in:
Will Bainbridge
2023-11-10 10:20:52 +00:00
parent 02c28dda6a
commit cef86f598a
552 changed files with 1408 additions and 2530 deletions

View File

@ -25,7 +25,7 @@ License
#include "adjointOutletPressureFvPatchScalarField.H" #include "adjointOutletPressureFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvPatchMapper.H" #include "fieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
@ -49,7 +49,7 @@ adjointOutletPressureFvPatchScalarField
const adjointOutletPressureFvPatchScalarField& ptf, const adjointOutletPressureFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedValueFvPatchScalarField(ptf, p, iF, mapper) fixedValueFvPatchScalarField(ptf, p, iF, mapper)

View File

@ -73,7 +73,7 @@ public:
const adjointOutletPressureFvPatchScalarField&, const adjointOutletPressureFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Construct as copy setting internal field reference //- Construct as copy setting internal field reference

View File

@ -26,8 +26,8 @@ License
#include "adjointOutletVelocityFvPatchVectorField.H" #include "adjointOutletVelocityFvPatchVectorField.H"
#include "volFields.H" #include "volFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fieldMapper.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "fvPatchFieldMapper.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -49,7 +49,7 @@ adjointOutletVelocityFvPatchVectorField
const adjointOutletVelocityFvPatchVectorField& ptf, const adjointOutletVelocityFvPatchVectorField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<vector, volMesh>& iF, const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedValueFvPatchVectorField(ptf, p, iF, mapper) fixedValueFvPatchVectorField(ptf, p, iF, mapper)

View File

@ -73,7 +73,7 @@ public:
const adjointOutletVelocityFvPatchVectorField&, const adjointOutletVelocityFvPatchVectorField&,
const fvPatch&, const fvPatch&,
const DimensionedField<vector, volMesh>&, const DimensionedField<vector, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Construct as copy setting internal field reference //- Construct as copy setting internal field reference

View File

@ -58,7 +58,7 @@ Foam::alphaOneFvPatchScalarField::alphaOneFvPatchScalarField
const alphaOneFvPatchScalarField& ptf, const alphaOneFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper, false) // Don't map fixedValueFvPatchField<scalar>(ptf, p, iF, mapper, false) // Don't map

View File

@ -81,7 +81,7 @@ public:
const alphaOneFvPatchScalarField&, const alphaOneFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -45,7 +45,7 @@ Foam::filmContactAngleFvPatchScalarField::filmContactAngleFvPatchScalarField
const filmContactAngleFvPatchScalarField& psf, const filmContactAngleFvPatchScalarField& psf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
zeroGradientFvPatchScalarField(psf, p, iF, mapper), zeroGradientFvPatchScalarField(psf, p, iF, mapper),

View File

@ -129,7 +129,7 @@ public:
const filmContactAngleFvPatchScalarField&, const filmContactAngleFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -66,7 +66,7 @@ filmSurfaceVelocityFvPatchVectorField
const filmSurfaceVelocityFvPatchVectorField& ptf, const filmSurfaceVelocityFvPatchVectorField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<vector, volMesh>& iF, const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
mixedFvPatchField<vector>(ptf, p, iF, mapper), mixedFvPatchField<vector>(ptf, p, iF, mapper),

View File

@ -116,7 +116,7 @@ public:
const filmSurfaceVelocityFvPatchVectorField&, const filmSurfaceVelocityFvPatchVectorField&,
const fvPatch&, const fvPatch&,
const DimensionedField<vector, volMesh>&, const DimensionedField<vector, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -46,7 +46,7 @@ Foam::mappedFilmPressureFvPatchScalarField::mappedFilmPressureFvPatchScalarField
const mappedFilmPressureFvPatchScalarField& ptf, const mappedFilmPressureFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
zeroGradientFvPatchField<scalar>(ptf, p, iF, mapper) zeroGradientFvPatchField<scalar>(ptf, p, iF, mapper)

View File

@ -75,7 +75,7 @@ public:
const mappedFilmPressureFvPatchScalarField&, const mappedFilmPressureFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -81,7 +81,7 @@ JohnsonJacksonParticleSlipFvPatchVectorField
const JohnsonJacksonParticleSlipFvPatchVectorField& ptf, const JohnsonJacksonParticleSlipFvPatchVectorField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<vector, volMesh>& iF, const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
partialSlipFvPatchVectorField(ptf, p, iF, mapper), partialSlipFvPatchVectorField(ptf, p, iF, mapper),

View File

@ -94,7 +94,7 @@ public:
const JohnsonJacksonParticleSlipFvPatchVectorField&, const JohnsonJacksonParticleSlipFvPatchVectorField&,
const fvPatch&, const fvPatch&,
const DimensionedField<vector, volMesh>&, const DimensionedField<vector, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -97,7 +97,7 @@ JohnsonJacksonParticleThetaFvPatchScalarField
const JohnsonJacksonParticleThetaFvPatchScalarField& ptf, const JohnsonJacksonParticleThetaFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
mixedFvPatchScalarField(ptf, p, iF, mapper), mixedFvPatchScalarField(ptf, p, iF, mapper),

View File

@ -97,7 +97,7 @@ public:
const JohnsonJacksonParticleThetaFvPatchScalarField&, const JohnsonJacksonParticleThetaFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "alphatPhaseChangeWallFunctionBase.H" #include "alphatPhaseChangeWallFunctionBase.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "phaseInterface.H" #include "phaseInterface.H"
#include "phaseSystem.H" #include "phaseSystem.H"

View File

@ -687,7 +687,7 @@ alphatWallBoilingWallFunctionFvPatchScalarField
const alphatWallBoilingWallFunctionFvPatchScalarField& psf, const alphatWallBoilingWallFunctionFvPatchScalarField& psf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedValueFvPatchScalarField(psf, p, iF, mapper), fixedValueFvPatchScalarField(psf, p, iF, mapper),
@ -752,7 +752,7 @@ alphatWallBoilingWallFunctionFvPatchScalarField
void alphatWallBoilingWallFunctionFvPatchScalarField::map void alphatWallBoilingWallFunctionFvPatchScalarField::map
( (
const fvPatchScalarField& ptf, const fvPatchScalarField& ptf,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
{ {
fixedValueFvPatchScalarField::map(ptf, mapper); fixedValueFvPatchScalarField::map(ptf, mapper);

View File

@ -317,7 +317,7 @@ public:
const alphatWallBoilingWallFunctionFvPatchScalarField&, const alphatWallBoilingWallFunctionFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference
@ -394,11 +394,7 @@ public:
// Mapping functions // Mapping functions
//- Map the given fvPatchField onto this fvPatchField //- Map the given fvPatchField onto this fvPatchField
virtual void map virtual void map(const fvPatchScalarField&, const fieldMapper&);
(
const fvPatchScalarField&,
const fvPatchFieldMapper&
);
//- Reset the fvPatchField to the given fvPatchField //- Reset the fvPatchField to the given fvPatchField
// Used for mesh to mesh mapping // Used for mesh to mesh mapping

View File

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "coupledMultiphaseTemperatureFvPatchScalarField.H" #include "coupledMultiphaseTemperatureFvPatchScalarField.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "phaseSystem.H" #include "phaseSystem.H"
#include "compressibleMomentumTransportModel.H" #include "compressibleMomentumTransportModel.H"
#include "phaseCompressibleMomentumTransportModel.H" #include "phaseCompressibleMomentumTransportModel.H"
@ -190,7 +190,7 @@ coupledMultiphaseTemperatureFvPatchScalarField
const coupledMultiphaseTemperatureFvPatchScalarField& psf, const coupledMultiphaseTemperatureFvPatchScalarField& psf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
coupledTemperatureFvPatchScalarField(psf, p, iF, mapper) coupledTemperatureFvPatchScalarField(psf, p, iF, mapper)

View File

@ -113,7 +113,7 @@ public:
const coupledMultiphaseTemperatureFvPatchScalarField&, const coupledMultiphaseTemperatureFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -111,7 +111,7 @@ multiphaseExternalTemperatureFvPatchScalarField
const multiphaseExternalTemperatureFvPatchScalarField& psf, const multiphaseExternalTemperatureFvPatchScalarField& psf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
externalTemperatureFvPatchScalarField(psf, p, iF, mapper) externalTemperatureFvPatchScalarField(psf, p, iF, mapper)

View File

@ -99,7 +99,7 @@ public:
const multiphaseExternalTemperatureFvPatchScalarField&, const multiphaseExternalTemperatureFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -25,7 +25,7 @@ License
#include "smoluchowskiJumpTFvPatchScalarField.H" #include "smoluchowskiJumpTFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "basicThermo.H" #include "basicThermo.H"
#include "mathematicalConstants.H" #include "mathematicalConstants.H"
@ -85,7 +85,7 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
const smoluchowskiJumpTFvPatchScalarField& ptf, const smoluchowskiJumpTFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
mixedFvPatchScalarField(ptf, p, iF, mapper), mixedFvPatchScalarField(ptf, p, iF, mapper),
@ -117,7 +117,7 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
void Foam::smoluchowskiJumpTFvPatchScalarField::map void Foam::smoluchowskiJumpTFvPatchScalarField::map
( (
const fvPatchField<scalar>& ptf, const fvPatchField<scalar>& ptf,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
{ {
mixedFvPatchField<scalar>::map(ptf, mapper); mixedFvPatchField<scalar>::map(ptf, mapper);

View File

@ -97,7 +97,7 @@ public:
const smoluchowskiJumpTFvPatchScalarField&, const smoluchowskiJumpTFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Construct as copy setting internal field reference //- Construct as copy setting internal field reference
@ -125,11 +125,7 @@ public:
// Mapping functions // Mapping functions
//- Map the given fvPatchField onto this fvPatchField //- Map the given fvPatchField onto this fvPatchField
virtual void map virtual void map(const fvPatchScalarField&, const fieldMapper&);
(
const fvPatchScalarField&,
const fvPatchFieldMapper&
);
//- Reset the fvPatchField to the given fvPatchField //- Reset the fvPatchField to the given fvPatchField
// Used for mesh to mesh mapping // Used for mesh to mesh mapping

View File

@ -26,7 +26,7 @@ License
#include "maxwellSlipUFvPatchVectorField.H" #include "maxwellSlipUFvPatchVectorField.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H" #include "mathematicalConstants.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "fvcGrad.H" #include "fvcGrad.H"
@ -90,7 +90,7 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
const maxwellSlipUFvPatchVectorField& mspvf, const maxwellSlipUFvPatchVectorField& mspvf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<vector, volMesh>& iF, const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
mixedFixedValueSlipFvPatchVectorField(mspvf, p, iF, mapper), mixedFixedValueSlipFvPatchVectorField(mspvf, p, iF, mapper),
@ -128,7 +128,7 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
void Foam::maxwellSlipUFvPatchVectorField::map void Foam::maxwellSlipUFvPatchVectorField::map
( (
const fvPatchVectorField& pvf, const fvPatchVectorField& pvf,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
{ {
mixedFixedValueSlipFvPatchVectorField::map(pvf, mapper); mixedFixedValueSlipFvPatchVectorField::map(pvf, mapper);

View File

@ -102,7 +102,7 @@ public:
const maxwellSlipUFvPatchVectorField&, const maxwellSlipUFvPatchVectorField&,
const fvPatch&, const fvPatch&,
const DimensionedField<vector, volMesh>&, const DimensionedField<vector, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Construct as copy setting internal field reference //- Construct as copy setting internal field reference
@ -130,11 +130,7 @@ public:
// Mapping functions // Mapping functions
//- Map the given fvPatchField onto this fvPatchField //- Map the given fvPatchField onto this fvPatchField
virtual void map virtual void map(const fvPatchVectorField&, const fieldMapper&);
(
const fvPatchVectorField&,
const fvPatchFieldMapper&
);
//- Reset the fvPatchField to the given fvPatchField //- Reset the fvPatchField to the given fvPatchField
// Used for mesh to mesh mapping // Used for mesh to mesh mapping

View File

@ -61,7 +61,7 @@ Foam::mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
const mixedFixedValueSlipFvPatchField<Type>& ptf, const mixedFixedValueSlipFvPatchField<Type>& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, volMesh>& iF, const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
transformFvPatchField<Type>(ptf, p, iF, mapper), transformFvPatchField<Type>(ptf, p, iF, mapper),
@ -89,7 +89,7 @@ template<class Type>
void Foam::mixedFixedValueSlipFvPatchField<Type>::map void Foam::mixedFixedValueSlipFvPatchField<Type>::map
( (
const fvPatchField<Type>& ptf, const fvPatchField<Type>& ptf,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
{ {
transformFvPatchField<Type>::map(ptf, mapper); transformFvPatchField<Type>::map(ptf, mapper);

View File

@ -97,7 +97,7 @@ public:
const mixedFixedValueSlipFvPatchField<Type>&, const mixedFixedValueSlipFvPatchField<Type>&,
const fvPatch&, const fvPatch&,
const DimensionedField<Type, volMesh>&, const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference
@ -139,11 +139,7 @@ public:
// Mapping functions // Mapping functions
//- Map the given fvPatchField onto this fvPatchField //- Map the given fvPatchField onto this fvPatchField
virtual void map virtual void map(const fvPatchField<Type>&, const fieldMapper&);
(
const fvPatchField<Type>&,
const fvPatchFieldMapper&
);
//- Reset the fvPatchField to the given fvPatchField //- Reset the fvPatchField to the given fvPatchField
// Used for mesh to mesh mapping // Used for mesh to mesh mapping

View File

@ -25,7 +25,7 @@ License
#include "fixedRhoFvPatchScalarField.H" #include "fixedRhoFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "volFields.H" #include "volFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -48,7 +48,7 @@ Foam::fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField
const fixedRhoFvPatchScalarField& ptf, const fixedRhoFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedValueFvPatchScalarField(ptf, p, iF, mapper), fixedValueFvPatchScalarField(ptf, p, iF, mapper),

View File

@ -111,7 +111,7 @@ public:
const fixedRhoFvPatchScalarField&, const fixedRhoFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Copy constructor setting internal field reference //- Copy constructor setting internal field reference

View File

@ -50,7 +50,7 @@ hydrostaticDisplacementFvPatchVectorField
const hydrostaticDisplacementFvPatchVectorField& tdpvf, const hydrostaticDisplacementFvPatchVectorField& tdpvf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<vector, volMesh>& iF, const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
tractionDisplacementFvPatchVectorField(tdpvf, p, iF, mapper), tractionDisplacementFvPatchVectorField(tdpvf, p, iF, mapper),

View File

@ -87,7 +87,7 @@ public:
const hydrostaticDisplacementFvPatchVectorField&, const hydrostaticDisplacementFvPatchVectorField&,
const fvPatch&, const fvPatch&,
const DimensionedField<vector, volMesh>&, const DimensionedField<vector, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -67,7 +67,7 @@ tractionDisplacementFvPatchVectorField
const tractionDisplacementFvPatchVectorField& tdpvf, const tractionDisplacementFvPatchVectorField& tdpvf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<vector, volMesh>& iF, const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedGradientFvPatchVectorField(tdpvf, p, iF, mapper), fixedGradientFvPatchVectorField(tdpvf, p, iF, mapper),
@ -94,7 +94,7 @@ tractionDisplacementFvPatchVectorField
void Foam::tractionDisplacementFvPatchVectorField::map void Foam::tractionDisplacementFvPatchVectorField::map
( (
const fvPatchVectorField& ptf, const fvPatchVectorField& ptf,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
{ {
fixedGradientFvPatchVectorField::map(ptf, mapper); fixedGradientFvPatchVectorField::map(ptf, mapper);

View File

@ -95,7 +95,7 @@ public:
const tractionDisplacementFvPatchVectorField&, const tractionDisplacementFvPatchVectorField&,
const fvPatch&, const fvPatch&,
const DimensionedField<vector, volMesh>&, const DimensionedField<vector, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference
@ -142,11 +142,7 @@ public:
// Mapping functions // Mapping functions
//- Map the given fvPatchField onto this fvPatchField //- Map the given fvPatchField onto this fvPatchField
virtual void map virtual void map(const fvPatchVectorField&, const fieldMapper&);
(
const fvPatchVectorField&,
const fvPatchFieldMapper&
);
//- Reset the fvPatchField to the given fvPatchField //- Reset the fvPatchField to the given fvPatchField
// Used for mesh to mesh mapping // Used for mesh to mesh mapping

View File

@ -58,7 +58,7 @@ Foam::fvFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
) )
: :
labelList(mag(addressing) - 1), labelList(mag(addressing) - 1),
directFvPatchFieldMapper(static_cast<const labelList&>(*this)) directFieldMapper(static_cast<const labelList&>(*this))
{} {}

View File

@ -40,7 +40,7 @@ SourceFiles
#include "IOobjectList.H" #include "IOobjectList.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "directFvPatchFieldMapper.H" #include "directFieldMapper.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -63,7 +63,7 @@ public:
class patchFieldDecomposer class patchFieldDecomposer
: :
public labelList, public labelList,
public directFvPatchFieldMapper public directFieldMapper
{ {
public: public:

View File

@ -35,11 +35,7 @@ Foam::pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
const labelList& directAddr const labelList& directAddr
) )
: :
pointPatchFieldMapperPatchRef generalFieldMapper(),
(
completeMeshPatch,
procMeshPatch
),
directAddressing_(procMeshPatch.size(), -1), directAddressing_(procMeshPatch.size(), -1),
hasUnmapped_(false) hasUnmapped_(false)
{ {

View File

@ -38,7 +38,7 @@ SourceFiles
#include "pointMesh.H" #include "pointMesh.H"
#include "pointFields.H" #include "pointFields.H"
#include "pointPatchFieldMapperPatchRef.H" #include "generalFieldMapper.H"
#include "IOobjectList.H" #include "IOobjectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -61,15 +61,17 @@ public:
//- Point patch field decomposer class //- Point patch field decomposer class
class patchFieldDecomposer class patchFieldDecomposer
: :
public pointPatchFieldMapperPatchRef public generalFieldMapper
{ {
// Private Data // Private Data
//- ...
labelList directAddressing_; labelList directAddressing_;
//- Does map contain any unmapped values //- Does map contain any unmapped values?
bool hasUnmapped_; bool hasUnmapped_;
public: public:
// Constructors // Constructors

View File

@ -39,8 +39,6 @@ SourceFiles
#include "PtrList.H" #include "PtrList.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "IOobjectList.H" #include "IOobjectList.H"
#include "fvPatchFieldMapper.H"
#include "setSizeFvPatchFieldMapper.H"
#include "labelIOList.H" #include "labelIOList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -31,7 +31,8 @@ License
#include "emptyFvPatchField.H" #include "emptyFvPatchField.H"
#include "emptyFvsPatchField.H" #include "emptyFvsPatchField.H"
#include "processorCyclicFvPatch.H" #include "processorCyclicFvPatch.H"
#include "reverseFvPatchFieldMapper.H" #include "reverseFieldMapper.H"
#include "setSizeFieldMapper.H"
#include "stringOps.H" #include "stringOps.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -213,7 +214,7 @@ Foam::fvFieldReconstructor::reconstructVolField
procField.boundaryField()[procPatchi], procField.boundaryField()[procPatchi],
completeMesh_.boundary()[completePatchi], completeMesh_.boundary()[completePatchi],
DimensionedField<Type, volMesh>::null(), DimensionedField<Type, volMesh>::null(),
setSizeFvPatchFieldMapper setSizeFieldMapper
( (
completeMesh_.boundary()[completePatchi].size() completeMesh_.boundary()[completePatchi].size()
) )
@ -224,7 +225,7 @@ Foam::fvFieldReconstructor::reconstructVolField
patchFields[completePatchi].map patchFields[completePatchi].map
( (
procField.boundaryField()[procPatchi], procField.boundaryField()[procPatchi],
reverseFvPatchFieldMapper reverseFieldMapper
( (
faceProcAddressingBf_[proci][procPatchi] - 1 faceProcAddressingBf_[proci][procPatchi] - 1
) )
@ -266,7 +267,7 @@ Foam::fvFieldReconstructor::reconstructVolField
patchFields[completePatchi].map patchFields[completePatchi].map
( (
procField.boundaryField()[procPatchi], procField.boundaryField()[procPatchi],
reverseFvPatchFieldMapper reverseFieldMapper
( (
faceProcAddressingBf_[proci][procPatchi] - 1 faceProcAddressingBf_[proci][procPatchi] - 1
) )
@ -373,7 +374,7 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
procField.boundaryField()[procPatchi], procField.boundaryField()[procPatchi],
completeMesh_.boundary()[completePatchi], completeMesh_.boundary()[completePatchi],
DimensionedField<Type, surfaceMesh>::null(), DimensionedField<Type, surfaceMesh>::null(),
setSizeFvPatchFieldMapper setSizeFieldMapper
( (
completeMesh_.boundary()[completePatchi].size() completeMesh_.boundary()[completePatchi].size()
) )
@ -384,7 +385,7 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
patchFields[completePatchi].map patchFields[completePatchi].map
( (
procField.boundaryField()[procPatchi], procField.boundaryField()[procPatchi],
reverseFvPatchFieldMapper reverseFieldMapper
( (
faceProcAddressingBf_[proci][procPatchi] - 1 faceProcAddressingBf_[proci][procPatchi] - 1
) )
@ -409,7 +410,7 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
patchFields[completePatchi].map patchFields[completePatchi].map
( (
procField.boundaryField()[procPatchi], procField.boundaryField()[procPatchi],
reverseFvPatchFieldMapper reverseFieldMapper
( (
faceProcAddressingBf_[proci][procPatchi] - 1 faceProcAddressingBf_[proci][procPatchi] - 1
) )

View File

@ -38,8 +38,6 @@ SourceFiles
#include "pointMesh.H" #include "pointMesh.H"
#include "pointFields.H" #include "pointFields.H"
#include "pointPatchFieldMapper.H"
#include "setSizePointPatchFieldMapper.H"
#include "IOobjectList.H" #include "IOobjectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -25,7 +25,8 @@ License
#include "pointFieldReconstructor.H" #include "pointFieldReconstructor.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "reversePointPatchFieldMapper.H" #include "reverseFieldMapper.H"
#include "setSizeFieldMapper.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -123,7 +124,7 @@ Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject)
procField.boundaryField()[patchi], procField.boundaryField()[patchi],
completeMesh_.boundary()[curBPatch], completeMesh_.boundary()[curBPatch],
DimensionedField<Type, pointMesh>::null(), DimensionedField<Type, pointMesh>::null(),
setSizePointPatchFieldMapper setSizeFieldMapper
( (
completeMesh_.boundary()[curBPatch].size() completeMesh_.boundary()[curBPatch].size()
) )
@ -134,7 +135,7 @@ Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject)
patchFields[curBPatch].map patchFields[curBPatch].map
( (
procField.boundaryField()[patchi], procField.boundaryField()[patchi],
reversePointPatchFieldMapper reverseFieldMapper
( (
patchPointAddressing_[proci][patchi] patchPointAddressing_[proci][patchi]
) )

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -40,7 +40,7 @@ SourceFiles
#include "fvMesh.H" #include "fvMesh.H"
#include "HashTable.H" #include "HashTable.H"
#include "fvPatchMapper.H" #include "generalFieldMapper.H"
#include "scalarList.H" #include "scalarList.H"
#include "className.H" #include "className.H"
@ -179,7 +179,7 @@ public:
//- Patch-field interpolation class //- Patch-field interpolation class
class patchFieldInterpolator class patchFieldInterpolator
: :
public generalFvPatchFieldMapper public generalFieldMapper
{ {
const labelList& directAddressing_; const labelList& directAddressing_;

View File

@ -25,7 +25,7 @@ License
#include "CONSTRUCT.H" #include "CONSTRUCT.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
@ -84,7 +84,7 @@ CONSTRUCT
const CLASS& ptf, const CLASS& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<TYPE, volMesh>& iF, const DimensionedField<TYPE, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
PARENT(ptf, p, iF, mapper), PARENT(ptf, p, iF, mapper),
@ -123,7 +123,7 @@ template<class Type>
void Foam::CLASS::map void Foam::CLASS::map
( (
const FVPATCHF& ptf, const FVPATCHF& ptf,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
{ {
PARENT::map(ptf, mapper); PARENT::map(ptf, mapper);

View File

@ -147,7 +147,7 @@ public:
const CLASS&, const CLASS&,
const fvPatch&, const fvPatch&,
const DimensionedField<TYPE, volMesh>&, const DimensionedField<TYPE, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference
@ -185,11 +185,7 @@ public:
// Mapping functions // Mapping functions
//- Map the given fvPatchField onto this fvPatchField //- Map the given fvPatchField onto this fvPatchField
virtual void map virtual void map(const FVPATCHF&, const fieldMapper&);
(
const FVPATCHF&,
const fvPatchFieldMapper&
);
//- Reset the fvPatchField to the given fvPatchField //- Reset the fvPatchField to the given fvPatchField
// Used for mesh to mesh mapping // Used for mesh to mesh mapping

View File

@ -25,7 +25,7 @@ License
#include "codedFixedValueFvPatchFieldTemplate.H" #include "codedFixedValueFvPatchFieldTemplate.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "unitConversion.H" #include "unitConversion.H"
@ -107,7 +107,7 @@ ${typeName}FixedValueFvPatch${FieldType}
const ${typeName}FixedValueFvPatch${FieldType}& ptf, const ${typeName}FixedValueFvPatch${FieldType}& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<${TemplateType}, volMesh>& iF, const DimensionedField<${TemplateType}, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedValueFvPatchField<${TemplateType}>(ptf, p, iF, mapper) fixedValueFvPatchField<${TemplateType}>(ptf, p, iF, mapper)

View File

@ -75,7 +75,7 @@ public:
const ${typeName}FixedValueFvPatch${FieldType}&, const ${typeName}FixedValueFvPatch${FieldType}&,
const fvPatch&, const fvPatch&,
const DimensionedField<${TemplateType}, volMesh>&, const DimensionedField<${TemplateType}, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -25,7 +25,7 @@ License
#include "codedFixedValuePointPatchFieldTemplate.H" #include "codedFixedValuePointPatchFieldTemplate.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "pointPatchFieldMapper.H" #include "fieldMapper.H"
#include "pointFields.H" #include "pointFields.H"
#include "unitConversion.H" #include "unitConversion.H"
//{{{ begin codeInclude //{{{ begin codeInclude
@ -106,7 +106,7 @@ ${typeName}FixedValuePointPatch${FieldType}
const ${typeName}FixedValuePointPatch${FieldType}& ptf, const ${typeName}FixedValuePointPatch${FieldType}& ptf,
const pointPatch& p, const pointPatch& p,
const DimensionedField<${TemplateType}, pointMesh>& iF, const DimensionedField<${TemplateType}, pointMesh>& iF,
const pointPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedValuePointPatchField<${TemplateType}>(ptf, p, iF, mapper) fixedValuePointPatchField<${TemplateType}>(ptf, p, iF, mapper)

View File

@ -75,7 +75,7 @@ public:
const ${typeName}FixedValuePointPatch${FieldType}&, const ${typeName}FixedValuePointPatch${FieldType}&,
const pointPatch&, const pointPatch&,
const DimensionedField<${TemplateType}, pointMesh>&, const DimensionedField<${TemplateType}, pointMesh>&,
const pointPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -25,7 +25,6 @@ License
#include "codedFvModelTemplate.H" #include "codedFvModelTemplate.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "unitConversion.H" #include "unitConversion.H"

View File

@ -25,7 +25,7 @@ License
#include "codedMixedFvPatchFieldTemplate.H" #include "codedMixedFvPatchFieldTemplate.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "unitConversion.H" #include "unitConversion.H"
@ -107,7 +107,7 @@ ${typeName}MixedValueFvPatch${FieldType}
const ${typeName}MixedValueFvPatch${FieldType}& ptf, const ${typeName}MixedValueFvPatch${FieldType}& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<${TemplateType}, volMesh>& iF, const DimensionedField<${TemplateType}, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
mixedFvPatchField<${TemplateType}>(ptf, p, iF, mapper) mixedFvPatchField<${TemplateType}>(ptf, p, iF, mapper)

View File

@ -75,7 +75,7 @@ public:
const ${typeName}MixedValueFvPatch${FieldType}&, const ${typeName}MixedValueFvPatch${FieldType}&,
const fvPatch&, const fvPatch&,
const DimensionedField<${TemplateType}, volMesh>&, const DimensionedField<${TemplateType}, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -25,7 +25,7 @@ License
#include "turbulentMixingLengthDissipationRateInletFvPatchScalarField.H" #include "turbulentMixingLengthDissipationRateInletFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "volFields.H" #include "volFields.H"
#include "momentumTransportModel.H" #include "momentumTransportModel.H"
@ -65,7 +65,7 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField
const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf, const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
inletOutletFvPatchScalarField(ptf, p, iF, mapper), inletOutletFvPatchScalarField(ptf, p, iF, mapper),

View File

@ -122,7 +122,7 @@ public:
const turbulentMixingLengthDissipationRateInletFvPatchScalarField&, const turbulentMixingLengthDissipationRateInletFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -25,7 +25,7 @@ License
#include "turbulentMixingLengthFrequencyInletFvPatchScalarField.H" #include "turbulentMixingLengthFrequencyInletFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "volFields.H" #include "volFields.H"
#include "momentumTransportModel.H" #include "momentumTransportModel.H"
@ -65,7 +65,7 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField
const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf, const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
inletOutletFvPatchScalarField(ptf, p, iF, mapper), inletOutletFvPatchScalarField(ptf, p, iF, mapper),

View File

@ -122,7 +122,7 @@ public:
const turbulentMixingLengthFrequencyInletFvPatchScalarField&, const turbulentMixingLengthFrequencyInletFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -25,7 +25,7 @@ License
#include "fixedShearStressFvPatchVectorField.H" #include "fixedShearStressFvPatchVectorField.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "momentumTransportModel.H" #include "momentumTransportModel.H"
@ -51,7 +51,7 @@ Foam::fixedShearStressFvPatchVectorField::fixedShearStressFvPatchVectorField
const fixedShearStressFvPatchVectorField& ptf, const fixedShearStressFvPatchVectorField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<vector, volMesh>& iF, const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedValueFvPatchVectorField(ptf, p, iF, mapper), fixedValueFvPatchVectorField(ptf, p, iF, mapper),

View File

@ -79,7 +79,7 @@ public:
const fixedShearStressFvPatchVectorField&, const fixedShearStressFvPatchVectorField&,
const fvPatch&, const fvPatch&,
const DimensionedField<vector, volMesh>&, const DimensionedField<vector, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -58,7 +58,7 @@ Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField
const porousBafflePressureFvPatchField& ptf, const porousBafflePressureFvPatchField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedJumpFvPatchField<scalar>(ptf, p, iF, mapper), fixedJumpFvPatchField<scalar>(ptf, p, iF, mapper),

View File

@ -146,7 +146,7 @@ public:
const porousBafflePressureFvPatchField&, const porousBafflePressureFvPatchField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -263,7 +263,7 @@ epsilonWallFunctionFvPatchScalarField
const epsilonWallFunctionFvPatchScalarField& ptf, const epsilonWallFunctionFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),

View File

@ -169,7 +169,7 @@ public:
const epsilonWallFunctionFvPatchScalarField&, const epsilonWallFunctionFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -54,7 +54,7 @@ fWallFunctionFvPatchScalarField::fWallFunctionFvPatchScalarField
const fWallFunctionFvPatchScalarField& ptf, const fWallFunctionFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper) fixedValueFvPatchField<scalar>(ptf, p, iF, mapper)

View File

@ -93,7 +93,7 @@ public:
const fWallFunctionFvPatchScalarField&, const fWallFunctionFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -52,7 +52,7 @@ kLowReWallFunctionFvPatchScalarField::kLowReWallFunctionFvPatchScalarField
const kLowReWallFunctionFvPatchScalarField& ptf, const kLowReWallFunctionFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),

View File

@ -103,7 +103,7 @@ public:
const kLowReWallFunctionFvPatchScalarField&, const kLowReWallFunctionFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -46,7 +46,7 @@ Foam::kqRWallFunctionFvPatchField<Type>::kqRWallFunctionFvPatchField
const kqRWallFunctionFvPatchField& ptf, const kqRWallFunctionFvPatchField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, volMesh>& iF, const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
zeroGradientFvPatchField<Type>(ptf, p, iF, mapper) zeroGradientFvPatchField<Type>(ptf, p, iF, mapper)

View File

@ -92,7 +92,7 @@ public:
const kqRWallFunctionFvPatchField&, const kqRWallFunctionFvPatchField&,
const fvPatch&, const fvPatch&,
const DimensionedField<Type, volMesh>&, const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -25,7 +25,7 @@ License
#include "nutLowReWallFunctionFvPatchScalarField.H" #include "nutLowReWallFunctionFvPatchScalarField.H"
#include "momentumTransportModel.H" #include "momentumTransportModel.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
@ -60,7 +60,7 @@ nutLowReWallFunctionFvPatchScalarField::nutLowReWallFunctionFvPatchScalarField
const nutLowReWallFunctionFvPatchScalarField& ptf, const nutLowReWallFunctionFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper) nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)

View File

@ -97,7 +97,7 @@ public:
const nutLowReWallFunctionFvPatchScalarField&, const nutLowReWallFunctionFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -25,7 +25,7 @@ License
#include "nutURoughWallFunctionFvPatchScalarField.H" #include "nutURoughWallFunctionFvPatchScalarField.H"
#include "momentumTransportModel.H" #include "momentumTransportModel.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
@ -227,7 +227,7 @@ nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField
const nutURoughWallFunctionFvPatchScalarField& ptf, const nutURoughWallFunctionFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
nutUWallFunctionFvPatchScalarField(ptf, p, iF, mapper), nutUWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
@ -253,7 +253,7 @@ nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField
void nutURoughWallFunctionFvPatchScalarField::map void nutURoughWallFunctionFvPatchScalarField::map
( (
const fvPatchScalarField& ptf, const fvPatchScalarField& ptf,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
{ {
nutUWallFunctionFvPatchScalarField::map(ptf, mapper); nutUWallFunctionFvPatchScalarField::map(ptf, mapper);

View File

@ -129,7 +129,7 @@ public:
const nutURoughWallFunctionFvPatchScalarField&, const nutURoughWallFunctionFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference
@ -191,11 +191,7 @@ public:
// Mapping functions // Mapping functions
//- Map the given fvPatchField onto this fvPatchField //- Map the given fvPatchField onto this fvPatchField
virtual void map virtual void map(const fvPatchScalarField&, const fieldMapper&);
(
const fvPatchScalarField&,
const fvPatchFieldMapper&
);
//- Reset the fvPatchField to the given fvPatchField //- Reset the fvPatchField to the given fvPatchField
// Used for mesh to mesh mapping // Used for mesh to mesh mapping

View File

@ -25,7 +25,7 @@ License
#include "nutUSpaldingWallFunctionFvPatchScalarField.H" #include "nutUSpaldingWallFunctionFvPatchScalarField.H"
#include "momentumTransportModel.H" #include "momentumTransportModel.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
@ -137,7 +137,7 @@ nutUSpaldingWallFunctionFvPatchScalarField
const nutUSpaldingWallFunctionFvPatchScalarField& ptf, const nutUSpaldingWallFunctionFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper) nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)

View File

@ -119,7 +119,7 @@ public:
const nutUSpaldingWallFunctionFvPatchScalarField&, const nutUSpaldingWallFunctionFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -25,7 +25,7 @@ License
#include "nutUWallFunctionFvPatchScalarField.H" #include "nutUWallFunctionFvPatchScalarField.H"
#include "momentumTransportModel.H" #include "momentumTransportModel.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
@ -131,7 +131,7 @@ nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField
const nutUWallFunctionFvPatchScalarField& ptf, const nutUWallFunctionFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper) nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)

View File

@ -99,7 +99,7 @@ public:
const nutUWallFunctionFvPatchScalarField&, const nutUWallFunctionFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -25,7 +25,7 @@ License
#include "nutWallFunctionFvPatchScalarField.H" #include "nutWallFunctionFvPatchScalarField.H"
#include "momentumTransportModel.H" #include "momentumTransportModel.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "wallFvPatch.H" #include "wallFvPatch.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
@ -87,7 +87,7 @@ Foam::nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField
const nutWallFunctionFvPatchScalarField& ptf, const nutWallFunctionFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedValueFvPatchScalarField(ptf, p, iF, mapper), fixedValueFvPatchScalarField(ptf, p, iF, mapper),

View File

@ -134,7 +134,7 @@ public:
const nutWallFunctionFvPatchScalarField&, const nutWallFunctionFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -25,7 +25,7 @@ License
#include "nutkRoughWallFunctionFvPatchScalarField.H" #include "nutkRoughWallFunctionFvPatchScalarField.H"
#include "momentumTransportModel.H" #include "momentumTransportModel.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
@ -144,7 +144,7 @@ nutkRoughWallFunctionFvPatchScalarField::nutkRoughWallFunctionFvPatchScalarField
const nutkRoughWallFunctionFvPatchScalarField& ptf, const nutkRoughWallFunctionFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper), nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
@ -170,7 +170,7 @@ nutkRoughWallFunctionFvPatchScalarField::nutkRoughWallFunctionFvPatchScalarField
void nutkRoughWallFunctionFvPatchScalarField::map void nutkRoughWallFunctionFvPatchScalarField::map
( (
const fvPatchScalarField& ptf, const fvPatchScalarField& ptf,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
{ {
nutkWallFunctionFvPatchScalarField::map(ptf, mapper); nutkWallFunctionFvPatchScalarField::map(ptf, mapper);

View File

@ -133,7 +133,7 @@ public:
const nutkRoughWallFunctionFvPatchScalarField&, const nutkRoughWallFunctionFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference
@ -195,11 +195,7 @@ public:
// Mapping functions // Mapping functions
//- Map the given fvPatchField onto this fvPatchField //- Map the given fvPatchField onto this fvPatchField
virtual void map virtual void map(const fvPatchScalarField&, const fieldMapper&);
(
const fvPatchScalarField&,
const fvPatchFieldMapper&
);
//- Reset the fvPatchField to the given fvPatchField //- Reset the fvPatchField to the given fvPatchField
// Used for mesh to mesh mapping // Used for mesh to mesh mapping

View File

@ -25,7 +25,7 @@ License
#include "nutkWallFunctionFvPatchScalarField.H" #include "nutkWallFunctionFvPatchScalarField.H"
#include "momentumTransportModel.H" #include "momentumTransportModel.H"
#include "fvPatchFieldMapper.H" #include "fieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "wallFvPatch.H" #include "wallFvPatch.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
@ -89,7 +89,7 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
const nutkWallFunctionFvPatchScalarField& ptf, const nutkWallFunctionFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper) nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)

View File

@ -96,7 +96,7 @@ public:
const nutkWallFunctionFvPatchScalarField&, const nutkWallFunctionFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -305,7 +305,7 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
const omegaWallFunctionFvPatchScalarField& ptf, const omegaWallFunctionFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),

View File

@ -177,7 +177,7 @@ public:
const omegaWallFunctionFvPatchScalarField&, const omegaWallFunctionFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -53,7 +53,7 @@ v2WallFunctionFvPatchScalarField::v2WallFunctionFvPatchScalarField
const v2WallFunctionFvPatchScalarField& ptf, const v2WallFunctionFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper) fixedValueFvPatchField<scalar>(ptf, p, iF, mapper)

View File

@ -95,7 +95,7 @@ public:
const v2WallFunctionFvPatchScalarField&, const v2WallFunctionFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -55,7 +55,7 @@ epsilonmWallFunctionFvPatchScalarField
const epsilonmWallFunctionFvPatchScalarField& ptf, const epsilonmWallFunctionFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fieldMapper& mapper
) )
: :
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper) fixedValueFvPatchField<scalar>(ptf, p, iF, mapper)

View File

@ -81,7 +81,7 @@ public:
const epsilonmWallFunctionFvPatchScalarField&, const epsilonmWallFunctionFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,6 +25,38 @@ License
#include "directFieldMapper.H" #include "directFieldMapper.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::directFieldMapper::map
(
Field<Type>& f,
const Field<Type>& mapF
) const
{
if (notNull(addressing_) && addressing_.size())
{
f.map(mapF, addressing_);
}
else
{
f.setSize(0);
}
}
template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::directFieldMapper::map
(
const Field<Type>& mapF
) const
{
tmp<Field<Type>> tf(new Field<Type>(addressing_.size()));
map(tf.ref(), mapF);
return tf;
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
FOR_ALL_FIELD_TYPES(IMPLEMENT_FIELD_MAPPER_OPERATOR, directFieldMapper) FOR_ALL_FIELD_TYPES(IMPLEMENT_FIELD_MAPPER_OPERATOR, directFieldMapper)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -45,13 +45,24 @@ namespace Foam
class directFieldMapper class directFieldMapper
: :
virtual public fieldMapper public fieldMapper
{ {
// Private Data
//- Addressing from new back to old
const labelUList& addressing_;
//- Does map contain any unmapped values
bool hasUnmapped_;
// Private Member Functions // Private Member Functions
//- Map a field in-place
template<class Type> template<class Type>
void map(Field<Type>& f, const Field<Type>& mapF) const; void map(Field<Type>& f, const Field<Type>& mapF) const;
//- Map a field and return the result
template<class Type> template<class Type>
tmp<Field<Type>> map(const Field<Type>& f) const; tmp<Field<Type>> map(const Field<Type>& f) const;
@ -60,9 +71,17 @@ public:
// Constructors // Constructors
//- Null constructor //- Construct given addressing
directFieldMapper() directFieldMapper(const labelUList& addressing)
{} :
addressing_(addressing),
hasUnmapped_(false)
{
if (addressing_.size() && min(addressing_) < 0)
{
hasUnmapped_ = true;
}
}
//- Destructor //- Destructor
@ -72,12 +91,11 @@ public:
// Member Functions // Member Functions
//- Are there unmapped values? I.e. do all size() elements get //- Are there unmapped values? Do all elements get get a value?
// get value virtual bool hasUnmapped() const
virtual bool hasUnmapped() const = 0; {
return hasUnmapped_;
//- Access to the direct map addressing }
virtual const labelUList& addressing() const = 0;
// Member Operators // Member Operators
@ -96,12 +114,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "directFieldMapperTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -63,8 +63,7 @@ public:
// Member Functions // Member Functions
//- Are there unmapped values? I.e. do all size() elements get //- Are there unmapped values? Do all elements get get a value?
// get value
virtual bool hasUnmapped() const = 0; virtual bool hasUnmapped() const = 0;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,6 +25,58 @@ License
#include "generalFieldMapper.H" #include "generalFieldMapper.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::generalFieldMapper::map
(
Field<Type>& f,
const Field<Type>& mapF
) const
{
if (direct())
{
if (notNull(directAddressing()) && directAddressing().size())
{
f.map(mapF, directAddressing());
}
else
{
f.setSize(0);
}
}
else
{
if (notNull(addressing()) && addressing().size())
{
f.map(mapF, addressing(), weights());
}
else
{
f.setSize(0);
}
}
}
template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::generalFieldMapper::map
(
const Field<Type>& mapF
) const
{
tmp<Field<Type>> tf
(
new Field<Type>
(
direct() ? directAddressing().size() : addressing().size()
)
);
map(tf.ref(), mapF);
return tf;
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::labelUList& Foam::generalFieldMapper::directAddressing() const const Foam::labelUList& Foam::generalFieldMapper::directAddressing() const

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -45,13 +45,15 @@ namespace Foam
class generalFieldMapper class generalFieldMapper
: :
virtual public fieldMapper public fieldMapper
{ {
// Private Member Functions // Private Member Functions
//- Map a field in-place
template<class Type> template<class Type>
void map(Field<Type>& f, const Field<Type>& mapF) const; void map(Field<Type>& f, const Field<Type>& mapF) const;
//- Map a field and return the result
template<class Type> template<class Type>
tmp<Field<Type>> map(const Field<Type>& f) const; tmp<Field<Type>> map(const Field<Type>& f) const;
@ -72,16 +74,19 @@ public:
// Member Functions // Member Functions
//- Is the mapper direct?
virtual bool direct() const = 0; virtual bool direct() const = 0;
//- Are there unmapped values? I.e. do all size() elements get //- Are there unmapped values? Do all elements get get a value?
// get value
virtual bool hasUnmapped() const = 0; virtual bool hasUnmapped() const = 0;
//- Access the direct addressing
virtual const labelUList& directAddressing() const; virtual const labelUList& directAddressing() const;
//- Access the general addressing
virtual const labelListList& addressing() const; virtual const labelListList& addressing() const;
//- Access the general weights
virtual const scalarListList& weights() const; virtual const scalarListList& weights() const;
@ -101,12 +106,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "generalFieldMapperTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -1,80 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "generalFieldMapper.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::generalFieldMapper::map
(
Field<Type>& f,
const Field<Type>& mapF
) const
{
if (direct())
{
if (notNull(directAddressing()) && directAddressing().size())
{
f.map(mapF, directAddressing());
}
else
{
f.setSize(0);
}
}
else
{
if (notNull(addressing()) && addressing().size())
{
f.map(mapF, addressing(), weights());
}
else
{
f.setSize(0);
}
}
}
template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::generalFieldMapper::map
(
const Field<Type>& mapF
) const
{
tmp<Field<Type>> tf
(
new Field<Type>
(
direct() ? directAddressing().size() : addressing().size()
)
);
map(tf.ref(), mapF);
return tf;
}
// ************************************************************************* //

View File

@ -25,6 +25,29 @@ License
#include "identityFieldMapper.H" #include "identityFieldMapper.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::identityFieldMapper::map
(
Field<Type>& f,
const Field<Type>& mapF
) const
{
f = mapF;
}
template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::identityFieldMapper::map
(
const Field<Type>& mapF
) const
{
return mapF;
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
FOR_ALL_FIELD_TYPES(IMPLEMENT_FIELD_MAPPER_OPERATOR, identityFieldMapper) FOR_ALL_FIELD_TYPES(IMPLEMENT_FIELD_MAPPER_OPERATOR, identityFieldMapper)

View File

@ -45,13 +45,15 @@ namespace Foam
class identityFieldMapper class identityFieldMapper
: :
virtual public fieldMapper public fieldMapper
{ {
// Private Member Functions // Private Member Functions
//- Map a field in-place
template<class Type> template<class Type>
void map(Field<Type>& f, const Field<Type>& mapF) const; void map(Field<Type>& f, const Field<Type>& mapF) const;
//- Map a field and return the result
template<class Type> template<class Type>
tmp<Field<Type>> map(const Field<Type>& f) const; tmp<Field<Type>> map(const Field<Type>& f) const;
@ -72,8 +74,7 @@ public:
// Member Functions // Member Functions
//- Are there unmapped values? I.e. do all size() elements get //- Are there unmapped values? Do all elements get get a value?
// get value
virtual bool hasUnmapped() const virtual bool hasUnmapped() const
{ {
return false; return false;
@ -96,12 +97,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "identityFieldMapperTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -25,6 +25,33 @@ License
#include "reverseFieldMapper.H" #include "reverseFieldMapper.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::reverseFieldMapper::map
(
Field<Type>& f,
const Field<Type>& mapF
) const
{
if (notNull(addressing_) && addressing_.size())
{
f.rmap(mapF, addressing_);
}
}
template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::reverseFieldMapper::map
(
const Field<Type>& mapF
) const
{
NotImplemented;
return tmp<Field<Type>>(nullptr);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
FOR_ALL_FIELD_TYPES(IMPLEMENT_FIELD_MAPPER_OPERATOR, reverseFieldMapper) FOR_ALL_FIELD_TYPES(IMPLEMENT_FIELD_MAPPER_OPERATOR, reverseFieldMapper)

View File

@ -45,13 +45,24 @@ namespace Foam
class reverseFieldMapper class reverseFieldMapper
: :
virtual public fieldMapper public fieldMapper
{ {
// Private Data
//- Addressing from new back to old
const labelUList& addressing_;
//- Does map contain any unmapped values
bool hasUnmapped_;
// Private Member Functions // Private Member Functions
//- Map a field in-place
template<class Type> template<class Type>
void map(Field<Type>& f, const Field<Type>& mapF) const; void map(Field<Type>& f, const Field<Type>& mapF) const;
//- Map a field and return the result
template<class Type> template<class Type>
tmp<Field<Type>> map(const Field<Type>& f) const; tmp<Field<Type>> map(const Field<Type>& f) const;
@ -60,9 +71,17 @@ public:
// Constructors // Constructors
//- Null constructor //- Construct given addressing
reverseFieldMapper() reverseFieldMapper(const labelUList& addressing)
{} :
addressing_(addressing),
hasUnmapped_(false)
{
if (addressing_.size() && min(addressing_) < 0)
{
hasUnmapped_ = true;
}
}
//- Destructor //- Destructor
@ -72,12 +91,11 @@ public:
// Member Functions // Member Functions
//- Are there unmapped values? I.e. do all size() elements get //- Are there unmapped values? Do all elements get get a value?
// get value virtual bool hasUnmapped() const
virtual bool hasUnmapped() const = 0; {
return hasUnmapped_;
//- Access to the reverse map addressing }
virtual const labelUList& addressing() const = 0;
// Member Operators // Member Operators
@ -96,12 +114,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "reverseFieldMapperTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,12 +25,23 @@ License
#include "setSizeFieldMapper.H" #include "setSizeFieldMapper.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::setSizeFieldMapper::setSizeFieldMapper(const label size) template<class Type>
: void Foam::setSizeFieldMapper::map(Field<Type>& f, const Field<Type>&) const
size_(size) {
{} f.setSize(size_);
}
template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::setSizeFieldMapper::map
(
const Field<Type>&
) const
{
return tmp<Field<Type>>(new Field<Type>(size_));
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //

Some files were not shown because too many files have changed in this diff Show More