Skip to content

Commit

Permalink
GRIDEDIT-1614 Fixed clang formatting warning
Browse files Browse the repository at this point in the history
  • Loading branch information
BillSenior committed Feb 17, 2025
1 parent 5e84e5a commit 37833ac
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
8 changes: 4 additions & 4 deletions libs/MeshKernel/include/MeshKernel/Constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,22 @@ namespace meshkernel
constexpr int intValue = -999; ///< Integer value used as missing value
constexpr UInt uintValue = std::numeric_limits<UInt>::max(); ///< missing value used for invalid indices
constexpr Eigen::Index EigenIndexValue = std::numeric_limits<Eigen::Index>::max(); ///< missing value used for invalid eigen indices
} // namespace missing
} // namespace missing

// often used values
namespace numeric
{
static double const squareRootOfThree = std::sqrt(3.0); ///< The result of sqrt(3)
constexpr double oneThird = 1.0 / 3.0; ///< The result of 1 / 3
constexpr int defaultSnappingIterations = 5; ///< Default number of iterations to take in the spline snapping algorithm
} // namespace numeric
} // namespace numeric

// unit conversion constants
namespace conversion
{
constexpr double degToRad = M_PI / 180.0; ///< Conversion factor from degrees to radians(pi / 180)
constexpr double radToDeg = 1.0 / degToRad; ///< Conversion factor from radians to degrees(180 / pi)
} // namespace conversion
} // namespace conversion

// geometric constants
namespace geometric
Expand All @@ -95,7 +95,7 @@ namespace meshkernel
{
constexpr double gravity = 9.80665; ///< Gravitational acceleration on earth (m/s^2)
static double const sqrt_gravity = std::sqrt(gravity); ///< Square root of gravitational acceleration on earth
} // namespace physical
} // namespace physical

} // namespace constants
} // namespace meshkernel
10 changes: 5 additions & 5 deletions libs/MeshKernel/include/MeshKernel/Contacts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ namespace meshkernel
/// @brief Validate checking mesh1d and mesh2d are not empty, throws an exception otherwise
void Validate() const;

Mesh1D& m_mesh1d; ///< The 1-d mesh to connect
Mesh2D& m_mesh2d; ///< The 2-d mesh to connect
std::vector<UInt> m_mesh1dIndices; ///< The indices of the connected 1-d nodes
std::vector<UInt> m_mesh2dIndices; ///< The indices of the connected 2-d faces
Mesh1D& m_mesh1d; ///< The 1-d mesh to connect
Mesh2D& m_mesh2d; ///< The 2-d mesh to connect
std::vector<UInt> m_mesh1dIndices; ///< The indices of the connected 1-d nodes
std::vector<UInt> m_mesh2dIndices; ///< The indices of the connected 2-d faces
std::vector<Point> m_facesCircumcenters; ///< The circumcentres of the faces of the mesh2d.
bool m_areComputed = false; ///< Indicates whether contacts have been computed
bool m_areComputed = false; ///< Indicates whether contacts have been computed
};
} // namespace meshkernel
2 changes: 1 addition & 1 deletion libs/MeshKernel/src/CasulliRefinement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ void meshkernel::CasulliRefinement::ConnectNewNodes(Mesh2D& mesh, const std::vec

void meshkernel::CasulliRefinement::ComputeNewFaceNodes(Mesh2D& mesh, std::vector<EdgeNodes>& newNodes, std::vector<NodeMask>& nodeMask)
{
std::vector<Point> faceCircumcentres = MeshFaceCenters::ComputeCircumcenters (mesh);
std::vector<Point> faceCircumcentres = MeshFaceCenters::ComputeCircumcenters(mesh);

for (UInt i = 0; i < mesh.GetNumFaces(); ++i)
{
Expand Down
4 changes: 2 additions & 2 deletions libs/MeshKernel/src/Contacts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
#include "MeshKernel/Definitions.hpp"
#include "MeshKernel/Exceptions.hpp"
#include "MeshKernel/MeshEdgeLength.hpp"
#include "MeshKernel/MeshFaceCenters.hpp"
#include "MeshKernel/Operations.hpp"
#include "MeshKernel/Polygons.hpp"
#include "MeshKernel/MeshFaceCenters.hpp"
#include "MeshKernel/Utilities/RTreeFactory.hpp"

using meshkernel::Contacts;
Expand All @@ -48,7 +48,7 @@ Contacts::Contacts(Mesh1D& mesh1d, Mesh2D& mesh2d)
throw AlgorithmError("meshkernel::Contacts::Contacts: m_mesh1d and m_mesh2d projections are different");
}

m_facesCircumcenters = MeshFaceCenters::ComputeCircumcenters (mesh2d);
m_facesCircumcenters = MeshFaceCenters::ComputeCircumcenters(mesh2d);
}

void Contacts::ComputeSingleContacts(const std::vector<bool>& oneDNodeMask,
Expand Down
5 changes: 2 additions & 3 deletions libs/MeshKernel/src/MeshOrthogonality.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include "MeshKernel/MeshOrthogonality.hpp"
#include "MeshKernel/Constants.hpp"
#include "MeshKernel/Exceptions.hpp"
#include "MeshKernel/Operations.hpp"
#include "MeshKernel/MeshFaceCenters.hpp"
#include "MeshKernel/Operations.hpp"

std::vector<double> meshkernel::MeshOrthogonality::Compute(const Mesh2D& mesh)
{
Expand Down Expand Up @@ -84,8 +84,7 @@ void meshkernel::MeshOrthogonality::Compute(const Mesh2D& mesh, std::span<double
throw ConstraintError("array for orthogonality values is not the correct size");
}

std::vector<Point> faceCircumcentres = MeshFaceCenters::ComputeCircumcenters (mesh);

std::vector<Point> faceCircumcentres = MeshFaceCenters::ComputeCircumcenters(mesh);

const auto numEdges = mesh.GetNumEdges();

Expand Down
2 changes: 1 addition & 1 deletion libs/MeshKernel/tests/src/MeshRefinementTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ TEST(MeshRefinement, RefineElongatedFaces)
// Assert circumcenters are correctly computed
constexpr double tolerance = 1e-6;

std::vector<Point> faceCircumcenters = MeshFaceCenters::ComputeCircumcenters (*mesh);
std::vector<Point> faceCircumcenters = MeshFaceCenters::ComputeCircumcenters(*mesh);

// Compare the x-location of the circumcentre.
ASSERT_NEAR(1673.0860169014584, faceCircumcenters[0].x, tolerance);
Expand Down

0 comments on commit 37833ac

Please sign in to comment.