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
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -144,14 +144,13 @@ public:
|
||||
bool newFormat = true
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
autoPtr<particle> clone() const
|
||||
//- Return a clone
|
||||
virtual autoPtr<particle> clone() const
|
||||
{
|
||||
return autoPtr<particle>(new findCellParticle(*this));
|
||||
return particle::Clone(*this);
|
||||
}
|
||||
|
||||
//- Factory class to read-construct particles used for
|
||||
// parallel transfer
|
||||
//- Factory class to read-construct particles (for parallel transfer)
|
||||
class iNew
|
||||
{
|
||||
const polyMesh& mesh_;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2022 OpenCFD Ltd.
|
||||
Copyright (C) 2022-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -170,10 +170,10 @@ public:
|
||||
//- Construct copy
|
||||
streamLineParticle(const streamLineParticle& p);
|
||||
|
||||
//- Construct and return a clone
|
||||
autoPtr<particle> clone() const
|
||||
//- Return a clone
|
||||
virtual autoPtr<particle> clone() const
|
||||
{
|
||||
return autoPtr<particle>(new streamLineParticle(*this));
|
||||
return particle::Clone(*this);
|
||||
}
|
||||
|
||||
//- Factory class to read-construct particles used for parallel transfer
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -41,7 +41,6 @@ SourceFiles
|
||||
#define Foam_wallBoundedParticle_H
|
||||
|
||||
#include "particle.H"
|
||||
#include "autoPtr.H"
|
||||
#include "InfoProxy.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -176,14 +175,13 @@ public:
|
||||
//- Construct copy
|
||||
wallBoundedParticle(const wallBoundedParticle& p);
|
||||
|
||||
//- Construct and return a clone
|
||||
autoPtr<particle> clone() const
|
||||
//- Return a clone
|
||||
virtual autoPtr<particle> clone() const
|
||||
{
|
||||
return autoPtr<particle>(new wallBoundedParticle(*this));
|
||||
return particle::Clone(*this);
|
||||
}
|
||||
|
||||
//- Factory class to read-construct particles used for
|
||||
// parallel transfer
|
||||
//- Factory class to read-construct particles (for parallel transfer)
|
||||
class iNew
|
||||
{
|
||||
const polyMesh& mesh_;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2024 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -40,7 +40,6 @@ SourceFiles
|
||||
#define Foam_wallBoundedStreamLineParticle_H
|
||||
|
||||
#include "wallBoundedParticle.H"
|
||||
#include "autoPtr.H"
|
||||
#include "interpolation.H"
|
||||
#include "vectorList.H"
|
||||
#include "InfoProxy.H"
|
||||
@ -181,14 +180,13 @@ public:
|
||||
//- Construct copy
|
||||
wallBoundedStreamLineParticle(const wallBoundedStreamLineParticle& p);
|
||||
|
||||
//- Construct and return a clone
|
||||
//- Return a clone
|
||||
autoPtr<particle> clone() const
|
||||
{
|
||||
return autoPtr<particle>(new wallBoundedStreamLineParticle(*this));
|
||||
return particle::Clone(*this);
|
||||
}
|
||||
|
||||
//- Factory class to read-construct particles used for
|
||||
// parallel transfer
|
||||
//- Factory class to read-construct particles (for parallel transfer)
|
||||
class iNew
|
||||
{
|
||||
const polyMesh& mesh_;
|
||||
|
||||
Reference in New Issue
Block a user