STYLE: use brace constructors for Foam::zero and Foam::one

- makes it clearer that these are constructors and not function calls
This commit is contained in:
Mark Olesen
2020-10-24 13:32:44 +02:00
parent 98d05fa80a
commit 07bbae0c55
35 changed files with 71 additions and 71 deletions

View File

@ -446,7 +446,7 @@ int main(int argc, char *argv[])
// Default exposed patch id
labelList exposedPatchIDs(one(), -1);
labelList exposedPatchIDs(one{}, -1);
if (args.found("patches"))
{

View File

@ -95,7 +95,7 @@ Description
auto writer = autoPtr<vtk::patchWriter>::New
(
meshProxy.mesh(),
labelList(one(), pp.index()),
labelList(one{}, pp.index()),
writeOpts,
nearCellValue,
(

View File

@ -195,7 +195,7 @@ Description
auto writer = autoPtr<vtk::patchWriter>::New
(
meshProxy.mesh(),
labelList(one(), pp.index()),
labelList(one{}, pp.index()),
writeOpts,
nearCellValue,
// Output patch: "boundary"/name

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -571,7 +571,7 @@ Foam::meshedSurface Foam::PDRobstacle::surface() const
// pts += obs.pt;
faceList fcs(one(), face(identity(4)));
faceList fcs(one{}, face(identity(4)));
surf.transfer(pts, fcs);

View File

@ -122,7 +122,7 @@ HashTable<wordList> extractPatchGroups(const dictionary& boundaryDict)
}
else
{
groupToPatch.insert(groupName, wordList(one(), patchName));
groupToPatch.insert(groupName, wordList(one{}, patchName));
}
}
}

View File

@ -287,7 +287,7 @@ Foam::instantList Foam::timeSelector::selectIfPresent
}
// No timeSelector option specified. Do not change runTime.
return instantList(one(), instant(runTime.value(), runTime.timeName()));
return instantList(one{}, instant(runTime.value(), runTime.timeName()));
}

View File

@ -497,7 +497,7 @@ Foam::polyBoundaryMesh::groupPatchIDs() const
}
else
{
groupPatchIDs.insert(groupName, labelList(one(), patchi));
groupPatchIDs.insert(groupName, labelList(one{}, patchi));
}
}
}

View File

@ -258,7 +258,7 @@ Foam::labelList Foam::faBoundaryMesh::indices
if (patchId >= 0)
{
return labelList(one(), patchId);
return labelList(one{}, patchId);
}
}

View File

