ENH: use cmptMag, cmptMultiply instead of replacing field components

This commit is contained in:
Mark Olesen
2023-01-27 15:21:19 +01:00
parent ea2bedf073
commit 5672bb296f
8 changed files with 34 additions and 46 deletions

View File

@ -227,14 +227,9 @@ void applyScaling(pointField& points, const List<scalar>& scaling)
}
else if (scaling.size() == 3)
{
Info<< "Scaling points by ("
<< scaling[0] << ' '
<< scaling[1] << ' '
<< scaling[2] << ')' << nl;
points.replace(vector::X, scaling[0]*points.component(vector::X));
points.replace(vector::Y, scaling[1]*points.component(vector::Y));
points.replace(vector::Z, scaling[2]*points.component(vector::Z));
const vector factor(scaling[0], scaling[1], scaling[2]);
Info<< "Scaling points by " << factor << nl;
cmptMultiply(points, points, factor);
}
}