mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use Zero when zero-initializing types
- makes the intent clearer and avoids the need for additional
constructor casting. Eg,
labelList(10, Zero) vs. labelList(10, 0)
scalarField(10, Zero) vs. scalarField(10, scalar(0))
vectorField(10, Zero) vs. vectorField(10, vector::zero)
This commit is contained in:
@ -141,7 +141,7 @@ tmp<vectorField> calcPointNormals
|
||||
{
|
||||
const labelListList& edgeFaces = s.edgeFaces();
|
||||
|
||||
labelList nNormals(s.nPoints(), 0);
|
||||
labelList nNormals(s.nPoints(), Zero);
|
||||
forAll(edgeStat, edgeI)
|
||||
{
|
||||
if (edgeStat[edgeI] != surfaceFeatures::NONE)
|
||||
@ -355,10 +355,10 @@ tmp<scalarField> avg
|
||||
const scalarField& edgeWeights
|
||||
)
|
||||
{
|
||||
tmp<scalarField> tres(new scalarField(s.nPoints(), 0.0));
|
||||
tmp<scalarField> tres(new scalarField(s.nPoints(), Zero));
|
||||
scalarField& res = tres.ref();
|
||||
|
||||
scalarField sumWeight(s.nPoints(), 0.0);
|
||||
scalarField sumWeight(s.nPoints(), Zero);
|
||||
|
||||
const edgeList& edges = s.edges();
|
||||
|
||||
@ -499,7 +499,7 @@ void lloydsSmoothing
|
||||
const pointField& points = s.points();
|
||||
|
||||
vectorField pointSum(s.nPoints(), Zero);
|
||||
labelList nPointSum(s.nPoints(), 0);
|
||||
labelList nPointSum(s.nPoints(), Zero);
|
||||
|
||||
forAll(edges, edgeI)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user