@ -209,7 +209,7 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs()
if (volumetric_ || rhoName_ == "none")
{
updateValues(one());
updateValues(one{});
}
else
{

View File

@ -192,7 +192,7 @@ void Foam::flowRateOutletVelocityFvPatchVectorField::updateCoeffs()
if (volumetric_ || rhoName_ == "none")
{
updateValues(one());
updateValues(one{});
}
else
{

View File

@ -211,7 +211,7 @@ void Foam::matchedFlowRateOutletVelocityFvPatchVectorField::updateCoeffs()
if (volumetric_)
{
updateValues(inletPatchID, one(), one());
updateValues(inletPatchID, one{}, one{});
}
else
{

View File

@ -616,7 +616,7 @@ bool Foam::functionObjects::externalCoupled::read(const dictionary& dict)
regionToGroups_.insert
(
regionGroupNames_.last(),
labelList(one(), nGroups)
labelList(one{}, nGroups)
);
}
groupNames_.append(groupName);

View File

@ -457,7 +457,7 @@ bool Foam::functionObjects::vtkWrite::write()
auto writer = autoPtr<vtk::patchWriter>::New
(
meshProxy.mesh(),
labelList(one(), pp.index()),
labelList(one{}, pp.index()),
writeOpts_,
// Output name for patch: "boundary"/name
(

View File

@ -534,7 +534,7 @@ Foam::PDRblock::PDRblock
bentry.name_ = "patch" + Foam::name(patchi);
bentry.type_ = "patch";
bentry.size_ = 0;
bentry.faces_ = labelList(one(), patchi);
bentry.faces_ = labelList(one{}, patchi);
}
reset(xgrid, ygrid, zgrid);

View File

@ -484,7 +484,7 @@ Foam::extendedEdgeMesh::extendedEdgeMesh
const boolList& surfBaffleRegions
)
:
extendedEdgeMesh(one::minus())
extendedEdgeMesh(one::minus{})
{
// Extract and reorder the data from surfaceFeatures
const triSurface& surf = sFeat.surface();
@ -547,7 +547,7 @@ Foam::extendedEdgeMesh::extendedEdgeMesh
const labelUList& featurePoints
)
:
extendedEdgeMesh(one::minus())
extendedEdgeMesh(one::minus{})
{
sortPointsAndEdges
(

View File

@ -161,7 +161,7 @@ public:
// Usually the element centres (should be of length size()).
virtual tmp<pointField> coordinates() const
{
return tmp<pointField>::New(one(), origin());
return tmp<pointField>::New(one{}, origin());
}
//- Get bounding spheres (centre and radius squared), one per element.

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -137,7 +137,7 @@ Foam::boxToCell::boxToCell
)
:
topoSetCellSource(mesh),
bbs_(one(), treeBoundBox(checkIs(is)))
bbs_(one{}, treeBoundBox(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -60,7 +60,7 @@ Foam::cellToCell::cellToCell
)
:
topoSetCellSource(mesh),
names_(one(), setName)
names_(one{}, setName)
{}
@ -89,7 +89,7 @@ Foam::cellToCell::cellToCell
)
:
topoSetCellSource(mesh),
names_(one(), word(checkIs(is)))
names_(one{}, word(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -144,7 +144,7 @@ Foam::faceToCell::faceToCell
)
:
topoSetCellSource(mesh),
names_(one(), setName),
names_(one{}, setName),
option_(option)
{}
@ -175,7 +175,7 @@ Foam::faceToCell::faceToCell
)
:
topoSetCellSource(mesh),
names_(one(), word(checkIs(is))),
names_(one{}, word(checkIs(is))),
option_(faceActionNames_.read(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2018 OpenCFD Ltd.
Copyright (C) 2016-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -120,7 +120,7 @@ Foam::faceZoneToCell::faceZoneToCell
)
:
topoSetCellSource(mesh),
selectedZones_(one(), zoneName),
selectedZones_(one{}, zoneName),
option_(option)
{}
@ -152,7 +152,7 @@ Foam::faceZoneToCell::faceZoneToCell
)
:
topoSetCellSource(mesh),
selectedZones_(one(), wordRe(checkIs(is))),
selectedZones_(one{}, wordRe(checkIs(is))),
option_(faceActionNames_.read(checkIs(is)))
{}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -115,7 +115,7 @@ Foam::patchToCell::patchToCell
)
:
topoSetCellSource(mesh),
selectedPatches_(one(), patchName)
selectedPatches_(one{}, patchName)
{}
@ -145,7 +145,7 @@ Foam::patchToCell::patchToCell
)
:
topoSetCellSource(mesh),
selectedPatches_(one(), wordRe(checkIs(is)))
selectedPatches_(one{}, wordRe(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2019 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -124,7 +124,7 @@ Foam::pointToCell::pointToCell
)
:
topoSetCellSource(mesh),
names_(one(), setName),
names_(one{}, setName),
option_(option)
{}
@ -155,7 +155,7 @@ Foam::pointToCell::pointToCell
)
:
topoSetCellSource(mesh),
names_(one(), word(checkIs(is))),
names_(one{}, word(checkIs(is))),
option_(pointActionNames_.read(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -116,7 +116,7 @@ Foam::zoneToCell::zoneToCell
)
:
topoSetCellSource(mesh),
selectedZones_(one(), zoneName)
selectedZones_(one{}, zoneName)
{}
@ -146,7 +146,7 @@ Foam::zoneToCell::zoneToCell
)
:
topoSetCellSource(mesh),
selectedZones_(one(), wordRe(checkIs(is)))
selectedZones_(one{}, wordRe(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -137,7 +137,7 @@ Foam::boxToFace::boxToFace
)
:
topoSetFaceSource(mesh),
bbs_(one(), treeBoundBox(checkIs(is)))
bbs_(one{}, treeBoundBox(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -161,7 +161,7 @@ Foam::cellToFace::cellToFace
)
:
topoSetFaceSource(mesh),
names_(one(), setName),
names_(one{}, setName),
option_(option)
{}
@ -192,7 +192,7 @@ Foam::cellToFace::cellToFace
)
:
topoSetFaceSource(mesh),
names_(one(), word(checkIs(is))),
names_(one{}, word(checkIs(is))),
option_(cellActionNames_.read(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -60,7 +60,7 @@ Foam::faceToFace::faceToFace
)
:
topoSetFaceSource(mesh),
names_(one(), setName)
names_(one{}, setName)
{}
@ -89,7 +89,7 @@ Foam::faceToFace::faceToFace
)
:
topoSetFaceSource(mesh),
names_(one(), word(checkIs(is)))
names_(one{}, word(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -116,7 +116,7 @@ Foam::patchToFace::patchToFace
)
:
topoSetFaceSource(mesh),
selectedPatches_(one(), patchName)
selectedPatches_(one{}, patchName)
{}
@ -146,7 +146,7 @@ Foam::patchToFace::patchToFace
)
:
topoSetFaceSource(mesh),
selectedPatches_(one(), wordRe(checkIs(is)))
selectedPatches_(one{}, wordRe(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -170,7 +170,7 @@ Foam::pointToFace::pointToFace
)
:
topoSetFaceSource(mesh),
names_(one(), setName),
names_(one{}, setName),
option_(option)
{}
@ -201,7 +201,7 @@ Foam::pointToFace::pointToFace
)
:
topoSetFaceSource(mesh),
names_(one(), word(checkIs(is))),
names_(one{}, word(checkIs(is))),
option_(pointActionNames_.read(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -117,7 +117,7 @@ Foam::zoneToFace::zoneToFace
)
:
topoSetFaceSource(mesh),
selectedZones_(one(), zoneName)
selectedZones_(one{}, zoneName)
{}
@ -147,7 +147,7 @@ Foam::zoneToFace::zoneToFace
)
:
topoSetFaceSource(mesh),
selectedZones_(one(), wordRe(checkIs(is)))
selectedZones_(one{}, wordRe(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -137,7 +137,7 @@ Foam::boxToPoint::boxToPoint
)
:
topoSetPointSource(mesh),
bbs_(one(), treeBoundBox(checkIs(is)))
bbs_(one{}, treeBoundBox(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -98,7 +98,7 @@ Foam::cellToPoint::cellToPoint
)
:
topoSetPointSource(mesh),
names_(one(), setName),
names_(one{}, setName),
option_(option)
{}
@ -129,7 +129,7 @@ Foam::cellToPoint::cellToPoint
)
:
topoSetPointSource(mesh),
names_(one(), word(checkIs(is))),
names_(one{}, word(checkIs(is))),
option_(cellActionNames_.read(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2019 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -92,7 +92,7 @@ Foam::faceToPoint::faceToPoint
)
:
topoSetPointSource(mesh),
names_(one(), setName),
names_(one{}, setName),
option_(option)
{}
@ -123,7 +123,7 @@ Foam::faceToPoint::faceToPoint
)
:
topoSetPointSource(mesh),
names_(one(), word(checkIs(is))),
names_(one{}, word(checkIs(is))),
option_(faceActionNames_.read(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -60,7 +60,7 @@ Foam::pointToPoint::pointToPoint
)
:
topoSetPointSource(mesh),
names_(one(), setName)
names_(one{}, setName)
{}
@ -89,7 +89,7 @@ Foam::pointToPoint::pointToPoint
)
:
topoSetPointSource(mesh),
names_(one(), word(checkIs(is)))
names_(one{}, word(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -117,7 +117,7 @@ Foam::zoneToPoint::zoneToPoint
)
:
topoSetPointSource(mesh),
selectedZones_(one(), zoneName)
selectedZones_(one{}, zoneName)
{}
@ -147,7 +147,7 @@ Foam::zoneToPoint::zoneToPoint
)
:
topoSetPointSource(mesh),
selectedZones_(one(), wordRe(checkIs(is)))
selectedZones_(one{}, wordRe(checkIs(is)))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2019 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -1326,7 +1326,7 @@ Foam::isoSurfaceTopo::isoSurfaceTopo
}
surfZoneList allZones(one(), surfZone("allFaces", allTris.size()));
surfZoneList allZones(one{}, surfZone("allFaces", allTris.size()));
MeshStorage::clear();
MeshStorage updated