From 88cbee7663654f6e00831bf6617e75374b3795b2 Mon Sep 17 00:00:00 2001 From: BillSenior Date: Tue, 29 Oct 2024 15:14:22 +0100 Subject: [PATCH] GRIDEDIT-1502 Fixed clang- formatting warning --- .../CurvilinearGrid/CurvilinearGrid.hpp | 16 ++++------ .../src/CurvilinearGrid/CurvilinearGrid.cpp | 32 ++++++++----------- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/libs/MeshKernel/include/MeshKernel/CurvilinearGrid/CurvilinearGrid.hpp b/libs/MeshKernel/include/MeshKernel/CurvilinearGrid/CurvilinearGrid.hpp index a6ff54ff3..10f85fd63 100644 --- a/libs/MeshKernel/include/MeshKernel/CurvilinearGrid/CurvilinearGrid.hpp +++ b/libs/MeshKernel/include/MeshKernel/CurvilinearGrid/CurvilinearGrid.hpp @@ -463,9 +463,8 @@ namespace meshkernel void CommitAction(const ResetCurvilinearNodeAction& undoAction); private: - /// @brief One dimensional array of NodeType - using NodeTypeArray1D = std::array; + using NodeTypeArray1D = std::array; /// @brief Two dimensional array of NodeType using NodeTypeArray2D = std::array; @@ -479,7 +478,7 @@ namespace meshkernel using NodeTypeArray4D = std::array; /// @brief Get interior node type array - static NodeTypeArray4D InitialiseInteriorNodeType (); + static NodeTypeArray4D InitialiseInteriorNodeType(); /// @brief Remove invalid nodes. /// This function is recursive @@ -530,20 +529,19 @@ namespace meshkernel void SetFacesRTreeRequiresUpdate(bool value) { m_facesRTreeRequiresUpdate = value; } /// @brief Get the node type of the bottom row of nodes, m = 0 - NodeType GetBottomNodeType (const UInt n) const; + NodeType GetBottomNodeType(const UInt n) const; /// @brief Get the node type of the top row of nodes, m = NumM - 1 - NodeType GetTopNodeType (const UInt n) const; + NodeType GetTopNodeType(const UInt n) const; /// @brief Get the node type of the left row of nodes, n = 0 - NodeType GetLeftNodeType (const UInt m) const; + NodeType GetLeftNodeType(const UInt m) const; /// @brief Get the node type of the right row of nodes, m = NumN - 1 - NodeType GetRightNodeType (const UInt m) const; + NodeType GetRightNodeType(const UInt m) const; /// @brief Get the node type of the interior nodes - NodeType GetInteriorNodeType (const UInt n, const UInt m) const; - + NodeType GetInteriorNodeType(const UInt n, const UInt m) const; Projection m_projection; ///< The curvilinear grid projection lin_alg::Matrix m_gridNodes; ///< Member variable storing the grid diff --git a/libs/MeshKernel/src/CurvilinearGrid/CurvilinearGrid.cpp b/libs/MeshKernel/src/CurvilinearGrid/CurvilinearGrid.cpp index c883344cc..743fc49d3 100644 --- a/libs/MeshKernel/src/CurvilinearGrid/CurvilinearGrid.cpp +++ b/libs/MeshKernel/src/CurvilinearGrid/CurvilinearGrid.cpp @@ -430,7 +430,7 @@ void CurvilinearGrid::RemoveInvalidNodes(bool invalidNodesToRemove) RemoveInvalidNodes(invalidNodesToRemove); } -meshkernel::NodeType CurvilinearGrid::GetBottomNodeType (const UInt n) const +meshkernel::NodeType CurvilinearGrid::GetBottomNodeType(const UInt n) const { NodeType result = NodeType::Bottom; @@ -454,7 +454,7 @@ meshkernel::NodeType CurvilinearGrid::GetBottomNodeType (const UInt n) const return result; } -meshkernel::NodeType CurvilinearGrid::GetTopNodeType (const UInt n) const +meshkernel::NodeType CurvilinearGrid::GetTopNodeType(const UInt n) const { NodeType result = NodeType::Up; UInt m = NumM() - 1; @@ -463,7 +463,7 @@ meshkernel::NodeType CurvilinearGrid::GetTopNodeType (const UInt n) const { result = NodeType::UpperLeft; } - else if (n == NumN () - 1) + else if (n == NumN() - 1) { result = NodeType::UpperRight; } @@ -479,8 +479,7 @@ meshkernel::NodeType CurvilinearGrid::GetTopNodeType (const UInt n) const return result; } - -meshkernel::NodeType CurvilinearGrid::GetLeftNodeType (const UInt m) const +meshkernel::NodeType CurvilinearGrid::GetLeftNodeType(const UInt m) const { NodeType result = NodeType::Left; @@ -491,18 +490,17 @@ meshkernel::NodeType CurvilinearGrid::GetLeftNodeType (const UInt m) const else if (!GetNode(0, m + 1).IsValid()) { // TODO SHould this be NodeType::UpperLeft - result = NodeType::UpperLeft;//UpperRight; + result = NodeType::UpperLeft; // UpperRight; } return result; } -meshkernel::NodeType CurvilinearGrid::GetRightNodeType (const UInt m) const +meshkernel::NodeType CurvilinearGrid::GetRightNodeType(const UInt m) const { NodeType result = NodeType::Right; UInt n = NumN() - 1; - if (!GetNode(n, m - 1).IsValid()) { result = NodeType::BottomRight; @@ -515,7 +513,8 @@ meshkernel::NodeType CurvilinearGrid::GetRightNodeType (const UInt m) const return result; } -meshkernel::CurvilinearGrid::NodeTypeArray4D CurvilinearGrid::InitialiseInteriorNodeType () { +meshkernel::CurvilinearGrid::NodeTypeArray4D CurvilinearGrid::InitialiseInteriorNodeType() +{ NodeTypeArray4D result; @@ -537,23 +536,20 @@ meshkernel::CurvilinearGrid::NodeTypeArray4D CurvilinearGrid::InitialiseInterior result[1][1][1][1] = NodeType::InternalValid; return result; - } - -meshkernel::NodeType CurvilinearGrid::GetInteriorNodeType (const UInt n, const UInt m) const +meshkernel::NodeType CurvilinearGrid::GetInteriorNodeType(const UInt n, const UInt m) const { - static const NodeTypeArray4D InteriorNodeType = InitialiseInteriorNodeType (); + static const NodeTypeArray4D InteriorNodeType = InitialiseInteriorNodeType(); const size_t isTopRightFaceValid = IsFaceMaskValid(n, m) ? 1u : 0u; const size_t isTopLeftFaceValid = IsFaceMaskValid(n - 1, m) ? 1u : 0u; const size_t isBottomLeftFaceValid = IsFaceMaskValid(n - 1, m - 1) ? 1u : 0u; const size_t isBottomRightFaceValid = IsFaceMaskValid(n, m - 1) ? 1u : 0u; - return InteriorNodeType [isTopRightFaceValid][isTopLeftFaceValid][isBottomLeftFaceValid][isBottomRightFaceValid]; + return InteriorNodeType[isTopRightFaceValid][isTopLeftFaceValid][isBottomLeftFaceValid][isBottomRightFaceValid]; } - void CurvilinearGrid::ComputeGridNodeTypes() { RemoveInvalidNodes(true); @@ -574,14 +570,14 @@ void CurvilinearGrid::ComputeGridNodeTypes() // Bottom side if (m == 0) { - GetNodeType(n, m) = GetBottomNodeType (n); + GetNodeType(n, m) = GetBottomNodeType(n); continue; } // Upper side if (m == NumM() - 1) { - GetNodeType(n, m) = GetTopNodeType (n); + GetNodeType(n, m) = GetTopNodeType(n); continue; } @@ -599,7 +595,7 @@ void CurvilinearGrid::ComputeGridNodeTypes() continue; } - GetNodeType(n, m) = GetInteriorNodeType (n, m); + GetNodeType(n, m) = GetInteriorNodeType(n, m); } } }