mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use factory Clone method for handling member clone() methods
- reduces code clutter, simplifies modification for new types.
Handled classes:
Function1, PatchFunction1, coordinateRotation, coordinateSystem,
particle, liquidProperties, solidProperties
This commit is contained in:
committed by
Andrew Heather
parent
39e054b0b8
commit
987dbe4589
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -85,12 +85,6 @@ public:
|
||||
const bool faceValues = true
|
||||
);
|
||||
|
||||
//- Copy construct
|
||||
${typeName}PatchFunction1${FieldType}
|
||||
(
|
||||
const ${typeName}PatchFunction1${FieldType}& rhs
|
||||
) = default;
|
||||
|
||||
//- Copy construct, resetting patch
|
||||
${typeName}PatchFunction1${FieldType}
|
||||
(
|
||||
@ -98,25 +92,25 @@ public:
|
||||
const polyPatch& pp
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
//- Copy construct
|
||||
${typeName}PatchFunction1${FieldType}
|
||||
(
|
||||
const ${typeName}PatchFunction1${FieldType}& rhs
|
||||
) = default;
|
||||
|
||||
//- Return a clone
|
||||
virtual tmp<PatchFunction1<${TemplateType}>> clone() const
|
||||
{
|
||||
return tmp<PatchFunction1<${TemplateType}>>
|
||||
(
|
||||
new ${typeName}PatchFunction1${FieldType}(*this)
|
||||
);
|
||||
return PatchFunction1<${TemplateType}>::Clone(*this);
|
||||
}
|
||||
|
||||
//- Construct and return a clone setting patch
|
||||
//- Return a clone, setting the patch
|
||||
virtual tmp<PatchFunction1<${TemplateType}>> clone
|
||||
(
|
||||
const polyPatch& pp
|
||||
) const
|
||||
{
|
||||
return tmp<PatchFunction1<${TemplateType}>>
|
||||
(
|
||||
new ${typeName}PatchFunction1${FieldType}(*this, pp)
|
||||
);
|
||||
return PatchFunction1<${TemplateType}>::Clone(*this, pp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user