From 494b0ae37c52cb4b0f26364411f49538004a2788 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Mon, 28 Apr 2025 15:31:30 +0200 Subject: [PATCH] code formatting in blayer files --- libsrc/meshing/boundarylayer.cpp | 52 ++++++++++---------- libsrc/meshing/boundarylayer.hpp | 12 ++--- libsrc/meshing/boundarylayer_interpolate.cpp | 6 +-- libsrc/meshing/boundarylayer_limiter.hpp | 9 ++-- 4 files changed, 39 insertions(+), 40 deletions(-) diff --git a/libsrc/meshing/boundarylayer.cpp b/libsrc/meshing/boundarylayer.cpp index 54a6966f..11a32cfb 100644 --- a/libsrc/meshing/boundarylayer.cpp +++ b/libsrc/meshing/boundarylayer.cpp @@ -14,7 +14,7 @@ namespace netgen struct SpecialPointException : public Exception { - SpecialPointException() + SpecialPointException () : Exception("") {} }; @@ -101,14 +101,14 @@ Vec<3> CalcGrowthVector (FlatArray> ns) return gw; } -SpecialBoundaryPoint ::GrowthGroup ::GrowthGroup(FlatArray faces_, - FlatArray> normals) +SpecialBoundaryPoint ::GrowthGroup ::GrowthGroup (FlatArray faces_, + FlatArray> normals) { faces = faces_; growth_vector = CalcGrowthVector(normals); } -SpecialBoundaryPoint ::SpecialBoundaryPoint( +SpecialBoundaryPoint ::SpecialBoundaryPoint ( const std::map>& normals) { // find opposing face normals @@ -146,7 +146,7 @@ SpecialBoundaryPoint ::SpecialBoundaryPoint( growth_groups.Append(GrowthGroup(g2_faces, normals2)); } -Vec<3> BoundaryLayerTool ::getEdgeTangent(PointIndex pi, int edgenr, FlatArray segs) +Vec<3> BoundaryLayerTool ::getEdgeTangent (PointIndex pi, int edgenr, FlatArray segs) { Vec<3> tangent = 0.0; ArrayMem pts; @@ -171,7 +171,7 @@ Vec<3> BoundaryLayerTool ::getEdgeTangent(PointIndex pi, int edgenr, FlatArray & segments, Array & free_segments) +void BuildSegments (Mesh& mesh, bool have_single_segments, Array& segments, Array& free_segments) { // auto& topo = mesh.GetTopology(); @@ -234,11 +234,11 @@ void BuildSegments (Mesh& mesh, bool have_single_segments, Array & segm free_segments.Append(seg); continue; } - if(!have_single_segments) - { - segments.Append(seg); - continue; - } + if (!have_single_segments) + { + segments.Append(seg); + continue; + } mesh.GetTopology().GetSegmentSurfaceElements(segi + 1, surf_els); for (auto seli : surf_els) { @@ -284,8 +284,8 @@ void MergeAndAddSegments (Mesh& mesh, FlatArray segments, FlatArray>, SegmentIndex> -BoundaryLayerTool ::BuildSegMap() +BoundaryLayerTool ::BuildSegMap () { // Bit array to keep track of segments already processed BitArray segs_done(nseg + 1); @@ -536,7 +536,7 @@ BoundaryLayerTool ::BuildSegMap() return segmap; } -BitArray BoundaryLayerTool ::ProjectGrowthVectorsOnSurface() +BitArray BoundaryLayerTool ::ProjectGrowthVectorsOnSurface () { BitArray in_surface_direction(nfd_old + 1); in_surface_direction.Clear(); @@ -596,7 +596,7 @@ BitArray BoundaryLayerTool ::ProjectGrowthVectorsOnSurface() return in_surface_direction; } -void BoundaryLayerTool ::InsertNewElements( +void BoundaryLayerTool ::InsertNewElements ( FlatArray>, SegmentIndex> segmap, const BitArray& in_surface_direction) { @@ -1065,7 +1065,7 @@ void BoundaryLayerTool ::InsertNewElements( } } -void BoundaryLayerTool ::SetDomInOut() +void BoundaryLayerTool ::SetDomInOut () { if (insert_only_volume_elements) return; @@ -1081,7 +1081,7 @@ void BoundaryLayerTool ::SetDomInOut() } } -void BoundaryLayerTool ::SetDomInOutSides() +void BoundaryLayerTool ::SetDomInOutSides () { // Set the domin/domout entries for face descriptors on the "side" of new boundary layers if (insert_only_volume_elements) @@ -1155,7 +1155,7 @@ void BoundaryLayerTool ::SetDomInOutSides() } } -void BoundaryLayerTool ::AddSegments() +void BoundaryLayerTool ::AddSegments () { auto& new_segs = insert_only_volume_elements ? new_segments_on_moved_bnd : new_segments; @@ -1199,14 +1199,14 @@ void BoundaryLayerTool ::AddSegments() mesh.AddSegment(seg); } -void BoundaryLayerTool ::AddSurfaceElements() +void BoundaryLayerTool ::AddSurfaceElements () { for (auto& sel : insert_only_volume_elements ? new_sels_on_moved_bnd : new_sels) mesh.AddSurfaceElement(sel); } -void BoundaryLayerTool ::ProcessParameters() +void BoundaryLayerTool ::ProcessParameters () { if (int* bc = get_if(¶ms.boundary); bc) { @@ -1374,7 +1374,7 @@ void BoundaryLayerTool ::ProcessParameters() domains.Invert(); } -void BoundaryLayerTool ::Perform() +void BoundaryLayerTool ::Perform () { if (domains.NumSet() == 0) return; diff --git a/libsrc/meshing/boundarylayer.hpp b/libsrc/meshing/boundarylayer.hpp index 5a315cc2..0d8e20f5 100644 --- a/libsrc/meshing/boundarylayer.hpp +++ b/libsrc/meshing/boundarylayer.hpp @@ -22,15 +22,15 @@ struct SpecialBoundaryPoint Vec<3> growth_vector; Array new_points; - GrowthGroup(FlatArray faces_, FlatArray> normals); - GrowthGroup(const GrowthGroup&) = default; - GrowthGroup() = default; + GrowthGroup (FlatArray faces_, FlatArray> normals); + GrowthGroup (const GrowthGroup&) = default; + GrowthGroup () = default; }; Array growth_groups; Vec<3> separating_direction; - SpecialBoundaryPoint(const std::map>& normals); - SpecialBoundaryPoint() = default; + SpecialBoundaryPoint (const std::map>& normals); + SpecialBoundaryPoint () = default; }; DLL_HEADER void GenerateBoundaryLayer (Mesh& mesh, @@ -41,7 +41,7 @@ DLL_HEADER int /* new_domain_number */ GenerateBoundaryLayer2 (Mesh& mesh, int d class BoundaryLayerTool { public: - BoundaryLayerTool(Mesh& mesh_, const BoundaryLayerParameters& params_); + BoundaryLayerTool (Mesh& mesh_, const BoundaryLayerParameters& params_); void ProcessParameters (); void Perform (); diff --git a/libsrc/meshing/boundarylayer_interpolate.cpp b/libsrc/meshing/boundarylayer_interpolate.cpp index b3d3293f..f4e742e2 100644 --- a/libsrc/meshing/boundarylayer_interpolate.cpp +++ b/libsrc/meshing/boundarylayer_interpolate.cpp @@ -70,7 +70,7 @@ BuildNeighbors (FlatArray points, const Mesh& mesh) return neighbors; } -void BoundaryLayerTool ::InterpolateGrowthVectors() +void BoundaryLayerTool ::InterpolateGrowthVectors () { point_types.SetSize(mesh.GetNP()); for (auto p : mesh.Points().Range()) @@ -299,7 +299,7 @@ void BoundaryLayerTool ::InterpolateGrowthVectors() } } -void BoundaryLayerTool ::InterpolateSurfaceGrowthVectors() +void BoundaryLayerTool ::InterpolateSurfaceGrowthVectors () { static Timer tall("InterpolateSurfaceGrowthVectors"); RegionTimer rtall(tall); @@ -399,7 +399,7 @@ void BoundaryLayerTool ::InterpolateSurfaceGrowthVectors() growthvectors[pi] += corrections[pi]; } -void BoundaryLayerTool ::FixSurfaceElements() +void BoundaryLayerTool ::FixSurfaceElements () { static Timer tall("FixSurfaceElements"); RegionTimer rtall(tall); diff --git a/libsrc/meshing/boundarylayer_limiter.hpp b/libsrc/meshing/boundarylayer_limiter.hpp index 95ba9d9e..6904a61d 100644 --- a/libsrc/meshing/boundarylayer_limiter.hpp +++ b/libsrc/meshing/boundarylayer_limiter.hpp @@ -29,7 +29,7 @@ struct GrowthVectorLimiter Array map_from; Table p2sel; - GrowthVectorLimiter(BoundaryLayerTool& tool_) + GrowthVectorLimiter (BoundaryLayerTool& tool_) : tool(tool_), params(tool_.params), mesh(tool_.mesh), height(tool_.total_height), growthvectors(tool_.growthvectors), map_from(mesh.Points().Size()) { changed_domains = tool.domains; @@ -287,7 +287,7 @@ struct GrowthVectorLimiter if (factor == 0.0) return; // for (PointIndex pi : IntRange(tool.np, mesh.GetNP())) - for (PointIndex pi : mesh.Points().Range().Modify(tool.np,0)) + for (PointIndex pi : mesh.Points().Range().Modify(tool.np, 0)) { // auto pi_from = map_from[pi]; std::set pis; @@ -464,8 +464,7 @@ struct GrowthVectorLimiter } template - void FindTreeIntersections (double trig_shift, double seg_shift, TFunc f, - TBitArray * relevant_points = nullptr) + void FindTreeIntersections (double trig_shift, double seg_shift, TFunc f, TBitArray* relevant_points = nullptr) { static Timer t("GrowthVectorLimiter::FindTreeIntersections"); RegionTimer rt(t); @@ -629,7 +628,7 @@ struct GrowthVectorLimiter size_t limit_counter = 1; TBitArray relevant_points, relevant_points_next; - relevant_points.SetSize(mesh.Points().Size() + 1); + relevant_points.SetSize(mesh.Points().Size() + 1); relevant_points_next.SetSize(mesh.Points().Size() + 1); relevant_points.Set();