Commit 07bbae0c authored by Mark Olesen's avatar Mark Olesen
Browse files

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

- makes it clearer that these are constructors and not function calls
parent 98d05fa8
......@@ -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"))
{
......
......@@ -95,7 +95,7 @@ Description
auto writer = autoPtr<vtk::patchWriter>::New
(
meshProxy.mesh(),
labelList(one(), pp.index()),
labelList(one{}, pp.index()),
writeOpts,
nearCellValue,
(
......
......@@ -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
......
......@@ -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);
......
......@@ -122,7 +122,7 @@ HashTable<wordList> extractPatchGroups(const dictionary& boundaryDict)
}
else
{
groupToPatch.insert(groupName, wordList(one(), patchName));
groupToPatch.insert(groupName, wordList(one{}, patchName));
}
}
}
......
......@@ -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()));
}
......
......@@ -497,7 +497,7 @@ Foam::polyBoundaryMesh::groupPatchIDs() const
}
else
{
groupPatchIDs.insert(groupName, labelList(one(), patchi));
groupPatchIDs.insert(groupName, labelList(one{}, patchi));
}
}
}
......
......@@ -258,7 +258,7 @@ Foam::labelList Foam::faBoundaryMesh::indices
if (patchId >= 0)
{
return labelList(one(), patchId);
return labelList(one{}, patchId);
}
}
......
......@@ -209,7 +209,7 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs()
if (volumetric_ || rhoName_ == "none")
{
updateValues(one());
updateValues(one{});
}
else
{
......
......@@ -192,7 +192,7 @@ void Foam::flowRateOutletVelocityFvPatchVectorField::updateCoeffs()
if (volumetric_ || rhoName_ == "none")
{
updateValues(one());
updateValues(one{});
}
else
{
......
......@@ -211,7 +211,7 @@ void Foam::matchedFlowRateOutletVelocityFvPatchVectorField::updateCoeffs()
if (volumetric_)
{
updateValues(inletPatchID, one(), one());
updateValues(inletPatchID, one{}, one{});
}
else
{
......
......@@ -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);
......
......@@ -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
(
......
......@@ -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);
......
......@@ -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
(
......
......@@ -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.
......
......@@ -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)))
{}
......
......@@ -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)))
{}
......
......@@ -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)))
{}
......
......@@ -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)))
{}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment