code formatting in blayer files

This commit is contained in:
Matthias Hochsteger 2025-04-28 15:31:30 +02:00
parent f42d0c0be4
commit 494b0ae37c
4 changed files with 39 additions and 40 deletions

View File

@ -14,7 +14,7 @@ namespace netgen
struct SpecialPointException : public Exception
{
SpecialPointException()
SpecialPointException ()
: Exception("") {}
};
@ -101,14 +101,14 @@ Vec<3> CalcGrowthVector (FlatArray<Vec<3>> ns)
return gw;
}
SpecialBoundaryPoint ::GrowthGroup ::GrowthGroup(FlatArray<int> faces_,
SpecialBoundaryPoint ::GrowthGroup ::GrowthGroup (FlatArray<int> faces_,
FlatArray<Vec<3>> normals)
{
faces = faces_;
growth_vector = CalcGrowthVector(normals);
}
SpecialBoundaryPoint ::SpecialBoundaryPoint(
SpecialBoundaryPoint ::SpecialBoundaryPoint (
const std::map<int, Vec<3>>& 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<Segment*> segs)
Vec<3> BoundaryLayerTool ::getEdgeTangent (PointIndex pi, int edgenr, FlatArray<Segment*> segs)
{
Vec<3> tangent = 0.0;
ArrayMem<PointIndex, 2> pts;
@ -171,7 +171,7 @@ Vec<3> BoundaryLayerTool ::getEdgeTangent(PointIndex pi, int edgenr, FlatArray<S
return tangent.Normalize();
}
void BoundaryLayerTool ::LimitGrowthVectorLengths()
void BoundaryLayerTool ::LimitGrowthVectorLengths ()
{
static Timer tall("BoundaryLayerTool::LimitGrowthVectorLengths");
RegionTimer rtall(tall);
@ -220,7 +220,7 @@ bool HaveSingleSegments (const Mesh& mesh)
// duplicates segments (and sets seg.si accordingly) to have a unified data
// structure for all geometry types
void BuildSegments (Mesh& mesh, bool have_single_segments, Array<Segment> & segments, Array<Segment> & free_segments)
void BuildSegments (Mesh& mesh, bool have_single_segments, Array<Segment>& segments, Array<Segment>& free_segments)
{
// auto& topo = mesh.GetTopology();
@ -234,7 +234,7 @@ void BuildSegments (Mesh& mesh, bool have_single_segments, Array<Segment> & segm
free_segments.Append(seg);
continue;
}
if(!have_single_segments)
if (!have_single_segments)
{
segments.Append(seg);
continue;
@ -284,7 +284,7 @@ void MergeAndAddSegments (Mesh& mesh, FlatArray<Segment> segments, FlatArray<Seg
addSegment(seg);
}
BoundaryLayerTool::BoundaryLayerTool(Mesh& mesh_,
BoundaryLayerTool::BoundaryLayerTool (Mesh& mesh_,
const BoundaryLayerParameters& params_)
: mesh(mesh_), topo(mesh_.GetTopology()), params(params_)
{
@ -318,7 +318,7 @@ BoundaryLayerTool::BoundaryLayerTool(Mesh& mesh_,
si_map[i] = i;
}
void BoundaryLayerTool ::CreateNewFaceDescriptors()
void BoundaryLayerTool ::CreateNewFaceDescriptors ()
{
surfacefacs.SetSize(nfd_old + 1);
surfacefacs = 0.0;
@ -360,7 +360,7 @@ void BoundaryLayerTool ::CreateNewFaceDescriptors()
throw Exception("Surface " + to_string(si) + " is not a boundary of the domain to be grown into!");
}
void BoundaryLayerTool ::CreateFaceDescriptorsSides()
void BoundaryLayerTool ::CreateFaceDescriptorsSides ()
{
if (insert_only_volume_elements)
return;
@ -400,7 +400,7 @@ void BoundaryLayerTool ::CreateFaceDescriptorsSides()
}
}
void BoundaryLayerTool ::CalculateGrowthVectors()
void BoundaryLayerTool ::CalculateGrowthVectors ()
{
growthvectors.SetSize(np);
growthvectors = 0.;
@ -457,7 +457,7 @@ void BoundaryLayerTool ::CalculateGrowthVectors()
}
Array<Array<pair<SegmentIndex, int>>, 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<Array<pair<SegmentIndex, int>>, 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<int>(&params.boundary); bc)
{
@ -1374,7 +1374,7 @@ void BoundaryLayerTool ::ProcessParameters()
domains.Invert();
}
void BoundaryLayerTool ::Perform()
void BoundaryLayerTool ::Perform ()
{
if (domains.NumSet() == 0)
return;

View File

@ -22,15 +22,15 @@ struct SpecialBoundaryPoint
Vec<3> growth_vector;
Array<PointIndex> new_points;
GrowthGroup(FlatArray<int> faces_, FlatArray<Vec<3>> normals);
GrowthGroup(const GrowthGroup&) = default;
GrowthGroup() = default;
GrowthGroup (FlatArray<int> faces_, FlatArray<Vec<3>> normals);
GrowthGroup (const GrowthGroup&) = default;
GrowthGroup () = default;
};
Array<GrowthGroup> growth_groups;
Vec<3> separating_direction;
SpecialBoundaryPoint(const std::map<int, Vec<3>>& normals);
SpecialBoundaryPoint() = default;
SpecialBoundaryPoint (const std::map<int, Vec<3>>& 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 ();

View File

@ -70,7 +70,7 @@ BuildNeighbors (FlatArray<PointIndex> 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);

View File

@ -29,7 +29,7 @@ struct GrowthVectorLimiter
Array<PointIndex, PointIndex> map_from;
Table<SurfaceElementIndex, PointIndex> 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<PointIndex> pis;
@ -464,8 +464,7 @@ struct GrowthVectorLimiter
}
template <typename TFunc>
void FindTreeIntersections (double trig_shift, double seg_shift, TFunc f,
TBitArray<PointIndex> * relevant_points = nullptr)
void FindTreeIntersections (double trig_shift, double seg_shift, TFunc f, TBitArray<PointIndex>* relevant_points = nullptr)
{
static Timer t("GrowthVectorLimiter::FindTreeIntersections");
RegionTimer rt(t);