Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
57291e86
Commit
57291e86
authored
Feb 26, 2018
by
Mark OLESEN
Browse files
STYLE: use autoPtr::New and tmp::New for simple return types
parent
52b36f84
Changes
196
Hide whitespace changes
Inline
Side-by-side
applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/phaseModel/phaseModel.H
View file @
57291e86
...
...
@@ -100,7 +100,7 @@ public:
autoPtr
<
phaseModel
>
operator
()(
Istream
&
is
)
const
{
return
autoPtr
<
phaseModel
>
(
new
phaseModel
(
is
,
p_
,
T_
)
)
;
return
autoPtr
<
phaseModel
>
::
New
(
is
,
p_
,
T_
);
}
};
...
...
applications/test/PtrList/Test-PtrList.C
View file @
57291e86
...
...
@@ -60,7 +60,7 @@ public:
autoPtr
<
Scalar
>
clone
()
const
{
return
autoPtr
<
Scalar
>
(
new
Scalar
(
data_
)
)
;
return
autoPtr
<
Scalar
>
::
New
(
data_
);
}
friend
Ostream
&
operator
<<
(
Ostream
&
os
,
const
Scalar
&
val
)
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/smoothAlignmentSolver/smoothAlignmentSolver.C
View file @
57291e86
...
...
@@ -93,14 +93,11 @@ Foam::autoPtr<Foam::mapDistribute> Foam::smoothAlignmentSolver::buildReferredMap
indices
.
transfer
(
dynIndices
);
List
<
Map
<
label
>>
compactMap
;
return
autoPtr
<
mapDistribute
>
return
autoPtr
<
mapDistribute
>
::
New
(
new
mapDistribute
(
globalIndexing
,
indices
,
compactMap
)
globalIndexing
,
indices
,
compactMap
);
}
...
...
@@ -157,14 +154,11 @@ Foam::autoPtr<Foam::mapDistribute> Foam::smoothAlignmentSolver::buildMap
}
List
<
Map
<
label
>>
compactMap
;
return
autoPtr
<
mapDistribute
>
return
autoPtr
<
mapDistribute
>
::
New
(
new
mapDistribute
(
globalIndexing
,
pointPoints
,
compactMap
)
globalIndexing
,
pointPoints
,
compactMap
);
}
...
...
applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C
View file @
57291e86
...
...
@@ -518,39 +518,36 @@ autoPtr<mapPolyMesh> reorderMesh
}
return
autoPtr
<
mapPolyMesh
>
return
autoPtr
<
mapPolyMesh
>
::
New
(
new
mapPolyMesh
(
mesh
,
// const polyMesh& mesh,
mesh
.
nPoints
(),
// nOldPoints,
mesh
.
nFaces
(),
// nOldFaces,
mesh
.
nCells
(),
// nOldCells,
identity
(
mesh
.
nPoints
()),
// pointMap,
List
<
objectMap
>
(
0
),
// pointsFromPoints,
faceOrder
,
// faceMap,
List
<
objectMap
>
(
0
),
// facesFromPoints,
List
<
objectMap
>
(
0
),
// facesFromEdges,
List
<
objectMap
>
(
0
),
// facesFromFaces,
cellOrder
,
// cellMap,
List
<
objectMap
>
(
0
),
// cellsFromPoints,
List
<
objectMap
>
(
0
),
// cellsFromEdges,
List
<
objectMap
>
(
0
),
// cellsFromFaces,
List
<
objectMap
>
(
0
),
// cellsFromCells,
identity
(
mesh
.
nPoints
()),
// reversePointMap,
reverseFaceOrder
,
// reverseFaceMap,
reverseCellOrder
,
// reverseCellMap,
flipFaceFlux
,
// flipFaceFlux,
patchPointMap
,
// patchPointMap,
labelListList
(
0
),
// pointZoneMap,
labelListList
(
0
),
// faceZonePointMap,
labelListList
(
0
),
// faceZoneFaceMap,
labelListList
(
0
),
// cellZoneMap,
pointField
(
0
),
// preMotionPoints,
patchStarts
,
// oldPatchStarts,
oldPatchNMeshPoints
,
// oldPatchNMeshPoints
autoPtr
<
scalarField
>
()
// oldCellVolumes
)
mesh
,
// const polyMesh& mesh,
mesh
.
nPoints
(),
// nOldPoints,
mesh
.
nFaces
(),
// nOldFaces,
mesh
.
nCells
(),
// nOldCells,
identity
(
mesh
.
nPoints
()),
// pointMap,
List
<
objectMap
>
(),
// pointsFromPoints,
faceOrder
,
// faceMap,
List
<
objectMap
>
(),
// facesFromPoints,
List
<
objectMap
>
(),
// facesFromEdges,
List
<
objectMap
>
(),
// facesFromFaces,
cellOrder
,
// cellMap,
List
<
objectMap
>
(),
// cellsFromPoints,
List
<
objectMap
>
(),
// cellsFromEdges,
List
<
objectMap
>
(),
// cellsFromFaces,
List
<
objectMap
>
(),
// cellsFromCells,
identity
(
mesh
.
nPoints
()),
// reversePointMap,
reverseFaceOrder
,
// reverseFaceMap,
reverseCellOrder
,
// reverseCellMap,
flipFaceFlux
,
// flipFaceFlux,
patchPointMap
,
// patchPointMap,
labelListList
(),
// pointZoneMap,
labelListList
(),
// faceZonePointMap,
labelListList
(),
// faceZoneFaceMap,
labelListList
(),
// cellZoneMap,
pointField
(),
// preMotionPoints,
patchStarts
,
// oldPatchStarts,
oldPatchNMeshPoints
,
// oldPatchNMeshPoints
autoPtr
<
scalarField
>
()
// oldCellVolumes
);
}
...
...
applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
View file @
57291e86
...
...
@@ -98,15 +98,12 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
{
if
(
fullMatch
||
masterMesh
.
nCells
()
==
0
)
{
return
autoPtr
<
faceCoupleInfo
>
return
autoPtr
<
faceCoupleInfo
>
::
New
(
new
faceCoupleInfo
(
masterMesh
,
meshToAdd
,
mergeDist
,
// Absolute merging distance
true
// Matching faces identical
)
masterMesh
,
meshToAdd
,
mergeDist
,
// Absolute merging distance
true
// Matching faces identical
);
}
else
...
...
@@ -215,20 +212,17 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
}
addFaces
.
shrink
();
return
autoPtr
<
faceCoupleInfo
>
return
autoPtr
<
faceCoupleInfo
>
::
New
(
new
faceCoupleInfo
(
masterMesh
,
masterFaces
,
meshToAdd
,
addFaces
,
mergeDist
,
// Absolute merging distance
true
,
// Matching faces identical?
false
,
// If perfect match are faces already ordered
// (e.g. processor patches)
false
// are faces each on separate patch?
)
masterMesh
,
masterFaces
,
meshToAdd
,
addFaces
,
mergeDist
,
// Absolute merging distance
true
,
// Matching faces identical?
false
,
// If perfect match are faces already ordered
// (e.g. processor patches)
false
// are faces each on separate patch?
);
}
}
...
...
applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C
View file @
57291e86
...
...
@@ -49,7 +49,7 @@ Foam::tmp<Foam::Field<Type>> Foam::readParticleField
if
(
obj
!=
nullptr
)
{
IOField
<
Type
>
newField
(
*
obj
);
return
tmp
<
Field
<
Type
>>
(
new
Field
<
Type
>
(
newField
.
xfer
())
)
;
return
tmp
<
Field
<
Type
>>
::
New
(
newField
.
xfer
());
}
FatalErrorInFunction
...
...
applications/utilities/postProcessing/lumped/lumpedPointForces/lumpedPointForces.C
View file @
57291e86
...
...
@@ -55,22 +55,19 @@ autoPtr<GeoFieldType> loadField
Info
<<
"Reading "
<<
GeoFieldType
::
typeName
<<
' '
<<
io
->
name
()
<<
endl
;
return
autoPtr
<
GeoFieldType
>
return
autoPtr
<
GeoFieldType
>
::
New
(
new
GeoFieldType
IOobject
(
IOobject
(
io
->
name
(),
io
->
instance
(),
io
->
local
(),
io
->
db
(),
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
,
io
->
registerObject
()
),
mesh
)
io
->
name
(),
io
->
instance
(),
io
->
local
(),
io
->
db
(),
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
,
io
->
registerObject
()
),
mesh
);
}
...
...
applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C
View file @
57291e86
...
...
@@ -244,7 +244,7 @@ tmp<volScalarField> calcNut
// Correct nut
turbulence
->
validate
();
return
tmp
<
volScalarField
>
(
new
volScalarField
(
turbulence
->
nut
())
)
;
return
tmp
<
volScalarField
>
::
New
(
turbulence
->
nut
());
}
else
{
...
...
@@ -264,7 +264,7 @@ tmp<volScalarField> calcNut
// Correct nut
turbulence
->
validate
();
return
tmp
<
volScalarField
>
(
new
volScalarField
(
turbulence
->
nut
())
)
;
return
tmp
<
volScalarField
>
::
New
(
turbulence
->
nut
());
}
}
...
...
applications/utilities/preProcessing/setFields/setFields.C
View file @
57291e86
...
...
@@ -141,7 +141,7 @@ public:
autoPtr
<
setCellField
>
clone
()
const
{
return
autoPtr
<
setCellField
>
(
new
setCellField
()
);
return
autoPtr
<
setCellField
>
::
New
(
);
}
class
iNew
...
...
@@ -182,7 +182,7 @@ public:
<<
endl
;
}
return
autoPtr
<
setCellField
>
(
new
setCellField
()
);
return
autoPtr
<
setCellField
>
::
New
(
);
}
};
};
...
...
@@ -332,7 +332,7 @@ public:
autoPtr
<
setFaceField
>
clone
()
const
{
return
autoPtr
<
setFaceField
>
(
new
setFaceField
()
);
return
autoPtr
<
setFaceField
>
::
New
(
);
}
class
iNew
...
...
@@ -373,7 +373,7 @@ public:
<<
endl
;
}
return
autoPtr
<
setFaceField
>
(
new
setFaceField
()
);
return
autoPtr
<
setFaceField
>
::
New
(
);
}
};
};
...
...
applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C
View file @
57291e86
...
...
@@ -1480,33 +1480,30 @@ autoPtr<extendedFeatureEdgeMesh> createEdgeMesh
//calcFeaturePoints(inter.cutPoints(), inter.cutEdges());
return
autoPtr
<
extendedFeatureEdgeMesh
>
return
autoPtr
<
extendedFeatureEdgeMesh
>
::
New
(
new
extendedFeatureEdgeMesh
(
io
,
inter
.
cutPoints
(),
inter
.
cutEdges
(),
0
,
// concaveStart,
0
,
// mixedStart,
0
,
// nonFeatureStart,
internalStart
,
// internalStart,
nIntOrExt
,
// flatStart,
nIntOrExt
+
nFlat
,
// openStart,
nIntOrExt
+
nFlat
+
nOpen
,
// multipleStart,
normalsTmp
,
normalVolumeTypesTmp
,
edgeDirections
,
normalDirectionsTmp
,
edgeNormalsTmp
,
labelListList
(
0
),
// featurePointNormals,
labelListList
(
0
),
// featurePointEdges,
labelList
(
0
)
// regionEdges
)
io
,
inter
.
cutPoints
(),
inter
.
cutEdges
(),
0
,
// concaveStart,
0
,
// mixedStart,
0
,
// nonFeatureStart,
internalStart
,
// internalStart,
nIntOrExt
,
// flatStart,
nIntOrExt
+
nFlat
,
// openStart,
nIntOrExt
+
nFlat
+
nOpen
,
// multipleStart,
normalsTmp
,
normalVolumeTypesTmp
,
edgeDirections
,
normalDirectionsTmp
,
edgeNormalsTmp
,
labelListList
(),
// featurePointNormals,
labelListList
(),
// featurePointEdges,
labelList
()
// regionEdges
);
}
...
...
applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromFile.C
View file @
57291e86
...
...
@@ -86,16 +86,13 @@ Foam::surfaceFeaturesExtraction::extractFromFile::features
<<
"Selecting edges based purely on geometric tests: "
<<
geometricTestOnly
().
c_str
()
<<
endl
;
return
autoPtr
<
surfaceFeatures
>
return
autoPtr
<
surfaceFeatures
>
::
New
(
new
surfaceFeatures
(
surf
,
eMesh
.
points
(),
eMesh
.
edges
(),
1e-6
,
// mergeTol
geometricTestOnly
()
)
surf
,
eMesh
.
points
(),
eMesh
.
edges
(),
1e-6
,
// mergeTol
geometricTestOnly
()
);
}
...
...
applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromNone.C
View file @
57291e86
...
...
@@ -73,7 +73,7 @@ Foam::surfaceFeaturesExtraction::extractFromNone::features
const
triSurface
&
surf
)
const
{
return
autoPtr
<
surfaceFeatures
>
(
new
surfaceFeatures
(
surf
)
)
;
return
autoPtr
<
surfaceFeatures
>
::
New
(
surf
);
}
...
...
applications/utilities/surface/surfaceFeatureExtract/extractionMethod/extractFromSurface.C
View file @
57291e86
...
...
@@ -80,16 +80,13 @@ Foam::surfaceFeaturesExtraction::extractFromSurface::features
<<
"Selecting edges based purely on geometric tests: "
<<
geometricTestOnly
().
c_str
()
<<
endl
;
return
autoPtr
<
surfaceFeatures
>
return
autoPtr
<
surfaceFeatures
>
::
New
(
new
surfaceFeatures
(
surf
,
includedAngle
(),
0
,
// minLen
0
,
// minElems
geometricTestOnly
()
)
surf
,
includedAngle
(),
0
,
// minLen
0
,
// minElems
geometricTestOnly
()
);
}
...
...
src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H
View file @
57291e86
...
...
@@ -418,10 +418,7 @@ public:
//- Clone
autoPtr
<
dynamicIndexedOctree
<
Type
>>
clone
()
const
{
return
autoPtr
<
dynamicIndexedOctree
<
Type
>>
(
new
dynamicIndexedOctree
<
Type
>
(
*
this
)
);
return
autoPtr
<
dynamicIndexedOctree
<
Type
>>::
New
(
*
this
);
}
...
...
src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H
View file @
57291e86
...
...
@@ -432,10 +432,7 @@ public:
//- Clone
autoPtr
<
indexedOctree
<
Type
>>
clone
()
const
{
return
autoPtr
<
indexedOctree
<
Type
>>
(
new
indexedOctree
<
Type
>
(
*
this
)
);
return
autoPtr
<
indexedOctree
<
Type
>>::
New
(
*
this
);
}
// Member Functions
...
...
src/OpenFOAM/containers/Lists/CompactListList/CompactListListI.H
View file @
57291e86
...
...
@@ -101,10 +101,7 @@ template<class T, class Container>
inline
Foam
::
autoPtr
<
Foam
::
CompactListList
<
T
,
Container
>>
Foam
::
CompactListList
<
T
,
Container
>::
clone
()
const
{
return
autoPtr
<
CompactListList
<
T
,
Container
>>
(
new
CompactListList
<
T
,
Container
>
(
*
this
)
);
return
autoPtr
<
CompactListList
<
T
,
Container
>>::
New
(
*
this
);
}
...
...
src/OpenFOAM/containers/Lists/FixedList/FixedListI.H
View file @
57291e86
...
...
@@ -135,7 +135,7 @@ template<class T, unsigned Size>
inline
Foam
::
autoPtr
<
Foam
::
FixedList
<
T
,
Size
>>
Foam
::
FixedList
<
T
,
Size
>::
clone
()
const
{
return
autoPtr
<
FixedList
<
T
,
Size
>>
(
new
FixedList
<
T
,
Size
>
(
*
this
)
)
;
return
autoPtr
<
FixedList
<
T
,
Size
>>
::
New
(
*
this
);
}
...
...
src/OpenFOAM/containers/Lists/List/ListI.H
View file @
57291e86
...
...
@@ -95,7 +95,7 @@ inline constexpr Foam::List<T>::List() noexcept
template
<
class
T
>
inline
Foam
::
autoPtr
<
Foam
::
List
<
T
>>
Foam
::
List
<
T
>::
clone
()
const
{
return
autoPtr
<
List
<
T
>>
(
new
List
<
T
>
(
*
this
)
)
;
return
autoPtr
<
List
<
T
>>
::
New
(
*
this
);
}
...
...
src/OpenFOAM/containers/Lists/PackedList/PackedBoolListI.H
View file @
57291e86
...
...
@@ -125,7 +125,7 @@ inline Foam::PackedBoolList::PackedBoolList
inline
Foam
::
autoPtr
<
Foam
::
PackedBoolList
>
Foam
::
PackedBoolList
::
clone
()
const
{
return
autoPtr
<
PackedBoolList
>
(
new
PackedBoolList
(
*
this
)
)
;
return
autoPtr
<
PackedBoolList
>
::
New
(
*
this
);
}
...
...
src/OpenFOAM/containers/Lists/PackedList/PackedListI.H
View file @
57291e86
...
...
@@ -267,7 +267,7 @@ template<unsigned nBits>
inline
Foam
::
autoPtr
<
Foam
::
PackedList
<
nBits
>>
Foam
::
PackedList
<
nBits
>::
clone
()
const
{
return
autoPtr
<
PackedList
<
nBits
>>
(
new
PackedList
<
nBits
>
(
*
this
)
)
;
return
autoPtr
<
PackedList
<
nBits
>>
::
New
(
*
this
);
}
...
...
Prev
1
2
3
4
5
…
10
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment