ENH: vector mag(), magSqr() methods - complementary to dist(), distSqr()

ENH: use direct access to pointHit as point(), use dist(), distSqr()

- if the pointHit has already been checked for hit(), can/should
  simply use point() noexcept access subsequently to avoid redundant
  checks. Using vector distSqr() methods provides a minor optimization
  (no itermediate temporary), but can also make for clearer code.

ENH: copy construct pointIndexHit with different index

- symmetric with constructing from a pointHit with an index

STYLE: prefer pointHit point() instead of rawPoint()
This commit is contained in:
Mark Olesen
2022-11-01 12:15:08 +01:00
committed by Andrew Heather
parent 5ec435aca3
commit 27c2cdc040
112 changed files with 669 additions and 674 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2018-2021 OpenCFD Ltd.
Copyright (C) 2018-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -273,12 +273,12 @@ void Foam::patchSeedSet::calcSamples
const point& cc = mesh().cellCentres()[celli];
samplingPts.append
(
info.hitPoint() + 1e-1*(cc-info.hitPoint())
info.point() + 1e-1*(cc-info.point())
);
}
else
{
samplingPts.append(info.rawPoint());
samplingPts.append(info.point());
}
samplingCells.append(celli);
samplingFaces.append(facei);