diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.H b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.H index 0ac35141e652c56b14057b8a3f20a19444fa09e7..ef03d5e198cfab5dea8c3ae35c3ff9e7b86a6013 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 1ebe0338aee38afbda11ef210e732934c1351363..50862433b390996ba9719a7fbc8000950d723c74 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 28587acacaa9cec1b1e2d7f11604195fdb55abbb..85fff0f1c88ea143db5f085b8881f6d38b323640 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 072a0d28075bfa2fa27ebecfc91cd4feba04d9a0..3268eab8d34bd6c114af2a66af4802be4999f62a 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 d64974874526bfa4e265a8d24b636e8ede3e9788..a6bd29689c390e39adb6f33b5ff62fe79440dda3 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 6a1357a8204df98b6be9fae955d94fa0c1fb3dca..5256fdfbd0580b3f0748ce7281044aee73417ae2 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 2863677d8343895bd7dc383305e271b8c84c9b41..208c574975cfab7d3c3d9db54d4a7925a420f875 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 433ae213e2cdadb165688096482ea48ea4feabd7..c84ffe069283cb70f56cbf6fa0b8fcd4cd8380da 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 9c13942f156a4bfbfd1fed50860b6e50a6cb9ebf..b20d6f64ccc3cdac10cdb836f9edf32a86861c3f 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 52c2593a1a0de85b6cab7591f0b4f48ee7347301..6590915eb6130ca1339edbb177073e5b05e3ca97 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 1baf7be91e73294948c3241c02d044886ef48d3d..92f61528f660bd388c2eb2b4ae42e8de7d8bcbf8 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 d46cd3e1a6f38c8ac2ecad65efad26f08830b40b..3fef28149c84f06b7250ce1d246f719c70b70b29 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 74195dc8df5b3dc1a5f56245bba701446d98c8d6..8e9ee59f8236015b892d6940774e87be746aa68c 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 c94efce3dd75698ae73b793d3350040905ab037b..20cb347469c38a61a076143928ead31c05598ed6 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 44c460d5c6b8689e3655d23d86b84c56c1ce9283..220be3b830cedd3a1f86b255bd13473d5edd66e5 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 42189f5a278306ff1cf77b06d7803c6f8382f2cf..a3f040c7fac63a3d8091e15e9925c40a9e8945fc 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 616743df38a6336ef95818e698e78010884c0b27..a70e06f7320501d07b127237bf5a116fd40f2e92 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 06203b7ad85e2a52e628aa0ca035afc32ae152bf..c325c8552924547325a18e03c51f3b83d8cab699 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 2bd1a9e993c8bfdd6c8ca570a9a915318a9e1301..377be7993047c3729435ade1efff1c89bee19cbd 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 ca91d23cff70e5a9703119d37b3b4e552b7330d6..14ac2777e1839c3b7e06b0cafadf1097961ae4d8 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 f8cccfa7b0139e3a81322fd3c9df710052473f95..80e5905a4e2e0718f7843bf6d23e36e611d3c805 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 600fc2080be3caec74474549d31a3ac6a9c57b45..628ae11ae9a84b1521167a265b7819d3f2d79300 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 dc2c9fc903f788f8a90fb20384841477d8d2d373..a865ee9ee7748eb4ca7a29f76f590dcbb564f450 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 982884b84a3c8f978c3746d2949d0280003ca1e2..8808cc3a0abfb54f3f283053d9743dc472b6339d 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 ed9f82d6692b449a56e9f277e2c0bbe0baca4a8e..61f0962398c1115253a39179d7e2306e60d76a50 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 7dd46e4f74dcac65e1021da30908e95fb8b51a9b..a5eed9049d410ba8475b371d1c462873f512d278 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 7be7b6ff01eb45dda1c967c166a5c6ff4ac4b38b..8a9192bd16b33d1f3aca5671ca2850b2868f3d66 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 1422a6132058cc28150aba0d010b6ef3747dc6aa..1b9b545902687b9c587285f77e12ef69819a90d2 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 7b2ebc85869f34f100829ed3eda19d5c6494bc64..436076f52142aeed8aa5df93c14809d68d962fe0 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 438acf74ce304932e93cfaf058a8a9663629b4d7..9999047742a94499d77317159d0a4ef4a3f63aaa 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 d4c031350ed67fae5bd2456d0cd8fc479fdd9d9a..bdfa66a5a8f71614eab224d507cc1e5a3b030218 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 027cc956ad2769b7e8f9defe56a92939d88aecb7..cae5ae25506b6f4dc680975e79f3f752c2151c3c 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 2fe588648acdafa6ed384339aa93775d6060b65b..88de0d0d09e88784cc573044804c973e3b9a1c7a 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 011569f452cd1237c47ed9183180c79bc64033f8..543b7f57cf99388e2d601c7287fc7bb8ce94eb25 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 e0e9d41ab06730a717c12a9a7214c7483095b2ff..7f7a2d2d177310f163e6a6655d34b82aa9d4ff4a 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 9246a2853632b85660aa888ec03d1fc64333dc3b..e32721ee5c7d1683d01ec5fe2ef49b9ecb244098 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 4ea6936c7ee5b9fa3b760a9957646e367a42d281..c89a8cb0dbb1369599d9388566ef9c77a2e9406c 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 0077f5ed27ae0afbfd3ce755ea91ec5ae0b66871..158130e4c5aa37dca56deb45c8799f3b102e251b 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 0fb4f64e3f6e91ec24dc575e68eb93f8cd75d221..e99ee74e9ab0f6ccc701d541bbe5a098eb529009 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 db8c5fa6c6ffcddce13e4f959101f9489290a02e..622df17ae6858775dd4b0165efe75ac6cbeff00e 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 9ddf258d94f44b9a3402afb15e9877b919a0f6ce..6c3aef724d0b05a44515cf06a92d536bd0c043fa 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 0c8d12d140232278a8244d51f2cefb4fcc798c88..b552a4cf48948eac62d91a5fda39778c3e04588b 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 b90fd8a988da4a734c622418fdfcd917832bb36f..2c2cf4eff9406e64255d6dcc5b3d6998a1cc0764 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 3f84c8be6f472bab56534b08759d4dc28763a9f2..351bf184747bd5b1a43436ce4594bee6f7408e6f 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 9a9e747781c68970cc5600e318e2f1ad057ba0ab..efcd889d931c4da63905f0579892237b1ec862cc 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 09935152a5a77355537206891bee2ad26478c77d..edac484a4f77e34fa11ab5e12eea85f144acd901 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 18cb1277384c77d191ceff750d1d54a40055993d..e2010c780c47edd189fab038f3afed8f97d47dd5 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 9b96cb2b68ab8ec2cc63731340d8fbe53a0ef41e..81f8ecaf9521b768f4aab6ec1f9b65c1b99925a5 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 1f1da1e629cf343b6c6987bbfd888c8d3c40f1e5..322819f8bbc62163db43589aebd7e27ace6460cc 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 e04791c48ba64f2740c675f8cca01fabd6a2108c..5691a52d087d76d5852325931504d3be9a611ef3 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 4fb98c8c34f9c195a4dc829fea58cc4f3ba27be8..0e0e25f9083f27d689f48754b7d22d3b1ce978fb 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 2641003b1f7d4cf8b46dd408a82bbc62ff547ee2..f718dbeca3b8edba27ad41e0cb4e44a70d6f0708 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 e2d8d70213d677cef2b3942ec57ff370c4f86447..db567693f70819b23b75297c31fa3f57da161951 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 ffe51f9d3746af6414bc07236213b3de6ea4dbff..b1c0d08eca60dcb9353d9fb8792231ddf5a7b3a9 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 ddbbd8179e49c76148887a333217e8acd0adfaeb..fc541a22b7f25e0dd40474782af021df4f9d42be 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 af5169c21109dc8beace617d0d3d1ad43f82bd8a..003299c83f32132d40a0cacea8fe5c3fdcf944cb 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 3280cedc7d7761d7e4542ecfae8085b5b40fada6..94e6583857dcca8eb7a8cf53422aa61ab6649469 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 e80434bf4739fb9d6bf055f0f8f27c4b85a85181..3101206000bb2427426310c82f7e26e5d9cceca9 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 c006c0249aa6770472132332638d958f0180b813..8dc5162c0e26755a45db91b892420ccad1b88aa8 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 2cace45acf502a35da104215483c6ace6e10006c..ecb892deab86a8a995d543c25fa7aed904c7af5a 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 0dce8f571cf3776f932e24eaa73716bf23601f0c..f17cbf217ef8c1cf0e4fd570cc6d295b14a0d008 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 49b7a099921c3d42a6560614c3cda78cb8503e59..a3439bed586b5fa4fd5ce70e5c7644e7fd5e15ac 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 818ce6ba41b5ec526020e2af2e090a5a38500a88..95a7f26b429dbc209bca2126e31b97e363911e87 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 77c81522deae2680dbf142d22af3fcae398369be..500a4aa322e04cd0d68c5c16571c9581f91f3937 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 1ed9211e1b6748cc758a015000593b9f5f5c5940..2a61023250452e7dd99fb9a375b23d7506545661 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 6e6ae1696c6241f731808718ac4cb5852b28cd4c..9772728ab5aa452bb69def2da72240941b495fc8 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 4f8eefa33c310b5d6134796f49ec18f8f26f85f3..53b7f314f1835c04397ab9c9cd102ebc0ae6a381 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 9f180b65f2187a6316b21e4651ed4d55357e0fe7..07f612924d528f70f778e6d228cac4546d4c1d94 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 0c6232d962053898dbf8d9826ca5530db5c331f9..616d257fe482ac17c4fcd61f75b88dbf63a67023 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 c326fe3d63a365e847ee7296ca4226eec7df0d52..1c618f3f7f0e8b0a55d04df5f464773ec3ef56b1 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 abedc113279bbbf391b7380361111afbcbcf2a60..760d9668b461153847857119ba31ccc1c22feb23 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 b99f739ee9de0b06b945f31f0818bf439138b925..fa3f891e13ac5efab5c86ba835c08dad9b21f197 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 f4d0bdbab504c786df6fa6759d950a6fd5551b75..16f0e01da09c5ae9690031811e67fdb5172b9580 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 becbcfcf051b0ed31554e54e752fa4f8dce650ab..fb9846b1482a1c8da44e9f07a1461fe8bdc2a197 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 8afba50b8e3213e9f365d002c80c12910b33685d..dcee956514f0179ba8ecb59e41af5fe7b57193d2 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 7915ed2fc14f229712b8a3d8db5bd23f2a638599..f4515b6a59a9d4c05cfb3a597492fc8c70a12407 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 ba4a9dff763954aff75a63932c333d25a3ec76ea..407c9a9b1509c81a24c893f220ab8f684132bb36 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 359800d18cd52ccef2bba60c02da544aa789232c..5ac2a891c5ea2bf8190539a59cd8ae3562ce024f 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 f21c228ad6cdfdf50c642e5c33d8d1f531c9d22e..de754592bebdd746a0d0216ffc7f4dcfbb42654d 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 32bc5e91ad8d96c37176bc2f9c8a51632a1fad74..06736b61b3004d16ce4d15f2b86d64f5d699931c 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 7233d56e893f2584ec15fd11e6b897b39845146f..e09d2aea515aa00a37a3d7c52944e83b99a0c57b 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 f1933ec1ab15d72f23d2b750772f9058698d8bcf..f417f28c4057fda54c698f4f5505b7d2d39873bb 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 de365d612c578983609c8e689946760352953fc5..828937bb6ca82d82183a11cc5f29815513f9d43c 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 dd4718cd35a339ddd25254a43bec8a2989ddfa74..8a6c8dffb94aa3105e124155fce3d52d844d6c4c 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 d6b63c61c4d5e676de3206d4739a9fa1d3c490a7..80b1522c26e9fbda07d681f8ae49a2b7ca0b614b 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 6d83692442aacdd41584949571f9d32eafafcae7..29a2d67a5fb81fb66d634c36a98259a53d604715 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 88abbde9c844168c870eba4cd02156171dc24621..02cb6831c730a4949f7b708fe3c126ea588e12e1 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 3b9187c63bc6a85ff234171d0f6df59388497a81..e46a1d25b228e0aeb02292c282ac9dac84d55c83 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 f140258de071dc580c036a7453e092b371f0c15c..32996ee3845235780c464155af8b1e133f842d9e 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 70154cc728ad4e21870675455d70278d735d52ae..1e56baf866a6bd012ae3ec7354789c76b6959e58 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 7340d59a201ce3b1524ae7b259a3f9210ff77541..4c049d4f45b55bbaf84b83a52625b6119af49db3 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 4af170d7b80533075a3fdea3e8f5704cbee04c23..3bb102745874767572a9f11522e0a911e4e8f4cf 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 620a16dbad649fc9a826a99950e4ae03e8ef0e7b..ab3182b3a4721fd2d0f6ae815ac448cf7c9e4cc4 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 f2c438325badd8ca55a5780db486612c13221900..e99ab8dae0eb67e039b0a8544d2d16f8c8b608dd 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 5fc16ad869c6eb36ab888231bc60b89a90a108b4..ad447c3321791cae6360ac0843db12764bca533d 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 723426ff2e93532e9e3c4a2ea7dffa330e1982aa..745414151c4db81c17bc8fd1dec241be02276b00 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 507cb9ad0ff50c27a97a68b244e6d66e25277ded..4dcafedc41067e4082b9d6b5c1cd78346fedb813 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 ae9585421cb5160bb2147f3e1bdceb01a69563a9..b84e73530484a0198d948d5dde491e70af19ba5b 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 6ddf22fb42908c99aa43cdc9f3cd3b14d2c86f9f..fd746a305e8ca292cfb28bb9cf46a94064c67361 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 c56b7a9ffe36fbfd3544cc5b5a925d05a98f25a7..b7fb3fa912a126765cdb1b567ddea485ce0ecf39 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 180033d5e7995c35b6e482fc53e02c778f2f66c9..3993605ab30098b932e650006a6b2c22bf56f058 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 a53926874234f6edbf423b6764602d9162cb505e..6c7004db9f771f5a2e88d62f798960b4e0bdeffc 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 c8f9e6441f8a71a5de7ffbe36974c84c157986c2..78baf5315686839d4f7fcff490b939ab01b3aa1e 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 f2f80db21a013c5aa7ab75f28373656895090cc1..08dd7ab39b8308c3469b915e471ba7c2b720ab62 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 017e6426437930d116ebd0de30cb5055b25da2cc..f179b3e8de8d927eaf542427e97b9fccf27c33a9 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 b484b702b5fd63a33255660b0ccb075efee0632a..96428b68fd42c36cabc32c8b98de4f529bf38d4a 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 228a801ff72f656a0e62c0d3118dd6edbd8f8553..ae77aee61a2edcaef68112b17c138d56cb571d8d 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 4b998a3fcad362e0e4c0499177160409ec658df3..b5f8c50fa4d7c551f526e1d25d34c22b3e5647d0 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 f5732855a5ac0d75d0913cc550e8c2cf93b71a24..95d3ad431a34b3a92b8c667616b9eab49d11964c 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 69395b5c62aaf15d0336de49002104331421e114..2b2a407ac7a927f444f92656e223a877439ecc16 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 32bfa068db9b6f8c0ebe48b6e9e29ec20f9998d5..938ce78d2be39a4680717da1b25d042e258c234c 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 fa328a54289769e366c19bc6fc0684cf3a912ea0..59aed7e1c41872ed3169d2173479e2158d34223a 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 bb730b23f5d02f4e4c9d16c104025ab852cb6a7c..33e2c8784e876b476b831a4d3f0ba85740dbf967 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 03e44871b4785e753c7a4ade53f09189a5ab38e5..8de6386d2ad4aa48c4cd9a2a5cb081a0b0ae27bb 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 59089a4b4d18166f5c5e56efd9401a7e4cadd93f..ab2abde60d927cafbc9e35f1fb0830955d749bbf 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 2729af6a17a1e0f51ae0339ca789f87ef26a471e..155a20cb7e71e686293160975b13714d41092d9d 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 d56bc7113a729e8711d21fc0886a83a8d60c487e..effa2031c7f87c593d1b5c271f4846edc26c250b 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 dad65d55ffaecc304a31bbfe7157d3199185c805..a18da2822a8e8c9787abe477df578c473e9d08da 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 5d10c6a2a981eb96c1983d8ab7739f897fe4b7eb..f80fadc4fe480b1bc370bb8d7d8a4c024d795b04 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 d8c09c57173bd136e616eddbd33a450d51b4915d..1abd1eb2b3c86b63cac3eb2666cc23f9c60635cd 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 7c43a6ca226d3dcfcf5ffd0db038fc061056ffcf..7d4f5518f7e6b8a80079da400487fb90b2877857 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 d886c4d8d37a7907ea00cd6d0645c0595b0e8c02..a15239c2bb3d643dd1d7128956c9a246788d4110 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 6b7a51733e2d23aacf201bfa4c26be58c4be6939..cb2f0797aceb5a4893223d94691bfee4cd3bf240 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 89042ab75170d4803b7fad85ede4d1d1f83708f2..0576d3cccea0bf0edcfc8e5d0c8aa322a217897b 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 65d8582bc2218432151efacb22e04626eaf2bbfc..094fe5b62515af21c0f9fcb06b48ea23721db9f4 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 ef6807119ec85512a1a0f6b193a6c2a549ae6e20..a01b26187b40324a71508d7795e5c35c153414a4 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 b2b3595ae5bbe72a191231b604fbd38c7ea1b9ab..7b265ce60498b71f70b10b60d1a5a3219c0b6291 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 1b2a9083adc5569ad398d31f38326171a73da6fb..f79ce7aa645ad482bc4a6eb0cf11c9ae482a7677 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 3b41ecc270746dfd6ad3cbc7b5240a4993c2e47e..09fc3971b11f61ddc2287d450b42fbd6a7d005dc 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 b78bb1e67d6382826dde685689991995397675ac..da0eb6fef09d9de4b01ebb2b6d276cd2528da9b9 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 6d97bc67ed89be43408909ad32292e737093328b..d86c9084cb400b3f473755f674aab1d9843fa91a 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 21c42d36f08b3649461ac78be522544c6a8f6e39..9f325feb1bd2bab9a8e912ba0e35fc20686936dc 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 4bc96dadd44264c193d13e50ea18f8a1f3fb4cda..08b110dc81e5885b17837df2379126d16dbdc69e 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 f8068ac40afc43ed6ac39b5d1c05afb2a26dba15..08e018d2cb7cd47487e550914b05cfa759086259 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 7416fa0685583ad736f55769827acc7f808370d1..0727afe5f81f6e4eb4f94871b5d2bd7b064aece3 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 fea87f176dc523b2aaea14a032977af498a5b826..400112d67a93d58a95af899645d7e73baad1af22 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 d51a2942b7e85c29ea5efde448718cdd2b8b8669..36c2252e7ec9e866b2cfec9de4ab02eb4ec6a497 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 f0f31cfefb37317ba92139afe5abd946aeea88f9..2dc9d4592d4fe350c5475cf8215a3c13b5613ef0 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 139054619082ba242f3da27d0bc20e5dfe3cbf2a..675c182dfa6ea145fbf9324d1be3c41c76ab0f95 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 56663319a4d917e2953fcc35072bd56a5a10f9f3..295aba083618e65473fb9b0728c1f67ebc311946 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 38be063ad4bbe146fb9e68403827fd7d99a19749..4eadf0edfc34e9c28fbf9f6524d1d7dc2c003750 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 0c747c5cb839606e4f00e4c083dfb51701ad59a6..3cde2e1c537c55f09ec167cf12f8e599e318117d 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 821b473d23e4fcfea673117bcf72f587b5da9d66..863bd67ffb380a3513e99ed0f36bf24dc7715ebe 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 401d3e1477da0182d6a23ab1d5327857251d1ffe..495472af4eea4e61ac01c4d48ddb898088219abc 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 efda99389e287db995b4078a158f7705e67c137a..a0d8c5bf9ca3b6c326b32e6b1e2973ce97eeb3c6 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 96a57d99f081758c6e87cc4670034e9cffa48473..4a0fb21631e316e001b403ea4de5063aa394c20a 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 a4707921bd13ae97d6c0fdcde6613109803ed71f..6c7fd4ebe783e7a389cc5a4c5d2c8b4b93bd174c 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 719b4ab426fd6b81e20801a1dfae47cb3df9142f..121f4e763da91a5f85ccdd082c33fd8fb160c845 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 cddfa8aa34c2d075ffb1cd5cce1f98665339ea6b..1fae7a7f37710dd760555d6cb6519a7e214fec62 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 d36397c07362c60578710921b23b460f9e4bea3a..c5a7a2e1d219ff8b694083be25bada8119550fd2 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 ee758e59283a7a0536bac1221d68270b2bab5b7b..f9e340bbccdb3bd5e028382b5dbaae953eb94352 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 d25ef22b01c275077c2429e2b7d1720b04c56b10..a6656c937b67cc32cedf32774ea98591999ee9f1 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 855401aa13d20a594f64213fb60a009130243919..5240397df9308c1f26e58844e8ea7db4a6fb965e 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 1be8a7d1cc0cab0551e90931a10182ef734dd1dc..ae5b90eaac64e7bb2d249abd60f649ce4960655e 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 0ebb2f934e80df3382272bcce9a3b7cbcd5d4b60..ed03178de34bf114cc40ae81aae0d1bb32f63cd8 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 d811f125f508bb1fcbdf18a3a0d877a266d3c5d5..7fe1f594902eb6958fd6ea7fa2f808985745fcb3 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 7ccabdb43c6a8e703e9b259329f46cba2fe45467..e9c7cbcb46ac0cdf5ea7411d5eb30d47fc151d6a 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 49a7e611a43c9a848fedfb97d2fcf6f0e41927cb..2093f34e67002f1db48c02f10e9e47f8520cf1a1 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 b85605dd3f72d677b96ee205363bd4add3ca80ce..e34a34d94d51755a7fb4b0dcd0e3add2b6c0e378 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 1e88968065cc8bb681f69914e458771fcba3ed71..0a459a4ea6ea47da0ef85f0985638ca2c7f5fa20 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 00eb4a13211b500634083eb535bb9516d0e6de1f..3756b435a75a38ed23b805777d9782c7cc672691 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 76f5707391dbee9b8c89d3d37e1b3d87a107e86b..5f108129101a8b1bc35529f65e0635dc62dd81c0 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 1922113c0b7c11aa0d37cafb4975e22e883b93a1..832380193d8795175fb01b7665850b5736c513d3 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 aadeeb81c206de55e00032b4773fe761de51f68d..259a2230279562c0ae8a860f1efe0d1a8c226b7e 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 fbf117c729f3fadc78c0cc5e6a9801ec679abc59..f33a7ffbe4d0fe1ea6a1ca2da1e561c29412a9ed 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 edeaff00c0924a2f14d45239bbb815263ffa1c09..62e239cb733bf6022850ff6785adb079b744bda0 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 485f5cdf9006cf5b385cbf9d32c6fbbc3059ef35..e196f9618ea7b00026c10746b34115fbb5bc9ac5 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 6deeb490ce45b3d926361491f4ee3736ddd13c1c..e1ff6e4beb98d0cf08cce772c5546fb6cd4fc449 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 72cae77cd4a035888151ff1db10e04d8995d2268..ac9e12926097bfc1c5c381046fcf227d4860a48b 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 3b6ec90354608b09fd40a5ece186de5a2d6c6623..401f48c9428871e611b27bdc9276969621fb09c2 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 f303e5631743908bdfcc897b99d164352eee491f..925a4bc1496f4bb88090b97d1c380cdfe40fbf15 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 12e2c1f77dcf419cebb6ca3ea7516d388ed7e0cc..397c423905434f9814708781124535d75334cf1b 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 fdf0ce6f7ba8c3a328b0f7efc65aa729a59900e0..b2ef9bd0734f717eccb32dda484bf5fc5eba9aaf 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 3a3dad2722ef21c0d0574242185c176d5e4a6255..daf5066f3c885982d07cbed286d550339ff11187 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 3da0a9e034233d3761c036ad63ff49988fe56886..d3ee964ed15940bc8ab91d0728f4f653d6027afc 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 255dd6cb58f73c11278260e836b720a65a8a364a..867d1032c763ea01ef00cd613776724b4037b96e 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 e1af7fb531f6823643190cbfcafb7b1f2e66c432..20ef53876ecb439003de67feef05f47560cca232 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 9b5b05cd7ec3d74e68863b3d8bec9ac96cb5facd..7dca9f95e71a0928c1ec00db4c464b99d1ce84b7 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 faa7b11eb816048f4bcf114bd08e5e4a49f71c88..3590a2aeb94d355590930e1b1164ae645410ccf2 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 1f7e51e3c896857b8a03ec9515deb397623c9aa9..0996ffc75f5588a8433a5d3aa4587f0423938f46 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 53b98b91490165ddbcda12613e63716c0c0bbc01..8a1f3a588b94b6f493ded533e53165860d9d35e9 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 ddb64980d580bbf508260f954fb48582ab0fceab..ccc47baa746ff70051d9254f9b1256849caf2a1d 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 c9b3f2783469ef3b9a6932e4f0ca9d9c6b1aff25..eb5ed46922c82596da51002371f47b061eb6aca2 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 ca1f4c4d2d86f939246bd7aab308b1b6f12412e7..948c0c4c0f74b27ed2149eebd20e0e50f70847bb 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 0ca0a76e9161533e43921f971b970f0d91b48d00..27a87d229c7f5e461c97dfa4d37ba1ad9cd70165 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 85bf2b931d23b85f0d352f289285da4293d11e47..00fd8eae9ddaa62545447e89c96ef725e8fbdc0c 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 080c250af7f2c18c3fa5590672840ae9431cc75b..fe3cae1316b572b9d45fea6fbcb255557489608e 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 f4f52f7c225363aa7983ab8ada2410bf19a5ffe5..fff0d47336e3a9e7ce9a75648cb0ec7458a6e951 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 766c68b0269d835856defbe5c9663df4c8c07262..d4acd6a0d84cfe9f24f2f5bee785517be93a78ef 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 e4af130ac248d0a5f8fe995ffc80e8792510a0b9..96b8cd2ecb40c4cc2952c6a18016cf65954623cc 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 3db2a464ebb01ad6bea25e80d9917d38113a536b..4f03a78572c1744a11c9ed77643ccc07a9837560 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 1ea26624f35ad34df75d3aff75a20a464ee77be1..54a0923c474e05b5caf6eea1326b7b8a4d3d0f42 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 c879dfcb14f286a0a651c8e74b4c90fb2145b1e6..bc019c970c008275fc76d3bd6cf8ba9a4313e790 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 d09ab668d9ee035b141214d4c0e8d6f56c25bb6a..7b99e7752d596dd8b95c39d342b4b26f1cb8d4aa 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 ca4f952cebfaef4b7a9d94baa992251faf19bc51..65bc81e11aeea1372dd58bc2c8a07207331f4a68 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 257091063ba4188cf832809046cd348e07396090..aff0983a27b310d16c5ba7eecba9912d967a0f7b 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 e46cca0a0d0591df07d1222d13755c70d94e7bfc..f1f468fd6054bc040c0fa76b43f96749dbcf7645 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 01d9755d12d5c01b65a4b5c28c8588bf07072b65..e8b1ff1000e9710afa204ff91bd15daf3cf3a543 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 1fa82f8fdf66dba2cff10f2a2df7d858c6827a98..89f0183fdf35b7be3ec2a45aaf31455b64905f49 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 15ca55838f4a8ec682b038376baef7c79706d1e7..c0a0e7a08860a48ab7722fb41376193145d65fff 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 247dfa882b3afd133a084b7dad3ebd1ecb98dab7..2aa4597254ceaf428db85964ca2d2cb3350d2e43 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 43c95445d2bd652923b27dd23bd2f33a09f903ca..bc8898d43d794d74b9ce7da1706816f56816c581 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 952a0abba0e674f41ba2abf0710c9692dfe17a5e..467dbae41026314c979e4a2ed8c0c42dc02b6f9d 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 65725e53fe22852acb3f9b8028769350617614f8..c19e26042648da526b8c9c056b480a0b9d0fb5af 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 66fd1e5d348edc5e946eb2111b635fc9ea9e2001..e3f771190932427f9d0f1ee3a41410a5a31da1c9 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 5f8ef1e830b36a906b44ea6f7edc13e347f129ec..b3b9c50867a9e45704f609ad2064d00999bec543 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 6ad4679298cd2c55199e1c41ec5960e6de6eeaf1..bee6cb18228abd213b1e35ac13e274599b5f6fec 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 6d7bec13202a6859901ecf417ddd488e72348e64..b61afa01cc00f4bb8f531a9fa1d3594e7bee5fb3 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 fe09ee3903e283f6f83b7a49e5d1e5d7eadf79ce..42ce5e7d03f57fb2a8211493c484a684e4aab618 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 5924157ad2a4788629283b088b6e2d6a32f5a167..4b74e3dfcec2ad602546add4dd74914d3f4ac781 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 7803e42942801e88a8f9a14c6cd5c3b1f69e11e8..b62dfc4bb1dec795a9de60f8bd2a984196534496 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 87fa9cab6a17d0a50012ce00851a8ed7bbd91fcd..a74bba4a97532171a154619148d3200a6337a844 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 3a481a799dc3228344eb560912ee723962a896ea..0d64f42ee4852222368ba240cf0d1681e23fa214 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 25a6c571051eff414f2fd80b9892381bafeb5353..862684eb1e5ee30769449f90a87b3aba6b391bc0 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 683968c2566c6857ea4d7dfed51de4ada3f1f8bc..a45207389a1e0d3ef0bcbd3073b05eef0d0a1f24 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 9119b7e2db06525421f37efde99d52b9b98c4a1e..06214fcbf11f3bbdc4721959ad94a99ec812a450 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 c9a0c1496783e07af492cc85c7d5ef9521902239..29f4c23c8bd2adfeae01bb59bd55d87f3aa6f5a0 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 a4d53e374886f3e855c4fdba0bfae80e62560649..7671f1dbac2e2ceda2c889a923bee2f32af90fbb 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 8b0cb4129b2e8c2dc6375999edae7294312d96a2..648b421e0bdaeaa8330eac851457f25124bf2cda 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 68e8e90021b65c494cc75938a77db4a335abb884..fddecf96db5a5528f550a0e3a3578c89cdcbae81 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 fc2bca0339df5d999ee1aee6f159e03a9af1b26b..f100fed3b6c0456860443796bf93c3cbd46b9360 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 f54cc9139c565e6db98b68e7b025f3167aacd7e4..09be775aed2ad636241c73aff504d93502b86b05 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 13f3cf4c2771f926b77e577c4721a48f32b584d2..f986f2e17f6f4ad4db2fd556872a4ddda1937ca9 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 9d1bdd895459c430c6555ba9621f744ccb303ff0..f3533c0da7270501b98a065f8aaa7615151a761d 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 2600e37a0cb7cb5553cfd7247338e9c34301636f..2cc2a43b3d485a6b1613d74b1c2e2c04e0c4cb14 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 ef1fd0578dde897af840c622f055bdcd85c268dd..ed5696a1f31ef784e63219ae58a8fbbe03d7ef79 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 b127f9f94e73ac52a17feda70f1d884873a972e5..3e52da8949e16a4d00f55fd56cf31873cfa8fa8b 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 ef71bf6ca328d31d257e84cc6960fc9923868795..39f3a95cc42249a1b91300326d26f6dab5404fff 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 4140db8be011d07e56d593601f64b4da0f755307..521cc7dc58658ce2669a1632af13df1be0df5445 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 94862dabe9323c0b35c21994ddfaacf9cd5b0540..37330328c1e076cae6097cf7dfa9cc22870916bc 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 1d993b178ba4d48ad2065df2da451a89a27d1492..9056467691a7ca626e7eede7e29aff8364b9cd0b 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 443ab350aadc2d907c272d59636d1ba7c8122559..ed1536312cec3c99ea56916ee9c1e4d6135f80bd 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 56982775bed3626ed41f3a28d5dd4b62fc692095..bd8b64db01a6ab26cc091bacb7cb7f8e95911281 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 e1eaf8355fec3f4bbf24b3d05782a821c8111d6a..221630943f636d9d2908195006b10d8454a50222 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 463444a94dc3a1548ce71fc0c0416042cad178cf..ab5ec9dc4271daefa2d93afbf8b0938fadf6046f 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 239814c185197397ec9fbceaf2ee765eddce8fc8..08179b72e84f0f7d142530db5d5650cad0a050bf 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 64aeaeb48698955ea75fde0b0fa5e93ac65267b3..42c92679d924a84ab18df8ed917ff149bafc2c40 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 7da4cccf0cb8595c5e1fa8d0799845de3134e3a0..c609d02df916c15cd1c4db4ebf6a59b59845c464 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 dbb056325b47a453d4d0e2dbac9bcb39de36e383..da9480eb7fdbd8bc9b7f7e0111040f155884aa11 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 4846360f893ce45ddf79d72fd0a3f4ffdf0d71aa..2550303c7300d6440a18f6ba7dd4229e2ec196ed 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 45da7b0fd725012f366c70a58f72be2d690d26da..09833a088eae6a5eaca635d29ce7545adeb211b6 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 1d96c1c568fd278a9b1998c91153aa9cb2222470..764132185232c4f1092e885da94a49e6b49a3dd8 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 dce9f785da9ff595ac8988f6c8089feca4b954fa..6f5fdd7d718cb7048f5a9e7698aebd3e7180bc11 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 481d1aac6ab4af7a4ed60b7519ee58dfb7349033..dd96291ee6823f633075c289eab0fba950b8abfb 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 59c762dfb183c6a5209b6dd489116d23cbed8b42..4368b03621c6365a22d6e15e9a34a7087a6c4578 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 9b97484efe6021b0d209c66b62eaec49a6a068f8..4fa95f968069ea13bdf1aa5102cf89f87f35c6c8 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 54abdbfbd294480fba4e4004d49b852f6ca23c42..cf3f253e054984253605a2284435c07b6a50dd4a 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 861dfc45a171b0c12298ff8e4e6ef4b7e0a09a24..9c5ce9eb72a6b1f89fcff36ab09c6f0fd8c3285c 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 d4b9ff1c180a2d12e48ad86e9130db317b3451bc..26f2f4beb5d0b59c5501f661db23c4f4ab394037 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 bfe1071a3b7217a70b7ad227e697d678ea7af59f..090cc3f8fdf875a794e40e783b8ed10a9bf57d48 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 c82d23b4dbb8b6db7d82102ffae660f262f944fc..55dbcd2bc9c4941d34aae7eff7418e5a171a38ac 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 17ef20543afa73bd6803c32c22a979781e7e4337..b175af60ee7452c8b9b876d994765dd976112479 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 b94b01d5374c20c58454c156b3c0d9b36588a884..4afd37a988140c384df1898bbe96243068546593 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 fe7841d377553e2109f05f190c18029e2fd44660..47bd75de50b9c00b26539aed0fee595c632d4a7c 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 b73fab2a6d55df0f88efea1d3ebeac77aab33ec3..cb5b72d83a4c4073688c8e11988004023cfc6d7f 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 f77cec235380323822175f7fd4fffe6452a85f28..c3865b1dc1fad53d76e8e1b03ee015c0854cc857 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 bacd84bc1e30fc8ace7758527ea0cb2775c28c2b..ca9628e2ac1225a129d21bda7304aa018e2e8ac3 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 0c39ddc7d29fe1ceac8f11fd22c3b89a3e3639c3..7e78583f80d7f7932d5def0d64ff28fe53a5caba 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 2a46c18454633d7e42a4b8d23003b7098d8ec87d..8fa5889ebea5f072e05d9ba42cfa0a3a676be607 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 2dedce3d9111691a6dda3eb03ab1975b5bb56c97..18804b5fc03c73420f2ab77fe63b48864f6c5c30 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 e8105cd39de95ebdd53e21829a5d515905829040..d591e49894952dcbbe4cc6095a10ca5e153dcdc8 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 284ad8e84cca84fe40cd0c8170bae1ad9e1e3492..7449a2036713638b86c1518b4a8a949468a19970 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 7ad03942e79cb95ff861daac16f4c68915dc6ff0..49d24ad289bed078ff8a661e1328bddd99c75882 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 48c6cc59cecfd28543b8dcd81429d3dce0eb879f..d02442f483fcc2ff1d87a0d7b8e3c899287ef966 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 f74273dceeba59206589701db697b8d9de309f76..59a55e25707cc4f8eff96c3e5c59ffc46249968c 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 0447dd99710720f4c2d88ad542f144f5842e3be7..637129c0fdf8b659a0905dffc6e0cb6d38f1488b 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 c91f40202f56aeb40b9dc4e3a4c61d4ee90136e7..1f68de1bf45dd4a467b8ee269ed364e57dbb40f1 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 0afd14f059151e9ade76ead2b62ded7503be1ef6..0ce5845796d5178d56f9b4500d2d00164bcdc395 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 41862edb7b7f3a7068d14166d5c15d008e2d7773..15379495a261eb5e6909a098fa7930b5173b14e0 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 17755d529547fe6529d7d9858c8dd6f9234420d4..6c618a974768e7604909abab2fae20418b14335a 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 5840a30269529aa59b5b4203cc2d5adabec85303..f6ffa116bbcfc037a4b520e71a530deeda281105 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 c98e567de39491eb6acb2a781956f842888d5a01..9cf2a5c27efc5136ceb572db716db072ce76cf78 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 97406ef979ac3f0ea2c99b1e2f52279d8dc9b4b4..085e282dcab8aa31a8259e55afd6fffd4716f651 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 1f61a89d7a188e4a9cc23f9a8fd30f4369d7f678..68ccdf27d1eb9116a193544d6445b39f67636b1b 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 04d4891f0966af67446f1d69b9e9bb6cccc6c441..b760aac7475a70636d88f7043a7410773a9ce6b4 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 ad035cc6ff7f9eaac33884b80be1d6877ef15902..8765168bd14b9e95ea530c605b83dc4a08a0cbe5 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 95c57078aa6e78b21ea3a6f9a81c890b97eaa4fd..19320666986705ee7c4a5c36fa90ac9945145917 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 160da9dd9518c051d51736667e41ee0985ebbc87..af2402bf0fde3fb1f7c23a0d6bbf4978a6db304b 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 382ffa5baaaf9791b1521668825a0f70a096222f..e76012d5eea695c635888c78ac1e32edff5ba8a0 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 7ead8328d5b09f6d8221d49fbc2eec88614b4972..5597759c1fddeb4b8d20784b217e13c727d32cb4 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 30a1752191db6267a3a98a2854050aa398dee02c..399b8f8829e3f4bb4a1f8da520e9cc6a05ba718d 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 62b1dc4e8c9f1c19f7caf057abd9fa8053da53b6..055493c62880a5d0baf63d7df770e046fb370186 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 65d801600cf68b03080e4f8734bcd22e65c186da..178d8d22ba388019af43512737e477d8be00102a 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 291ea991b0f2abd6392d3af3907052c757b6b177..6e80cc55fd676fd696c5bc2aead29653aab6cfcb 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 99d5674c26366c90b026c7cd8a10dc3210f4e19b..b3affc40f477d50213dcd0d4596869cc33466f96 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 06482f88890a2a581e646fd01be5e8558c180435..dfc89cb325143aaf422f3e64d09715563c2971bb 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 888ce70940af1ea666f55b2be343b7219c9c04d8..3e8ed6f4d717c5857e8ec7a4faef92157e435aa7 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 ae73acd7c34e668c2d650ff103a6b5d1f20f003d..2ce51e82e2a95a29f52b767c457cdbeab153dc76 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 8f20dcb0ea3425811818fc68cee414146dabea34..4a03b1af8577e352dec9ee27aacb51e7b5834f04 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 246a33a557bb6635bf0ebf55924fa7c19778f460..ace90b07d09e1759684134542bba32e92632d638 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 dd04e830f3f34b1d89d5368bd95818933ae44a00..93fb25d2d933e5eb832128f6d0c9c8fa3946693f 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 7f93602416642091c781abe76b734ffc4281f9b7..0c549f6a5bd97d5b506a6e3df0e8360ef5805f5b 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 c1e95db2aac30c6fb5973d31addb30c7e3fe4c1c..f4ed962fbaba13d1ed99e4427194a3d536e32866 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 f681a9cd6413b11d1234611b34e49939113560d9..cb22fb67268188854425c16fde958ee53e5b6b27 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 a9fac35aa3ed79f5d48363cc37068be84cba1a09..c48dbed8614661d3148f4ba6d673dbbd976ab57d 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 e054fd12dbfcee834afb3856e13743e3bb9bd504..de01803baf6f9673f8329fe8844df543bcbccbd0 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 a28a4e5f54afcdac1f68c52ddefee6d79da41d92..4c3ca140aaf3ce9f057bb357c1e7bf9c94770a87 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 dbf31cc0e80378726259cd2e97725d0c06005228..7b89c0446f2f9d1ec26de0ae12c910572241b537 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 03bb661c89ac009d2e8f02f3fdad160ab7b1a38c..88d9a5418f091711aa5c2577818213e8509b7238 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 e00efd363448548e768e04e5f70fcc752ffdd801..3040f6566c917fd77a1258ef5540690d70e80c01 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 6c07141c7cb37286be24dbe8ad7d09a9c7de5f8d..97c4c47b84a6a81dacfa1e154f4118a2269f5948 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 7ec3dd8f9b6acef880a8e23d66bea7a4b7397951..28f6b789c566ab8a88c841ecb23dfe08653be6e0 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 77fb64736f65cf62f8cf76bf687f7be7b52ea61b..49f5bde9e438ecc2b40d6bd7a84ab95984e53628 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 cb4690bb41bf7485ef091c67b9e4d6223c649d84..6396cdf9b68478d314f505061d36a426286da06d 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 6068281e183c690a22afd599af116442472175eb..45c49e2bf45f7dc8de814cb1faa864b56b95e732 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 bdad64bd4ef7485d23ed42318263b705845e90ae..cff941c9efb3c82c467da6ba0516d7590110f2db 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 56c805024d7f063e9454f94d025e751e5ee49179..d9ae1a1e5d348af943c39de535999f744caaab8b 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 1ee34af3e339dcb325d1a543f3e5be34452b3951..e5f98883e2228c35d61ae23ed511b7912e63359b 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 af184d2aea7d79596ade8937d023e3081d080239..f1720546d86b99242ea9fbbe667622f61498c9f7 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 3b2c76c1e56c6c2c6fe3f91bc12e314a655be992..ea90811c9b19bd1e2bf3dcb7c9bb3210e7f8b2ac 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 3cc10f5ce67fd6e87ffe3f0f1e128d2d6aadb90a..94e43f4ea85bd210ed2bba39d17284d390eafcb6 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 6bbd16709ef627545bed30997fee09255c954748..d8a77ee110c8f2a3f96fe58db99909fc308a1626 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 91b6940c3bd474c92bffdcc090af637b9a05a5b2..7327c991a23441a0cdd9d70a63eec8db96ebf1ea 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 39bb8a36ad2c33ed50ddd027b804f04868b3bfd1..8012c12ace72e8d53a1548c62ffb5165d50de1f3 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 cd5d357264af8a88b7e1a50bb24a2be5169eca76..eadaf40e350df7d79ee55d3bed9cb05d79f56d9e 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 18f448f15f40726301bef49660cdf72ef750766f..9f1cff6ee5a0a89930cb40e8052a6e7d141994e3 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 d7ebbf2c457faa5426da311b57f619677ca11812..0b4099ec0eca5dbc9d3aa53f3b85979429bc90ad 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 26fdc2cf27454ee7002183a4292c70adf0464186..0402f973e09090ab7f6e8f0ded2a1f2459281def 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 e67f00ff6ac3575243296da2ef89ec179a02db1f..8102ff9bd1f892f16500593c587bb82a8bf8855d 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 9bc259d00e7847112dd488836e6752b04e4127e2..670ad02a3e1ede48551d866dddfe120be0680289 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 836ce9249bc9330eec92957c482ef0f58aebef28..9e7fcd048e5c59eaa673d9bcd312fc6e9e5e1837 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 bad3c6db95c60a71b3af8c11b9ebc5009237d6b8..b711dbd2aefbe33b6946c9cec49b817295c9145e 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 cb4aae6c51388dd1868c897be8d1595594062013..5ae31ccddd0bfe68d8cfd2c11ad3508e75b04f89 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 64cfd0f070e94ee8c48b00842bf09007b9f13cfd..dba84d973bdf6b4278120217d86888128cf58159 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 c657b4cc72a366559ee242ad77945f0471bb276f..5d961e010c044df96f2f91707b34dfce813f4154 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 ea0a8ed59d61ce9bb2edd695e87fd67a4f1e89e3..ad4cf26abf189cc04f09f43b6d9961826b7b13e3 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 0640c2a39e5b3330c5c007ab89d91d338b7e55f7..844000f90497ed6d9e9497bcf502abe0716e3572 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 db2c6292bc6b1241a17f9d37f6f58fdc06bbbae2..58ae15b2c45d58499fe8ea79b567996aa5d12d79 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 72824c12d8060d55beedd9eeb7b6a99012eefbe7..56e08da2f223cc7496e4683a927811a866379136 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 075b9dc26d6b9a70014cca2bc57e0605d786eb62..69c61b466e7eee6362e9e65c038409a7de4fee0a 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 4a6faa495e00d90cfb7a6ff3fd400809c5dfe213..d59c2bda695838b5979af92f5c02ada526241346 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 7de8e9d7a3747577e1034bb0a134c96eb480be30..e4e621a55cd199ba4d4aa60fde6821f726410941 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 44a721daa25bbcfd362deddcb10d64c8b7784358..0fc48788c6f54d22f9ec25099a80de4f913f82ba 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 9a35d35a78b9ffbb2991ead7d16b33384c5308db..ed6a596d40f1bf9ac070ef503f2f12ecaead94e5 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 ae11c223a63631fae731417a943a88ab2c51bfe2..611c6ae15aae163ec39509f0d43a89bc9221b786 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 bcc7c2522ea1f7c72101b5b0546d7ec93b93fc64..0f069a3df2335937c23b1adf4ab537bdcc65e5c3 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 356273dc7dce4d112f46c188e0dd7cb251310b31..09ffb7826c0c45b642c5b0fb351a723aaefac975 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 86bd3df4ab59e0b80228d1c38558a3b2413eb7c8..674eebcfa8decb23447b755547d24d579e24715c 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 8164adca40e4400b069036eb3d90f6cc9b1ae370..023632aaab88d4f0c58ab7e49923cb3725e47483 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 6f6572a40d7d81ae586b6695dc3495d361b1043e..86afb41ab817511ddd59632df1f939ff0e20e793 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 bf84e88d0bbb821343c6a0d733cf7e371033771c..8e8c2a61dc7c471fbd23a72661e34e63e71dfa83 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 918300f68f475e5237697670dd5e928d2d336081..e7b01cf743c4ad3c2db5dd1c4bce0c722a716709 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 0f7e73da03dd01e2ce8208b1044dd1ada826417a..2fde200cf8087b7f0e80c852a5498984d4dfbb45 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 71da65c388d5541956b6549dcc924e979437f25f..ea583586243c02120ff3db29edd9b073d7a177e9 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 bab87648027691463a47c5649e3b74d4d6257a7a..c66e6fabbc6a8dfcaa444c305c8f1ce12f1977c4 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 c99ce057cd073c0bdefe0e2310e146b809d5b008..b8cd2bfd7ca1d21ac53e11d908926bfcfe54d117 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 bc456ae4fe33ea185e74a5820c3807a2384b6e70..3fd12a61d78b2417781f96864cfc81903334674d 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 112aa9610fa9febc109d2dd685417bb0968ba020..baf4640efa7ba7bc827310af56753fea6ab729de 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 f232c79c71455e8d856632511c910b3f4c307378..87dde766df238eef77f1a5a49f4a769835774dfb 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 e996cfcb5af376f7abc99cd874740997f0cc2842..9ff483132a5a33a0a8f19d17d6be3f5008900202 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 2ca2ef4321e9415d4a8d7321220e59c20202a920..99573406a2472f33826c16f9f84c96f692810ed9 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 c4f6c10172dbf8b894b382bccd9318875f05592d..839860201926069c5d37324553c06c18bccc838a 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 140492c752e632d03efe34f4f1b75585f790f0e9..0608a84820924b87c37e0ec4cf762d0801cb9710 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 72dea9c83c2dc985e21e6677d89a3a7ba29e68eb..74325b5d1ea4b5852a5b2d0e6b13bd52776a22b2 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 29f6444350d4dad9e72847013e7893e67e4880f1..97619869a19b58c33cd7caf4bb08eb23605b6a73 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 8817bd35bf807963450fdffdf1159917afa55a3f..4193eeb257101fff035755ca6888bec63ba6f993 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 97ffe143311445e11695ba971c46be92e6ae4cfd..b6167db80118bbf14cccb468116cb49aaabc97f5 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 555939fda0652e7584c1922cdf0bb0722886336e..11f4ed7adab42356c6ab682f5b8cec4042fcf8cc 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 ce5855721fb8d78ee34b56f616ab31b0f46f25dd..419aba0d1e9acec03a55ce1884c1720a03f06503 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 6e3860fefe9f2709f37d71c40ed88bacc8f3292f..de82730c32d3ee5a204423a7dd916d86c0b4ea10 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 e71e9044efaac5fbb18facd2d89f2433b655d4e5..b82a92cccafeffea948673acab54cb3fdcd5d63f 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); }