From 152eceeb56283202477e222966c0c359ba30d5d8 Mon Sep 17 00:00:00 2001 From: Mark OLESEN <mark.olesen@esi-group.com> Date: Tue, 23 Jan 2024 11:22:19 +0000 Subject: [PATCH] Use factory Clone for patch fields --- .../T/smoluchowskiJumpTFvPatchScalarField.H | 25 +++----- .../BCs/U/maxwellSlipUFvPatchVectorField.H | 24 +++----- .../BCs/rho/fixedRhoFvPatchScalarField.H | 24 +++----- ...woPhaseRadCoupledMixedFvPatchScalarField.H | 31 +++------- .../adjointOutletPressureFvPatchScalarField.H | 24 +++----- .../adjointOutletVelocityFvPatchVectorField.H | 24 +++----- .../alphaContactAngleFvPatchScalarField.H | 24 +++----- .../alphaContactAngleFvPatchScalarField.H | 24 +++----- .../tractionDisplacementFvPatchVectorField.H | 24 +++----- ...DisplacementCorrectionFvPatchVectorField.H | 24 +++----- .../fixedValueFvPatchFieldTemplate.H | 24 +++----- .../fixedValuePointPatchFieldTemplate.H | 20 +++--- .../dynamicCode/mixedFvPatchFieldTemplate.H | 24 +++----- .../basicSymmetryPointPatchField.H | 27 +++----- .../calculated/calculatedPointPatchField.C | 25 +++++--- .../calculated/calculatedPointPatchField.H | 33 ++++------ .../basic/coupled/coupledPointPatchField.H | 6 +- .../fixedValue/fixedValuePointPatchField.H | 27 +++----- .../basic/value/valuePointPatchField.H | 27 +++----- .../zeroGradientPointPatchField.H | 27 +++----- .../constraint/cyclic/cyclicPointPatchField.H | 26 +++----- .../cyclicSlip/cyclicSlipPointPatchField.H | 26 +++----- .../constraint/empty/emptyPointPatchField.H | 28 +++------ ...nonuniformTransformCyclicPointPatchField.H | 26 +++----- .../processor/processorPointPatchField.H | 27 +++----- .../processorCyclicPointPatchField.H | 27 +++----- .../symmetry/symmetryPointPatchField.H | 27 +++----- .../symmetryPlanePointPatchField.H | 27 +++----- .../constraint/wedge/wedgePointPatchField.H | 26 +++----- .../codedFixedValuePointPatchField.H | 24 +++----- .../fixedNormalSlipPointPatchField.H | 28 +++------ .../derived/slip/slipPointPatchField.H | 27 +++----- ...eVaryingUniformFixedValuePointPatchField.H | 20 +++--- .../pointPatchField/pointPatchField.H | 32 ++++++++-- ...ayatillekeWallFunctionFvPatchScalarField.H | 24 +++----- ...thDissipationRateInletFvPatchScalarField.H | 31 +++------- ...ngLengthFrequencyInletFvPatchScalarField.H | 31 +++------- .../fixedShearStressFvPatchVectorField.H | 24 +++----- .../porousBafflePressureFvPatchField.H | 22 +++---- .../epsilonWallFunctionFvPatchScalarField.H | 24 +++----- .../kLowReWallFunctionFvPatchScalarField.H | 24 +++----- .../kqRWallFunctionFvPatchField.H | 22 +++---- .../nutLowReWallFunctionFvPatchScalarField.H | 24 +++----- ...utUBlendedWallFunctionFvPatchScalarField.H | 24 +++----- .../nutURoughWallFunctionFvPatchScalarField.H | 24 +++----- ...tUSpaldingWallFunctionFvPatchScalarField.H | 24 +++----- ...UTabulatedWallFunctionFvPatchScalarField.H | 24 +++----- .../nutUWallFunctionFvPatchScalarField.H | 24 +++----- .../nutkRoughWallFunctionFvPatchScalarField.H | 24 +++----- .../nutkWallFunctionFvPatchScalarField.H | 24 +++----- .../omegaWallFunctionFvPatchScalarField.H | 25 +++----- ...ndaryLayerInletEpsilonFvPatchScalarField.H | 24 +++----- ...atmBoundaryLayerInletKFvPatchScalarField.H | 24 +++----- ...oundaryLayerInletOmegaFvPatchScalarField.H | 24 +++----- ...daryLayerInletVelocityFvPatchVectorField.H | 24 +++----- ...entHeatFluxTemperatureFvPatchScalarField.H | 28 +++------ ...atmAlphatkWallFunctionFvPatchScalarField.H | 24 +++----- ...atmEpsilonWallFunctionFvPatchScalarField.H | 25 +++----- .../atmNutUWallFunctionFvPatchScalarField.H | 24 +++----- .../atmNutWallFunctionFvPatchScalarField.H | 24 +++----- .../atmNutkWallFunctionFvPatchScalarField.H | 24 +++----- .../atmOmegaWallFunctionFvPatchScalarField.H | 24 +++----- .../freeSurfacePressureFvPatchScalarField.H | 24 +++----- .../freeSurfaceVelocityFvPatchVectorField.H | 24 +++----- ...yMotionDisplacementPointPatchVectorField.H | 27 +++----- .../basicSymmetry/basicSymmetryFaPatchField.H | 22 +++---- .../basic/calculated/calculatedFaPatchField.C | 24 ++++++-- .../basic/calculated/calculatedFaPatchField.H | 22 +++---- .../basic/coupled/coupledFaPatchField.H | 6 +- .../extrapolatedCalculatedFaPatchField.H | 22 +++---- .../fixedGradient/fixedGradientFaPatchField.H | 22 +++---- .../basic/fixedValue/fixedValueFaPatchField.H | 22 +++---- .../basic/mixed/mixedFaPatchField.H | 22 +++---- .../basic/sliced/slicedFaPatchField.C | 61 +++---------------- .../basic/sliced/slicedFaPatchField.H | 16 +++-- .../basic/transform/transformFaPatchField.H | 6 +- .../zeroGradient/zeroGradientFaPatchField.H | 22 +++---- .../constraint/cyclic/cyclicFaPatchField.H | 22 +++---- .../constraint/empty/emptyFaPatchField.H | 22 +++---- .../processor/processorFaPatchField.H | 22 +++---- .../symmetry/symmetryFaPatchField.H | 22 +++---- .../constraint/wedge/wedgeFaPatchField.H | 22 +++---- .../clampedPlate/clampedPlateFaPatchField.H | 22 +++---- .../edgeNormalFixedValueFaPatchVectorField.H | 29 +++------ .../fixedValueOutflowFaPatchField.H | 22 +++---- .../derived/ignore/ignoreFaPatchField.H | 22 +++---- .../inletOutlet/inletOutletFaPatchField.H | 22 +++---- .../outletInlet/outletInletFaPatchField.H | 22 +++---- .../derived/slip/slipFaPatchField.H | 22 +++---- ...timeVaryingUniformFixedValueFaPatchField.H | 22 +++---- .../uniformFixedGradientFaPatchField.H | 22 +++---- .../uniformFixedValueFaPatchField.H | 22 +++---- .../uniformMixed/uniformMixedFaPatchField.H | 22 +++---- .../faPatchFields/faPatchField/faPatchField.H | 50 +++++++++++++-- .../calculated/calculatedFaePatchField.C | 21 +++++-- .../calculated/calculatedFaePatchField.H | 23 +++---- .../basic/coupled/coupledFaePatchField.H | 6 +- .../fixedValue/fixedValueFaePatchField.H | 23 +++---- .../basic/sliced/slicedFaePatchField.C | 37 +---------- .../basic/sliced/slicedFaePatchField.H | 16 +++-- .../constraint/cyclic/cyclicFaePatchField.H | 22 +++---- .../constraint/empty/emptyFaePatchField.H | 23 +++---- .../processor/processorFaePatchField.H | 24 +++----- .../symmetry/symmetryFaePatchField.H | 23 +++---- .../constraint/wedge/wedgeFaePatchField.H | 22 +++---- .../faePatchField/faePatchField.H | 36 +++++++++-- .../SRFFreestreamVelocityFvPatchVectorField.H | 24 +++----- .../SRFVelocityFvPatchVectorField.H | 24 +++----- .../SRFWallVelocityFvPatchVectorField.H | 24 +++----- .../exprFixedValueFvPatchField.H | 23 +++---- .../fvPatchFields/exprMixedFvPatchField.H | 22 +++---- .../exprValuePointPatchField.H | 20 +----- .../basicSymmetry/basicSymmetryFvPatchField.H | 22 +++---- .../basic/calculated/calculatedFvPatchField.C | 7 ++- .../basic/calculated/calculatedFvPatchField.H | 22 +++---- .../basic/coupled/coupledFvPatchField.H | 6 +- .../directionMixedFvPatchField.H | 22 +++---- .../extrapolatedCalculatedFvPatchField.H | 22 +++---- .../fixedGradient/fixedGradientFvPatchField.H | 22 +++---- .../basic/fixedValue/fixedValueFvPatchField.H | 22 +++---- .../basic/mixed/mixedFvPatchField.H | 22 +++---- .../basic/sliced/slicedFvPatchField.C | 61 +++---------------- .../basic/sliced/slicedFvPatchField.H | 16 +++-- .../basic/transform/transformFvPatchField.H | 6 +- .../zeroGradient/zeroGradientFvPatchField.H | 22 +++---- .../calculatedProcessorFvPatchField.H | 22 +++---- .../constraint/cyclic/cyclicFvPatchField.H | 22 +++---- .../cyclicACMI/cyclicACMIFvPatchField.H | 22 +++---- .../cyclicAMI/cyclicAMIFvPatchField.H | 22 +++---- .../cyclicSlip/cyclicSlipFvPatchField.H | 22 +++---- .../constraint/empty/emptyFvPatchField.H | 22 +++---- .../nonuniformTransformCyclicFvPatchField.H | 23 +++---- .../processor/processorFvPatchField.H | 22 +++---- .../processorCyclicFvPatchField.H | 22 +++---- .../symmetry/symmetryFvPatchField.H | 22 +++---- .../symmetryPlane/symmetryPlaneFvPatchField.H | 22 +++---- .../constraint/wedge/wedgeFvPatchField.H | 22 +++---- .../acousticWaveTransmissiveFvPatchField.H | 22 +++---- .../activeBaffleVelocityFvPatchVectorField.H | 24 +++----- ...ureForceBaffleVelocityFvPatchVectorField.H | 28 +++------ .../derived/advective/advectiveFvPatchField.H | 22 +++---- .../codedFixedValueFvPatchField.H | 22 +++---- .../codedMixed/codedMixedFvPatchField.H | 22 +++---- ...lindricalInletVelocityFvPatchVectorField.H | 24 +++----- ...lectrostaticDepositionFvPatchScalarField.H | 24 +++----- .../derived/fan/fanFvPatchField.H | 22 +++---- .../fanPressureFvPatchScalarField.H | 28 +++------ ...uxExtrapolatedPressureFvPatchScalarField.H | 24 +++----- .../fixedFluxPressureFvPatchScalarField.H | 24 +++----- .../fixedInternalValueFvPatchField.H | 22 +++---- .../derived/fixedJump/fixedJumpFvPatchField.H | 22 +++---- .../fixedJumpAMI/fixedJumpAMIFvPatchField.H | 22 +++---- .../derived/fixedMean/fixedMeanFvPatchField.H | 22 +++---- .../fixedMeanOutletInletFvPatchField.H | 22 +++---- ...malInletOutletVelocityFvPatchVectorField.H | 24 +++----- .../fixedNormalSlipFvPatchField.H | 22 +++---- ...ureCompressibleDensityFvPatchScalarField.H | 28 +++------ .../fixedProfile/fixedProfileFvPatchField.H | 22 +++---- .../flowRateInletVelocityFvPatchVectorField.H | 24 +++----- ...flowRateOutletVelocityFvPatchVectorField.H | 24 +++----- .../fluxCorrectedVelocityFvPatchVectorField.H | 24 +++----- .../freestream/freestreamFvPatchField.H | 22 +++---- .../freestreamPressureFvPatchScalarField.H | 24 +++----- .../freestreamVelocityFvPatchVectorField.H | 24 +++----- .../inletOutlet/inletOutletFvPatchField.H | 22 +++---- ...OutletTotalTemperatureFvPatchScalarField.H | 24 +++----- .../interfaceCompressionFvPatchScalarField.H | 24 +++----- ...erstitialInletVelocityFvPatchVectorField.H | 24 +++----- .../mappedField/mappedFieldFvPatchField.H | 29 +++------ .../mappedMixedFieldFvPatchField.H | 29 +++------ .../mappedFixedInternalValueFvPatchField.H | 22 +++---- ...ppedFixedPushedInternalValueFvPatchField.H | 29 +++------ .../mappedFixedValueFvPatchField.H | 22 +++---- .../mappedFlowRateFvPatchVectorField.H | 25 +++----- .../mappedMixed/mappedMixedFvPatchField.H | 29 +++------ ...mappedVelocityFluxFixedValueFvPatchField.H | 24 +++----- ...FlowRateOutletVelocityFvPatchVectorField.H | 24 +++----- .../movingWallVelocityFvPatchVectorField.H | 24 +++----- .../derived/noSlip/noSlipFvPatchVectorField.H | 24 +++----- .../outletInlet/outletInletFvPatchField.H | 22 +++---- .../outletMappedUniformInletFvPatchField.H | 22 +++---- ...utletPhaseMeanVelocityFvPatchVectorField.H | 28 +++------ .../partialSlip/partialSlipFvPatchField.H | 22 +++---- ...aseHydrostaticPressureFvPatchScalarField.H | 24 +++----- .../plenumPressureFvPatchScalarField.H | 24 +++----- ...tedInletOutletVelocityFvPatchVectorField.H | 31 +++------- ...eDirectedInletVelocityFvPatchVectorField.H | 28 +++------ ...tOutletParSlipVelocityFvPatchVectorField.H | 31 +++------- ...ureInletOutletVelocityFvPatchVectorField.H | 24 +++----- ...reInletUniformVelocityFvPatchVectorField.H | 24 +++----- .../pressureInletVelocityFvPatchVectorField.H | 24 +++----- ...malInletOutletVelocityFvPatchVectorField.H | 31 +++------- ...IDControlInletVelocityFvPatchVectorField.H | 31 +++------- ...phaInletOutletVelocityFvPatchVectorField.H | 31 +++------- ...ableAlphaTotalPressureFvPatchScalarField.H | 28 +++------ .../prghPressureFvPatchScalarField.H | 24 +++----- ...talHydrostaticPressureFvPatchScalarField.H | 24 +++----- .../prghTotalPressureFvPatchScalarField.H | 24 +++----- ...ureInletOutletVelocityFvPatchVectorField.H | 28 +++------ .../rotatingTotalPressureFvPatchScalarField.H | 24 +++----- .../rotatingWallVelocityFvPatchVectorField.H | 27 +++----- .../scaledFixedValueFvPatchField.H | 22 +++---- .../derived/slip/slipFvPatchField.H | 22 +++---- .../supersonicFreestreamFvPatchVectorField.H | 24 +++----- ...urfaceNormalFixedValueFvPatchVectorField.H | 28 +++------ .../swirlFanVelocityFvPatchField.H | 22 +++---- ...lFlowRateInletVelocityFvPatchVectorField.H | 24 +++----- .../swirlInletVelocityFvPatchVectorField.H | 24 +++----- .../syringePressureFvPatchScalarField.H | 24 +++----- .../timeVaryingMappedFixedValueFvPatchField.H | 22 +++---- .../totalPressureFvPatchScalarField.H | 24 +++----- .../totalTemperatureFvPatchScalarField.H | 24 +++----- ...ranslatingWallVelocityFvPatchVectorField.H | 26 +++----- .../turbulentDFSEMInletFvPatchVectorField.H | 24 +++----- .../turbulentDigitalFilterInletFvPatchField.H | 22 +++---- .../turbulentInletFvPatchField.H | 22 +++---- ...sityKineticEnergyInletFvPatchScalarField.H | 31 +++------- ...ityHydrostaticPressureFvPatchScalarField.H | 28 +++------ .../uniformFixedGradientFvPatchField.H | 22 +++---- .../uniformFixedValueFvPatchField.H | 22 +++---- .../uniformInletOutletFvPatchField.H | 22 +++---- .../uniformJump/uniformJumpFvPatchField.H | 22 +++---- .../uniformJumpAMIFvPatchField.H | 22 +++---- .../uniformMixed/uniformMixedFvPatchField.H | 22 +++---- ...niformNormalFixedValueFvPatchVectorField.H | 28 +++------ .../uniformTotalPressureFvPatchScalarField.H | 24 +++----- .../variableHeightFlowRateFvPatchField.H | 22 +++---- ...tFlowRateInletVelocityFvPatchVectorField.H | 28 +++------ .../waveSurfacePressureFvPatchScalarField.H | 24 +++----- .../waveTransmissiveFvPatchField.H | 22 +++---- .../fvPatchFields/fvPatchField/fvPatchField.H | 36 ++++++++--- .../calculated/calculatedFvsPatchField.C | 4 +- .../calculated/calculatedFvsPatchField.H | 22 +++---- .../basic/coupled/coupledFvsPatchField.H | 6 +- .../fixedValue/fixedValueFvsPatchField.H | 23 +++---- .../basic/sliced/slicedFvsPatchField.C | 37 +---------- .../basic/sliced/slicedFvsPatchField.H | 16 +++-- .../constraint/cyclic/cyclicFvsPatchField.H | 22 +++---- .../cyclicACMI/cyclicACMIFvsPatchField.H | 29 ++++----- .../cyclicAMI/cyclicAMIFvsPatchField.H | 30 ++++----- .../cyclicSlip/cyclicSlipFvsPatchField.H | 22 +++---- .../constraint/empty/emptyFvsPatchField.H | 22 +++---- .../nonuniformTransformCyclicFvsPatchField.H | 22 +++---- .../processor/processorFvsPatchField.H | 22 +++---- .../processorCyclicFvsPatchField.H | 22 +++---- .../symmetry/symmetryFvsPatchField.H | 22 +++---- .../symmetryPlaneFvsPatchField.H | 22 +++---- .../constraint/wedge/wedgeFvsPatchField.H | 22 +++---- .../fvsPatchField/fvsPatchField.H | 36 ++++++++--- .../externalCoupledMixedFvPatchField.H | 22 +++---- ...oupledTemperatureMixedFvPatchScalarField.H | 26 +++----- .../cellMotion/cellMotionFvPatchField.H | 22 +++---- .../surfaceSlipDisplacementFvPatchField.H | 23 +++---- ...llatingDisplacementPointPatchVectorField.H | 27 +++----- ...OscillatingVelocityPointPatchVectorField.H | 27 +++----- ...llatingDisplacementPointPatchVectorField.H | 27 +++----- ...oscillatingVelocityPointPatchVectorField.H | 27 +++----- ...surfaceDisplacementPointPatchVectorField.H | 30 +++------ ...aceSlipDisplacementPointPatchVectorField.H | 30 +++------ ...meVaryingMappedFixedValuePointPatchField.H | 20 +++--- ...polatedDisplacementPointPatchVectorField.H | 27 +++----- .../waveDisplacementPointPatchVectorField.H | 27 +++----- .../genericFaPatchField/genericFaPatchField.H | 22 +++---- .../genericFaePatchField.H | 22 +++---- .../genericFvPatchField/genericFvPatchField.H | 22 +++---- .../genericFvsPatchField.H | 22 +++---- .../genericPointPatchField.H | 27 +++----- ...edPointDisplacementPointPatchVectorField.H | 27 +++----- .../zeroFixedValuePointPatchField.H | 26 ++------ .../cyclicACMIPointPatchField.H | 26 +++----- .../cyclicAMIPointPatchField.H | 26 +++----- .../uniformFixedValuePointPatchField.H | 27 +++----- ...djointFarFieldPressureFvPatchScalarField.H | 24 +++----- ...djointFarFieldVelocityFvPatchVectorField.H | 24 +++----- .../adjointInletVelocityFvPatchVectorField.H | 24 +++----- .../adjointOutletPressureFvPatchScalarField.H | 24 +++----- .../adjointOutletVelocityFvPatchVectorField.H | 25 +++----- ...ointOutletVelocityFluxFvPatchVectorField.H | 25 +++----- ...ntRotatingWallVelocityFvPatchVectorField.H | 24 +++----- .../adjointWallVelocityFvPatchVectorField.H | 24 +++----- ...jointWallVelocityLowReFvPatchVectorField.H | 24 +++----- .../adjointZeroInletFvPatchField.H | 22 +++---- ...djointFarFieldNuaTildaFvPatchScalarField.H | 24 +++----- .../adjointFarFieldTMVar1FvPatchScalarField.H | 24 +++----- .../adjointFarFieldTMVar2FvPatchScalarField.H | 24 +++----- .../adjointInletNuaTildaFvPatchScalarField.H | 24 +++----- .../adjointOutletFluxFvPatchField.H | 22 +++---- .../adjointOutletKaFvPatchScalarField.H | 24 +++----- .../adjointOutletNuaTildaFvPatchScalarField.H | 24 +++----- ...ointOutletNuaTildaFluxFvPatchScalarField.H | 24 +++----- .../adjointOutletWaFvPatchScalarField.H | 24 +++----- .../kaqRWallFunctionFvPatchScalarField.H | 24 +++----- .../waWallFunctionFvPatchScalarField.H | 24 +++----- .../oversetPolyPatch/oversetFvPatchField.H | 22 +++---- .../alphaContactAngleFvPatchScalarField.H | 24 +++----- ...imeVaryingMassSorptionFvPatchScalarField.H | 24 +++----- .../alphaContactAngleFvPatchScalarField.H | 24 +++----- ...allBoilingWallFunctionFvPatchScalarField.H | 31 +++------- ...ayatillekeWallFunctionFvPatchScalarField.H | 31 +++------- ...allBoilingWallFunctionFvPatchScalarField.H | 24 +++----- .../copiedFixedValueFvPatchScalarField.H | 24 +++----- ...ixedMultiPhaseHeatFluxFvPatchScalarField.H | 24 +++----- ...sonJacksonParticleSlipFvPatchVectorField.H | 24 +++----- ...onJacksonParticleThetaFvPatchScalarField.H | 24 +++----- ...sonJacksonParticleSlipFvPatchVectorField.H | 24 +++----- ...onJacksonParticleThetaFvPatchScalarField.H | 24 +++----- .../velocityFilmShellFvPatchVectorField.H | 24 +++----- .../thermalShellFvPatchScalarField.H | 24 +++----- .../vibrationShellFvPatchScalarField.H | 24 +++----- ...sRadiativeCoupledMixedFvPatchScalarField.H | 31 +++------- ...ysisTemperatureCoupledFvPatchScalarField.H | 24 +++----- ...rolysisVelocityCoupledFvPatchVectorField.H | 24 +++----- ...ilmHeightInletVelocityFvPatchVectorField.H | 24 +++----- ...linedFilmNusseltHeightFvPatchScalarField.H | 24 +++----- ...lmNusseltInletVelocityFvPatchVectorField.H | 27 +++----- ...alphatFilmWallFunctionFvPatchScalarField.H | 24 +++----- .../nutkFilmWallFunctionFvPatchScalarField.H | 24 +++----- .../thermalBaffleFvPatchScalarField.H | 25 +++----- ...gidBodyDisplacementPointPatchVectorField.H | 27 +++----- ...gidBodyDisplacementPointPatchVectorField.H | 27 +++----- ...convectiveHeatTransferFvPatchScalarField.H | 24 +++----- ...allHeatFluxTemperatureFvPatchScalarField.H | 24 +++----- ...fixedIncidentRadiationFvPatchScalarField.H | 35 +++-------- ...emperatureCoupledMixedFvPatchScalarField.H | 31 +++------- ...pedMassWallTemperatureFvPatchScalarField.H | 24 +++----- ...tletMachNumberPressureFvPatchScalarField.H | 24 +++----- ...ppedUniformInletHeatAdditionFvPatchField.H | 22 +++---- ...ableBaffleMassFractionFvPatchScalarField.H | 28 +++------ ...ermeableBaffleVelocityFvPatchVectorField.H | 28 +++------ .../thermalBaffle1DFvPatchScalarField.H | 24 +++----- ...RateAdvectiveDiffusiveFvPatchScalarField.H | 30 +++------ ...tureCoupledBaffleMixedFvPatchScalarField.H | 31 +++------- ...eratureRadCoupledMixedFvPatchScalarField.H | 31 +++------- ...ayatillekeWallFunctionFvPatchScalarField.H | 28 +++------ .../alphatWallFunctionFvPatchScalarField.H | 24 +++----- .../sorptionWallFunctionFvPatchScalarField.H | 28 +++------ .../wallHeatTransferFvPatchScalarField.H | 24 +++----- .../energyJump/energyJumpFvPatchScalarField.H | 22 +++---- .../energyJumpAMIFvPatchScalarField.H | 22 +++---- .../fixedEnergyFvPatchScalarField.H | 24 +++----- .../gradientEnergyFvPatchScalarField.H | 24 +++----- .../mixedEnergyFvPatchScalarField.H | 24 +++----- .../MarshakRadiationFvPatchScalarField.H | 24 +++----- ...iationFixedTemperatureFvPatchScalarField.H | 28 +++------ ...iffusiveRadiationMixedFvPatchScalarField.H | 24 +++----- ...veViewFactorFixedValueFvPatchScalarField.H | 28 +++------ ...specularRadiationMixedFvPatchScalarField.H | 24 +++----- ...iffusiveRadiationMixedFvPatchScalarField.H | 26 +++----- .../enthalpySorptionFvPatchScalarField.H | 24 +++----- .../fixedUnburntEnthalpyFvPatchScalarField.H | 24 +++----- ...radientUnburntEnthalpyFvPatchScalarField.H | 24 +++----- .../mixedUnburntEnthalpyFvPatchScalarField.H | 24 +++----- .../speciesSorptionFvPatchScalarField.H | 24 +++----- ...stantAlphaContactAngleFvPatchScalarField.H | 24 +++----- ...namicAlphaContactAngleFvPatchScalarField.H | 24 +++----- ...ndentAlphaContactAngleFvPatchScalarField.H | 31 +++------- ...ryingAlphaContactAngleFvPatchScalarField.H | 24 +++----- .../alphaFixedPressureFvPatchScalarField.H | 24 +++----- .../waveAlpha/waveAlphaFvPatchScalarField.H | 24 +++----- .../waveVelocityFvPatchVectorField.H | 24 +++----- .../waveMakerPointPatchVectorField.H | 27 +++----- 361 files changed, 3155 insertions(+), 5621 deletions(-) diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.H b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.H index 0ac35141e65..ef03d5e198c 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.H +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.H @@ -110,15 +110,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new smoluchowskiJumpTFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference smoluchowskiJumpTFvPatchScalarField ( @@ -126,18 +117,22 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new smoluchowskiJumpTFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } + // Mapping functions //- Map (and resize as needed) from self given a mapping object diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.H b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.H index 1ebe0338aee..50862433b39 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.H +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.H @@ -118,15 +118,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new maxwellSlipUFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference maxwellSlipUFvPatchVectorField ( @@ -134,16 +125,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new maxwellSlipUFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.H b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.H index 28587acacaa..85fff0f1c88 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.H +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.H @@ -135,15 +135,6 @@ public: const fixedRhoFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new fixedRhoFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference fixedRhoFvPatchScalarField ( @@ -151,16 +142,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new fixedRhoFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.H index 072a0d28075..3268eab8d34 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.H @@ -196,18 +196,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField ( @@ -215,20 +203,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.H b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.H index d6497487452..a6bd29689c3 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.H +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.H @@ -85,15 +85,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new adjointOutletPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference adjointOutletPressureFvPatchScalarField ( @@ -101,16 +92,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new adjointOutletPressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.H b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.H index 6a1357a8204..5256fdfbd05 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.H +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.H @@ -85,15 +85,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new adjointOutletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference adjointOutletVelocityFvPatchVectorField ( @@ -101,16 +92,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new adjointOutletVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/alphaContactAngle/alphaContactAngleFvPatchScalarField.H b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/alphaContactAngle/alphaContactAngleFvPatchScalarField.H index 2863677d834..208c574975c 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/alphaContactAngle/alphaContactAngleFvPatchScalarField.H +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/alphaContactAngle/alphaContactAngleFvPatchScalarField.H @@ -164,15 +164,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new alphaContactAngleFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference alphaContactAngleFvPatchScalarField ( @@ -180,16 +171,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new alphaContactAngleFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.H b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.H index 433ae213e2c..c84ffe06928 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.H @@ -164,15 +164,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new alphaContactAngleFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference alphaContactAngleFvPatchScalarField ( @@ -180,16 +171,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new alphaContactAngleFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.H b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.H index 9c13942f156..b20d6f64ccc 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.H +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.H @@ -100,15 +100,6 @@ public: const tractionDisplacementFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new tractionDisplacementFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference tractionDisplacementFvPatchVectorField ( @@ -116,16 +107,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new tractionDisplacementFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.H b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.H index 52c2593a1a0..6590915eb61 100644 --- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.H +++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.H @@ -98,15 +98,6 @@ public: const tractionDisplacementCorrectionFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new tractionDisplacementCorrectionFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference tractionDisplacementCorrectionFvPatchVectorField ( @@ -114,16 +105,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new tractionDisplacementCorrectionFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.H b/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.H index 1baf7be91e7..92f61528f66 100644 --- a/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.H +++ b/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.H @@ -107,15 +107,6 @@ public: const ${typeName}FixedValueFvPatch${FieldType}& ); - //- Construct and return a clone - virtual tmp<fvPatch${FieldType}> clone() const - { - return tmp<fvPatch${FieldType}> - ( - new ${typeName}FixedValueFvPatch${FieldType}(*this) - ); - } - //- Construct as copy setting internal field reference ${typeName}FixedValueFvPatch${FieldType} ( @@ -123,16 +114,19 @@ public: const DimensionedField<${TemplateType}, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatch${FieldType}> clone + //- Return a clone + virtual tmp<fvPatchField<${TemplateType}>> clone() const + { + return fvPatchField<${TemplateType}>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<${TemplateType}>> clone ( const DimensionedField<${TemplateType}, volMesh>& iF ) const { - return tmp<fvPatch${FieldType}> - ( - new ${typeName}FixedValueFvPatch${FieldType}(*this, iF) - ); + return fvPatchField<${TemplateType}>::Clone(*this, iF); } diff --git a/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.H b/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.H index d46cd3e1a6f..3fef28149c8 100644 --- a/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.H +++ b/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.H @@ -108,15 +108,6 @@ public: const ${typeName}FixedValuePointPatch${FieldType}& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<${TemplateType}>> clone() const - { - return autoPtr<pointPatchField<${TemplateType}>> - ( - new ${typeName}FixedValuePointPatch${FieldType}(*this) - ); - } - //- Construct as copy setting internal field reference ${typeName}FixedValuePointPatch${FieldType} ( @@ -124,16 +115,19 @@ public: const DimensionedField<${TemplateType}, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<${TemplateType}>> clone() const + { + return pointPatchField<${TemplateType}>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<${TemplateType}>> clone ( const DimensionedField<${TemplateType}, pointMesh>& iF ) const { - return autoPtr<pointPatchField<${TemplateType}>> - ( - new ${typeName}FixedValuePointPatch${FieldType}(*this, iF) - ); + return pointPatchField<${TemplateType}>::Clone(*this, iF); } diff --git a/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.H b/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.H index 74195dc8df5..8e9ee59f823 100644 --- a/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.H +++ b/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.H @@ -107,15 +107,6 @@ public: const ${typeName}MixedValueFvPatch${FieldType}& ); - //- Construct and return a clone - virtual tmp<fvPatch${FieldType}> clone() const - { - return tmp<fvPatch${FieldType}> - ( - new ${typeName}MixedValueFvPatch${FieldType}(*this) - ); - } - //- Construct as copy setting internal field reference ${typeName}MixedValueFvPatch${FieldType} ( @@ -123,16 +114,19 @@ public: const DimensionedField<${TemplateType}, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatch${FieldType}> clone + //- Return a clone + virtual tmp<fvPatchField<${TemplateType}>> clone() const + { + return fvPatchField<${TemplateType}>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<${TemplateType}>> clone ( const DimensionedField<${TemplateType}, volMesh>& iF ) const { - return tmp<fvPatch${FieldType}> - ( - new ${typeName}MixedValueFvPatch${FieldType}(*this, iF) - ); + return fvPatchField<${TemplateType}>::Clone(*this, iF); } diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/basicSymmetry/basicSymmetryPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/basicSymmetry/basicSymmetryPointPatchField.H index c94efce3dd7..20cb347469c 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/basicSymmetry/basicSymmetryPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/basic/basicSymmetry/basicSymmetryPointPatchField.H @@ -83,18 +83,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new basicSymmetryPointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference basicSymmetryPointPatchField ( @@ -102,20 +90,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new basicSymmetryPointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C index 44c460d5c6b..220be3b830c 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C @@ -78,14 +78,13 @@ Foam::calculatedPointPatchField<Type>::calculatedPointPatchField template<class Type> -template<class Type2> Foam::autoPtr<Foam::pointPatchField<Type>> Foam::pointPatchField<Type>::NewCalculatedType ( - const pointPatchField<Type2>& pf + const pointPatch& p ) { - auto* patchTypeCtor = patchConstructorTable(pf.patch().type()); + auto* patchTypeCtor = patchConstructorTable(p.type()); if (patchTypeCtor) { @@ -93,8 +92,8 @@ Foam::pointPatchField<Type>::NewCalculatedType ( patchTypeCtor ( - pf.patch(), - Field<Type>::null() + p, + DimensionedField<Type, pointMesh>::null() ) ); } @@ -104,12 +103,24 @@ Foam::pointPatchField<Type>::NewCalculatedType ( new calculatedPointPatchField<Type> ( - pf.patch(), - Field<Type>::null() + p, + DimensionedField<Type, pointMesh>::null() ) ); } } +template<class Type> +template<class AnyType> +Foam::autoPtr<Foam::pointPatchField<Type>> +Foam::pointPatchField<Type>::NewCalculatedType +( + const pointPatchField<AnyType>& pf +) +{ + return NewCalculatedType(pf.patch()); +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.H index 42189f5a278..a3f040c7fac 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.H @@ -85,18 +85,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new calculatedPointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference calculatedPointPatchField ( @@ -104,18 +92,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference - virtual autoPtr<pointPatchField<Type>> - clone(const DimensionedField<Type, pointMesh>& iF) const + virtual autoPtr<pointPatchField<Type>> clone + ( + const DimensionedField<Type, pointMesh>& iF + ) const { - return autoPtr<pointPatchField<Type>> - ( - new calculatedPointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } }; diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/coupled/coupledPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/coupled/coupledPointPatchField.H index 616743df38a..a70e06f7320 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/coupled/coupledPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/basic/coupled/coupledPointPatchField.H @@ -87,9 +87,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const = 0; - //- Construct as copy setting internal field reference coupledPointPatchField ( @@ -97,6 +94,9 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const = 0; + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H index 06203b7ad85..c325c855292 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/basic/fixedValue/fixedValuePointPatchField.H @@ -111,18 +111,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new fixedValuePointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference fixedValuePointPatchField ( @@ -130,20 +118,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new fixedValuePointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H index 2bd1a9e993c..377be799304 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.H @@ -142,18 +142,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new valuePointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference valuePointPatchField ( @@ -161,20 +149,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new valuePointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/zeroGradient/zeroGradientPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/basic/zeroGradient/zeroGradientPointPatchField.H index ca91d23cff7..14ac2777e18 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/zeroGradient/zeroGradientPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/basic/zeroGradient/zeroGradientPointPatchField.H @@ -85,18 +85,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new zeroGradientPointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference zeroGradientPointPatchField ( @@ -104,20 +92,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new zeroGradientPointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } }; diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.H index f8cccfa7b01..80e5905a4e2 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.H @@ -92,18 +92,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new cyclicPointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference cyclicPointPatchField ( @@ -111,19 +99,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new cyclicPointPatchField<Type> - ( - *this, iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchField.H index 600fc2080be..628ae11ae9a 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchField.H @@ -87,18 +87,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new cyclicSlipPointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference cyclicSlipPointPatchField ( @@ -106,19 +94,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new cyclicSlipPointPatchField<Type> - ( - *this, iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/empty/emptyPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/empty/emptyPointPatchField.H index dc2c9fc903f..a865ee9ee77 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/empty/emptyPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/empty/emptyPointPatchField.H @@ -86,18 +86,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new emptyPointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference emptyPointPatchField ( @@ -105,22 +93,22 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new emptyPointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } + // Member functions //- Constraint handling diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchField.H index 982884b84a3..8808cc3a0ab 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchField.H @@ -87,18 +87,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new nonuniformTransformCyclicPointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference nonuniformTransformCyclicPointPatchField ( @@ -106,19 +94,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new nonuniformTransformCyclicPointPatchField<Type> - ( - *this, iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/processor/processorPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/processor/processorPointPatchField.H index ed9f82d6692..61f0962398c 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/processor/processorPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/processor/processorPointPatchField.H @@ -91,18 +91,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new processorPointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference processorPointPatchField ( @@ -110,20 +98,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new processorPointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.H index 7dd46e4f74d..a5eed9049d4 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.H @@ -99,18 +99,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new processorCyclicPointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference processorCyclicPointPatchField ( @@ -118,20 +106,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new processorCyclicPointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/symmetry/symmetryPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetry/symmetryPointPatchField.H index 7be7b6ff01e..8a9192bd16b 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/symmetry/symmetryPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetry/symmetryPointPatchField.H @@ -87,18 +87,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new symmetryPointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference symmetryPointPatchField ( @@ -106,20 +94,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new symmetryPointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchField.H index 1422a613205..1b9b5459026 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchField.H @@ -92,18 +92,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new symmetryPlanePointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference symmetryPlanePointPatchField ( @@ -111,20 +99,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new symmetryPlanePointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/wedge/wedgePointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/wedge/wedgePointPatchField.H index 7b2ebc85869..436076f5214 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/wedge/wedgePointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/wedge/wedgePointPatchField.H @@ -87,18 +87,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new wedgePointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference wedgePointPatchField ( @@ -106,19 +94,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new wedgePointPatchField<Type> - ( - *this, iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/OpenFOAM/fields/pointPatchFields/derived/codedFixedValue/codedFixedValuePointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/derived/codedFixedValue/codedFixedValuePointPatchField.H index 438acf74ce3..9999047742a 100644 --- a/src/OpenFOAM/fields/pointPatchFields/derived/codedFixedValue/codedFixedValuePointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/derived/codedFixedValue/codedFixedValuePointPatchField.H @@ -209,15 +209,6 @@ public: const codedFixedValuePointPatchField<Type>& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new codedFixedValuePointPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference codedFixedValuePointPatchField ( @@ -225,20 +216,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new codedFixedValuePointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/OpenFOAM/fields/pointPatchFields/derived/fixedNormalSlip/fixedNormalSlipPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/derived/fixedNormalSlip/fixedNormalSlipPointPatchField.H index d4c031350ed..bdfa66a5a8f 100644 --- a/src/OpenFOAM/fields/pointPatchFields/derived/fixedNormalSlip/fixedNormalSlipPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/derived/fixedNormalSlip/fixedNormalSlipPointPatchField.H @@ -104,18 +104,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new fixedNormalSlipPointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference fixedNormalSlipPointPatchField ( @@ -123,22 +111,22 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new fixedNormalSlipPointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } + // Member functions //- Update the patch field diff --git a/src/OpenFOAM/fields/pointPatchFields/derived/slip/slipPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/derived/slip/slipPointPatchField.H index 027cc956ad2..cae5ae25506 100644 --- a/src/OpenFOAM/fields/pointPatchFields/derived/slip/slipPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/derived/slip/slipPointPatchField.H @@ -86,18 +86,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new slipPointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference slipPointPatchField ( @@ -105,20 +93,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new slipPointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } }; diff --git a/src/OpenFOAM/fields/pointPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValuePointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValuePointPatchField.H index 2fe588648ac..88de0d0d09e 100644 --- a/src/OpenFOAM/fields/pointPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValuePointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValuePointPatchField.H @@ -101,15 +101,6 @@ public: const timeVaryingUniformFixedValuePointPatchField<Type>& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new timeVaryingUniformFixedValuePointPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference timeVaryingUniformFixedValuePointPatchField ( @@ -117,16 +108,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new timeVaryingUniformFixedValuePointPatchField<Type>(*this, iF) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H index 011569f452c..543b7f57cf9 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H @@ -345,17 +345,31 @@ public: const DimensionedField<Type, pointMesh>& ); - //- Construct and return a clone + //- Clone patch field with its own internal field reference virtual autoPtr<pointPatchField<Type>> clone() const = 0; - //- Construct and return a clone setting internal field reference + //- Clone patch field with an internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const = 0; - // Selectors + // Factory Methods + + //- Clone a patch field, optionally with internal field reference etc. + template<class DerivedPatchField, class... Args> + static autoPtr<pointPatchField<Type>> Clone + ( + const DerivedPatchField& pf, + Args&&... args + ) + { + return autoPtr<pointPatchField<Type>> + ( + new DerivedPatchField(pf, std::forward<Args>(args)...) + ); + } //- Return a pointer to a new patchField created on freestore given // patch and internal field @@ -400,11 +414,19 @@ public: //- Return a pointer to a new calculatedPointPatchField created on // freestore without setting patchField values - template<class Type2> static autoPtr<pointPatchField<Type>> NewCalculatedType ( - const pointPatchField<Type2>& + const pointPatch& p + ); + + //- Return a pointer to a new calculatedPointPatchField created on + // freestore without setting patchField values + template<class AnyType> + static autoPtr<pointPatchField<Type>> + NewCalculatedType + ( + const pointPatchField<AnyType>& pf ); diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.H index e0e9d41ab06..7f7a2d2d177 100644 --- a/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.H +++ b/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.H @@ -172,15 +172,6 @@ public: const alphatJayatillekeWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new alphatJayatillekeWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference alphatJayatillekeWallFunctionFvPatchScalarField ( @@ -188,16 +179,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new alphatJayatillekeWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H index 9246a285363..e32721ee5c7 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H @@ -167,18 +167,6 @@ public: const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new turbulentMixingLengthDissipationRateInletFvPatchScalarField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference turbulentMixingLengthDissipationRateInletFvPatchScalarField ( @@ -186,20 +174,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new turbulentMixingLengthDissipationRateInletFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H index 4ea6936c7ee..c89a8cb0dbb 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H @@ -144,18 +144,6 @@ public: const turbulentMixingLengthFrequencyInletFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new turbulentMixingLengthFrequencyInletFvPatchScalarField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference turbulentMixingLengthFrequencyInletFvPatchScalarField ( @@ -163,20 +151,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new turbulentMixingLengthFrequencyInletFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.H index 0077f5ed27a..158130e4c5a 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.H @@ -130,15 +130,6 @@ public: const fixedShearStressFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new fixedShearStressFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference fixedShearStressFvPatchVectorField ( @@ -146,16 +137,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new fixedShearStressFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H index 0fb4f64e3f6..e99ee74e9ab 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H @@ -182,15 +182,6 @@ public: const porousBafflePressureFvPatchField& ); - //- Construct and return a clone - virtual tmp<fvPatchField<scalar>> clone() const - { - return tmp<fvPatchField<scalar>> - ( - new porousBafflePressureFvPatchField(*this) - ); - } - //- Construct as copy setting internal field reference porousBafflePressureFvPatchField ( @@ -198,16 +189,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchField<scalar>> - ( - new porousBafflePressureFvPatchField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H index db8c5fa6c6f..622df17ae68 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H @@ -212,15 +212,6 @@ public: const epsilonWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new epsilonWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference epsilonWallFunctionFvPatchScalarField ( @@ -228,16 +219,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new epsilonWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H index 9ddf258d94f..6c3aef724d0 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H @@ -173,15 +173,6 @@ public: const kLowReWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new kLowReWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference kLowReWallFunctionFvPatchScalarField ( @@ -189,16 +180,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new kLowReWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H index 0c8d12d1402..b552a4cf489 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H @@ -123,15 +123,6 @@ public: const kqRWallFunctionFvPatchField& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new kqRWallFunctionFvPatchField(*this) - ); - } - //- Construct as copy setting internal field reference kqRWallFunctionFvPatchField ( @@ -139,16 +130,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new kqRWallFunctionFvPatchField(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.H index b90fd8a988d..2c2cf4eff94 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.H @@ -129,15 +129,6 @@ public: const nutLowReWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new nutLowReWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference nutLowReWallFunctionFvPatchScalarField ( @@ -145,16 +136,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new nutLowReWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUBlendedWallFunction/nutUBlendedWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUBlendedWallFunction/nutUBlendedWallFunctionFvPatchScalarField.H index 3f84c8be6f4..351bf184747 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUBlendedWallFunction/nutUBlendedWallFunctionFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUBlendedWallFunction/nutUBlendedWallFunctionFvPatchScalarField.H @@ -175,15 +175,6 @@ public: const nutUBlendedWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new nutUBlendedWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference nutUBlendedWallFunctionFvPatchScalarField ( @@ -191,16 +182,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new nutUBlendedWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H index 9a9e747781c..efcd889d931 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H @@ -171,15 +171,6 @@ public: const nutURoughWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new nutURoughWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference nutURoughWallFunctionFvPatchScalarField ( @@ -187,16 +178,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new nutURoughWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.H index 09935152a5a..edac484a4f7 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.H @@ -189,15 +189,6 @@ public: const nutUSpaldingWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new nutUSpaldingWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference nutUSpaldingWallFunctionFvPatchScalarField ( @@ -205,16 +196,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new nutUSpaldingWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.H index 18cb1277384..e2010c780c4 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.H @@ -156,15 +156,6 @@ public: const nutUTabulatedWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new nutUTabulatedWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference nutUTabulatedWallFunctionFvPatchScalarField ( @@ -172,16 +163,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new nutUTabulatedWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.H index 9b96cb2b68a..81f8ecaf952 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.H @@ -143,15 +143,6 @@ public: const nutUWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new nutUWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference nutUWallFunctionFvPatchScalarField ( @@ -159,16 +150,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new nutUWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H index 1f1da1e629c..322819f8bbc 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H @@ -153,15 +153,6 @@ public: const nutkRoughWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new nutkRoughWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference nutkRoughWallFunctionFvPatchScalarField ( @@ -169,16 +160,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new nutkRoughWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H index e04791c48ba..5691a52d087 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H @@ -134,15 +134,6 @@ public: const nutkWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new nutkWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference nutkWallFunctionFvPatchScalarField ( @@ -150,16 +141,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new nutkWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H index 4fb98c8c34f..0e0e25f9083 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H @@ -203,15 +203,6 @@ public: const omegaWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new omegaWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference omegaWallFunctionFvPatchScalarField ( @@ -219,18 +210,22 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new omegaWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } + //- Destructor virtual ~omegaWallFunctionFvPatchScalarField() = default; diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.H b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.H index 2641003b1f7..f718dbeca3b 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.H +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.H @@ -149,15 +149,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new atmBoundaryLayerInletEpsilonFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference atmBoundaryLayerInletEpsilonFvPatchScalarField ( @@ -165,16 +156,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new atmBoundaryLayerInletEpsilonFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.H b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.H index e2d8d70213d..db567693f70 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.H +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.H @@ -148,15 +148,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new atmBoundaryLayerInletKFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference atmBoundaryLayerInletKFvPatchScalarField ( @@ -164,16 +155,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new atmBoundaryLayerInletKFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletOmega/atmBoundaryLayerInletOmegaFvPatchScalarField.H b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletOmega/atmBoundaryLayerInletOmegaFvPatchScalarField.H index ffe51f9d374..b1c0d08eca6 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletOmega/atmBoundaryLayerInletOmegaFvPatchScalarField.H +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletOmega/atmBoundaryLayerInletOmegaFvPatchScalarField.H @@ -145,15 +145,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new atmBoundaryLayerInletOmegaFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference atmBoundaryLayerInletOmegaFvPatchScalarField ( @@ -161,16 +152,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new atmBoundaryLayerInletOmegaFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H index ddbbd8179e4..fc541a22b7f 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H @@ -152,15 +152,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new atmBoundaryLayerInletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference atmBoundaryLayerInletVelocityFvPatchVectorField ( @@ -168,16 +159,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new atmBoundaryLayerInletVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/atmosphericModels/derivedFvPatchFields/atmTurbulentHeatFluxTemperature/atmTurbulentHeatFluxTemperatureFvPatchScalarField.H b/src/atmosphericModels/derivedFvPatchFields/atmTurbulentHeatFluxTemperature/atmTurbulentHeatFluxTemperatureFvPatchScalarField.H index af5169c2110..003299c83f3 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmTurbulentHeatFluxTemperature/atmTurbulentHeatFluxTemperatureFvPatchScalarField.H +++ b/src/atmosphericModels/derivedFvPatchFields/atmTurbulentHeatFluxTemperature/atmTurbulentHeatFluxTemperatureFvPatchScalarField.H @@ -177,15 +177,6 @@ public: const atmTurbulentHeatFluxTemperatureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new atmTurbulentHeatFluxTemperatureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference atmTurbulentHeatFluxTemperatureFvPatchScalarField ( @@ -193,20 +184,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new atmTurbulentHeatFluxTemperatureFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmAlphatkWallFunction/atmAlphatkWallFunctionFvPatchScalarField.H b/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmAlphatkWallFunction/atmAlphatkWallFunctionFvPatchScalarField.H index 3280cedc7d7..94e6583857d 100644 --- a/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmAlphatkWallFunction/atmAlphatkWallFunctionFvPatchScalarField.H +++ b/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmAlphatkWallFunction/atmAlphatkWallFunctionFvPatchScalarField.H @@ -179,15 +179,6 @@ public: const atmAlphatkWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new atmAlphatkWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference atmAlphatkWallFunctionFvPatchScalarField ( @@ -195,16 +186,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new atmAlphatkWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmEpsilonWallFunction/atmEpsilonWallFunctionFvPatchScalarField.H b/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmEpsilonWallFunction/atmEpsilonWallFunctionFvPatchScalarField.H index e80434bf473..3101206000b 100644 --- a/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmEpsilonWallFunction/atmEpsilonWallFunctionFvPatchScalarField.H +++ b/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmEpsilonWallFunction/atmEpsilonWallFunctionFvPatchScalarField.H @@ -170,15 +170,6 @@ public: const atmEpsilonWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new atmEpsilonWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference atmEpsilonWallFunctionFvPatchScalarField ( @@ -186,18 +177,22 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new atmEpsilonWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } + //- Destructor virtual ~atmEpsilonWallFunctionFvPatchScalarField() = default; diff --git a/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmNutUWallFunction/atmNutUWallFunctionFvPatchScalarField.H b/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmNutUWallFunction/atmNutUWallFunctionFvPatchScalarField.H index c006c0249aa..8dc5162c0e2 100644 --- a/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmNutUWallFunction/atmNutUWallFunctionFvPatchScalarField.H +++ b/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmNutUWallFunction/atmNutUWallFunctionFvPatchScalarField.H @@ -170,15 +170,6 @@ public: const atmNutUWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new atmNutUWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference atmNutUWallFunctionFvPatchScalarField ( @@ -186,16 +177,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new atmNutUWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmNutWallFunction/atmNutWallFunctionFvPatchScalarField.H b/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmNutWallFunction/atmNutWallFunctionFvPatchScalarField.H index 2cace45acf5..ecb892deab8 100644 --- a/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmNutWallFunction/atmNutWallFunctionFvPatchScalarField.H +++ b/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmNutWallFunction/atmNutWallFunctionFvPatchScalarField.H @@ -207,15 +207,6 @@ public: const atmNutWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new atmNutWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference atmNutWallFunctionFvPatchScalarField ( @@ -223,16 +214,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new atmNutWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmNutkWallFunction/atmNutkWallFunctionFvPatchScalarField.H b/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmNutkWallFunction/atmNutkWallFunctionFvPatchScalarField.H index 0dce8f571cf..f17cbf217ef 100644 --- a/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmNutkWallFunction/atmNutkWallFunctionFvPatchScalarField.H +++ b/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmNutkWallFunction/atmNutkWallFunctionFvPatchScalarField.H @@ -191,15 +191,6 @@ public: const atmNutkWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new atmNutkWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference atmNutkWallFunctionFvPatchScalarField ( @@ -207,16 +198,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new atmNutkWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmOmegaWallFunction/atmOmegaWallFunctionFvPatchScalarField.H b/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmOmegaWallFunction/atmOmegaWallFunctionFvPatchScalarField.H index 49b7a099921..a3439bed586 100644 --- a/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmOmegaWallFunction/atmOmegaWallFunctionFvPatchScalarField.H +++ b/src/atmosphericModels/derivedFvPatchFields/wallFunctions/atmOmegaWallFunction/atmOmegaWallFunctionFvPatchScalarField.H @@ -169,15 +169,6 @@ public: const atmOmegaWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new atmOmegaWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference atmOmegaWallFunctionFvPatchScalarField ( @@ -185,16 +176,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new atmOmegaWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/dynamicFaMesh/interfaceTrackingFvMesh/fvPatchFields/freeSurfacePressure/freeSurfacePressureFvPatchScalarField.H b/src/dynamicFaMesh/interfaceTrackingFvMesh/fvPatchFields/freeSurfacePressure/freeSurfacePressureFvPatchScalarField.H index 818ce6ba41b..95a7f26b429 100644 --- a/src/dynamicFaMesh/interfaceTrackingFvMesh/fvPatchFields/freeSurfacePressure/freeSurfacePressureFvPatchScalarField.H +++ b/src/dynamicFaMesh/interfaceTrackingFvMesh/fvPatchFields/freeSurfacePressure/freeSurfacePressureFvPatchScalarField.H @@ -132,15 +132,6 @@ public: const freeSurfacePressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField > - ( - new freeSurfacePressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference freeSurfacePressureFvPatchScalarField ( @@ -148,16 +139,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new freeSurfacePressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/dynamicFaMesh/interfaceTrackingFvMesh/fvPatchFields/freeSurfaceVelocity/freeSurfaceVelocityFvPatchVectorField.H b/src/dynamicFaMesh/interfaceTrackingFvMesh/fvPatchFields/freeSurfaceVelocity/freeSurfaceVelocityFvPatchVectorField.H index 77c81522dea..500a4aa322e 100644 --- a/src/dynamicFaMesh/interfaceTrackingFvMesh/fvPatchFields/freeSurfaceVelocity/freeSurfaceVelocityFvPatchVectorField.H +++ b/src/dynamicFaMesh/interfaceTrackingFvMesh/fvPatchFields/freeSurfaceVelocity/freeSurfaceVelocityFvPatchVectorField.H @@ -90,15 +90,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new freeSurfaceVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference freeSurfaceVelocityFvPatchVectorField ( @@ -106,16 +97,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new freeSurfaceVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H b/src/dynamicMesh/motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H index 1ed9211e1b6..2a610232504 100644 --- a/src/dynamicMesh/motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H +++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H @@ -101,18 +101,6 @@ public: const solidBodyMotionDisplacementPointPatchVectorField& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<vector>> clone() const - { - return autoPtr<pointPatchField<vector>> - ( - new solidBodyMotionDisplacementPointPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference solidBodyMotionDisplacementPointPatchVectorField ( @@ -121,20 +109,19 @@ public: ); + //- Return a clone + virtual autoPtr<pointPatchField<vector>> clone() const + { + return pointPatchField<vector>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<vector>> clone ( const DimensionedField<vector, pointMesh>& iF ) const { - return autoPtr<pointPatchField<vector>> - ( - new solidBodyMotionDisplacementPointPatchVectorField - ( - *this, - iF - ) - ); + return pointPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchField.H b/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchField.H index 6e6ae1696c6..9772728ab5a 100644 --- a/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchField.H @@ -95,15 +95,6 @@ public: const basicSymmetryFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new basicSymmetryFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference basicSymmetryFaPatchField ( @@ -111,16 +102,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new basicSymmetryFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchField.C b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchField.C index 4f8eefa33c3..53b7f314f18 100644 --- a/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchField.C +++ b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchField.C @@ -90,19 +90,19 @@ Foam::calculatedFaPatchField<Type>::calculatedFaPatchField template<class Type> -template<class AnyType> -Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::NewCalculatedType +Foam::tmp<Foam::faPatchField<Type>> +Foam::faPatchField<Type>::NewCalculatedType ( - const faPatchField<AnyType>& pf + const faPatch& p ) { - auto* patchTypeCtor = patchConstructorTable(pf.patch().type()); + auto* patchTypeCtor = patchConstructorTable(p.type()); if (patchTypeCtor) { return patchTypeCtor ( - pf.patch(), + p, DimensionedField<Type, areaMesh>::null() ); } @@ -112,7 +112,7 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::NewCalculatedType ( new calculatedFaPatchField<Type> ( - pf.patch(), + p, DimensionedField<Type, areaMesh>::null() ) ); @@ -120,6 +120,18 @@ Foam::tmp<Foam::faPatchField<Type>> Foam::faPatchField<Type>::NewCalculatedType } +template<class Type> +template<class AnyType> +Foam::tmp<Foam::faPatchField<Type>> +Foam::faPatchField<Type>::NewCalculatedType +( + const faPatchField<AnyType>& pf +) +{ + return NewCalculatedType(pf.patch()); +} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> diff --git a/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchField.H b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchField.H index 9f180b65f21..07f612924d5 100644 --- a/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/basic/calculated/calculatedFaPatchField.H @@ -97,15 +97,6 @@ public: const calculatedFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new calculatedFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference calculatedFaPatchField ( @@ -113,16 +104,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new calculatedFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchField.H b/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchField.H index 0c6232d9620..616d257fe48 100644 --- a/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/basic/coupled/coupledFaPatchField.H @@ -108,9 +108,6 @@ public: const coupledFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const = 0; - //- Construct as copy setting internal field reference coupledFaPatchField ( @@ -118,6 +115,9 @@ public: const DimensionedField<Type, areaMesh>& ); + //- Return clone + virtual tmp<faPatchField<Type>> clone() const = 0; + //- Construct and return a clone virtual tmp<faPatchField<Type>> clone ( diff --git a/src/finiteArea/fields/faPatchFields/basic/extrapolatedCalculated/extrapolatedCalculatedFaPatchField.H b/src/finiteArea/fields/faPatchFields/basic/extrapolatedCalculated/extrapolatedCalculatedFaPatchField.H index c326fe3d63a..1c618f3f7f0 100644 --- a/src/finiteArea/fields/faPatchFields/basic/extrapolatedCalculated/extrapolatedCalculatedFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/basic/extrapolatedCalculated/extrapolatedCalculatedFaPatchField.H @@ -108,15 +108,6 @@ public: const extrapolatedCalculatedFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new extrapolatedCalculatedFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference extrapolatedCalculatedFaPatchField ( @@ -124,16 +115,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new extrapolatedCalculatedFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchField.H b/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchField.H index abedc113279..760d9668b46 100644 --- a/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/basic/fixedGradient/fixedGradientFaPatchField.H @@ -144,15 +144,6 @@ public: const fixedGradientFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new fixedGradientFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference fixedGradientFaPatchField ( @@ -160,16 +151,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new fixedGradientFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchField.H b/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchField.H index b99f739ee9d..fa3f891e13a 100644 --- a/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/basic/fixedValue/fixedValueFaPatchField.H @@ -106,15 +106,6 @@ public: const fixedValueFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new fixedValueFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference fixedValueFaPatchField ( @@ -122,16 +113,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new fixedValueFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/basic/mixed/mixedFaPatchField.H b/src/finiteArea/fields/faPatchFields/basic/mixed/mixedFaPatchField.H index f4d0bdbab50..16f0e01da09 100644 --- a/src/finiteArea/fields/faPatchFields/basic/mixed/mixedFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/basic/mixed/mixedFaPatchField.H @@ -144,15 +144,6 @@ public: const mixedFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new mixedFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference mixedFaPatchField ( @@ -160,16 +151,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new mixedFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/basic/sliced/slicedFaPatchField.C b/src/finiteArea/fields/faPatchFields/basic/sliced/slicedFaPatchField.C index becbcfcf051..fb9846b1482 100644 --- a/src/finiteArea/fields/faPatchFields/basic/sliced/slicedFaPatchField.C +++ b/src/finiteArea/fields/faPatchFields/basic/sliced/slicedFaPatchField.C @@ -111,47 +111,14 @@ Foam::slicedFaPatchField<Type>::slicedFaPatchField } -template<class Type> -Foam::tmp<Foam::faPatchField<Type>> -Foam::slicedFaPatchField<Type>::clone() const -{ - return tmp<faPatchField<Type>> - ( - new slicedFaPatchField<Type>(*this) - ); -} - - template<class Type> Foam::slicedFaPatchField<Type>::slicedFaPatchField ( const slicedFaPatchField<Type>& ptf ) : - faPatchField<Type> - ( - ptf.patch(), - ptf.internalField(), - Field<Type>() - ) -{ - // Transfer the slice from the argument - UList<Type>::shallowCopy(ptf); -} - - -template<class Type> -Foam::tmp<Foam::faPatchField<Type>> -Foam::slicedFaPatchField<Type>::clone -( - const DimensionedField<Type, areaMesh>& iF -) const -{ - return tmp<faPatchField<Type>> - ( - new slicedFaPatchField<Type>(*this, iF) - ); -} + slicedFaPatchField<Type>(ptf, ptf.internalField()) +{} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -170,8 +137,7 @@ template<class Type> Foam::tmp<Foam::Field<Type>> Foam::slicedFaPatchField<Type>::snGrad() const { NotImplemented; - - return Field<Type>::null(); + return nullptr; } @@ -180,8 +146,7 @@ Foam::tmp<Foam::Field<Type>> Foam::slicedFaPatchField<Type>::patchInternalField() const { NotImplemented; - - return Field<Type>::null(); + return nullptr; } @@ -200,8 +165,7 @@ Foam::slicedFaPatchField<Type>::patchNeighbourField ) const { NotImplemented; - - return Field<Type>::null(); + return nullptr; } @@ -210,8 +174,7 @@ Foam::tmp<Foam::Field<Type>> Foam::slicedFaPatchField<Type>::patchNeighbourField() const { NotImplemented; - - return Field<Type>::null(); + return nullptr; } @@ -223,8 +186,7 @@ Foam::slicedFaPatchField<Type>::valueInternalCoeffs ) const { NotImplemented; - - return Field<Type>::null(); + return nullptr; } @@ -236,8 +198,7 @@ Foam::slicedFaPatchField<Type>::valueBoundaryCoeffs ) const { NotImplemented; - - return Field<Type>::null(); + return nullptr; } @@ -246,8 +207,7 @@ Foam::tmp<Foam::Field<Type>> Foam::slicedFaPatchField<Type>::gradientInternalCoeffs() const { NotImplemented; - - return Field<Type>::null(); + return nullptr; } @@ -256,8 +216,7 @@ Foam::tmp<Foam::Field<Type>> Foam::slicedFaPatchField<Type>::gradientBoundaryCoeffs() const { NotImplemented; - - return Field<Type>::null(); + return nullptr; } diff --git a/src/finiteArea/fields/faPatchFields/basic/sliced/slicedFaPatchField.H b/src/finiteArea/fields/faPatchFields/basic/sliced/slicedFaPatchField.H index 8afba50b8e3..dcee956514f 100644 --- a/src/finiteArea/fields/faPatchFields/basic/sliced/slicedFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/basic/sliced/slicedFaPatchField.H @@ -116,9 +116,6 @@ public: //- Construct as copy slicedFaPatchField(const slicedFaPatchField<Type>&); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const; - //- Construct as copy setting internal field reference slicedFaPatchField ( @@ -126,11 +123,20 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF - ) const; + ) const + { + return faPatchField<Type>::Clone(*this, iF); + } //- Destructor diff --git a/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchField.H b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchField.H index 7915ed2fc14..f4515b6a59a 100644 --- a/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchField.H @@ -92,9 +92,6 @@ public: const faPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const = 0; - //- Construct as copy setting internal field reference transformFaPatchField ( @@ -102,6 +99,9 @@ public: const DimensionedField<Type, areaMesh>& ); + //- Return clone + virtual tmp<faPatchField<Type>> clone() const = 0; + //- Construct and return a clone setting internal field reference virtual tmp<faPatchField<Type>> clone ( diff --git a/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchField.H b/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchField.H index ba4a9dff763..407c9a9b150 100644 --- a/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/basic/zeroGradient/zeroGradientFaPatchField.H @@ -96,15 +96,6 @@ public: const zeroGradientFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new zeroGradientFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference zeroGradientFaPatchField ( @@ -112,16 +103,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new zeroGradientFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.H b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.H index 359800d18cd..5ac2a891c5e 100644 --- a/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.H @@ -118,15 +118,6 @@ public: const cyclicFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new cyclicFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference cyclicFaPatchField ( @@ -134,16 +125,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new cyclicFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchField.H b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchField.H index f21c228ad6c..de754592beb 100644 --- a/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/constraint/empty/emptyFaPatchField.H @@ -97,15 +97,6 @@ public: const emptyFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new emptyFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference emptyFaPatchField ( @@ -113,16 +104,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new emptyFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.H b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.H index 32bc5e91ad8..06736b61b30 100644 --- a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.H @@ -137,15 +137,6 @@ public: //- Construct as copy processorFaPatchField(const processorFaPatchField<Type>&); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new processorFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference processorFaPatchField ( @@ -153,16 +144,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new processorFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchField.H b/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchField.H index 7233d56e893..e09d2aea515 100644 --- a/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchField.H @@ -97,15 +97,6 @@ public: const symmetryFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new symmetryFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference symmetryFaPatchField ( @@ -113,16 +104,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new symmetryFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } }; diff --git a/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchField.H b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchField.H index f1933ec1ab1..f417f28c405 100644 --- a/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchField.H @@ -91,15 +91,6 @@ public: const faPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new wedgeFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference wedgeFaPatchField ( @@ -107,16 +98,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new wedgeFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/derived/clampedPlate/clampedPlateFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/clampedPlate/clampedPlateFaPatchField.H index de365d612c5..828937bb6ca 100644 --- a/src/finiteArea/fields/faPatchFields/derived/clampedPlate/clampedPlateFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/clampedPlate/clampedPlateFaPatchField.H @@ -115,15 +115,6 @@ public: const clampedPlateFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new clampedPlateFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference clampedPlateFaPatchField ( @@ -131,16 +122,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new clampedPlateFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/derived/edgeNormalFixedValue/edgeNormalFixedValueFaPatchVectorField.H b/src/finiteArea/fields/faPatchFields/derived/edgeNormalFixedValue/edgeNormalFixedValueFaPatchVectorField.H index dd4718cd35a..8a6c8dffb94 100644 --- a/src/finiteArea/fields/faPatchFields/derived/edgeNormalFixedValue/edgeNormalFixedValueFaPatchVectorField.H +++ b/src/finiteArea/fields/faPatchFields/derived/edgeNormalFixedValue/edgeNormalFixedValueFaPatchVectorField.H @@ -113,15 +113,6 @@ public: const edgeNormalFixedValueFaPatchVectorField& ); - //- Construct and return a clone - virtual tmp<faPatchVectorField> clone() const - { - return tmp<faPatchVectorField> - ( - new edgeNormalFixedValueFaPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference edgeNormalFixedValueFaPatchVectorField ( @@ -129,24 +120,22 @@ public: const DimensionedField<vector, areaMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<faPatchVectorField> clone + //- Return clone + virtual tmp<faPatchField<vector>> clone() const + { + return faPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<faPatchField<vector>> clone ( const DimensionedField<vector, areaMesh>& iF ) const { - return tmp<faPatchVectorField> - ( - new edgeNormalFixedValueFaPatchVectorField - ( - *this, - iF - ) - ); + return faPatchField<vector>::Clone(*this, iF); } - // Member functions // Mapping functions diff --git a/src/finiteArea/fields/faPatchFields/derived/fixedValueOutflow/fixedValueOutflowFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/fixedValueOutflow/fixedValueOutflowFaPatchField.H index d6b63c61c4d..80b1522c26e 100644 --- a/src/finiteArea/fields/faPatchFields/derived/fixedValueOutflow/fixedValueOutflowFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/fixedValueOutflow/fixedValueOutflowFaPatchField.H @@ -96,15 +96,6 @@ public: const fixedValueOutflowFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new fixedValueOutflowFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference fixedValueOutflowFaPatchField ( @@ -112,16 +103,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new fixedValueOutflowFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/derived/ignore/ignoreFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/ignore/ignoreFaPatchField.H index 6d83692442a..29a2d67a5fb 100644 --- a/src/finiteArea/fields/faPatchFields/derived/ignore/ignoreFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/ignore/ignoreFaPatchField.H @@ -114,15 +114,6 @@ public: const ignoreFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new ignoreFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference ignoreFaPatchField ( @@ -130,16 +121,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new ignoreFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/derived/inletOutlet/inletOutletFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/inletOutlet/inletOutletFaPatchField.H index 88abbde9c84..02cb6831c73 100644 --- a/src/finiteArea/fields/faPatchFields/derived/inletOutlet/inletOutletFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/inletOutlet/inletOutletFaPatchField.H @@ -136,15 +136,6 @@ public: const inletOutletFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new inletOutletFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference inletOutletFaPatchField ( @@ -152,16 +143,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new inletOutletFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/derived/outletInlet/outletInletFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/outletInlet/outletInletFaPatchField.H index 3b9187c63bc..e46a1d25b22 100644 --- a/src/finiteArea/fields/faPatchFields/derived/outletInlet/outletInletFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/outletInlet/outletInletFaPatchField.H @@ -135,15 +135,6 @@ public: const outletInletFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new outletInletFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference outletInletFaPatchField ( @@ -151,16 +142,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new outletInletFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchField.H index f140258de07..32996ee3845 100644 --- a/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchField.H @@ -97,15 +97,6 @@ public: const slipFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new slipFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference slipFaPatchField ( @@ -113,16 +104,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new slipFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchField.H index 70154cc728a..1e56baf866a 100644 --- a/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchField.H @@ -137,15 +137,6 @@ public: const timeVaryingUniformFixedValueFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new timeVaryingUniformFixedValueFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference timeVaryingUniformFixedValueFaPatchField ( @@ -153,16 +144,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new timeVaryingUniformFixedValueFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/derived/uniformFixedGradient/uniformFixedGradientFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/uniformFixedGradient/uniformFixedGradientFaPatchField.H index 7340d59a201..4c049d4f45b 100644 --- a/src/finiteArea/fields/faPatchFields/derived/uniformFixedGradient/uniformFixedGradientFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/uniformFixedGradient/uniformFixedGradientFaPatchField.H @@ -138,15 +138,6 @@ public: const uniformFixedGradientFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new uniformFixedGradientFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference uniformFixedGradientFaPatchField ( @@ -154,16 +145,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new uniformFixedGradientFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/derived/uniformFixedValue/uniformFixedValueFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/uniformFixedValue/uniformFixedValueFaPatchField.H index 4af170d7b80..3bb10274587 100644 --- a/src/finiteArea/fields/faPatchFields/derived/uniformFixedValue/uniformFixedValueFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/uniformFixedValue/uniformFixedValueFaPatchField.H @@ -139,15 +139,6 @@ public: const uniformFixedValueFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new uniformFixedValueFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference uniformFixedValueFaPatchField ( @@ -155,16 +146,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new uniformFixedValueFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/derived/uniformMixed/uniformMixedFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/uniformMixed/uniformMixedFaPatchField.H index 620a16dbad6..ab3182b3a47 100644 --- a/src/finiteArea/fields/faPatchFields/derived/uniformMixed/uniformMixedFaPatchField.H +++ b/src/finiteArea/fields/faPatchFields/derived/uniformMixed/uniformMixedFaPatchField.H @@ -160,15 +160,6 @@ public: const uniformMixedFaPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new uniformMixedFaPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference uniformMixedFaPatchField ( @@ -176,16 +167,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new uniformMixedFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchField.H b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchField.H index f2c438325ba..e99ab8dae0e 100644 --- a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchField.H +++ b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchField.H @@ -393,23 +393,56 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone + //- Clone patch field with its own internal field reference virtual tmp<faPatchField<Type>> clone() const { - return tmp<faPatchField<Type>>(new faPatchField<Type>(*this)); + return tmp<faPatchField<Type>> + ( + new faPatchField<Type>(*this, this->internalField_) + ); } - //- Construct and return a clone setting internal field reference + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>>(new faPatchField<Type>(*this, iF)); + return tmp<faPatchField<Type>> + ( + new faPatchField<Type>(*this, iF) + ); } - // Selectors + // Factory Methods + + //- Clone a patch field with its own internal field reference + template<class DerivedPatchField> + static tmp<faPatchField<Type>> Clone + ( + const DerivedPatchField& pf + ) + { + return tmp<faPatchField<Type>> + ( + new DerivedPatchField(pf) + ); + } + + //- Clone a patch field with an internal field reference + template<class DerivedPatchField> + static tmp<faPatchField<Type>> Clone + ( + const DerivedPatchField& pf, + const DimensionedField<Type, areaMesh>& iF + ) + { + return tmp<faPatchField<Type>> + ( + new DerivedPatchField(pf, iF) + ); + } //- Return a pointer to a new patchField created on freestore given //- patch and internal field @@ -451,6 +484,13 @@ public: const dictionary& ); + //- Return a pointer to a new calculatedFaPatchField created on + //- freestore without setting patchField values + static tmp<faPatchField<Type>> NewCalculatedType + ( + const faPatch& p + ); + //- Return a pointer to a new calculatedFaPatchField created on //- freestore without setting patchField values template<class AnyType> diff --git a/src/finiteArea/fields/faePatchFields/basic/calculated/calculatedFaePatchField.C b/src/finiteArea/fields/faePatchFields/basic/calculated/calculatedFaePatchField.C index 5fc16ad869c..ad447c33217 100644 --- a/src/finiteArea/fields/faePatchFields/basic/calculated/calculatedFaePatchField.C +++ b/src/finiteArea/fields/faePatchFields/basic/calculated/calculatedFaePatchField.C @@ -90,20 +90,19 @@ Foam::calculatedFaePatchField<Type>::calculatedFaePatchField template<class Type> -template<class Type2> Foam::tmp<Foam::faePatchField<Type>> Foam::faePatchField<Type>::NewCalculatedType ( - const faePatchField<Type2>& pf + const faPatch& p ) { - auto* patchTypeCtor = patchConstructorTable(pf.patch().type()); + auto* patchTypeCtor = patchConstructorTable(p.type()); if (patchTypeCtor) { return patchTypeCtor ( - pf.patch(), + p, DimensionedField<Type, edgeMesh>::null() ); } @@ -113,7 +112,7 @@ Foam::faePatchField<Type>::NewCalculatedType ( new calculatedFaePatchField<Type> ( - pf.patch(), + p, DimensionedField<Type, edgeMesh>::null() ) ); @@ -121,6 +120,18 @@ Foam::faePatchField<Type>::NewCalculatedType } +template<class Type> +template<class AnyType> +Foam::tmp<Foam::faePatchField<Type>> +Foam::faePatchField<Type>::NewCalculatedType +( + const faePatchField<AnyType>& pf +) +{ + return NewCalculatedType(pf.patch()); +} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> diff --git a/src/finiteArea/fields/faePatchFields/basic/calculated/calculatedFaePatchField.H b/src/finiteArea/fields/faePatchFields/basic/calculated/calculatedFaePatchField.H index 723426ff2e9..745414151c4 100644 --- a/src/finiteArea/fields/faePatchFields/basic/calculated/calculatedFaePatchField.H +++ b/src/finiteArea/fields/faePatchFields/basic/calculated/calculatedFaePatchField.H @@ -94,15 +94,6 @@ public: //- Construct as copy calculatedFaePatchField(const calculatedFaePatchField<Type>&); - //- Construct and return a clone - virtual tmp<faePatchField<Type>> clone() const - { - return tmp<faePatchField<Type>> - ( - new calculatedFaePatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference calculatedFaePatchField ( @@ -110,18 +101,22 @@ public: const DimensionedField<Type, edgeMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faePatchField<Type>> clone() const + { + return faePatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faePatchField<Type>> clone ( const DimensionedField<Type, edgeMesh>& iF ) const { - return tmp<faePatchField<Type>> - ( - new calculatedFaePatchField<Type>(*this, iF) - ); + return faePatchField<Type>::Clone(*this, iF); } + //- Destructor virtual ~calculatedFaePatchField() = default; diff --git a/src/finiteArea/fields/faePatchFields/basic/coupled/coupledFaePatchField.H b/src/finiteArea/fields/faePatchFields/basic/coupled/coupledFaePatchField.H index 507cb9ad0ff..4dcafedc410 100644 --- a/src/finiteArea/fields/faePatchFields/basic/coupled/coupledFaePatchField.H +++ b/src/finiteArea/fields/faePatchFields/basic/coupled/coupledFaePatchField.H @@ -106,9 +106,6 @@ public: const coupledFaePatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faePatchField<Type>> clone() const = 0; - //- Construct as copy setting internal field reference coupledFaePatchField ( @@ -116,6 +113,9 @@ public: const DimensionedField<Type, edgeMesh>& ); + //- Return clone + virtual tmp<faePatchField<Type>> clone() const = 0; + //- Construct and return a clone virtual tmp<faePatchField<Type>> clone ( diff --git a/src/finiteArea/fields/faePatchFields/basic/fixedValue/fixedValueFaePatchField.H b/src/finiteArea/fields/faePatchFields/basic/fixedValue/fixedValueFaePatchField.H index ae9585421cb..b84e7353048 100644 --- a/src/finiteArea/fields/faePatchFields/basic/fixedValue/fixedValueFaePatchField.H +++ b/src/finiteArea/fields/faePatchFields/basic/fixedValue/fixedValueFaePatchField.H @@ -106,15 +106,6 @@ public: const fixedValueFaePatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faePatchField<Type>> clone() const - { - return tmp<faePatchField<Type>> - ( - new fixedValueFaePatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference fixedValueFaePatchField ( @@ -122,18 +113,22 @@ public: const DimensionedField<Type, edgeMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faePatchField<Type>> clone() const + { + return faePatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faePatchField<Type>> clone ( const DimensionedField<Type, edgeMesh>& iF ) const { - return tmp<faePatchField<Type>> - ( - new fixedValueFaePatchField<Type>(*this, iF) - ); + return faePatchField<Type>::Clone(*this, iF); } + //- Destructor virtual ~fixedValueFaePatchField() = default; diff --git a/src/finiteArea/fields/faePatchFields/basic/sliced/slicedFaePatchField.C b/src/finiteArea/fields/faePatchFields/basic/sliced/slicedFaePatchField.C index 6ddf22fb429..fd746a305e8 100644 --- a/src/finiteArea/fields/faePatchFields/basic/sliced/slicedFaePatchField.C +++ b/src/finiteArea/fields/faePatchFields/basic/sliced/slicedFaePatchField.C @@ -111,47 +111,14 @@ Foam::slicedFaePatchField<Type>::slicedFaePatchField } -template<class Type> -Foam::tmp<Foam::faePatchField<Type>> -Foam::slicedFaePatchField<Type>::clone() const -{ - return tmp<faePatchField<Type>> - ( - new slicedFaePatchField<Type>(*this) - ); -} - - template<class Type> Foam::slicedFaePatchField<Type>::slicedFaePatchField ( const slicedFaePatchField<Type>& ptf ) : - faePatchField<Type> - ( - ptf.patch(), - ptf.internalField(), - Field<Type>() - ) -{ - // Transfer the slice from the argument - UList<Type>::shallowCopy(ptf); -} - - -template<class Type> -Foam::tmp<Foam::faePatchField<Type>> -Foam::slicedFaePatchField<Type>::clone -( - const DimensionedField<Type, edgeMesh>& iF -) const -{ - return tmp<faePatchField<Type>> - ( - new slicedFaePatchField<Type>(*this, iF) - ); -} + slicedFaePatchField<Type>(ptf, ptf.internalField()) +{} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // diff --git a/src/finiteArea/fields/faePatchFields/basic/sliced/slicedFaePatchField.H b/src/finiteArea/fields/faePatchFields/basic/sliced/slicedFaePatchField.H index c56b7a9ffe3..b7fb3fa912a 100644 --- a/src/finiteArea/fields/faePatchFields/basic/sliced/slicedFaePatchField.H +++ b/src/finiteArea/fields/faePatchFields/basic/sliced/slicedFaePatchField.H @@ -109,9 +109,6 @@ public: //- Construct as copy slicedFaePatchField(const slicedFaePatchField<Type>&); - //- Construct and return a clone - virtual tmp<faePatchField<Type>> clone() const; - //- Construct as copy setting internal field reference slicedFaePatchField ( @@ -119,11 +116,20 @@ public: const DimensionedField<Type, edgeMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faePatchField<Type>> clone() const + { + return faePatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faePatchField<Type>> clone ( const DimensionedField<Type, edgeMesh>& iF - ) const; + ) const + { + return faePatchField<Type>::Clone(*this, iF); + } //- Destructor diff --git a/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchField.H b/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchField.H index 180033d5e79..3993605ab30 100644 --- a/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchField.H +++ b/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchField.H @@ -103,15 +103,6 @@ public: const cyclicFaePatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faePatchField<Type>> clone() const - { - return tmp<faePatchField<Type>> - ( - new cyclicFaePatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference cyclicFaePatchField ( @@ -119,16 +110,19 @@ public: const DimensionedField<Type, edgeMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faePatchField<Type>> clone() const + { + return faePatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faePatchField<Type>> clone ( const DimensionedField<Type, edgeMesh>& iF ) const { - return tmp<faePatchField<Type>> - ( - new cyclicFaePatchField<Type>(*this, iF) - ); + return faePatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteArea/fields/faePatchFields/constraint/empty/emptyFaePatchField.H b/src/finiteArea/fields/faePatchFields/constraint/empty/emptyFaePatchField.H index a5392687423..6c7004db9f7 100644 --- a/src/finiteArea/fields/faePatchFields/constraint/empty/emptyFaePatchField.H +++ b/src/finiteArea/fields/faePatchFields/constraint/empty/emptyFaePatchField.H @@ -96,15 +96,6 @@ public: const emptyFaePatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faePatchField<Type>> clone() const - { - return tmp<faePatchField<Type>> - ( - new emptyFaePatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference emptyFaePatchField ( @@ -112,18 +103,22 @@ public: const DimensionedField<Type, edgeMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faePatchField<Type>> clone() const + { + return faePatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faePatchField<Type>> clone ( const DimensionedField<Type, edgeMesh>& iF ) const { - return tmp<faePatchField<Type>> - ( - new emptyFaePatchField<Type>(*this, iF) - ); + return faePatchField<Type>::Clone(*this, iF); } + //- Destructor virtual ~emptyFaePatchField() = default; diff --git a/src/finiteArea/fields/faePatchFields/constraint/processor/processorFaePatchField.H b/src/finiteArea/fields/faePatchFields/constraint/processor/processorFaePatchField.H index c8f9e6441f8..78baf531568 100644 --- a/src/finiteArea/fields/faePatchFields/constraint/processor/processorFaePatchField.H +++ b/src/finiteArea/fields/faePatchFields/constraint/processor/processorFaePatchField.H @@ -106,15 +106,6 @@ public: //- Construct as copy processorFaePatchField(const processorFaePatchField<Type>&); - //- Construct and return a clone - virtual tmp<faePatchField<Type>> clone() const - { - return tmp<faePatchField<Type>> - ( - new processorFaePatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference processorFaePatchField ( @@ -122,16 +113,19 @@ public: const DimensionedField<Type, edgeMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faePatchField<Type>> clone() const + { + return faePatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faePatchField<Type>> clone ( const DimensionedField<Type, edgeMesh>& iF ) const { - return tmp<faePatchField<Type>> - ( - new processorFaePatchField<Type>(*this, iF) - ); + return faePatchField<Type>::Clone(*this, iF); } @@ -144,7 +138,7 @@ public: //- Return true if running parallel virtual bool coupled() const { - return Pstream::parRun(); + return UPstream::parRun(); } }; diff --git a/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchField.H b/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchField.H index f2f80db21a0..08dd7ab39b8 100644 --- a/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchField.H +++ b/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchField.H @@ -98,15 +98,6 @@ public: const symmetryFaePatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faePatchField<Type>> clone() const - { - return tmp<faePatchField<Type>> - ( - new symmetryFaePatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference symmetryFaePatchField ( @@ -114,18 +105,22 @@ public: const DimensionedField<Type, edgeMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faePatchField<Type>> clone() const + { + return faePatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faePatchField<Type>> clone ( const DimensionedField<Type, edgeMesh>& iF ) const { - return tmp<faePatchField<Type>> - ( - new symmetryFaePatchField<Type>(*this, iF) - ); + return faePatchField<Type>::Clone(*this, iF); } + //- Destructor virtual ~symmetryFaePatchField() = default; }; diff --git a/src/finiteArea/fields/faePatchFields/constraint/wedge/wedgeFaePatchField.H b/src/finiteArea/fields/faePatchFields/constraint/wedge/wedgeFaePatchField.H index 017e6426437..f179b3e8de8 100644 --- a/src/finiteArea/fields/faePatchFields/constraint/wedge/wedgeFaePatchField.H +++ b/src/finiteArea/fields/faePatchFields/constraint/wedge/wedgeFaePatchField.H @@ -95,15 +95,6 @@ public: const wedgeFaePatchField<Type>& ); - //- Construct and return a clone - virtual tmp<faePatchField<Type>> clone() const - { - return tmp<faePatchField<Type>> - ( - new wedgeFaePatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference wedgeFaePatchField ( @@ -111,16 +102,19 @@ public: const DimensionedField<Type, edgeMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faePatchField<Type>> clone() const + { + return faePatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faePatchField<Type>> clone ( const DimensionedField<Type, edgeMesh>& iF ) const { - return tmp<faePatchField<Type>> - ( - new wedgeFaePatchField<Type>(*this, iF) - ); + return faePatchField<Type>::Clone(*this, iF); } }; diff --git a/src/finiteArea/fields/faePatchFields/faePatchField/faePatchField.H b/src/finiteArea/fields/faePatchFields/faePatchField/faePatchField.H index b484b702b5f..96428b68fd4 100644 --- a/src/finiteArea/fields/faePatchFields/faePatchField/faePatchField.H +++ b/src/finiteArea/fields/faePatchFields/faePatchField/faePatchField.H @@ -362,13 +362,16 @@ public: const DimensionedField<Type, edgeMesh>& ); - //- Construct and return a clone + //- Clone patch field with its own internal field reference virtual tmp<faePatchField<Type>> clone() const { - return tmp<faePatchField<Type>>(new faePatchField<Type>(*this)); + return tmp<faePatchField<Type>> + ( + new faePatchField<Type>(*this, this->internalField_) + ); } - //- Construct and return a clone setting internal field reference + //- Clone with an internal field reference virtual tmp<faePatchField<Type>> clone ( const DimensionedField<Type, edgeMesh>& iF @@ -385,7 +388,21 @@ public: virtual ~faePatchField() = default; - // Selectors + // Factory Methods + + //- Clone a patch field, optionally with internal field reference etc. + template<class DerivedPatchField, class... Args> + static tmp<faePatchField<Type>> Clone + ( + const DerivedPatchField& pf, + Args&&... args + ) + { + return tmp<faePatchField<Type>> + ( + new DerivedPatchField(pf, std::forward<Args>(args)...) + ); + } //- Return a pointer to a new patchField created on freestore given // patch and internal field @@ -430,10 +447,17 @@ public: //- Return a pointer to a new calculatedFaePatchField created on // freestore without setting patchField values - template<class Type2> static tmp<faePatchField<Type>> NewCalculatedType ( - const faePatchField<Type2>& + const faPatch& p + ); + + //- Return a pointer to a new calculatedFaePatchField created on + // freestore without setting patchField values + template<class AnyType> + static tmp<faePatchField<Type>> NewCalculatedType + ( + const faePatchField<AnyType>& pf ); diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.H b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.H index 228a801ff72..ae77aee61a2 100644 --- a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.H +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.H @@ -143,15 +143,6 @@ public: const SRFFreestreamVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new SRFFreestreamVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference SRFFreestreamVelocityFvPatchVectorField ( @@ -159,16 +150,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new SRFFreestreamVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.H b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.H index 4b998a3fcad..b5f8c50fa4d 100644 --- a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.H +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.H @@ -154,15 +154,6 @@ public: const SRFVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new SRFVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference SRFVelocityFvPatchVectorField ( @@ -170,16 +161,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new SRFVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFWallVelocityFvPatchVectorField/SRFWallVelocityFvPatchVectorField.H b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFWallVelocityFvPatchVectorField/SRFWallVelocityFvPatchVectorField.H index f5732855a5a..95d3ad431a3 100644 --- a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFWallVelocityFvPatchVectorField/SRFWallVelocityFvPatchVectorField.H +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFWallVelocityFvPatchVectorField/SRFWallVelocityFvPatchVectorField.H @@ -129,15 +129,6 @@ public: const SRFWallVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new SRFWallVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference SRFWallVelocityFvPatchVectorField ( @@ -145,16 +136,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new SRFWallVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchField.H b/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchField.H index 69395b5c62a..2b2a407ac7a 100644 --- a/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchField.H +++ b/src/finiteVolume/expressions/fields/fvPatchFields/exprFixedValueFvPatchField.H @@ -131,16 +131,6 @@ public: const exprFixedValueFvPatchField<Type>& ); - - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new exprFixedValueFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference exprFixedValueFvPatchField ( @@ -148,16 +138,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new exprFixedValueFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchField.H b/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchField.H index 32bfa068db9..938ce78d2be 100644 --- a/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchField.H +++ b/src/finiteVolume/expressions/fields/fvPatchFields/exprMixedFvPatchField.H @@ -135,15 +135,6 @@ public: const exprMixedFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new exprMixedFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference exprMixedFvPatchField ( @@ -151,16 +142,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new exprMixedFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/expressions/fields/pointPatchFields/exprValuePointPatchField.H b/src/finiteVolume/expressions/fields/pointPatchFields/exprValuePointPatchField.H index fa328a54289..59aed7e1c41 100644 --- a/src/finiteVolume/expressions/fields/pointPatchFields/exprValuePointPatchField.H +++ b/src/finiteVolume/expressions/fields/pointPatchFields/exprValuePointPatchField.H @@ -126,17 +126,10 @@ public: const exprValuePointPatchField<Type>& ); - - //- Construct and return a clone + //- Return a clone virtual autoPtr<pointPatchField<Type>> clone() const { - return autoPtr<pointPatchField<Type>> - ( - new exprValuePointPatchField<Type> - ( - *this - ) - ); + return pointPatchField<Type>::Clone(*this); } //- Construct and return a clone setting internal field reference @@ -145,14 +138,7 @@ public: const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new exprValuePointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.H index bb730b23f5d..33e2c8784e8 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.H @@ -93,15 +93,6 @@ public: const basicSymmetryFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new basicSymmetryFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference basicSymmetryFvPatchField ( @@ -109,16 +100,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new basicSymmetryFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C index 03e44871b47..8de6386d2ad 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C @@ -121,10 +121,11 @@ Foam::fvPatchField<Type>::NewCalculatedType template<class Type> -template<class Type2> -Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::NewCalculatedType +template<class AnyType> +Foam::tmp<Foam::fvPatchField<Type>> +Foam::fvPatchField<Type>::NewCalculatedType ( - const fvPatchField<Type2>& pf + const fvPatchField<AnyType>& pf ) { return NewCalculatedType(pf.patch()); diff --git a/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.H index 59089a4b4d1..ab2abde60d9 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.H @@ -124,15 +124,6 @@ public: const calculatedFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new calculatedFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference calculatedFvPatchField ( @@ -140,16 +131,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new calculatedFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H index 2729af6a17a..155a20cb7e7 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H @@ -123,9 +123,6 @@ public: const coupledFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const = 0; - //- Construct as copy setting internal field reference coupledFvPatchField ( @@ -133,6 +130,9 @@ public: const DimensionedField<Type, volMesh>& ); + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const = 0; + //- Construct and return a clone virtual tmp<fvPatchField<Type>> clone ( diff --git a/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.H index d56bc7113a7..effa2031c7f 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/directionMixed/directionMixedFvPatchField.H @@ -101,15 +101,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new directionMixedFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference directionMixedFvPatchField ( @@ -117,16 +108,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new directionMixedFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/extrapolatedCalculated/extrapolatedCalculatedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/extrapolatedCalculated/extrapolatedCalculatedFvPatchField.H index dad65d55ffa..a18da2822a8 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/extrapolatedCalculated/extrapolatedCalculatedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/extrapolatedCalculated/extrapolatedCalculatedFvPatchField.H @@ -107,15 +107,6 @@ public: const extrapolatedCalculatedFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new extrapolatedCalculatedFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference extrapolatedCalculatedFvPatchField ( @@ -123,16 +114,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new extrapolatedCalculatedFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.H index 5d10c6a2a98..f80fadc4fe4 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/fixedGradient/fixedGradientFvPatchField.H @@ -143,15 +143,6 @@ public: const fixedGradientFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new fixedGradientFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference fixedGradientFvPatchField ( @@ -159,16 +150,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new fixedGradientFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.H index d8c09c57173..1abd1eb2b3c 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/fixedValue/fixedValueFvPatchField.H @@ -137,15 +137,6 @@ public: const fixedValueFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new fixedValueFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference fixedValueFvPatchField ( @@ -153,16 +144,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new fixedValueFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.H index 7c43a6ca226..7d4f5518f7e 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.H @@ -168,15 +168,6 @@ public: const mixedFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new mixedFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference mixedFvPatchField ( @@ -184,16 +175,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new mixedFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C index d886c4d8d37..a15239c2bb3 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C @@ -111,47 +111,14 @@ Foam::slicedFvPatchField<Type>::slicedFvPatchField } -template<class Type> -Foam::tmp<Foam::fvPatchField<Type>> -Foam::slicedFvPatchField<Type>::clone() const -{ - return tmp<fvPatchField<Type>> - ( - new slicedFvPatchField<Type>(*this) - ); -} - - template<class Type> Foam::slicedFvPatchField<Type>::slicedFvPatchField ( const slicedFvPatchField<Type>& ptf ) : - fvPatchField<Type> - ( - ptf.patch(), - ptf.internalField(), - Field<Type>() - ) -{ - // Transfer the slice from the argument - UList<Type>::shallowCopy(ptf); -} - - -template<class Type> -Foam::tmp<Foam::fvPatchField<Type>> -Foam::slicedFvPatchField<Type>::clone -( - const DimensionedField<Type, volMesh>& iF -) const -{ - return tmp<fvPatchField<Type>> - ( - new slicedFvPatchField<Type>(*this, iF) - ); -} + slicedFvPatchField<Type>(ptf, ptf.internalField()) +{} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -170,8 +137,7 @@ template<class Type> Foam::tmp<Foam::Field<Type>> Foam::slicedFvPatchField<Type>::snGrad() const { NotImplemented; - - return Field<Type>::null(); + return nullptr; } @@ -180,8 +146,7 @@ Foam::tmp<Foam::Field<Type>> Foam::slicedFvPatchField<Type>::patchInternalField() const { NotImplemented; - - return Field<Type>::null(); + return nullptr; } @@ -200,8 +165,7 @@ Foam::slicedFvPatchField<Type>::patchNeighbourField ) const { NotImplemented; - - return Field<Type>::null(); + return nullptr; } @@ -210,8 +174,7 @@ Foam::tmp<Foam::Field<Type>> Foam::slicedFvPatchField<Type>::patchNeighbourField() const { NotImplemented; - - return Field<Type>::null(); + return nullptr; } @@ -223,8 +186,7 @@ Foam::slicedFvPatchField<Type>::valueInternalCoeffs ) const { NotImplemented; - - return Field<Type>::null(); + return nullptr; } @@ -236,8 +198,7 @@ Foam::slicedFvPatchField<Type>::valueBoundaryCoeffs ) const { NotImplemented; - - return Field<Type>::null(); + return nullptr; } @@ -246,8 +207,7 @@ Foam::tmp<Foam::Field<Type>> Foam::slicedFvPatchField<Type>::gradientInternalCoeffs() const { NotImplemented; - - return Field<Type>::null(); + return nullptr; } @@ -256,8 +216,7 @@ Foam::tmp<Foam::Field<Type>> Foam::slicedFvPatchField<Type>::gradientBoundaryCoeffs() const { NotImplemented; - - return Field<Type>::null(); + return nullptr; } diff --git a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.H index 6b7a51733e2..cb2f0797ace 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.H @@ -115,9 +115,6 @@ public: //- Construct as copy slicedFvPatchField(const slicedFvPatchField<Type>&); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const; - //- Construct as copy setting internal field reference slicedFvPatchField ( @@ -125,11 +122,20 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF - ) const; + ) const + { + return fvPatchField<Type>::Clone(*this, iF); + } //- Destructor diff --git a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.H index 89042ab7517..0576d3cccea 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/transform/transformFvPatchField.H @@ -96,9 +96,6 @@ public: const transformFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const = 0; - //- Construct as copy setting internal field reference transformFvPatchField ( @@ -106,6 +103,9 @@ public: const DimensionedField<Type, volMesh>& ); + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const = 0; + //- Construct and return a clone setting internal field reference virtual tmp<fvPatchField<Type>> clone ( diff --git a/src/finiteVolume/fields/fvPatchFields/basic/zeroGradient/zeroGradientFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/zeroGradient/zeroGradientFvPatchField.H index 65d8582bc22..094fe5b6251 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/zeroGradient/zeroGradientFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/zeroGradient/zeroGradientFvPatchField.H @@ -105,15 +105,6 @@ public: const zeroGradientFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new zeroGradientFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference zeroGradientFvPatchField ( @@ -121,16 +112,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new zeroGradientFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/calculatedProcessor/calculatedProcessorFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/calculatedProcessor/calculatedProcessorFvPatchField.H index ef6807119ec..a01b26187b4 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/calculatedProcessor/calculatedProcessorFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/calculatedProcessor/calculatedProcessorFvPatchField.H @@ -132,15 +132,6 @@ public: const calculatedProcessorFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new calculatedProcessorFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference calculatedProcessorFvPatchField ( @@ -148,16 +139,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new calculatedProcessorFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H index b2b3595ae5b..7b265ce6049 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H @@ -131,15 +131,6 @@ public: const cyclicFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new cyclicFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference cyclicFvPatchField ( @@ -147,16 +138,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new cyclicFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.H index 1b2a9083adc..f79ce7aa645 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.H @@ -180,15 +180,6 @@ public: //- Construct as copy cyclicACMIFvPatchField(const cyclicACMIFvPatchField<Type>&); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new cyclicACMIFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference cyclicACMIFvPatchField ( @@ -196,16 +187,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new cyclicACMIFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H index 3b41ecc2707..09fc3971b11 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H @@ -200,15 +200,6 @@ public: //- Construct as copy cyclicAMIFvPatchField(const cyclicAMIFvPatchField<Type>&); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new cyclicAMIFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference cyclicAMIFvPatchField ( @@ -216,16 +207,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new cyclicAMIFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.H index b78bb1e67d6..da0eb6fef09 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.H @@ -109,15 +109,6 @@ public: const cyclicSlipFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new cyclicSlipFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference cyclicSlipFvPatchField ( @@ -125,16 +116,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new cyclicSlipFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } }; diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.H index 6d97bc67ed8..d86c9084cb4 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/empty/emptyFvPatchField.H @@ -107,15 +107,6 @@ public: const emptyFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new emptyFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference emptyFvPatchField ( @@ -123,16 +114,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new emptyFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.H index 21c42d36f08..9f325feb1bd 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchField.H @@ -102,15 +102,6 @@ public: const nonuniformTransformCyclicFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new nonuniformTransformCyclicFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference nonuniformTransformCyclicFvPatchField ( @@ -118,18 +109,20 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new nonuniformTransformCyclicFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } - }; diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.H index 4bc96dadd44..08b110dc81e 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processor/processorFvPatchField.H @@ -145,15 +145,6 @@ public: //- Construct as copy processorFvPatchField(const processorFvPatchField<Type>&); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new processorFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference processorFvPatchField ( @@ -161,16 +152,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new processorFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.H index f8068ac40af..08e018d2cb7 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.H @@ -122,15 +122,6 @@ public: //- Construct as copy processorCyclicFvPatchField(const processorCyclicFvPatchField<Type>&); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new processorCyclicFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference processorCyclicFvPatchField ( @@ -138,16 +129,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new processorCyclicFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchField.H index 7416fa06855..0727afe5f81 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchField.H @@ -108,15 +108,6 @@ public: const symmetryFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new symmetryFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference symmetryFvPatchField ( @@ -124,16 +115,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new symmetryFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } }; diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchField.H index fea87f176dc..400112d67a9 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchField.H @@ -114,15 +114,6 @@ public: const symmetryPlaneFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new symmetryPlaneFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference symmetryPlaneFvPatchField ( @@ -130,16 +121,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new symmetryPlaneFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchField.H index d51a2942b7e..36c2252e7ec 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchField.H @@ -109,15 +109,6 @@ public: const wedgeFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new wedgeFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference wedgeFvPatchField ( @@ -125,16 +116,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new wedgeFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/acousticWaveTransmissive/acousticWaveTransmissiveFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/acousticWaveTransmissive/acousticWaveTransmissiveFvPatchField.H index f0f31cfefb3..2dc9d4592d4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/acousticWaveTransmissive/acousticWaveTransmissiveFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/acousticWaveTransmissive/acousticWaveTransmissiveFvPatchField.H @@ -131,15 +131,6 @@ public: const acousticWaveTransmissiveFvPatchField& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new acousticWaveTransmissiveFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference acousticWaveTransmissiveFvPatchField ( @@ -147,16 +138,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new acousticWaveTransmissiveFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.H index 13905461908..675c182dfa6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.H @@ -187,15 +187,6 @@ public: const activeBaffleVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new activeBaffleVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference activeBaffleVelocityFvPatchVectorField ( @@ -203,16 +194,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new activeBaffleVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.H index 56663319a4d..295aba08361 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.H @@ -200,15 +200,6 @@ public: const activePressureForceBaffleVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new activePressureForceBaffleVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference activePressureForceBaffleVelocityFvPatchVectorField ( @@ -216,20 +207,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new activePressureForceBaffleVelocityFvPatchVectorField - ( - *this, - iF - ) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H index 38be063ad4b..4eadf0edfc3 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H @@ -154,15 +154,6 @@ public: const advectiveFvPatchField& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new advectiveFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference advectiveFvPatchField ( @@ -170,16 +161,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new advectiveFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.H index 0c747c5cb83..3cde2e1c537 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.H @@ -211,15 +211,6 @@ public: const codedFixedValueFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new codedFixedValueFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference codedFixedValueFvPatchField ( @@ -227,16 +218,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new codedFixedValueFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/codedMixed/codedMixedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/codedMixed/codedMixedFvPatchField.H index 821b473d23e..863bd67ffb3 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/codedMixed/codedMixedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/codedMixed/codedMixedFvPatchField.H @@ -215,15 +215,6 @@ public: const codedMixedFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new codedMixedFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference codedMixedFvPatchField ( @@ -231,16 +222,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new codedMixedFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.H index 401d3e1477d..495472af4ee 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.H @@ -147,15 +147,6 @@ public: const cylindricalInletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new cylindricalInletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference cylindricalInletVelocityFvPatchVectorField ( @@ -163,16 +154,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new cylindricalInletVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/electrostaticDeposition/electrostaticDepositionFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/electrostaticDeposition/electrostaticDepositionFvPatchScalarField.H index efda99389e2..a0d8c5bf9ca 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/electrostaticDeposition/electrostaticDepositionFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/electrostaticDeposition/electrostaticDepositionFvPatchScalarField.H @@ -302,15 +302,6 @@ public: const electrostaticDepositionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new electrostaticDepositionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference electrostaticDepositionFvPatchScalarField ( @@ -318,16 +309,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new electrostaticDepositionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H index 96a57d99f08..4a0fb21631e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H @@ -196,15 +196,6 @@ public: const fanFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new fanFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference fanFvPatchField ( @@ -212,16 +203,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new fanFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.H index a4707921bd1..6c7fd4ebe78 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.H @@ -200,15 +200,6 @@ public: const fanPressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new fanPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference fanPressureFvPatchScalarField ( @@ -216,20 +207,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new fanPressureFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxExtrapolatedPressure/fixedFluxExtrapolatedPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxExtrapolatedPressure/fixedFluxExtrapolatedPressureFvPatchScalarField.H index 719b4ab426f..121f4e763da 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxExtrapolatedPressure/fixedFluxExtrapolatedPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxExtrapolatedPressure/fixedFluxExtrapolatedPressureFvPatchScalarField.H @@ -108,15 +108,6 @@ public: const fixedFluxExtrapolatedPressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new fixedFluxExtrapolatedPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference fixedFluxExtrapolatedPressureFvPatchScalarField ( @@ -124,16 +115,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new fixedFluxExtrapolatedPressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } }; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.H index cddfa8aa34c..1fae7a7f377 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.H @@ -117,15 +117,6 @@ public: const fixedFluxPressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new fixedFluxPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference fixedFluxPressureFvPatchScalarField ( @@ -133,16 +124,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new fixedFluxPressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedInternalValueFvPatchField/fixedInternalValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedInternalValueFvPatchField/fixedInternalValueFvPatchField.H index d36397c0736..c5a7a2e1d21 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedInternalValueFvPatchField/fixedInternalValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedInternalValueFvPatchField/fixedInternalValueFvPatchField.H @@ -116,15 +116,6 @@ public: const fixedInternalValueFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new fixedInternalValueFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference fixedInternalValueFvPatchField ( @@ -132,16 +123,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new fixedInternalValueFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H index ee758e59283..f9e340bbccd 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H @@ -147,15 +147,6 @@ public: const fixedJumpFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new fixedJumpFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference fixedJumpFvPatchField ( @@ -163,16 +154,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new fixedJumpFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H index d25ef22b01c..a6656c937b6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H @@ -133,15 +133,6 @@ public: const fixedJumpAMIFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new fixedJumpAMIFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference fixedJumpAMIFvPatchField ( @@ -149,16 +140,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new fixedJumpAMIFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedMean/fixedMeanFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedMean/fixedMeanFvPatchField.H index 855401aa13d..5240397df93 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedMean/fixedMeanFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedMean/fixedMeanFvPatchField.H @@ -123,15 +123,6 @@ public: const fixedMeanFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new fixedMeanFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference fixedMeanFvPatchField ( @@ -139,16 +130,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new fixedMeanFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedMeanOutletInlet/fixedMeanOutletInletFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedMeanOutletInlet/fixedMeanOutletInletFvPatchField.H index 1be8a7d1cc0..ae5b90eaac6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedMeanOutletInlet/fixedMeanOutletInletFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedMeanOutletInlet/fixedMeanOutletInletFvPatchField.H @@ -131,15 +131,6 @@ public: const fixedMeanOutletInletFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new fixedMeanOutletInletFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference fixedMeanOutletInletFvPatchField ( @@ -147,16 +138,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new fixedMeanOutletInletFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.H index 0ebb2f934e8..ed03178de34 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.H @@ -159,15 +159,6 @@ public: const fixedNormalInletOutletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new fixedNormalInletOutletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference fixedNormalInletOutletVelocityFvPatchVectorField ( @@ -175,16 +166,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new fixedNormalInletOutletVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.H index d811f125f50..7fe1f594902 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchField.H @@ -147,15 +147,6 @@ public: const fixedNormalSlipFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new fixedNormalSlipFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference fixedNormalSlipFvPatchField ( @@ -163,16 +154,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new fixedNormalSlipFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.H index 7ccabdb43c6..e9c7cbcb46a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.H @@ -138,15 +138,6 @@ public: const fixedPressureCompressibleDensityFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new fixedPressureCompressibleDensityFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference fixedPressureCompressibleDensityFvPatchScalarField ( @@ -154,20 +145,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new fixedPressureCompressibleDensityFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.H index 49a7e611a43..2093f34e670 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.H @@ -172,15 +172,6 @@ public: const fixedProfileFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new fixedProfileFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference fixedProfileFvPatchField ( @@ -188,16 +179,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new fixedProfileFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H index b85605dd3f7..e34a34d94d5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H @@ -182,15 +182,6 @@ public: const flowRateInletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new flowRateInletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference flowRateInletVelocityFvPatchVectorField ( @@ -198,16 +189,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new flowRateInletVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateOutletVelocity/flowRateOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/flowRateOutletVelocity/flowRateOutletVelocityFvPatchVectorField.H index 1e88968065c..0a459a4ea6e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateOutletVelocity/flowRateOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateOutletVelocity/flowRateOutletVelocityFvPatchVectorField.H @@ -173,15 +173,6 @@ public: const flowRateOutletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new flowRateOutletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference flowRateOutletVelocityFvPatchVectorField ( @@ -189,16 +180,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new flowRateOutletVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.H index 00eb4a13211..3756b435a75 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.H @@ -140,15 +140,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new fluxCorrectedVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference fluxCorrectedVelocityFvPatchVectorField ( @@ -156,16 +147,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new fluxCorrectedVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchField.H index 76f5707391d..5f108129101 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchField.H @@ -146,15 +146,6 @@ public: const freestreamFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new freestreamFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference freestreamFvPatchField ( @@ -162,16 +153,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new freestreamFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H index 1922113c0b7..832380193d8 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H @@ -128,15 +128,6 @@ public: const freestreamPressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new freestreamPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference freestreamPressureFvPatchScalarField ( @@ -144,16 +135,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new freestreamPressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestreamVelocity/freestreamVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/freestreamVelocity/freestreamVelocityFvPatchVectorField.H index aadeeb81c20..259a2230279 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestreamVelocity/freestreamVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestreamVelocity/freestreamVelocityFvPatchVectorField.H @@ -122,15 +122,6 @@ public: const freestreamVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new freestreamVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference freestreamVelocityFvPatchVectorField ( @@ -138,16 +129,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new freestreamVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.H index fbf117c729f..f33a7ffbe4d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.H @@ -135,15 +135,6 @@ public: const inletOutletFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new inletOutletFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference inletOutletFvPatchField ( @@ -151,16 +142,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new inletOutletFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.H index edeaff00c09..62e239cb733 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.H @@ -140,15 +140,6 @@ public: const inletOutletTotalTemperatureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new inletOutletTotalTemperatureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference inletOutletTotalTemperatureFvPatchScalarField ( @@ -156,16 +147,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new inletOutletTotalTemperatureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/interfaceCompression/interfaceCompressionFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/interfaceCompression/interfaceCompressionFvPatchScalarField.H index 485f5cdf900..e196f9618ea 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/interfaceCompression/interfaceCompressionFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/interfaceCompression/interfaceCompressionFvPatchScalarField.H @@ -104,15 +104,6 @@ public: const interfaceCompressionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new interfaceCompressionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference interfaceCompressionFvPatchScalarField ( @@ -120,16 +111,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new interfaceCompressionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.H index 6deeb490ce4..e1ff6e4beb9 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.H @@ -112,15 +112,6 @@ public: const interstitialInletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new interstitialInletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference interstitialInletVelocityFvPatchVectorField ( @@ -128,16 +119,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new interstitialInletVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.H index 72cae77cd4a..ac9e1292609 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.H @@ -158,18 +158,6 @@ public: const mappedFieldFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new mappedFieldFvPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference mappedFieldFvPatchField ( @@ -177,20 +165,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new mappedFieldFvPatchField<Type> - ( - *this, - iF - ) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedMixedFieldFvPatchField/mappedMixedFieldFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedMixedFieldFvPatchField/mappedMixedFieldFvPatchField.H index 3b6ec903546..401f48c9428 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedMixedFieldFvPatchField/mappedMixedFieldFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedMixedFieldFvPatchField/mappedMixedFieldFvPatchField.H @@ -152,18 +152,6 @@ public: const mappedMixedFieldFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new mappedMixedFieldFvPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference mappedMixedFieldFvPatchField ( @@ -171,20 +159,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new mappedMixedFieldFvPatchField<Type> - ( - *this, - iF - ) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedInternalValue/mappedFixedInternalValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedInternalValue/mappedFixedInternalValueFvPatchField.H index f303e563174..925a4bc1496 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedInternalValue/mappedFixedInternalValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedInternalValue/mappedFixedInternalValueFvPatchField.H @@ -127,15 +127,6 @@ public: const mappedFixedInternalValueFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new mappedFixedInternalValueFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference mappedFixedInternalValueFvPatchField ( @@ -143,16 +134,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new mappedFixedInternalValueFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchField.H index 12e2c1f77dc..397c4239054 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchField.H @@ -128,18 +128,6 @@ public: const mappedFixedPushedInternalValueFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new mappedFixedPushedInternalValueFvPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference mappedFixedPushedInternalValueFvPatchField ( @@ -147,20 +135,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new mappedFixedPushedInternalValueFvPatchField<Type> - ( - *this, - iF - ) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.H index fdf0ce6f7ba..b2ef9bd0734 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.H @@ -142,15 +142,6 @@ public: const mappedFixedValueFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new mappedFixedValueFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference mappedFixedValueFvPatchField ( @@ -158,16 +149,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new mappedFixedValueFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.H index 3a3dad2722e..daf5066f3c8 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.H @@ -133,15 +133,6 @@ public: const mappedFlowRateFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new mappedFlowRateFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference mappedFlowRateFvPatchVectorField ( @@ -149,22 +140,24 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new mappedFlowRateFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } // Member functions - //- Update the coefficients associated with the patch field virtual void updateCoeffs(); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedMixed/mappedMixedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedMixed/mappedMixedFvPatchField.H index 3da0a9e0342..d3ee964ed15 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedMixed/mappedMixedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedMixed/mappedMixedFvPatchField.H @@ -150,18 +150,6 @@ public: const mappedMixedFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new mappedMixedFvPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference mappedMixedFvPatchField ( @@ -169,20 +157,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new mappedMixedFvPatchField<Type> - ( - *this, - iF - ) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.H index 255dd6cb58f..867d1032c76 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.H @@ -131,15 +131,6 @@ public: const mappedVelocityFluxFixedValueFvPatchField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new mappedVelocityFluxFixedValueFvPatchField(*this) - ); - } - //- Construct as copy setting internal field reference mappedVelocityFluxFixedValueFvPatchField ( @@ -147,16 +138,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new mappedVelocityFluxFixedValueFvPatchField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/matchedFlowRateOutletVelocity/matchedFlowRateOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/matchedFlowRateOutletVelocity/matchedFlowRateOutletVelocityFvPatchVectorField.H index e1af7fb531f..20ef53876ec 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/matchedFlowRateOutletVelocity/matchedFlowRateOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/matchedFlowRateOutletVelocity/matchedFlowRateOutletVelocityFvPatchVectorField.H @@ -141,15 +141,6 @@ public: const matchedFlowRateOutletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new matchedFlowRateOutletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference matchedFlowRateOutletVelocityFvPatchVectorField ( @@ -157,16 +148,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new matchedFlowRateOutletVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.H index 9b5b05cd7ec..7dca9f95e71 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.H @@ -110,15 +110,6 @@ public: const movingWallVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new movingWallVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference movingWallVelocityFvPatchVectorField ( @@ -126,16 +117,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new movingWallVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/noSlip/noSlipFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/noSlip/noSlipFvPatchVectorField.H index faa7b11eb81..3590a2aeb94 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/noSlip/noSlipFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/noSlip/noSlipFvPatchVectorField.H @@ -107,15 +107,6 @@ public: const noSlipFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new noSlipFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference noSlipFvPatchVectorField ( @@ -123,16 +114,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new noSlipFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.H index 1f7e51e3c89..0996ffc75f5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.H @@ -135,15 +135,6 @@ public: const outletInletFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new outletInletFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference outletInletFvPatchField ( @@ -151,16 +142,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new outletInletFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchField.H index 53b98b91490..8a1f3a588b9 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchField.H @@ -209,15 +209,6 @@ public: const outletMappedUniformInletFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new outletMappedUniformInletFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference outletMappedUniformInletFvPatchField ( @@ -225,16 +216,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new outletMappedUniformInletFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletPhaseMeanVelocity/outletPhaseMeanVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/outletPhaseMeanVelocity/outletPhaseMeanVelocityFvPatchVectorField.H index ddb64980d58..ccc47baa746 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletPhaseMeanVelocity/outletPhaseMeanVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletPhaseMeanVelocity/outletPhaseMeanVelocityFvPatchVectorField.H @@ -130,15 +130,6 @@ public: const outletPhaseMeanVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new outletPhaseMeanVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference outletPhaseMeanVelocityFvPatchVectorField ( @@ -146,20 +137,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new outletPhaseMeanVelocityFvPatchVectorField - ( - *this, - iF - ) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.H index c9b3f278346..eb5ed46922c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/partialSlip/partialSlipFvPatchField.H @@ -135,15 +135,6 @@ public: const partialSlipFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new partialSlipFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference partialSlipFvPatchField ( @@ -151,16 +142,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new partialSlipFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.H index ca1f4c4d2d8..948c0c4c0f7 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.H @@ -155,15 +155,6 @@ public: const phaseHydrostaticPressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new phaseHydrostaticPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference phaseHydrostaticPressureFvPatchScalarField ( @@ -171,16 +162,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new phaseHydrostaticPressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/plenumPressure/plenumPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/plenumPressure/plenumPressureFvPatchScalarField.H index 0ca0a76e916..27a87d229c7 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/plenumPressure/plenumPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/plenumPressure/plenumPressureFvPatchScalarField.H @@ -219,15 +219,6 @@ public: const plenumPressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new plenumPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference plenumPressureFvPatchScalarField ( @@ -235,16 +226,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new plenumPressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.H index 85bf2b931d2..00fd8eae9dd 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.H @@ -140,18 +140,6 @@ public: const pressureDirectedInletOutletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new pressureDirectedInletOutletVelocityFvPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference pressureDirectedInletOutletVelocityFvPatchVectorField ( @@ -159,20 +147,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new pressureDirectedInletOutletVelocityFvPatchVectorField - ( - *this, - iF - ) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.H index 080c250af7f..fe3cae1316b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.H @@ -139,15 +139,6 @@ public: const pressureDirectedInletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new pressureDirectedInletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference pressureDirectedInletVelocityFvPatchVectorField ( @@ -155,20 +146,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new pressureDirectedInletVelocityFvPatchVectorField - ( - *this, - iF - ) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.H index f4f52f7c225..fff0d47336e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.H @@ -136,18 +136,6 @@ public: const pressureInletOutletParSlipVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new pressureInletOutletParSlipVelocityFvPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference pressureInletOutletParSlipVelocityFvPatchVectorField ( @@ -155,20 +143,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new pressureInletOutletParSlipVelocityFvPatchVectorField - ( - *this, - iF - ) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.H index 766c68b0269..d4acd6a0d84 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.H @@ -133,15 +133,6 @@ public: const pressureInletOutletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new pressureInletOutletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference pressureInletOutletVelocityFvPatchVectorField ( @@ -149,16 +140,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new pressureInletOutletVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.H index e4af130ac24..96b8cd2ecb4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.H @@ -108,15 +108,6 @@ public: const pressureInletUniformVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new pressureInletUniformVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference pressureInletUniformVelocityFvPatchVectorField ( @@ -124,16 +115,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new pressureInletUniformVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.H index 3db2a464ebb..4f03a78572c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.H @@ -126,15 +126,6 @@ public: const pressureInletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new pressureInletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference pressureInletVelocityFvPatchVectorField ( @@ -142,16 +133,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new pressureInletVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.H index 1ea26624f35..54a0923c474 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.H @@ -135,18 +135,6 @@ public: const pressureNormalInletOutletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new pressureNormalInletOutletVelocityFvPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference pressureNormalInletOutletVelocityFvPatchVectorField ( @@ -154,20 +142,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new pressureNormalInletOutletVelocityFvPatchVectorField - ( - *this, - iF - ) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressurePIDControlInletVelocity/pressurePIDControlInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressurePIDControlInletVelocity/pressurePIDControlInletVelocityFvPatchVectorField.H index c879dfcb14f..bc019c970c0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressurePIDControlInletVelocity/pressurePIDControlInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressurePIDControlInletVelocity/pressurePIDControlInletVelocityFvPatchVectorField.H @@ -225,18 +225,6 @@ public: const pressurePIDControlInletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new pressurePIDControlInletVelocityFvPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference pressurePIDControlInletVelocityFvPatchVectorField ( @@ -244,20 +232,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new pressurePIDControlInletVelocityFvPatchVectorField - ( - *this, - iF - ) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressurePermeableAlphaInletOutletVelocity/pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressurePermeableAlphaInletOutletVelocity/pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.H index d09ab668d9e..7b99e7752d5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressurePermeableAlphaInletOutletVelocity/pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressurePermeableAlphaInletOutletVelocity/pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.H @@ -156,18 +156,6 @@ public: const pressurePermeableAlphaInletOutletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new pressurePermeableAlphaInletOutletVelocityFvPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference pressurePermeableAlphaInletOutletVelocityFvPatchVectorField ( @@ -175,20 +163,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new pressurePermeableAlphaInletOutletVelocityFvPatchVectorField - ( - *this, - iF - ) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/prghPermeableAlphaTotalPressure/prghPermeableAlphaTotalPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/prghPermeableAlphaTotalPressure/prghPermeableAlphaTotalPressureFvPatchScalarField.H index ca4f952cebf..65bc81e11ae 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/prghPermeableAlphaTotalPressure/prghPermeableAlphaTotalPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/prghPermeableAlphaTotalPressure/prghPermeableAlphaTotalPressureFvPatchScalarField.H @@ -175,16 +175,6 @@ public: const prghPermeableAlphaTotalPressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchField<scalar>> clone() const - { - return tmp<fvPatchField<scalar>> - ( - new - prghPermeableAlphaTotalPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference prghPermeableAlphaTotalPressureFvPatchScalarField ( @@ -192,21 +182,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchField<scalar>> - ( - new - prghPermeableAlphaTotalPressureFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/prghPressure/prghPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/prghPressure/prghPressureFvPatchScalarField.H index 257091063ba..aff0983a27b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/prghPressure/prghPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/prghPressure/prghPressureFvPatchScalarField.H @@ -142,15 +142,6 @@ public: const prghPressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new prghPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference prghPressureFvPatchScalarField ( @@ -158,16 +149,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new prghPressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/prghTotalHydrostaticPressure/prghTotalHydrostaticPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/prghTotalHydrostaticPressure/prghTotalHydrostaticPressureFvPatchScalarField.H index e46cca0a0d0..f1f468fd605 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/prghTotalHydrostaticPressure/prghTotalHydrostaticPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/prghTotalHydrostaticPressure/prghTotalHydrostaticPressureFvPatchScalarField.H @@ -150,15 +150,6 @@ public: const prghTotalHydrostaticPressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new prghTotalHydrostaticPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference prghTotalHydrostaticPressureFvPatchScalarField ( @@ -166,16 +157,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new prghTotalHydrostaticPressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/prghTotalPressure/prghTotalPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/prghTotalPressure/prghTotalPressureFvPatchScalarField.H index 01d9755d12d..e8b1ff1000e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/prghTotalPressure/prghTotalPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/prghTotalPressure/prghTotalPressureFvPatchScalarField.H @@ -153,15 +153,6 @@ public: const prghTotalPressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new prghTotalPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference prghTotalPressureFvPatchScalarField ( @@ -169,16 +160,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new prghTotalPressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H index 1fa82f8fdf6..89f0183fdf3 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H @@ -144,15 +144,6 @@ public: const rotatingPressureInletOutletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new rotatingPressureInletOutletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference rotatingPressureInletOutletVelocityFvPatchVectorField ( @@ -160,20 +151,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new rotatingPressureInletOutletVelocityFvPatchVectorField - ( - *this, - iF - ) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.H index 15ca55838f4..c0a0e7a0886 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.H @@ -136,15 +136,6 @@ public: const rotatingTotalPressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new rotatingTotalPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference rotatingTotalPressureFvPatchScalarField ( @@ -152,16 +143,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new rotatingTotalPressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.H index 247dfa882b3..2aa4597254c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.H @@ -132,15 +132,6 @@ public: const rotatingWallVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new rotatingWallVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference rotatingWallVelocityFvPatchVectorField ( @@ -148,20 +139,22 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( - const DimensionedField<vector, volMesh>& iF + const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new rotatingWallVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } - // Member functions // Access functions diff --git a/src/finiteVolume/fields/fvPatchFields/derived/scaledFixedValue/scaledFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/scaledFixedValue/scaledFixedValueFvPatchField.H index 43c95445d2b..bc8898d43d7 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/scaledFixedValue/scaledFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/scaledFixedValue/scaledFixedValueFvPatchField.H @@ -138,15 +138,6 @@ public: //- Construct as copy scaledFixedValueFvPatchField(const scaledFixedValueFvPatchField&); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new scaledFixedValueFvPatchField(*this) - ); - } - //- Construct as copy setting internal field reference scaledFixedValueFvPatchField ( @@ -154,16 +145,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new scaledFixedValueFvPatchField(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/slip/slipFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/slip/slipFvPatchField.H index 952a0abba0e..467dbae4102 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/slip/slipFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/slip/slipFvPatchField.H @@ -104,15 +104,6 @@ public: const slipFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new slipFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference slipFvPatchField ( @@ -120,16 +111,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new slipFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.H index 65725e53fe2..c19e2604264 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.H @@ -153,15 +153,6 @@ public: const supersonicFreestreamFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new supersonicFreestreamFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference supersonicFreestreamFvPatchVectorField ( @@ -169,16 +160,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new supersonicFreestreamFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H index 66fd1e5d348..e3f77119093 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H @@ -130,15 +130,6 @@ public: const surfaceNormalFixedValueFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new surfaceNormalFixedValueFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference surfaceNormalFixedValueFvPatchVectorField ( @@ -146,20 +137,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new surfaceNormalFixedValueFvPatchVectorField - ( - *this, - iF - ) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlFanVelocity/swirlFanVelocityFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/swirlFanVelocity/swirlFanVelocityFvPatchField.H index 5f8ef1e830b..b3b9c50867a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/swirlFanVelocity/swirlFanVelocityFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlFanVelocity/swirlFanVelocityFvPatchField.H @@ -220,15 +220,6 @@ public: const swirlFanVelocityFvPatchField& ); - //- Construct and return a clone - virtual tmp<fvPatchField<vector>> clone() const - { - return tmp<fvPatchField<vector>> - ( - new swirlFanVelocityFvPatchField(*this) - ); - } - //- Construct as copy setting internal field reference swirlFanVelocityFvPatchField ( @@ -236,16 +227,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchField<vector>> - ( - new swirlFanVelocityFvPatchField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.H index 6ad4679298c..bee6cb18228 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.H @@ -154,15 +154,6 @@ public: const swirlFlowRateInletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new swirlFlowRateInletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference swirlFlowRateInletVelocityFvPatchVectorField ( @@ -170,16 +161,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new swirlFlowRateInletVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlInletVelocity/swirlInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/swirlInletVelocity/swirlInletVelocityFvPatchVectorField.H index 6d7bec13202..b61afa01cc0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/swirlInletVelocity/swirlInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlInletVelocity/swirlInletVelocityFvPatchVectorField.H @@ -147,15 +147,6 @@ public: const swirlInletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new swirlInletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference swirlInletVelocityFvPatchVectorField ( @@ -163,16 +154,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new swirlInletVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.H index fe09ee3903e..42ce5e7d03f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.H @@ -180,15 +180,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new syringePressureFvPatchScalarField(*this) - ); - } - //- Construct as copy syringePressureFvPatchScalarField ( @@ -202,16 +193,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new syringePressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H index 5924157ad2a..4b74e3dfcec 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H @@ -138,15 +138,6 @@ public: const timeVaryingMappedFixedValueFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new timeVaryingMappedFixedValueFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference timeVaryingMappedFixedValueFvPatchField ( @@ -154,16 +145,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new timeVaryingMappedFixedValueFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H index 7803e429428..b62dfc4bb1d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H @@ -199,15 +199,6 @@ public: const totalPressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new totalPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference totalPressureFvPatchScalarField ( @@ -215,16 +206,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new totalPressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H index 87fa9cab6a1..a74bba4a975 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H @@ -135,15 +135,6 @@ public: const totalTemperatureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new totalTemperatureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference totalTemperatureFvPatchScalarField ( @@ -151,16 +142,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new totalTemperatureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.H index 3a481a799dc..0d64f42ee48 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.H @@ -124,15 +124,6 @@ public: const translatingWallVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new translatingWallVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference translatingWallVelocityFvPatchVectorField ( @@ -140,16 +131,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( - const DimensionedField<vector, volMesh>& iF + const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new translatingWallVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentDFSEMInlet/turbulentDFSEMInletFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/turbulentDFSEMInlet/turbulentDFSEMInletFvPatchVectorField.H index 25a6c571051..862684eb1e5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentDFSEMInlet/turbulentDFSEMInletFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentDFSEMInlet/turbulentDFSEMInletFvPatchVectorField.H @@ -326,15 +326,6 @@ public: const turbulentDFSEMInletFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new turbulentDFSEMInletFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference turbulentDFSEMInletFvPatchVectorField ( @@ -342,16 +333,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new turbulentDFSEMInletFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentDigitalFilterInlet/turbulentDigitalFilterInletFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/turbulentDigitalFilterInlet/turbulentDigitalFilterInletFvPatchField.H index 683968c2566..a45207389a1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentDigitalFilterInlet/turbulentDigitalFilterInletFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentDigitalFilterInlet/turbulentDigitalFilterInletFvPatchField.H @@ -299,15 +299,6 @@ public: const turbulentDigitalFilterInletFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new turbulentDigitalFilterInletFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference turbulentDigitalFilterInletFvPatchField ( @@ -315,16 +306,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new turbulentDigitalFilterInletFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.H index 9119b7e2db0..06214fcbf11 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.H @@ -176,15 +176,6 @@ public: const turbulentInletFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new turbulentInletFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference turbulentInletFvPatchField ( @@ -192,16 +183,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new turbulentInletFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.H index c9a0c149678..29f4c23c8bd 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.H @@ -141,18 +141,6 @@ public: const turbulentIntensityKineticEnergyInletFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new turbulentIntensityKineticEnergyInletFvPatchScalarField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference turbulentIntensityKineticEnergyInletFvPatchScalarField ( @@ -160,20 +148,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new turbulentIntensityKineticEnergyInletFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.H index a4d53e37488..7671f1dbac2 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.H @@ -140,15 +140,6 @@ public: const uniformDensityHydrostaticPressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new uniformDensityHydrostaticPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference uniformDensityHydrostaticPressureFvPatchScalarField ( @@ -156,20 +147,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new uniformDensityHydrostaticPressureFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedGradient/uniformFixedGradientFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedGradient/uniformFixedGradientFvPatchField.H index 8b0cb4129b2..648b421e0bd 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedGradient/uniformFixedGradientFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedGradient/uniformFixedGradientFvPatchField.H @@ -140,15 +140,6 @@ public: const uniformFixedGradientFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new uniformFixedGradientFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference uniformFixedGradientFvPatchField ( @@ -156,16 +147,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new uniformFixedGradientFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.H index 68e8e90021b..fddecf96db5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.H @@ -140,15 +140,6 @@ public: const uniformFixedValueFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new uniformFixedValueFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference uniformFixedValueFvPatchField ( @@ -156,16 +147,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new uniformFixedValueFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.H index fc2bca0339d..f100fed3b6c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.H @@ -138,15 +138,6 @@ public: const uniformInletOutletFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new uniformInletOutletFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference uniformInletOutletFvPatchField ( @@ -154,16 +145,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new uniformInletOutletFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H index f54cc9139c5..09be775aed2 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H @@ -137,15 +137,6 @@ public: const uniformJumpFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new uniformJumpFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference uniformJumpFvPatchField ( @@ -153,16 +144,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new uniformJumpFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H index 13f3cf4c277..f986f2e17f6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H @@ -136,15 +136,6 @@ public: const uniformJumpAMIFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new uniformJumpAMIFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference uniformJumpAMIFvPatchField ( @@ -152,16 +143,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new uniformJumpAMIFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformMixed/uniformMixedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformMixed/uniformMixedFvPatchField.H index 9d1bdd89545..f3533c0da72 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformMixed/uniformMixedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformMixed/uniformMixedFvPatchField.H @@ -163,15 +163,6 @@ public: const uniformMixedFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new uniformMixedFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference uniformMixedFvPatchField ( @@ -179,16 +170,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new uniformMixedFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformNormalFixedValue/uniformNormalFixedValueFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformNormalFixedValue/uniformNormalFixedValueFvPatchVectorField.H index 2600e37a0cb..2cc2a43b3d4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformNormalFixedValue/uniformNormalFixedValueFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformNormalFixedValue/uniformNormalFixedValueFvPatchVectorField.H @@ -133,15 +133,6 @@ public: const uniformNormalFixedValueFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new uniformNormalFixedValueFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference uniformNormalFixedValueFvPatchVectorField ( @@ -149,20 +140,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new uniformNormalFixedValueFvPatchVectorField - ( - *this, - iF - ) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.H index ef1fd0578dd..ed5696a1f31 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.H @@ -145,15 +145,6 @@ public: const uniformTotalPressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new uniformTotalPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference uniformTotalPressureFvPatchScalarField ( @@ -161,16 +152,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new uniformTotalPressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRate/variableHeightFlowRateFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRate/variableHeightFlowRateFvPatchField.H index b127f9f94e7..3e52da8949e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRate/variableHeightFlowRateFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRate/variableHeightFlowRateFvPatchField.H @@ -139,15 +139,6 @@ public: const variableHeightFlowRateFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchField<scalar>> clone() const - { - return tmp<fvPatchField<scalar>> - ( - new variableHeightFlowRateFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference variableHeightFlowRateFvPatchScalarField ( @@ -155,16 +146,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchField<scalar>> - ( - new variableHeightFlowRateFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.H index ef71bf6ca32..39f3a95cc42 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.H @@ -138,15 +138,6 @@ public: const variableHeightFlowRateInletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new variableHeightFlowRateInletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference variableHeightFlowRateInletVelocityFvPatchVectorField ( @@ -154,20 +145,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new variableHeightFlowRateInletVelocityFvPatchVectorField - ( - *this, - iF - ) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H index 4140db8be01..521cc7dc586 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H @@ -165,15 +165,6 @@ public: const waveSurfacePressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new waveSurfacePressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference waveSurfacePressureFvPatchScalarField ( @@ -181,16 +172,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new waveSurfacePressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.H index 94862dabe93..37330328c1e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.H @@ -146,15 +146,6 @@ public: const waveTransmissiveFvPatchField& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new waveTransmissiveFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference waveTransmissiveFvPatchField ( @@ -162,16 +153,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new waveTransmissiveFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index 1d993b178ba..9056467691a 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -459,23 +459,43 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone + //- Clone patch field with its own internal field reference virtual tmp<fvPatchField<Type>> clone() const { - return tmp<fvPatchField<Type>>::New(*this); + return tmp<fvPatchField<Type>> + ( + new fvPatchField<Type>(*this, this->internalField_) + ); } - //- Construct and return a clone setting internal field reference + //- Clone patch field with given internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>>::New(*this, iF); + return tmp<fvPatchField<Type>> + ( + new fvPatchField<Type>(*this, iF) + ); } - // Selectors + // Factory Methods + + //- Clone a patch field, optionally with internal field reference etc. + template<class DerivedPatchField, class... Args> + static tmp<fvPatchField<Type>> Clone + ( + const DerivedPatchField& pf, + Args&&... args + ) + { + return tmp<fvPatchField<Type>> + ( + new DerivedPatchField(pf, std::forward<Args>(args)...) + ); + } //- Return a pointer to a new patchField created on freestore given // patch and internal field @@ -522,15 +542,15 @@ public: // freestore without setting patchField values static tmp<fvPatchField<Type>> NewCalculatedType ( - const fvPatch& + const fvPatch& p ); //- Return a pointer to a new calculatedFvPatchField created on // freestore without setting patchField values - template<class Type2> + template<class AnyType> static tmp<fvPatchField<Type>> NewCalculatedType ( - const fvPatchField<Type2>& + const fvPatchField<AnyType>& pf ); diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C index 443ab350aad..ed1536312ce 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C @@ -120,11 +120,11 @@ Foam::fvsPatchField<Type>::NewCalculatedType template<class Type> -template<class Type2> +template<class AnyType> Foam::tmp<Foam::fvsPatchField<Type>> Foam::fvsPatchField<Type>::NewCalculatedType ( - const fvsPatchField<Type2>& pf + const fvsPatchField<AnyType>& pf ) { return NewCalculatedType(pf.patch()); diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.H index 56982775bed..bd8b64db01a 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.H @@ -91,15 +91,6 @@ public: const calculatedFvsPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvsPatchField<Type>> clone() const - { - return tmp<fvsPatchField<Type>> - ( - new calculatedFvsPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference calculatedFvsPatchField ( @@ -107,16 +98,19 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<fvsPatchField<Type>> clone() const + { + return fvsPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvsPatchField<Type>> clone ( const DimensionedField<Type, surfaceMesh>& iF ) const { - return tmp<fvsPatchField<Type>> - ( - new calculatedFvsPatchField<Type>(*this, iF) - ); + return fvsPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchField.H index e1eaf8355fe..221630943f6 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/coupled/coupledFvsPatchField.H @@ -101,9 +101,6 @@ public: const coupledFvsPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvsPatchField<Type>> clone() const = 0; - //- Construct as copy setting internal field reference coupledFvsPatchField ( @@ -111,6 +108,9 @@ public: const DimensionedField<Type, surfaceMesh>& ); + //- Return clone + virtual tmp<fvsPatchField<Type>> clone() const = 0; + //- Construct and return a clone virtual tmp<fvsPatchField<Type>> clone ( diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.H index 463444a94dc..ab5ec9dc427 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/fixedValue/fixedValueFvsPatchField.H @@ -100,32 +100,25 @@ public: const fixedValueFvsPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvsPatchField<Type>> clone() const - { - return tmp<fvsPatchField<Type>> - ( - new fixedValueFvsPatchField<Type>(*this) - ); - } - - //- Construct as copy setting internal field reference fixedValueFvsPatchField ( const fixedValueFvsPatchField<Type>&, const DimensionedField<Type, surfaceMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<fvsPatchField<Type>> clone() const + { + return fvsPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvsPatchField<Type>> clone ( const DimensionedField<Type, surfaceMesh>& iF ) const { - return tmp<fvsPatchField<Type>> - ( - new fixedValueFvsPatchField<Type>(*this, iF) - ); + return fvsPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.C index 239814c1851..08179b72e84 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.C @@ -111,47 +111,14 @@ Foam::slicedFvsPatchField<Type>::slicedFvsPatchField } -template<class Type> -Foam::tmp<Foam::fvsPatchField<Type>> -Foam::slicedFvsPatchField<Type>::clone() const -{ - return tmp<fvsPatchField<Type>> - ( - new slicedFvsPatchField<Type>(*this) - ); -} - - template<class Type> Foam::slicedFvsPatchField<Type>::slicedFvsPatchField ( const slicedFvsPatchField<Type>& ptf ) : - fvsPatchField<Type> - ( - ptf.patch(), - ptf.internalField(), - Field<Type>() - ) -{ - // Transfer the slice from the argument - UList<Type>::shallowCopy(ptf); -} - - -template<class Type> -Foam::tmp<Foam::fvsPatchField<Type>> -Foam::slicedFvsPatchField<Type>::clone -( - const DimensionedField<Type, surfaceMesh>& iF -) const -{ - return tmp<fvsPatchField<Type>> - ( - new slicedFvsPatchField<Type>(*this, iF) - ); -} + slicedFvsPatchField<Type>(ptf, ptf.internalField()) +{} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H index 64aeaeb4869..42c92679d92 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/basic/sliced/slicedFvsPatchField.H @@ -109,9 +109,6 @@ public: //- Construct as copy slicedFvsPatchField(const slicedFvsPatchField<Type>&); - //- Construct and return a clone - virtual tmp<fvsPatchField<Type>> clone() const; - //- Construct as copy setting internal field reference slicedFvsPatchField ( @@ -119,11 +116,20 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<fvsPatchField<Type>> clone() const + { + return fvsPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvsPatchField<Type>> clone ( const DimensionedField<Type, surfaceMesh>& iF - ) const; + ) const + { + return fvsPatchField<Type>::Clone(*this, iF); + } //- Destructor diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclic/cyclicFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclic/cyclicFvsPatchField.H index 7da4cccf0cb..c609d02df91 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclic/cyclicFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclic/cyclicFvsPatchField.H @@ -98,15 +98,6 @@ public: const cyclicFvsPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvsPatchField<Type>> clone() const - { - return tmp<fvsPatchField<Type>> - ( - new cyclicFvsPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference cyclicFvsPatchField ( @@ -114,16 +105,19 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<fvsPatchField<Type>> clone() const + { + return fvsPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvsPatchField<Type>> clone ( const DimensionedField<Type, surfaceMesh>& iF ) const { - return tmp<fvsPatchField<Type>> - ( - new cyclicFvsPatchField<Type>(*this, iF) - ); + return fvsPatchField<Type>::Clone(*this, iF); } }; diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicACMI/cyclicACMIFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicACMI/cyclicACMIFvsPatchField.H index dbb056325b4..da9480eb7fd 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicACMI/cyclicACMIFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicACMI/cyclicACMIFvsPatchField.H @@ -98,15 +98,6 @@ public: const cyclicACMIFvsPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvsPatchField<Type>> clone() const - { - return tmp<fvsPatchField<Type>> - ( - new cyclicACMIFvsPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference cyclicACMIFvsPatchField ( @@ -114,24 +105,26 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<fvsPatchField<Type>> clone() const + { + return fvsPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvsPatchField<Type>> clone ( const DimensionedField<Type, surfaceMesh>& iF ) const { - return tmp<fvsPatchField<Type>> - ( - new cyclicACMIFvsPatchField<Type>(*this, iF) - ); + return fvsPatchField<Type>::Clone(*this, iF); } - // Member functions - // Access + // Member Functions - //- Return true if running parallel - virtual bool coupled() const; + //- Return true if running parallel + virtual bool coupled() const; }; diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.H index 4846360f893..2550303c730 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicAMI/cyclicAMIFvsPatchField.H @@ -98,15 +98,6 @@ public: const cyclicAMIFvsPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvsPatchField<Type>> clone() const - { - return tmp<fvsPatchField<Type>> - ( - new cyclicAMIFvsPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference cyclicAMIFvsPatchField ( @@ -114,25 +105,26 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<fvsPatchField<Type>> clone() const + { + return fvsPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvsPatchField<Type>> clone ( const DimensionedField<Type, surfaceMesh>& iF ) const { - return tmp<fvsPatchField<Type>> - ( - new cyclicAMIFvsPatchField<Type>(*this, iF) - ); + return fvsPatchField<Type>::Clone(*this, iF); } - // Member functions - - // Access - //- Return true if running parallel - virtual bool coupled() const; + // Member Functions + //- Return true if running parallel + virtual bool coupled() const; }; diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchField.H index 45da7b0fd72..09833a088ea 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchField.H @@ -93,15 +93,6 @@ public: const cyclicSlipFvsPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvsPatchField<Type>> clone() const - { - return tmp<fvsPatchField<Type>> - ( - new cyclicSlipFvsPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference cyclicSlipFvsPatchField ( @@ -109,16 +100,19 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<fvsPatchField<Type>> clone() const + { + return fvsPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvsPatchField<Type>> clone ( const DimensionedField<Type, surfaceMesh>& iF ) const { - return tmp<fvsPatchField<Type>> - ( - new cyclicSlipFvsPatchField<Type>(*this, iF) - ); + return fvsPatchField<Type>::Clone(*this, iF); } }; diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.H index 1d96c1c568f..76413218523 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.H @@ -92,15 +92,6 @@ public: const emptyFvsPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvsPatchField<Type>> clone() const - { - return tmp<fvsPatchField<Type>> - ( - new emptyFvsPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference emptyFvsPatchField ( @@ -108,16 +99,19 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<fvsPatchField<Type>> clone() const + { + return fvsPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvsPatchField<Type>> clone ( const DimensionedField<Type, surfaceMesh>& iF ) const { - return tmp<fvsPatchField<Type>> - ( - new emptyFvsPatchField<Type>(*this, iF) - ); + return fvsPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchField.H index dce9f785da9..6f5fdd7d718 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchField.H @@ -94,15 +94,6 @@ public: const nonuniformTransformCyclicFvsPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvsPatchField<Type>> clone() const - { - return tmp<fvsPatchField<Type>> - ( - new nonuniformTransformCyclicFvsPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference nonuniformTransformCyclicFvsPatchField ( @@ -110,16 +101,19 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<fvsPatchField<Type>> clone() const + { + return fvsPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvsPatchField<Type>> clone ( const DimensionedField<Type, surfaceMesh>& iF ) const { - return tmp<fvsPatchField<Type>> - ( - new nonuniformTransformCyclicFvsPatchField<Type>(*this, iF) - ); + return fvsPatchField<Type>::Clone(*this, iF); } }; diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchField.H index 481d1aac6ab..dd96291ee68 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/processor/processorFvsPatchField.H @@ -103,15 +103,6 @@ public: //- Construct as copy processorFvsPatchField(const processorFvsPatchField<Type>&); - //- Construct and return a clone - virtual tmp<fvsPatchField<Type>> clone() const - { - return tmp<fvsPatchField<Type>> - ( - new processorFvsPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference processorFvsPatchField ( @@ -119,16 +110,19 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<fvsPatchField<Type>> clone() const + { + return fvsPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvsPatchField<Type>> clone ( const DimensionedField<Type, surfaceMesh>& iF ) const { - return tmp<fvsPatchField<Type>> - ( - new processorFvsPatchField<Type>(*this, iF) - ); + return fvsPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchField.H index 59c762dfb18..4368b03621c 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/processorCyclic/processorCyclicFvsPatchField.H @@ -104,15 +104,6 @@ public: //- Construct as copy processorCyclicFvsPatchField(const processorCyclicFvsPatchField<Type>&); - //- Construct and return a clone - virtual tmp<fvsPatchField<Type>> clone() const - { - return tmp<fvsPatchField<Type>> - ( - new processorCyclicFvsPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference processorCyclicFvsPatchField ( @@ -120,16 +111,19 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<fvsPatchField<Type>> clone() const + { + return fvsPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvsPatchField<Type>> clone ( const DimensionedField<Type, surfaceMesh>& iF ) const { - return tmp<fvsPatchField<Type>> - ( - new processorCyclicFvsPatchField<Type>(*this, iF) - ); + return fvsPatchField<Type>::Clone(*this, iF); } diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchField.H index 9b97484efe6..4fa95f96806 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetry/symmetryFvsPatchField.H @@ -93,15 +93,6 @@ public: const symmetryFvsPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvsPatchField<Type>> clone() const - { - return tmp<fvsPatchField<Type>> - ( - new symmetryFvsPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference symmetryFvsPatchField ( @@ -109,16 +100,19 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<fvsPatchField<Type>> clone() const + { + return fvsPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvsPatchField<Type>> clone ( const DimensionedField<Type, surfaceMesh>& iF ) const { - return tmp<fvsPatchField<Type>> - ( - new symmetryFvsPatchField<Type>(*this, iF) - ); + return fvsPatchField<Type>::Clone(*this, iF); } }; diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.H index 54abdbfbd29..cf3f253e054 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.H @@ -94,15 +94,6 @@ public: const symmetryPlaneFvsPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvsPatchField<Type>> clone() const - { - return tmp<fvsPatchField<Type>> - ( - new symmetryPlaneFvsPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference symmetryPlaneFvsPatchField ( @@ -110,16 +101,19 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<fvsPatchField<Type>> clone() const + { + return fvsPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvsPatchField<Type>> clone ( const DimensionedField<Type, surfaceMesh>& iF ) const { - return tmp<fvsPatchField<Type>> - ( - new symmetryPlaneFvsPatchField<Type>(*this, iF) - ); + return fvsPatchField<Type>::Clone(*this, iF); } }; diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchField.H index 861dfc45a17..9c5ce9eb72a 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/wedge/wedgeFvsPatchField.H @@ -93,15 +93,6 @@ public: const wedgeFvsPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvsPatchField<Type>> clone() const - { - return tmp<fvsPatchField<Type>> - ( - new wedgeFvsPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference wedgeFvsPatchField ( @@ -109,16 +100,19 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<fvsPatchField<Type>> clone() const + { + return fvsPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvsPatchField<Type>> clone ( const DimensionedField<Type, surfaceMesh>& iF ) const { - return tmp<fvsPatchField<Type>> - ( - new wedgeFvsPatchField<Type>(*this, iF) - ); + return fvsPatchField<Type>::Clone(*this, iF); } }; diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H index d4b9ff1c180..26f2f4beb5d 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H @@ -372,23 +372,43 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct and return a clone + //- Clone patch field with its own internal field reference virtual tmp<fvsPatchField<Type>> clone() const { - return tmp<fvsPatchField<Type>>::New(*this); + return tmp<fvsPatchField<Type>> + ( + new fvsPatchField<Type>(*this, this->internalField_) + ); } - //- Construct and return a clone setting internal field reference + //- Clone with an internal field reference virtual tmp<fvsPatchField<Type>> clone ( const DimensionedField<Type, surfaceMesh>& iF ) const { - return tmp<fvsPatchField<Type>>::New(*this, iF); + return tmp<fvsPatchField<Type>> + ( + new fvsPatchField<Type>(*this, iF) + ); } - // Selectors + // Factory Methods + + //- Clone a patch field, optionally with internal field reference etc. + template<class DerivedPatchField, class... Args> + static tmp<fvsPatchField<Type>> Clone + ( + const DerivedPatchField& pf, + Args&&... args + ) + { + return tmp<fvsPatchField<Type>> + ( + new DerivedPatchField(pf, std::forward<Args>(args)...) + ); + } //- Return a pointer to a new patchField created on freestore given // patch and internal field @@ -435,15 +455,15 @@ public: // freestore without setting patchField values static tmp<fvsPatchField<Type>> NewCalculatedType ( - const fvPatch& + const fvPatch& p ); //- Return a pointer to a new calculatedFvsPatchField created on // freestore without setting patchField values - template<class Type2> + template<class AnyType> static tmp<fvsPatchField<Type>> NewCalculatedType ( - const fvsPatchField<Type2>& + const fvsPatchField<AnyType>& pf ); diff --git a/src/functionObjects/field/externalCoupled/externalCoupledMixed/externalCoupledMixedFvPatchField.H b/src/functionObjects/field/externalCoupled/externalCoupledMixed/externalCoupledMixedFvPatchField.H index bfe1071a3b7..090cc3f8fdf 100644 --- a/src/functionObjects/field/externalCoupled/externalCoupledMixed/externalCoupledMixedFvPatchField.H +++ b/src/functionObjects/field/externalCoupled/externalCoupledMixed/externalCoupledMixedFvPatchField.H @@ -118,15 +118,6 @@ public: const externalCoupledMixedFvPatchField& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new externalCoupledMixedFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference externalCoupledMixedFvPatchField ( @@ -134,16 +125,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new externalCoupledMixedFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/functionObjects/field/externalCoupled/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.H b/src/functionObjects/field/externalCoupled/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.H index c82d23b4dbb..55dbcd2bc9c 100644 --- a/src/functionObjects/field/externalCoupled/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.H +++ b/src/functionObjects/field/externalCoupled/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.H @@ -205,15 +205,6 @@ public: const externalCoupledTemperatureMixedFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchField<scalar>> clone() const - { - return tmp<fvPatchField<scalar>> - ( - new externalCoupledTemperatureMixedFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference externalCoupledTemperatureMixedFvPatchScalarField ( @@ -221,20 +212,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchField<scalar>> - ( - new externalCoupledTemperatureMixedFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchField.H b/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchField.H index 17ef20543af..b175af60ee7 100644 --- a/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchField.H +++ b/src/fvMotionSolver/fvPatchFields/derived/cellMotion/cellMotionFvPatchField.H @@ -94,15 +94,6 @@ public: const cellMotionFvPatchField<Type>& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new cellMotionFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference cellMotionFvPatchField ( @@ -110,16 +101,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new cellMotionFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/fvMotionSolver/fvPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementFvPatchField.H b/src/fvMotionSolver/fvPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementFvPatchField.H index b94b01d5374..4afd37a9881 100644 --- a/src/fvMotionSolver/fvPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementFvPatchField.H +++ b/src/fvMotionSolver/fvPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementFvPatchField.H @@ -108,15 +108,6 @@ public: slipFvPatchField<Type>(ptf) {} - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new surfaceSlipDisplacementFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference surfaceSlipDisplacementFvPatchField ( @@ -127,18 +118,22 @@ public: slipFvPatchField<Type>(ptf, iF) {} - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new surfaceSlipDisplacementFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } + virtual void write(Ostream& os) const { slipFvPatchField<Type>::write(os); diff --git a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.H index fe7841d3775..47bd75de50b 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.H @@ -95,18 +95,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<vector>> clone() const - { - return autoPtr<pointPatchField<vector>> - ( - new angularOscillatingDisplacementPointPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference angularOscillatingDisplacementPointPatchVectorField ( @@ -114,20 +102,19 @@ public: const DimensionedField<vector, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<vector>> clone() const + { + return pointPatchField<vector>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<vector>> clone ( const DimensionedField<vector, pointMesh>& iF ) const { - return autoPtr<pointPatchField<vector>> - ( - new angularOscillatingDisplacementPointPatchVectorField - ( - *this, - iF - ) - ); + return pointPatchField<vector>::Clone(*this, iF); } diff --git a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.H index b73fab2a6d5..cb5b72d83a4 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.H @@ -95,18 +95,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<vector>> clone() const - { - return autoPtr<pointPatchField<vector>> - ( - new angularOscillatingVelocityPointPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference angularOscillatingVelocityPointPatchVectorField ( @@ -114,20 +102,19 @@ public: const DimensionedField<vector, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<vector>> clone() const + { + return pointPatchField<vector>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<vector>> clone ( const DimensionedField<vector, pointMesh>& iF ) const { - return autoPtr<pointPatchField<vector>> - ( - new angularOscillatingVelocityPointPatchVectorField - ( - *this, - iF - ) - ); + return pointPatchField<vector>::Clone(*this, iF); } diff --git a/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.H index f77cec23538..c3865b1dc1f 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.H @@ -90,18 +90,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<vector>> clone() const - { - return autoPtr<pointPatchField<vector>> - ( - new oscillatingDisplacementPointPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference oscillatingDisplacementPointPatchVectorField ( @@ -109,20 +97,19 @@ public: const DimensionedField<vector, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<vector>> clone() const + { + return pointPatchField<vector>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<vector>> clone ( const DimensionedField<vector, pointMesh>& iF ) const { - return autoPtr<pointPatchField<vector>> - ( - new oscillatingDisplacementPointPatchVectorField - ( - *this, - iF - ) - ); + return pointPatchField<vector>::Clone(*this, iF); } diff --git a/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.H index bacd84bc1e3..ca9628e2ac1 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.H @@ -92,18 +92,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<vector>> clone() const - { - return autoPtr<pointPatchField<vector>> - ( - new oscillatingVelocityPointPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference oscillatingVelocityPointPatchVectorField ( @@ -111,20 +99,19 @@ public: const DimensionedField<vector, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<vector>> clone() const + { + return pointPatchField<vector>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<vector>> clone ( const DimensionedField<vector, pointMesh>& iF ) const { - return autoPtr<pointPatchField<vector>> - ( - new oscillatingVelocityPointPatchVectorField - ( - *this, - iF - ) - ); + return pointPatchField<vector>::Clone(*this, iF); } diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.H index 0c39ddc7d29..7e78583f80d 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.H @@ -169,18 +169,6 @@ public: const surfaceDisplacementPointPatchVectorField& ); - //- Construct and return a clone - virtual autoPtr<pointPatchVectorField> clone() const - { - return autoPtr<pointPatchVectorField> - ( - new surfaceDisplacementPointPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference surfaceDisplacementPointPatchVectorField ( @@ -188,22 +176,22 @@ public: const DimensionedField<vector, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<vector>> clone() const + { + return pointPatchField<vector>::Clone(*this); + } + //- Construct and return a clone setting internal field reference - virtual autoPtr<pointPatchVectorField> clone + virtual autoPtr<pointPatchField<vector>> clone ( const DimensionedField<vector, pointMesh>& iF ) const { - return autoPtr<pointPatchVectorField> - ( - new surfaceDisplacementPointPatchVectorField - ( - *this, - iF - ) - ); + return pointPatchField<vector>::Clone(*this, iF); } + // Member Functions //- Surface to follow. Demand loads surfaceNames. diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.H index 2a46c184546..8fa5889ebea 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.H @@ -159,18 +159,6 @@ public: const surfaceSlipDisplacementPointPatchVectorField& ); - //- Construct and return a clone - virtual autoPtr<pointPatchVectorField> clone() const - { - return autoPtr<pointPatchVectorField> - ( - new surfaceSlipDisplacementPointPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference surfaceSlipDisplacementPointPatchVectorField ( @@ -178,22 +166,22 @@ public: const DimensionedField<vector, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<vector>> clone() const + { + return pointPatchField<vector>::Clone(*this); + } + //- Construct and return a clone setting internal field reference - virtual autoPtr<pointPatchVectorField> clone + virtual autoPtr<pointPatchField<vector>> clone ( const DimensionedField<vector, pointMesh>& iF ) const { - return autoPtr<pointPatchVectorField> - ( - new surfaceSlipDisplacementPointPatchVectorField - ( - *this, - iF - ) - ); + return pointPatchField<vector>::Clone(*this, iF); } + // Member Functions //- Surface to follow. Demand loads surfaceNames. diff --git a/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.H b/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.H index 2dedce3d911..18804b5fc03 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.H @@ -161,15 +161,6 @@ public: const timeVaryingMappedFixedValuePointPatchField<Type>& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new timeVaryingMappedFixedValuePointPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference timeVaryingMappedFixedValuePointPatchField ( @@ -177,16 +168,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new timeVaryingMappedFixedValuePointPatchField<Type>(*this, iF) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/fvMotionSolver/pointPatchFields/derived/uniformInterpolatedDisplacement/uniformInterpolatedDisplacementPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/uniformInterpolatedDisplacement/uniformInterpolatedDisplacementPointPatchVectorField.H index e8105cd39de..d591e498949 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/uniformInterpolatedDisplacement/uniformInterpolatedDisplacementPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/uniformInterpolatedDisplacement/uniformInterpolatedDisplacementPointPatchVectorField.H @@ -129,18 +129,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<vector>> clone() const - { - return autoPtr<pointPatchField<vector>> - ( - new uniformInterpolatedDisplacementPointPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference uniformInterpolatedDisplacementPointPatchVectorField ( @@ -148,20 +136,19 @@ public: const DimensionedField<vector, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<vector>> clone() const + { + return pointPatchField<vector>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<vector>> clone ( const DimensionedField<vector, pointMesh>& iF ) const { - return autoPtr<pointPatchField<vector>> - ( - new uniformInterpolatedDisplacementPointPatchVectorField - ( - *this, - iF - ) - ); + return pointPatchField<vector>::Clone(*this, iF); } diff --git a/src/fvMotionSolver/pointPatchFields/derived/waveDisplacement/waveDisplacementPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/waveDisplacement/waveDisplacementPointPatchVectorField.H index 284ad8e84cc..7449a203671 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/waveDisplacement/waveDisplacementPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/waveDisplacement/waveDisplacementPointPatchVectorField.H @@ -91,18 +91,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<vector>> clone() const - { - return autoPtr<pointPatchField<vector>> - ( - new waveDisplacementPointPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference waveDisplacementPointPatchVectorField ( @@ -110,20 +98,19 @@ public: const DimensionedField<vector, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<vector>> clone() const + { + return pointPatchField<vector>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<vector>> clone ( const DimensionedField<vector, pointMesh>& iF ) const { - return autoPtr<pointPatchField<vector>> - ( - new waveDisplacementPointPatchVectorField - ( - *this, - iF - ) - ); + return pointPatchField<vector>::Clone(*this, iF); } diff --git a/src/genericPatchFields/genericFaPatchField/genericFaPatchField.H b/src/genericPatchFields/genericFaPatchField/genericFaPatchField.H index 7ad03942e79..49d24ad289b 100644 --- a/src/genericPatchFields/genericFaPatchField/genericFaPatchField.H +++ b/src/genericPatchFields/genericFaPatchField/genericFaPatchField.H @@ -97,15 +97,6 @@ public: const faPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<faPatchField<Type>> clone() const - { - return tmp<faPatchField<Type>> - ( - new genericFaPatchField<Type>(*this) - ); - } - //- Default construct genericFaPatchField(const genericFaPatchField<Type>&) = default; @@ -116,16 +107,19 @@ public: const DimensionedField<Type, areaMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faPatchField<Type>> clone() const + { + return faPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faPatchField<Type>> clone ( const DimensionedField<Type, areaMesh>& iF ) const { - return tmp<faPatchField<Type>> - ( - new genericFaPatchField<Type>(*this, iF) - ); + return faPatchField<Type>::Clone(*this, iF); } diff --git a/src/genericPatchFields/genericFaePatchField/genericFaePatchField.H b/src/genericPatchFields/genericFaePatchField/genericFaePatchField.H index 48c6cc59cec..d02442f483f 100644 --- a/src/genericPatchFields/genericFaePatchField/genericFaePatchField.H +++ b/src/genericPatchFields/genericFaePatchField/genericFaePatchField.H @@ -99,15 +99,6 @@ public: //- Default copy construct genericFaePatchField(const genericFaePatchField<Type>&) = default; - //- Construct and return a clone - virtual tmp<faePatchField<Type>> clone() const - { - return tmp<faePatchField<Type>> - ( - new genericFaePatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference genericFaePatchField ( @@ -115,16 +106,19 @@ public: const DimensionedField<Type, edgeMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<faePatchField<Type>> clone() const + { + return faePatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<faePatchField<Type>> clone ( const DimensionedField<Type, edgeMesh>& iF ) const { - return tmp<faePatchField<Type>> - ( - new genericFaePatchField<Type>(*this, iF) - ); + return faePatchField<Type>::Clone(*this, iF); } diff --git a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H index f74273dceeb..59a55e25707 100644 --- a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H +++ b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.H @@ -97,15 +97,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new genericFvPatchField<Type>(*this) - ); - } - //- Default copy construct genericFvPatchField(const genericFvPatchField<Type>&) = default; @@ -116,16 +107,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new genericFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/genericPatchFields/genericFvsPatchField/genericFvsPatchField.H b/src/genericPatchFields/genericFvsPatchField/genericFvsPatchField.H index 0447dd99710..637129c0fdf 100644 --- a/src/genericPatchFields/genericFvsPatchField/genericFvsPatchField.H +++ b/src/genericPatchFields/genericFvsPatchField/genericFvsPatchField.H @@ -96,15 +96,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvsPatchField<Type>> clone() const - { - return tmp<fvsPatchField<Type>> - ( - new genericFvsPatchField<Type>(*this) - ); - } - //- Default copy construct genericFvsPatchField(const genericFvsPatchField<Type>&) = default; @@ -115,16 +106,19 @@ public: const DimensionedField<Type, surfaceMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return clone + virtual tmp<fvsPatchField<Type>> clone() const + { + return fvsPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvsPatchField<Type>> clone ( const DimensionedField<Type, surfaceMesh>& iF ) const { - return tmp<fvsPatchField<Type>> - ( - new genericFvsPatchField<Type>(*this, iF) - ); + return fvsPatchField<Type>::Clone(*this, iF); } diff --git a/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H b/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H index c91f40202f5..1f68de1bf45 100644 --- a/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H +++ b/src/genericPatchFields/genericPointPatchField/genericPointPatchField.H @@ -93,18 +93,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new genericPointPatchField<Type> - ( - *this - ) - ); - } - //- Default copy construct genericPointPatchField(const genericPointPatchField<Type>&) = default; @@ -115,20 +103,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new genericPointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/lumpedPointMotion/pointPatchFields/lumpedPointDisplacementPointPatchVectorField.H b/src/lumpedPointMotion/pointPatchFields/lumpedPointDisplacementPointPatchVectorField.H index 0afd14f0591..0ce5845796d 100644 --- a/src/lumpedPointMotion/pointPatchFields/lumpedPointDisplacementPointPatchVectorField.H +++ b/src/lumpedPointMotion/pointPatchFields/lumpedPointDisplacementPointPatchVectorField.H @@ -138,18 +138,6 @@ public: const pointPatchFieldMapper& mapper ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<vector>> clone() const - { - return autoPtr<pointPatchField<vector>> - ( - new lumpedPointDisplacementPointPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference lumpedPointDisplacementPointPatchVectorField ( @@ -157,20 +145,19 @@ public: const DimensionedField<vector, pointMesh>& iF ); + //- Return a clone + virtual autoPtr<pointPatchField<vector>> clone() const + { + return pointPatchField<vector>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<vector>> clone ( const DimensionedField<vector, pointMesh>& iF ) const { - return autoPtr<pointPatchField<vector>> - ( - new lumpedPointDisplacementPointPatchVectorField - ( - *this, - iF - ) - ); + return pointPatchField<vector>::Clone(*this, iF); } diff --git a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/zeroFixedValue/zeroFixedValuePointPatchField.H b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/zeroFixedValue/zeroFixedValuePointPatchField.H index 41862edb7b7..15379495a26 100644 --- a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/zeroFixedValue/zeroFixedValuePointPatchField.H +++ b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/zeroFixedValue/zeroFixedValuePointPatchField.H @@ -99,18 +99,6 @@ public: const zeroFixedValuePointPatchField<Type>& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new zeroFixedValuePointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference zeroFixedValuePointPatchField ( @@ -118,6 +106,11 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone @@ -125,14 +118,7 @@ public: const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new zeroFixedValuePointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } }; diff --git a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPointPatchField/cyclicACMIPointPatchField.H b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPointPatchField/cyclicACMIPointPatchField.H index 17755d52954..6c618a97476 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPointPatchField/cyclicACMIPointPatchField.H +++ b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPointPatchField/cyclicACMIPointPatchField.H @@ -138,18 +138,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new cyclicACMIPointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference cyclicACMIPointPatchField ( @@ -157,19 +145,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new cyclicACMIPointPatchField<Type> - ( - *this, iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.H b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.H index 5840a302695..f6ffa116bbc 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.H +++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.H @@ -138,18 +138,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new cyclicAMIPointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference cyclicAMIPointPatchField ( @@ -157,19 +145,19 @@ public: const DimensionedField<Type, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new cyclicAMIPointPatchField<Type> - ( - *this, iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/meshTools/fields/pointPatchFields/uniformFixedValue/uniformFixedValuePointPatchField.H b/src/meshTools/fields/pointPatchFields/uniformFixedValue/uniformFixedValuePointPatchField.H index c98e567de39..9cf2a5c27ef 100644 --- a/src/meshTools/fields/pointPatchFields/uniformFixedValue/uniformFixedValuePointPatchField.H +++ b/src/meshTools/fields/pointPatchFields/uniformFixedValue/uniformFixedValuePointPatchField.H @@ -130,18 +130,6 @@ public: const uniformFixedValuePointPatchField<Type>& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<Type>> clone() const - { - return autoPtr<pointPatchField<Type>> - ( - new uniformFixedValuePointPatchField<Type> - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference uniformFixedValuePointPatchField ( @@ -150,20 +138,19 @@ public: ); + //- Return a clone + virtual autoPtr<pointPatchField<Type>> clone() const + { + return pointPatchField<Type>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<Type>> clone ( const DimensionedField<Type, pointMesh>& iF ) const { - return autoPtr<pointPatchField<Type>> - ( - new uniformFixedValuePointPatchField<Type> - ( - *this, - iF - ) - ); + return pointPatchField<Type>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldPressure/adjointFarFieldPressureFvPatchScalarField.H b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldPressure/adjointFarFieldPressureFvPatchScalarField.H index 97406ef979a..085e282dcab 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldPressure/adjointFarFieldPressureFvPatchScalarField.H +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldPressure/adjointFarFieldPressureFvPatchScalarField.H @@ -90,15 +90,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new adjointFarFieldPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference adjointFarFieldPressureFvPatchScalarField ( @@ -106,16 +97,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new adjointFarFieldPressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldVelocity/adjointFarFieldVelocityFvPatchVectorField.H b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldVelocity/adjointFarFieldVelocityFvPatchVectorField.H index 1f61a89d7a1..68ccdf27d1e 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldVelocity/adjointFarFieldVelocityFvPatchVectorField.H +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldVelocity/adjointFarFieldVelocityFvPatchVectorField.H @@ -90,15 +90,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new adjointFarFieldVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference adjointFarFieldVelocityFvPatchVectorField ( @@ -106,16 +97,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new adjointFarFieldVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointInletVelocity/adjointInletVelocityFvPatchVectorField.H b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointInletVelocity/adjointInletVelocityFvPatchVectorField.H index 04d4891f096..b760aac7475 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointInletVelocity/adjointInletVelocityFvPatchVectorField.H +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointInletVelocity/adjointInletVelocityFvPatchVectorField.H @@ -90,15 +90,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new adjointInletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference adjointInletVelocityFvPatchVectorField ( @@ -106,16 +97,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new adjointInletVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.H b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.H index ad035cc6ff7..8765168bd14 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.H +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.H @@ -90,15 +90,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new adjointOutletPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference adjointOutletPressureFvPatchScalarField ( @@ -106,16 +97,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new adjointOutletPressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.H b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.H index 95c57078aa6..19320666986 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.H +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.H @@ -100,15 +100,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new adjointOutletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference adjointOutletVelocityFvPatchVectorField ( @@ -116,20 +107,22 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new adjointOutletVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } - // Member functions //- Return true: Allow adjoint solvers to obtain the outlet phia diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletVelocityFlux/adjointOutletVelocityFluxFvPatchVectorField.H b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletVelocityFlux/adjointOutletVelocityFluxFvPatchVectorField.H index 160da9dd951..af2402bf0fd 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletVelocityFlux/adjointOutletVelocityFluxFvPatchVectorField.H +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointOutletVelocityFlux/adjointOutletVelocityFluxFvPatchVectorField.H @@ -97,15 +97,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new adjointOutletVelocityFluxFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference adjointOutletVelocityFluxFvPatchVectorField ( @@ -113,20 +104,22 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new adjointOutletVelocityFluxFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } - // Member functions //- Return true: Allow adjoint solvers to obtain the outlet phia diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointRotatingWallVelocity/adjointRotatingWallVelocityFvPatchVectorField.H b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointRotatingWallVelocity/adjointRotatingWallVelocityFvPatchVectorField.H index 382ffa5baaa..e76012d5eea 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointRotatingWallVelocity/adjointRotatingWallVelocityFvPatchVectorField.H +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointRotatingWallVelocity/adjointRotatingWallVelocityFvPatchVectorField.H @@ -104,15 +104,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new adjointRotatingWallVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference adjointRotatingWallVelocityFvPatchVectorField ( @@ -120,16 +111,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new adjointRotatingWallVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocity/adjointWallVelocityFvPatchVectorField.H b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocity/adjointWallVelocityFvPatchVectorField.H index 7ead8328d5b..5597759c1fd 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocity/adjointWallVelocityFvPatchVectorField.H +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocity/adjointWallVelocityFvPatchVectorField.H @@ -112,15 +112,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new adjointWallVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference adjointWallVelocityFvPatchVectorField ( @@ -128,16 +119,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new adjointWallVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocityLowRe/adjointWallVelocityLowReFvPatchVectorField.H b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocityLowRe/adjointWallVelocityLowReFvPatchVectorField.H index 30a1752191d..399b8f8829e 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocityLowRe/adjointWallVelocityLowReFvPatchVectorField.H +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointWallVelocityLowRe/adjointWallVelocityLowReFvPatchVectorField.H @@ -90,15 +90,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new adjointWallVelocityLowReFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference adjointWallVelocityLowReFvPatchVectorField ( @@ -106,16 +97,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new adjointWallVelocityLowReFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointZeroInlet/adjointZeroInletFvPatchField.H b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointZeroInlet/adjointZeroInletFvPatchField.H index 62b1dc4e8c9..055493c6288 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointZeroInlet/adjointZeroInletFvPatchField.H +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointZeroInlet/adjointZeroInletFvPatchField.H @@ -90,15 +90,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new adjointZeroInletFvPatchField(*this) - ); - } - //- Construct as copy setting internal field reference adjointZeroInletFvPatchField ( @@ -106,16 +97,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new adjointZeroInletFvPatchField(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldNuaTilda/adjointFarFieldNuaTildaFvPatchScalarField.H b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldNuaTilda/adjointFarFieldNuaTildaFvPatchScalarField.H index 65d801600cf..178d8d22ba3 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldNuaTilda/adjointFarFieldNuaTildaFvPatchScalarField.H +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldNuaTilda/adjointFarFieldNuaTildaFvPatchScalarField.H @@ -89,15 +89,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new adjointFarFieldNuaTildaFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference adjointFarFieldNuaTildaFvPatchScalarField ( @@ -105,16 +96,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new adjointFarFieldNuaTildaFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldTMVar1/adjointFarFieldTMVar1FvPatchScalarField.H b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldTMVar1/adjointFarFieldTMVar1FvPatchScalarField.H index 291ea991b0f..6e80cc55fd6 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldTMVar1/adjointFarFieldTMVar1FvPatchScalarField.H +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldTMVar1/adjointFarFieldTMVar1FvPatchScalarField.H @@ -88,15 +88,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new adjointFarFieldTMVar1FvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference adjointFarFieldTMVar1FvPatchScalarField ( @@ -104,16 +95,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new adjointFarFieldTMVar1FvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldTMVar2/adjointFarFieldTMVar2FvPatchScalarField.H b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldTMVar2/adjointFarFieldTMVar2FvPatchScalarField.H index 99d5674c263..b3affc40f47 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldTMVar2/adjointFarFieldTMVar2FvPatchScalarField.H +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointFarFieldTMVar2/adjointFarFieldTMVar2FvPatchScalarField.H @@ -88,15 +88,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new adjointFarFieldTMVar2FvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference adjointFarFieldTMVar2FvPatchScalarField ( @@ -104,16 +95,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new adjointFarFieldTMVar2FvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointInletNuaTilda/adjointInletNuaTildaFvPatchScalarField.H b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointInletNuaTilda/adjointInletNuaTildaFvPatchScalarField.H index 06482f88890..dfc89cb3251 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointInletNuaTilda/adjointInletNuaTildaFvPatchScalarField.H +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointInletNuaTilda/adjointInletNuaTildaFvPatchScalarField.H @@ -92,15 +92,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new adjointInletNuaTildaFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference adjointInletNuaTildaFvPatchScalarField ( @@ -108,16 +99,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new adjointInletNuaTildaFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletFlux/adjointOutletFluxFvPatchField.H b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletFlux/adjointOutletFluxFvPatchField.H index 888ce70940a..3e8ed6f4d71 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletFlux/adjointOutletFluxFvPatchField.H +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletFlux/adjointOutletFluxFvPatchField.H @@ -88,15 +88,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new adjointOutletFluxFvPatchField(*this) - ); - } - //- Construct as copy setting internal field reference adjointOutletFluxFvPatchField ( @@ -104,16 +95,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new adjointOutletFluxFvPatchField(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletKa/adjointOutletKaFvPatchScalarField.H b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletKa/adjointOutletKaFvPatchScalarField.H index ae73acd7c34..2ce51e82e2a 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletKa/adjointOutletKaFvPatchScalarField.H +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletKa/adjointOutletKaFvPatchScalarField.H @@ -88,15 +88,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new adjointOutletKaFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference adjointOutletKaFvPatchScalarField ( @@ -104,16 +95,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new adjointOutletKaFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletNuaTilda/adjointOutletNuaTildaFvPatchScalarField.H b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletNuaTilda/adjointOutletNuaTildaFvPatchScalarField.H index 8f20dcb0ea3..4a03b1af857 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletNuaTilda/adjointOutletNuaTildaFvPatchScalarField.H +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletNuaTilda/adjointOutletNuaTildaFvPatchScalarField.H @@ -89,15 +89,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new adjointOutletNuaTildaFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference adjointOutletNuaTildaFvPatchScalarField ( @@ -105,16 +96,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new adjointOutletNuaTildaFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletNuaTildaFlux/adjointOutletNuaTildaFluxFvPatchScalarField.H b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletNuaTildaFlux/adjointOutletNuaTildaFluxFvPatchScalarField.H index 246a33a557b..ace90b07d09 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletNuaTildaFlux/adjointOutletNuaTildaFluxFvPatchScalarField.H +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletNuaTildaFlux/adjointOutletNuaTildaFluxFvPatchScalarField.H @@ -90,15 +90,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new adjointOutletNuaTildaFluxFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference adjointOutletNuaTildaFluxFvPatchScalarField ( @@ -106,16 +97,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new adjointOutletNuaTildaFluxFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletWa/adjointOutletWaFvPatchScalarField.H b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletWa/adjointOutletWaFvPatchScalarField.H index dd04e830f3f..93fb25d2d93 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletWa/adjointOutletWaFvPatchScalarField.H +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/adjointOutletWa/adjointOutletWaFvPatchScalarField.H @@ -88,15 +88,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new adjointOutletWaFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference adjointOutletWaFvPatchScalarField ( @@ -104,16 +95,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new adjointOutletWaFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/kaqRWallFunction/kaqRWallFunctionFvPatchScalarField.H b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/kaqRWallFunction/kaqRWallFunctionFvPatchScalarField.H index 7f936024166..0c549f6a5bd 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/kaqRWallFunction/kaqRWallFunctionFvPatchScalarField.H +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/kaqRWallFunction/kaqRWallFunctionFvPatchScalarField.H @@ -94,15 +94,6 @@ public: const kaqRWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new kaqRWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference kaqRWallFunctionFvPatchScalarField ( @@ -110,16 +101,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new kaqRWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/waWallFunction/waWallFunctionFvPatchScalarField.H b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/waWallFunction/waWallFunctionFvPatchScalarField.H index c1e95db2aac..f4ed962fbab 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/waWallFunction/waWallFunctionFvPatchScalarField.H +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/derivedFvPatchFields/waWallFunction/waWallFunctionFvPatchScalarField.H @@ -102,15 +102,6 @@ public: const waWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new waWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference waWallFunctionFvPatchScalarField ( @@ -118,16 +109,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new waWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/overset/oversetPolyPatch/oversetFvPatchField.H b/src/overset/oversetPolyPatch/oversetFvPatchField.H index f681a9cd641..cb22fb67268 100644 --- a/src/overset/oversetPolyPatch/oversetFvPatchField.H +++ b/src/overset/oversetPolyPatch/oversetFvPatchField.H @@ -132,15 +132,6 @@ public: //- Construct as copy oversetFvPatchField(const oversetFvPatchField<Type>&); - //- Construct and return a clone - virtual tmp<fvPatchField<Type>> clone() const - { - return tmp<fvPatchField<Type>> - ( - new oversetFvPatchField<Type>(*this) - ); - } - //- Construct as copy setting internal field reference oversetFvPatchField ( @@ -148,16 +139,19 @@ public: const DimensionedField<Type, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<Type>> clone() const + { + return fvPatchField<Type>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<Type>> clone ( const DimensionedField<Type, volMesh>& iF ) const { - return tmp<fvPatchField<Type>> - ( - new oversetFvPatchField<Type>(*this, iF) - ); + return fvPatchField<Type>::Clone(*this, iF); } diff --git a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/derivedFvPatchFields/alphaContactAngle/alphaContactAngleFvPatchScalarField.H b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/derivedFvPatchFields/alphaContactAngle/alphaContactAngleFvPatchScalarField.H index a9fac35aa3e..c48dbed8614 100644 --- a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/derivedFvPatchFields/alphaContactAngle/alphaContactAngleFvPatchScalarField.H +++ b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/derivedFvPatchFields/alphaContactAngle/alphaContactAngleFvPatchScalarField.H @@ -167,15 +167,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new alphaContactAngleFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference alphaContactAngleFvPatchScalarField ( @@ -183,16 +174,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new alphaContactAngleFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/derivedFvPatchFields/timeVaryingMassSorption/timeVaryingMassSorptionFvPatchScalarField.H b/src/phaseSystemModels/multiphaseInter/phasesSystem/derivedFvPatchFields/timeVaryingMassSorption/timeVaryingMassSorptionFvPatchScalarField.H index e054fd12dbf..de01803baf6 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/derivedFvPatchFields/timeVaryingMassSorption/timeVaryingMassSorptionFvPatchScalarField.H +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/derivedFvPatchFields/timeVaryingMassSorption/timeVaryingMassSorptionFvPatchScalarField.H @@ -175,15 +175,6 @@ public: const timeVaryingMassSorptionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new timeVaryingMassSorptionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference timeVaryingMassSorptionFvPatchScalarField ( @@ -191,16 +182,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new timeVaryingMassSorptionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphaContactAngle/alphaContactAngleFvPatchScalarField.H b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphaContactAngle/alphaContactAngleFvPatchScalarField.H index a28a4e5f54a..4c3ca140aaf 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphaContactAngle/alphaContactAngleFvPatchScalarField.H +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphaContactAngle/alphaContactAngleFvPatchScalarField.H @@ -204,15 +204,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new alphaContactAngleFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference alphaContactAngleFvPatchScalarField ( @@ -220,16 +211,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new alphaContactAngleFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.H b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.H index dbf31cc0e80..7b89c0446f2 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.H +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.H @@ -151,18 +151,6 @@ public: const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField ( @@ -170,20 +158,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H index 03bb661c89a..88d9a5418f0 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.H @@ -182,18 +182,6 @@ public: const alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField ( @@ -201,20 +189,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H index e00efd36344..3040f6566c9 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H @@ -460,15 +460,6 @@ public: const alphatWallBoilingWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new alphatWallBoilingWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference alphatWallBoilingWallFunctionFvPatchScalarField ( @@ -476,16 +467,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new alphatWallBoilingWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.H b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.H index 6c07141c7cb..97c4c47b84a 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.H +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.H @@ -127,15 +127,6 @@ public: const copiedFixedValueFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new copiedFixedValueFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference copiedFixedValueFvPatchScalarField ( @@ -143,16 +134,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new copiedFixedValueFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.H b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.H index 7ec3dd8f9b6..28f6b789c56 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.H +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.H @@ -145,15 +145,6 @@ public: const fixedMultiPhaseHeatFluxFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new fixedMultiPhaseHeatFluxFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference fixedMultiPhaseHeatFluxFvPatchScalarField ( @@ -161,16 +152,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new fixedMultiPhaseHeatFluxFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H index 77fb64736f6..49f5bde9e43 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H +++ b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H @@ -112,15 +112,6 @@ public: const JohnsonJacksonParticleSlipFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new JohnsonJacksonParticleSlipFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference JohnsonJacksonParticleSlipFvPatchVectorField ( @@ -128,16 +119,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new JohnsonJacksonParticleSlipFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H index cb4690bb41b..6396cdf9b68 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H +++ b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H @@ -115,15 +115,6 @@ public: const JohnsonJacksonParticleThetaFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new JohnsonJacksonParticleThetaFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference JohnsonJacksonParticleThetaFvPatchScalarField ( @@ -131,16 +122,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new JohnsonJacksonParticleThetaFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H index 6068281e183..45c49e2bf45 100644 --- a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H +++ b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.H @@ -113,15 +113,6 @@ public: const JohnsonJacksonParticleSlipFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new JohnsonJacksonParticleSlipFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference JohnsonJacksonParticleSlipFvPatchVectorField ( @@ -129,16 +120,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new JohnsonJacksonParticleSlipFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H index bdad64bd4ef..cff941c9efb 100644 --- a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H +++ b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.H @@ -116,15 +116,6 @@ public: const JohnsonJacksonParticleThetaFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new JohnsonJacksonParticleThetaFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference JohnsonJacksonParticleThetaFvPatchScalarField ( @@ -132,16 +123,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new JohnsonJacksonParticleThetaFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/regionFaModels/derivedFvPatchFields/filmShell/velocityFilmShellFvPatchVectorField.H b/src/regionFaModels/derivedFvPatchFields/filmShell/velocityFilmShellFvPatchVectorField.H index 56c805024d7..d9ae1a1e5d3 100644 --- a/src/regionFaModels/derivedFvPatchFields/filmShell/velocityFilmShellFvPatchVectorField.H +++ b/src/regionFaModels/derivedFvPatchFields/filmShell/velocityFilmShellFvPatchVectorField.H @@ -181,15 +181,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new velocityFilmShellFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference velocityFilmShellFvPatchVectorField ( @@ -197,16 +188,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new velocityFilmShellFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/regionFaModels/derivedFvPatchFields/thermalShell/thermalShellFvPatchScalarField.H b/src/regionFaModels/derivedFvPatchFields/thermalShell/thermalShellFvPatchScalarField.H index 1ee34af3e33..e5f98883e22 100644 --- a/src/regionFaModels/derivedFvPatchFields/thermalShell/thermalShellFvPatchScalarField.H +++ b/src/regionFaModels/derivedFvPatchFields/thermalShell/thermalShellFvPatchScalarField.H @@ -138,15 +138,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new thermalShellFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference thermalShellFvPatchScalarField ( @@ -154,16 +145,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new thermalShellFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/regionFaModels/derivedFvPatchFields/vibrationShell/vibrationShellFvPatchScalarField.H b/src/regionFaModels/derivedFvPatchFields/vibrationShell/vibrationShellFvPatchScalarField.H index af184d2aea7..f1720546d86 100644 --- a/src/regionFaModels/derivedFvPatchFields/vibrationShell/vibrationShellFvPatchScalarField.H +++ b/src/regionFaModels/derivedFvPatchFields/vibrationShell/vibrationShellFvPatchScalarField.H @@ -127,15 +127,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new vibrationShellFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference vibrationShellFvPatchScalarField ( @@ -143,16 +134,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new vibrationShellFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisRadiativeCoupledMixed/filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.H b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisRadiativeCoupledMixed/filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.H index 3b2c76c1e56..ea90811c9b1 100644 --- a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisRadiativeCoupledMixed/filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.H +++ b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisRadiativeCoupledMixed/filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.H @@ -183,18 +183,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new filmPyrolysisRadiativeCoupledMixedFvPatchScalarField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference filmPyrolysisRadiativeCoupledMixedFvPatchScalarField ( @@ -202,20 +190,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new filmPyrolysisRadiativeCoupledMixedFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.H b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.H index 3cc10f5ce67..94e43f4ea85 100644 --- a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.H +++ b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.H @@ -124,15 +124,6 @@ public: const filmPyrolysisTemperatureCoupledFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new filmPyrolysisTemperatureCoupledFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference filmPyrolysisTemperatureCoupledFvPatchScalarField ( @@ -140,16 +131,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new filmPyrolysisTemperatureCoupledFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.H b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.H index 6bbd16709ef..d8a77ee110c 100644 --- a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.H +++ b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.H @@ -125,15 +125,6 @@ public: const filmPyrolysisVelocityCoupledFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new filmPyrolysisVelocityCoupledFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference filmPyrolysisVelocityCoupledFvPatchVectorField ( @@ -141,16 +132,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new filmPyrolysisVelocityCoupledFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.H b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.H index 91b6940c3bd..7327c991a23 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.H +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.H @@ -147,15 +147,6 @@ public: const filmHeightInletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new filmHeightInletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference filmHeightInletVelocityFvPatchVectorField ( @@ -163,16 +154,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new filmHeightInletVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.H b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.H index 39bb8a36ad2..8012c12ace7 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.H +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.H @@ -110,15 +110,6 @@ public: const inclinedFilmNusseltHeightFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new inclinedFilmNusseltHeightFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference inclinedFilmNusseltHeightFvPatchScalarField ( @@ -126,16 +117,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new inclinedFilmNusseltHeightFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.H b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.H index cd5d357264a..eadaf40e350 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.H +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.H @@ -110,15 +110,6 @@ public: const inclinedFilmNusseltInletVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new inclinedFilmNusseltInletVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference inclinedFilmNusseltInletVelocityFvPatchVectorField ( @@ -126,19 +117,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new inclinedFilmNusseltInletVelocityFvPatchVectorField - ( - *this, iF - ) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.H b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.H index 18f448f15f4..9f1cff6ee5a 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.H +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.H @@ -162,15 +162,6 @@ public: const alphatFilmWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new alphatFilmWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference alphatFilmWallFunctionFvPatchScalarField ( @@ -178,16 +169,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new alphatFilmWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/nutkFilmWallFunction/nutkFilmWallFunctionFvPatchScalarField.H b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/nutkFilmWallFunction/nutkFilmWallFunctionFvPatchScalarField.H index d7ebbf2c457..0b4099ec0ec 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/nutkFilmWallFunction/nutkFilmWallFunctionFvPatchScalarField.H +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/nutkFilmWallFunction/nutkFilmWallFunctionFvPatchScalarField.H @@ -158,15 +158,6 @@ public: const nutkFilmWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new nutkFilmWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference nutkFilmWallFunctionFvPatchScalarField ( @@ -174,16 +165,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new nutkFilmWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.H b/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.H index 26fdc2cf274..0402f973e09 100644 --- a/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.H +++ b/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.H @@ -301,16 +301,6 @@ public: const fvPatchFieldMapper& ); - - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new thermalBaffleFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference thermalBaffleFvPatchScalarField ( @@ -318,16 +308,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new thermalBaffleFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/sixDoFRigidBodyMotion/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.H b/src/sixDoFRigidBodyMotion/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.H index e67f00ff6ac..8102ff9bd1f 100644 --- a/src/sixDoFRigidBodyMotion/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.H +++ b/src/sixDoFRigidBodyMotion/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.H @@ -122,18 +122,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<vector>> clone() const - { - return autoPtr<pointPatchField<vector>> - ( - new sixDoFRigidBodyDisplacementPointPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference sixDoFRigidBodyDisplacementPointPatchVectorField ( @@ -141,20 +129,19 @@ public: const DimensionedField<vector, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<vector>> clone() const + { + return pointPatchField<vector>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<vector>> clone ( const DimensionedField<vector, pointMesh>& iF ) const { - return autoPtr<pointPatchField<vector>> - ( - new sixDoFRigidBodyDisplacementPointPatchVectorField - ( - *this, - iF - ) - ); + return pointPatchField<vector>::Clone(*this, iF); } diff --git a/src/sixDoFRigidBodyMotion/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.H b/src/sixDoFRigidBodyMotion/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.H index 9bc259d00e7..670ad02a3e1 100644 --- a/src/sixDoFRigidBodyMotion/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.H +++ b/src/sixDoFRigidBodyMotion/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.H @@ -97,18 +97,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<vector>> clone() const - { - return autoPtr<pointPatchField<vector>> - ( - new uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField ( @@ -116,20 +104,19 @@ public: const DimensionedField<vector, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<vector>> clone() const + { + return pointPatchField<vector>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<vector>> clone ( const DimensionedField<vector, pointMesh>& iF ) const { - return autoPtr<pointPatchField<vector>> - ( - new uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField - ( - *this, - iF - ) - ); + return pointPatchField<vector>::Clone(*this, iF); } diff --git a/src/thermoTools/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.H b/src/thermoTools/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.H index 836ce9249bc..9e7fcd048e5 100644 --- a/src/thermoTools/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.H +++ b/src/thermoTools/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.H @@ -143,15 +143,6 @@ public: const convectiveHeatTransferFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new convectiveHeatTransferFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference convectiveHeatTransferFvPatchScalarField ( @@ -159,16 +150,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new convectiveHeatTransferFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermoTools/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H b/src/thermoTools/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H index bad3c6db95c..b711dbd2aef 100644 --- a/src/thermoTools/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H +++ b/src/thermoTools/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H @@ -224,15 +224,6 @@ public: const externalWallHeatFluxTemperatureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new externalWallHeatFluxTemperatureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference externalWallHeatFluxTemperatureFvPatchScalarField ( @@ -240,16 +231,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new externalWallHeatFluxTemperatureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermoTools/derivedFvPatchFields/fixedIncidentRadiation/fixedIncidentRadiationFvPatchScalarField.H b/src/thermoTools/derivedFvPatchFields/fixedIncidentRadiation/fixedIncidentRadiationFvPatchScalarField.H index cb4aae6c513..5ae31ccddd0 100644 --- a/src/thermoTools/derivedFvPatchFields/fixedIncidentRadiation/fixedIncidentRadiationFvPatchScalarField.H +++ b/src/thermoTools/derivedFvPatchFields/fixedIncidentRadiation/fixedIncidentRadiationFvPatchScalarField.H @@ -134,19 +134,6 @@ public: const fixedIncidentRadiationFvPatchScalarField& ); - - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new fixedIncidentRadiationFvPatchScalarField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference fixedIncidentRadiationFvPatchScalarField ( @@ -154,27 +141,25 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new fixedIncidentRadiationFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } // Member functions - - // Mapping functions + // Mapping functions //- Map (and resize as needed) from self given a mapping object virtual void autoMap(const fvPatchFieldMapper&); diff --git a/src/thermoTools/derivedFvPatchFields/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.H b/src/thermoTools/derivedFvPatchFields/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.H index 64cfd0f070e..dba84d973bd 100644 --- a/src/thermoTools/derivedFvPatchFields/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.H +++ b/src/thermoTools/derivedFvPatchFields/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.H @@ -332,18 +332,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new humidityTemperatureCoupledMixedFvPatchScalarField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference humidityTemperatureCoupledMixedFvPatchScalarField ( @@ -351,20 +339,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new humidityTemperatureCoupledMixedFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermoTools/derivedFvPatchFields/lumpedMassWallTemperature/lumpedMassWallTemperatureFvPatchScalarField.H b/src/thermoTools/derivedFvPatchFields/lumpedMassWallTemperature/lumpedMassWallTemperatureFvPatchScalarField.H index c657b4cc72a..5d961e010c0 100644 --- a/src/thermoTools/derivedFvPatchFields/lumpedMassWallTemperature/lumpedMassWallTemperatureFvPatchScalarField.H +++ b/src/thermoTools/derivedFvPatchFields/lumpedMassWallTemperature/lumpedMassWallTemperatureFvPatchScalarField.H @@ -135,15 +135,6 @@ public: const lumpedMassWallTemperatureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new lumpedMassWallTemperatureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference lumpedMassWallTemperatureFvPatchScalarField ( @@ -151,16 +142,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new lumpedMassWallTemperatureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermoTools/derivedFvPatchFields/outletMachNumberPressure/outletMachNumberPressureFvPatchScalarField.H b/src/thermoTools/derivedFvPatchFields/outletMachNumberPressure/outletMachNumberPressureFvPatchScalarField.H index ea0a8ed59d6..ad4cf26abf1 100644 --- a/src/thermoTools/derivedFvPatchFields/outletMachNumberPressure/outletMachNumberPressureFvPatchScalarField.H +++ b/src/thermoTools/derivedFvPatchFields/outletMachNumberPressure/outletMachNumberPressureFvPatchScalarField.H @@ -216,15 +216,6 @@ public: const outletMachNumberPressureFvPatchScalarField& tppsf ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new outletMachNumberPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference outletMachNumberPressureFvPatchScalarField ( @@ -232,16 +223,19 @@ public: const DimensionedField<scalar, volMesh>& iF ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new outletMachNumberPressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermoTools/derivedFvPatchFields/outletMappedUniformInletHeatAddition/outletMappedUniformInletHeatAdditionFvPatchField.H b/src/thermoTools/derivedFvPatchFields/outletMappedUniformInletHeatAddition/outletMappedUniformInletHeatAdditionFvPatchField.H index 0640c2a39e5..844000f9049 100644 --- a/src/thermoTools/derivedFvPatchFields/outletMappedUniformInletHeatAddition/outletMappedUniformInletHeatAdditionFvPatchField.H +++ b/src/thermoTools/derivedFvPatchFields/outletMappedUniformInletHeatAddition/outletMappedUniformInletHeatAdditionFvPatchField.H @@ -142,15 +142,6 @@ public: const outletMappedUniformInletHeatAdditionFvPatchField& ); - //- Construct and return a clone - virtual tmp<fvPatchField<scalar>> clone() const - { - return tmp<fvPatchField<scalar>> - ( - new outletMappedUniformInletHeatAdditionFvPatchField(*this) - ); - } - //- Construct as copy setting internal field reference outletMappedUniformInletHeatAdditionFvPatchField ( @@ -158,16 +149,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchField<scalar>> - ( - new outletMappedUniformInletHeatAdditionFvPatchField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.H b/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.H index db2c6292bc6..58ae15b2c45 100644 --- a/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.H +++ b/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.H @@ -143,15 +143,6 @@ public: const semiPermeableBaffleMassFractionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new semiPermeableBaffleMassFractionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference semiPermeableBaffleMassFractionFvPatchScalarField ( @@ -159,20 +150,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new semiPermeableBaffleMassFractionFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.H b/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.H index 72824c12d80..56e08da2f22 100644 --- a/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.H +++ b/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.H @@ -126,15 +126,6 @@ public: const semiPermeableBaffleVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new semiPermeableBaffleVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference semiPermeableBaffleVelocityFvPatchVectorField ( @@ -142,20 +133,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new semiPermeableBaffleVelocityFvPatchVectorField - ( - *this, - iF - ) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/thermoTools/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.H b/src/thermoTools/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.H index 075b9dc26d6..69c61b466e7 100644 --- a/src/thermoTools/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.H +++ b/src/thermoTools/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.H @@ -198,15 +198,6 @@ public: const thermalBaffle1DFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new thermalBaffle1DFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference thermalBaffle1DFvPatchScalarField ( @@ -214,16 +205,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new thermalBaffle1DFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermoTools/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.H b/src/thermoTools/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.H index 4a6faa495e0..d59c2bda695 100644 --- a/src/thermoTools/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.H +++ b/src/thermoTools/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.H @@ -107,16 +107,6 @@ public: const totalFlowRateAdvectiveDiffusiveFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchField<scalar>> clone() const - { - return tmp<fvPatchField<scalar>> - ( - new - totalFlowRateAdvectiveDiffusiveFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference totalFlowRateAdvectiveDiffusiveFvPatchScalarField ( @@ -124,28 +114,24 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchField<scalar>> - ( - new - totalFlowRateAdvectiveDiffusiveFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } // Member functions - - // Mapping functions //- Map (and resize as needed) from self given a mapping object diff --git a/src/thermoTools/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H b/src/thermoTools/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H index 7de8e9d7a37..e4e621a55cd 100644 --- a/src/thermoTools/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H +++ b/src/thermoTools/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H @@ -170,18 +170,6 @@ public: const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new turbulentTemperatureCoupledBaffleMixedFvPatchScalarField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference turbulentTemperatureCoupledBaffleMixedFvPatchScalarField ( @@ -189,20 +177,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new turbulentTemperatureCoupledBaffleMixedFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermoTools/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H b/src/thermoTools/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H index 44a721daa25..0fc48788c6f 100644 --- a/src/thermoTools/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H +++ b/src/thermoTools/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H @@ -270,18 +270,6 @@ public: const turbulentTemperatureRadCoupledMixedFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new turbulentTemperatureRadCoupledMixedFvPatchScalarField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference turbulentTemperatureRadCoupledMixedFvPatchScalarField ( @@ -289,20 +277,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new turbulentTemperatureRadCoupledMixedFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermoTools/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.H b/src/thermoTools/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.H index 9a35d35a78b..ed6a596d40f 100644 --- a/src/thermoTools/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.H +++ b/src/thermoTools/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.H @@ -171,15 +171,6 @@ public: const alphatJayatillekeWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new alphatJayatillekeWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference alphatJayatillekeWallFunctionFvPatchScalarField ( @@ -187,20 +178,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new alphatJayatillekeWallFunctionFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermoTools/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H b/src/thermoTools/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H index ae11c223a63..611c6ae15aa 100644 --- a/src/thermoTools/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H +++ b/src/thermoTools/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H @@ -146,15 +146,6 @@ public: const alphatWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new alphatWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference alphatWallFunctionFvPatchScalarField ( @@ -162,16 +153,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new alphatWallFunctionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermoTools/derivedFvPatchFields/wallFunctions/sorptionWallFunction/sorptionWallFunctionFvPatchScalarField.H b/src/thermoTools/derivedFvPatchFields/wallFunctions/sorptionWallFunction/sorptionWallFunctionFvPatchScalarField.H index bcc7c2522ea..0f069a3df23 100644 --- a/src/thermoTools/derivedFvPatchFields/wallFunctions/sorptionWallFunction/sorptionWallFunctionFvPatchScalarField.H +++ b/src/thermoTools/derivedFvPatchFields/wallFunctions/sorptionWallFunction/sorptionWallFunctionFvPatchScalarField.H @@ -251,15 +251,6 @@ public: const sorptionWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new sorptionWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference sorptionWallFunctionFvPatchScalarField ( @@ -267,20 +258,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new sorptionWallFunctionFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermoTools/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.H b/src/thermoTools/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.H index 356273dc7dc..09ffb7826c0 100644 --- a/src/thermoTools/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.H +++ b/src/thermoTools/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.H @@ -121,15 +121,6 @@ public: const wallHeatTransferFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new wallHeatTransferFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference wallHeatTransferFvPatchScalarField ( @@ -137,16 +128,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new wallHeatTransferFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.H index 86bd3df4ab5..674eebcfa8d 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.H @@ -100,15 +100,6 @@ public: const energyJumpFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchField<scalar>> clone() const - { - return tmp<fvPatchField<scalar>> - ( - new energyJumpFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference energyJumpFvPatchScalarField ( @@ -116,16 +107,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchField<scalar>> - ( - new energyJumpFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.H index 8164adca40e..023632aaab8 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.H @@ -100,15 +100,6 @@ public: const energyJumpAMIFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchField<scalar>> clone() const - { - return tmp<fvPatchField<scalar>> - ( - new energyJumpAMIFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference energyJumpAMIFvPatchScalarField ( @@ -116,16 +107,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchField<scalar>> - ( - new energyJumpAMIFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.H index 6f6572a40d7..86afb41ab81 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.H @@ -108,15 +108,6 @@ public: const fixedEnergyFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new fixedEnergyFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference fixedEnergyFvPatchScalarField ( @@ -124,16 +115,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new fixedEnergyFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.H index bf84e88d0bb..8e8c2a61dc7 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.H @@ -123,15 +123,6 @@ public: const gradientEnergyFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new gradientEnergyFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference gradientEnergyFvPatchScalarField ( @@ -139,16 +130,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new gradientEnergyFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.H index 918300f68f4..e7b01cf743c 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.H @@ -99,15 +99,6 @@ public: const mixedEnergyFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new mixedEnergyFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference mixedEnergyFvPatchScalarField ( @@ -115,16 +106,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new mixedEnergyFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.H index 0f7e73da03d..2fde200cf80 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.H @@ -127,15 +127,6 @@ public: const MarshakRadiationFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new MarshakRadiationFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference MarshakRadiationFvPatchScalarField ( @@ -143,16 +134,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new MarshakRadiationFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.H index 71da65c388d..ea583586243 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.H @@ -127,15 +127,6 @@ public: const MarshakRadiationFixedTemperatureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new MarshakRadiationFixedTemperatureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference MarshakRadiationFixedTemperatureFvPatchScalarField ( @@ -143,20 +134,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new MarshakRadiationFixedTemperatureFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H index bab87648027..c66e6fabbc6 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H @@ -151,15 +151,6 @@ public: const greyDiffusiveRadiationMixedFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new greyDiffusiveRadiationMixedFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference greyDiffusiveRadiationMixedFvPatchScalarField ( @@ -167,16 +158,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new greyDiffusiveRadiationMixedFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.H index c99ce057cd0..b8cd2bfd7ca 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.H @@ -125,15 +125,6 @@ public: const greyDiffusiveViewFactorFixedValueFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new greyDiffusiveViewFactorFixedValueFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference greyDiffusiveViewFactorFixedValueFvPatchScalarField ( @@ -141,20 +132,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new greyDiffusiveViewFactorFixedValueFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/specularRadiation/specularRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/specularRadiation/specularRadiationMixedFvPatchScalarField.H index bc456ae4fe3..3fd12a61d78 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/specularRadiation/specularRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/specularRadiation/specularRadiationMixedFvPatchScalarField.H @@ -169,15 +169,6 @@ public: const specularRadiationMixedFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchField<scalar> > clone() const - { - return tmp<fvPatchField<scalar> > - ( - new specularRadiationMixedFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference specularRadiationMixedFvPatchScalarField ( @@ -185,16 +176,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchField<scalar> > clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchField<scalar> > - ( - new specularRadiationMixedFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H index 112aa9610fa..baf4640efa7 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H @@ -116,15 +116,6 @@ public: const wideBandDiffusiveRadiationMixedFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new wideBandDiffusiveRadiationMixedFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference wideBandDiffusiveRadiationMixedFvPatchScalarField ( @@ -132,23 +123,24 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new wideBandDiffusiveRadiationMixedFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } // Member functions - - // Evaluation functions //- Update the coefficients associated with the patch field diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/enthalpySorption/enthalpySorptionFvPatchScalarField.H b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/enthalpySorption/enthalpySorptionFvPatchScalarField.H index f232c79c714..87dde766df2 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/enthalpySorption/enthalpySorptionFvPatchScalarField.H +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/enthalpySorption/enthalpySorptionFvPatchScalarField.H @@ -210,15 +210,6 @@ public: const enthalpySorptionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new enthalpySorptionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference enthalpySorptionFvPatchScalarField ( @@ -226,16 +217,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new enthalpySorptionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H index e996cfcb5af..9ff483132a5 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H @@ -95,15 +95,6 @@ public: const fixedUnburntEnthalpyFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new fixedUnburntEnthalpyFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference fixedUnburntEnthalpyFvPatchScalarField ( @@ -111,16 +102,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new fixedUnburntEnthalpyFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H index 2ca2ef4321e..99573406a24 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H @@ -95,15 +95,6 @@ public: const gradientUnburntEnthalpyFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new gradientUnburntEnthalpyFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference gradientUnburntEnthalpyFvPatchScalarField ( @@ -111,16 +102,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new gradientUnburntEnthalpyFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H index c4f6c10172d..83986020192 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H @@ -95,15 +95,6 @@ public: const mixedUnburntEnthalpyFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new mixedUnburntEnthalpyFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference mixedUnburntEnthalpyFvPatchScalarField ( @@ -111,16 +102,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new mixedUnburntEnthalpyFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/speciesSorption/speciesSorptionFvPatchScalarField.H b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/speciesSorption/speciesSorptionFvPatchScalarField.H index 140492c752e..0608a848209 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/speciesSorption/speciesSorptionFvPatchScalarField.H +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/speciesSorption/speciesSorptionFvPatchScalarField.H @@ -245,15 +245,6 @@ public: const speciesSorptionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new speciesSorptionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference speciesSorptionFvPatchScalarField ( @@ -261,16 +252,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new speciesSorptionFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H index 72dea9c83c2..74325b5d1ea 100644 --- a/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H @@ -103,15 +103,6 @@ public: const constantAlphaContactAngleFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new constantAlphaContactAngleFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference constantAlphaContactAngleFvPatchScalarField ( @@ -119,16 +110,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new constantAlphaContactAngleFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H index 29f6444350d..97619869a19 100644 --- a/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H @@ -109,15 +109,6 @@ public: const dynamicAlphaContactAngleFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new dynamicAlphaContactAngleFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference dynamicAlphaContactAngleFvPatchScalarField ( @@ -125,16 +116,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new dynamicAlphaContactAngleFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/transportModels/twoPhaseProperties/alphaContactAngle/temperatureDependentAlphaContactAngle/temperatureDependentAlphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseProperties/alphaContactAngle/temperatureDependentAlphaContactAngle/temperatureDependentAlphaContactAngleFvPatchScalarField.H index 8817bd35bf8..4193eeb2571 100644 --- a/src/transportModels/twoPhaseProperties/alphaContactAngle/temperatureDependentAlphaContactAngle/temperatureDependentAlphaContactAngleFvPatchScalarField.H +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/temperatureDependentAlphaContactAngle/temperatureDependentAlphaContactAngleFvPatchScalarField.H @@ -128,18 +128,6 @@ public: const temperatureDependentAlphaContactAngleFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new temperatureDependentAlphaContactAngleFvPatchScalarField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference temperatureDependentAlphaContactAngleFvPatchScalarField ( @@ -147,20 +135,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new temperatureDependentAlphaContactAngleFvPatchScalarField - ( - *this, - iF - ) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H b/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H index 97ffe143311..b6167db8011 100644 --- a/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H @@ -96,15 +96,6 @@ public: const fvPatchFieldMapper& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new timeVaryingAlphaContactAngleFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference timeVaryingAlphaContactAngleFvPatchScalarField ( @@ -112,16 +103,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new timeVaryingAlphaContactAngleFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H b/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H index 555939fda06..11f4ed7adab 100644 --- a/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H +++ b/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H @@ -97,15 +97,6 @@ public: const alphaFixedPressureFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new alphaFixedPressureFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference alphaFixedPressureFvPatchScalarField ( @@ -113,16 +104,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new alphaFixedPressureFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/waveModels/derivedFvPatchFields/waveAlpha/waveAlphaFvPatchScalarField.H b/src/waveModels/derivedFvPatchFields/waveAlpha/waveAlphaFvPatchScalarField.H index ce5855721fb..419aba0d1e9 100644 --- a/src/waveModels/derivedFvPatchFields/waveAlpha/waveAlphaFvPatchScalarField.H +++ b/src/waveModels/derivedFvPatchFields/waveAlpha/waveAlphaFvPatchScalarField.H @@ -117,15 +117,6 @@ public: const waveAlphaFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new waveAlphaFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference waveAlphaFvPatchScalarField ( @@ -133,16 +124,19 @@ public: const DimensionedField<scalar, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone + //- Return a clone + virtual tmp<fvPatchField<scalar>> clone() const + { + return fvPatchField<scalar>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<scalar>> clone ( const DimensionedField<scalar, volMesh>& iF ) const { - return tmp<fvPatchScalarField> - ( - new waveAlphaFvPatchScalarField(*this, iF) - ); + return fvPatchField<scalar>::Clone(*this, iF); } diff --git a/src/waveModels/derivedFvPatchFields/waveVelocity/waveVelocityFvPatchVectorField.H b/src/waveModels/derivedFvPatchFields/waveVelocity/waveVelocityFvPatchVectorField.H index 6e3860fefe9..de82730c32d 100644 --- a/src/waveModels/derivedFvPatchFields/waveVelocity/waveVelocityFvPatchVectorField.H +++ b/src/waveModels/derivedFvPatchFields/waveVelocity/waveVelocityFvPatchVectorField.H @@ -117,15 +117,6 @@ public: const waveVelocityFvPatchVectorField& ); - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new waveVelocityFvPatchVectorField(*this) - ); - } - //- Construct as copy setting internal field reference waveVelocityFvPatchVectorField ( @@ -133,16 +124,19 @@ public: const DimensionedField<vector, volMesh>& ); - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone + //- Return a clone + virtual tmp<fvPatchField<vector>> clone() const + { + return fvPatchField<vector>::Clone(*this); + } + + //- Clone with an internal field reference + virtual tmp<fvPatchField<vector>> clone ( const DimensionedField<vector, volMesh>& iF ) const { - return tmp<fvPatchVectorField> - ( - new waveVelocityFvPatchVectorField(*this, iF) - ); + return fvPatchField<vector>::Clone(*this, iF); } diff --git a/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.H b/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.H index e71e9044efa..b82a92cccaf 100644 --- a/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.H +++ b/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.H @@ -248,18 +248,6 @@ public: const pointPatchFieldMapper& ); - //- Construct and return a clone - virtual autoPtr<pointPatchField<vector>> clone() const - { - return autoPtr<pointPatchField<vector>> - ( - new waveMakerPointPatchVectorField - ( - *this - ) - ); - } - //- Construct as copy setting internal field reference waveMakerPointPatchVectorField ( @@ -267,20 +255,19 @@ public: const DimensionedField<vector, pointMesh>& ); + //- Return a clone + virtual autoPtr<pointPatchField<vector>> clone() const + { + return pointPatchField<vector>::Clone(*this); + } + //- Construct and return a clone setting internal field reference virtual autoPtr<pointPatchField<vector>> clone ( const DimensionedField<vector, pointMesh>& iF ) const { - return autoPtr<pointPatchField<vector>> - ( - new waveMakerPointPatchVectorField - ( - *this, - iF - ) - ); + return pointPatchField<vector>::Clone(*this, iF); } -- GitLab