mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use autoPtr::New and tmp::New for simple return types
This commit is contained in:
@ -179,7 +179,7 @@ public:
|
||||
//- Construct and return a clone, resetting the boundary mesh
|
||||
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
|
||||
{
|
||||
return autoPtr<polyPatch>(new cyclicACMIPolyPatch(*this, bm));
|
||||
return autoPtr<polyPatch>::NewFrom<cyclicACMIPolyPatch>(*this, bm);
|
||||
}
|
||||
|
||||
//- Construct and return a clone, resetting the face list
|
||||
|
||||
@ -220,7 +220,7 @@ public:
|
||||
//- Construct and return a clone, resetting the boundary mesh
|
||||
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
|
||||
{
|
||||
return autoPtr<polyPatch>(new cyclicAMIPolyPatch(*this, bm));
|
||||
return autoPtr<polyPatch>::NewFrom<cyclicAMIPolyPatch>(*this, bm);
|
||||
}
|
||||
|
||||
//- Construct and return a clone, resetting the face list
|
||||
|
||||
@ -138,13 +138,9 @@ public:
|
||||
//- Return clone
|
||||
autoPtr<coordinateRotation> clone() const
|
||||
{
|
||||
return autoPtr<coordinateRotation>
|
||||
(
|
||||
new EulerCoordinateRotation
|
||||
(
|
||||
*this
|
||||
)
|
||||
);
|
||||
return
|
||||
autoPtr<coordinateRotation>::NewFrom
|
||||
<EulerCoordinateRotation>(*this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -131,13 +131,9 @@ public:
|
||||
//- Return clone
|
||||
autoPtr<coordinateRotation> clone() const
|
||||
{
|
||||
return autoPtr<coordinateRotation>
|
||||
(
|
||||
new STARCDCoordinateRotation
|
||||
(
|
||||
*this
|
||||
)
|
||||
);
|
||||
return
|
||||
autoPtr<coordinateRotation>::NewFrom
|
||||
<STARCDCoordinateRotation>(*this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -132,13 +132,12 @@ public:
|
||||
//- Return clone
|
||||
autoPtr<coordinateRotation> clone() const
|
||||
{
|
||||
return autoPtr<coordinateRotation>(new axesRotation(*this));
|
||||
return autoPtr<coordinateRotation>::NewFrom<axesRotation>(*this);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~axesRotation()
|
||||
{}
|
||||
virtual ~axesRotation() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -128,13 +128,12 @@ public:
|
||||
//- Return clone
|
||||
autoPtr<coordinateRotation> clone() const
|
||||
{
|
||||
return autoPtr<coordinateRotation>(new cylindrical(*this));
|
||||
return autoPtr<coordinateRotation>::NewFrom<cylindrical>(*this);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~cylindrical()
|
||||
{}
|
||||
virtual ~cylindrical() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -199,7 +199,7 @@ public:
|
||||
//- Return clone
|
||||
autoPtr<coordinateSystem> clone() const
|
||||
{
|
||||
return autoPtr<coordinateSystem>(new coordinateSystem(*this));
|
||||
return autoPtr<coordinateSystem>::New(*this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ Foam::autoPtr<Foam::coordinateSystem> Foam::coordinateSystem::New
|
||||
{
|
||||
const dictionary& coordDict = dict.subDict(typeName_());
|
||||
|
||||
return autoPtr<coordinateSystem>(new coordinateSystem(coordDict));
|
||||
return autoPtr<coordinateSystem>::New(coordDict);
|
||||
}
|
||||
|
||||
|
||||
@ -74,7 +74,7 @@ Foam::autoPtr<Foam::coordinateSystem> Foam::coordinateSystem::New
|
||||
const word name(is);
|
||||
const dictionary dict(is);
|
||||
|
||||
return autoPtr<coordinateSystem>(new coordinateSystem(name, dict));
|
||||
return autoPtr<coordinateSystem>::New(name, dict);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -92,16 +92,12 @@ public:
|
||||
//- Read file and return edgeMesh
|
||||
static autoPtr<edgeMesh> New(const fileName& name)
|
||||
{
|
||||
return autoPtr<edgeMesh>
|
||||
(
|
||||
new edgeMeshFormat(name)
|
||||
);
|
||||
return autoPtr<edgeMesh>::NewFrom<edgeMeshFormat>(name);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~edgeMeshFormat()
|
||||
{}
|
||||
virtual ~edgeMeshFormat() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -74,16 +74,14 @@ public:
|
||||
//- Read file and return surface
|
||||
static autoPtr<edgeMesh> New(const fileName& name)
|
||||
{
|
||||
return autoPtr<edgeMesh>
|
||||
(
|
||||
new extendedFeatureEdgeMeshFormat(name)
|
||||
);
|
||||
return
|
||||
autoPtr<edgeMesh>::NewFrom
|
||||
<extendedFeatureEdgeMeshFormat>(name);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~extendedFeatureEdgeMeshFormat()
|
||||
{}
|
||||
virtual ~extendedFeatureEdgeMeshFormat() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -82,10 +82,7 @@ public:
|
||||
//- Read file and return edge mesh
|
||||
static autoPtr<edgeMesh> New(const fileName& name)
|
||||
{
|
||||
return autoPtr<edgeMesh>
|
||||
(
|
||||
new NASedgeFormat(name)
|
||||
);
|
||||
return autoPtr<edgeMesh>::NewFrom<NASedgeFormat>(name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -78,10 +78,7 @@ public:
|
||||
//- Read file and return surface
|
||||
static autoPtr<edgeMesh> New(const fileName& name)
|
||||
{
|
||||
return autoPtr<edgeMesh>
|
||||
(
|
||||
new OBJedgeFormat(name)
|
||||
);
|
||||
return autoPtr<edgeMesh>::NewFrom<OBJedgeFormat>(name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -100,16 +100,12 @@ public:
|
||||
//- Read file and return edgeMesh
|
||||
static autoPtr<edgeMesh> New(const fileName& name)
|
||||
{
|
||||
return autoPtr<edgeMesh>
|
||||
(
|
||||
new STARCDedgeFormat(name)
|
||||
);
|
||||
return autoPtr<edgeMesh>::NewFrom<STARCDedgeFormat>(name);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~STARCDedgeFormat()
|
||||
{}
|
||||
virtual ~STARCDedgeFormat() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -90,16 +90,12 @@ public:
|
||||
//- Read file and return surface
|
||||
static autoPtr<edgeMesh> New(const fileName& name)
|
||||
{
|
||||
return autoPtr<edgeMesh>
|
||||
(
|
||||
new VTKedgeFormat(name)
|
||||
);
|
||||
return autoPtr<edgeMesh>::NewFrom<VTKedgeFormat>(name);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~VTKedgeFormat()
|
||||
{}
|
||||
virtual ~VTKedgeFormat() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -215,7 +215,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::calcRegionSplit
|
||||
compactOffsets[i] = globalToCompact.size();
|
||||
}
|
||||
|
||||
return autoPtr<globalIndex>(new globalIndex(std::move(compactOffsets)));
|
||||
return autoPtr<globalIndex>::New(std::move(compactOffsets));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -274,7 +274,7 @@ const Foam::wordList& Foam::searchablePlate::regions() const
|
||||
|
||||
Foam::tmp<Foam::pointField> Foam::searchablePlate::coordinates() const
|
||||
{
|
||||
return tmp<pointField>(new pointField(1, origin_ + 0.5*span_));
|
||||
return tmp<pointField>::New(1, origin_ + 0.5*span_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -374,17 +374,14 @@ Foam::pointToPointPlanarInterpolation::pointToPointPlanarInterpolation
|
||||
Foam::autoPtr<Foam::pointToPointPlanarInterpolation>
|
||||
Foam::pointToPointPlanarInterpolation::clone() const
|
||||
{
|
||||
return autoPtr<pointToPointPlanarInterpolation>
|
||||
return autoPtr<pointToPointPlanarInterpolation>::New
|
||||
(
|
||||
new pointToPointPlanarInterpolation
|
||||
(
|
||||
perturb_,
|
||||
nearestOnly_,
|
||||
referenceCS_,
|
||||
nPoints_,
|
||||
nearestVertex_,
|
||||
nearestVertexWeight_
|
||||
)
|
||||
perturb_,
|
||||
nearestOnly_,
|
||||
referenceCS_,
|
||||
nPoints_,
|
||||
nearestVertex_,
|
||||
nearestVertexWeight_
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user