From 58aa8c97c28c5ae973de2ca6906ef560a61a8018 Mon Sep 17 00:00:00 2001 From: Martin Lichtmes <> Date: Fri, 14 Jun 2024 09:23:39 +0200 Subject: [PATCH] ENH: report average surface normal in surfaceInertia utility (#3184) - can be useful for various orientation-related geometry or mesh manipulations during pre-/post-processing: * combine with linearDirection to achieve better extrusion results. * orientation of transformations, blockMesh, result projections, ... STYLE: minor code modernizations Co-authored-by: Mark Olesen <> --- .../surface/surfaceInertia/surfaceInertia.C | 81 ++++++++++--------- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/applications/utilities/surface/surfaceInertia/surfaceInertia.C b/applications/utilities/surface/surfaceInertia/surfaceInertia.C index 2b51209788..44275cb4d0 100644 --- a/applications/utilities/surface/surfaceInertia/surfaceInertia.C +++ b/applications/utilities/surface/surfaceInertia/surfaceInertia.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2015-2021 OpenCFD Ltd. + Copyright (C) 2015-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -161,25 +161,22 @@ int main(int argc, char *argv[]) // rather than tensors to allow indexed permutation. // Cartesian basis vectors - right handed orthogonal triplet - List cartesian(3); + FixedList cartesian; cartesian[0] = vector(1, 0, 0); cartesian[1] = vector(0, 1, 0); cartesian[2] = vector(0, 0, 1); - // Principal axis basis vectors - right handed orthogonal - // triplet - List principal(3); + // Principal axis basis vectors - right handed orthogonal triplet + FixedList principal; principal[0] = eVec.x(); principal[1] = eVec.y(); principal[2] = eVec.z(); - scalar maxMagDotProduct = -GREAT; - // Matching axis indices, first: cartesian, second:principal - Pair