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:
Mark Olesen
2024-01-08 11:30:58 +01:00
committed by Andrew Heather
parent 39e054b0b8
commit 987dbe4589
110 changed files with 543 additions and 570 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
Copyright (C) 2021-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -86,13 +86,10 @@ public:
const ${typeName}Function1_${TemplateType}& rhs
) = default;
//- Construct and return a clone
//- Return a clone
virtual tmp<Function1<${TemplateType}>> clone() const
{
return tmp<Function1<${TemplateType}>>
(
new ${typeName}Function1_${TemplateType}(*this)
);
return Function1<${TemplateType}>::Clone(*this);
}