mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use edge::unitVec() for improved code clarity
This commit is contained in:
@ -429,13 +429,11 @@ bool Foam::cellFeatures::isFeaturePoint(const label edge0, const label edge1)
|
||||
|
||||
const edge& e0 = mesh_.edges()[edge0];
|
||||
|
||||
vector e0Vec = e0.vec(mesh_.points());
|
||||
e0Vec /= mag(e0Vec);
|
||||
const vector e0Vec = e0.unitVec(mesh_.points());
|
||||
|
||||
const edge& e1 = mesh_.edges()[edge1];
|
||||
|
||||
vector e1Vec = e1.vec(mesh_.points());
|
||||
e1Vec /= mag(e1Vec);
|
||||
const vector e1Vec = e1.unitVec(mesh_.points());
|
||||
|
||||
scalar cosAngle;
|
||||
|
||||
|
||||
@ -192,11 +192,7 @@ Foam::vector Foam::meshTools::normEdgeVec
|
||||
const label edgeI
|
||||
)
|
||||
{
|
||||
vector eVec = mesh.edges()[edgeI].vec(mesh.points());
|
||||
|
||||
eVec /= mag(eVec);
|
||||
|
||||
return eVec;
|
||||
return mesh.edges()[edgeI].unitVec(mesh.points());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -432,8 +432,8 @@ void Foam::searchableExtrudedCircle::getNormal
|
||||
normal[i] = info[i].hitPoint()-curvePt.hitPoint();
|
||||
|
||||
// Subtract axial direction
|
||||
vector axialVec = edges[curvePt.index()].vec(points);
|
||||
axialVec /= mag(axialVec);
|
||||
const vector axialVec = edges[curvePt.index()].unitVec(points);
|
||||
|
||||
normal[i] -= (normal[i]&axialVec)*axialVec;
|
||||
normal[i] /= mag(normal[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user