Implemented class: SurfaceSampler2D
Boundary nodes serve a dual purpose in meshfree structural analysis:
In the MLPG method, boundary conditions are not enforced in the same way as in FEM. Dirichlet conditions are typically imposed by direct substitution or by a penalty/Lagrange multiplier approach applied at boundary nodes; Neumann conditions enter the weak form as surface integrals over the boundary of the local subdomain that overlaps with the global boundary. In both cases, having boundary nodes precisely on the geometric edges — with correct normals — is essential.
The boundary of a planar face is a closed polygon consisting of one or more edges (wires). Each edge is a parametric curve C(u), where u ∈ [u0, u1] is the curve parameter.
The arc-length along the edge is defined as:
The total arc-length of the edge is L = s(u1). The algorithm places nodes at positions ui such that:
where h is the characteristic node spacing. This guarantees that consecutive boundary nodes are separated by exactly h along the curve, regardless of the curve's parametrization (linear, arc, spline, etc.).
At each boundary node placed at parameter ui, the outward in-plane normal is computed as:
REVERSED direction with respect to the face outer wire, negate the tangent.This construction guarantees that n̂ lies in the plane of the face (perpendicular to Nface) and points outward from the domain interior for a counter-clockwise (CCW) wound outer wire.
The sampling is performed using the OpenCASCADE (OCC) library:
BRepTools_WireExplorer.GCPnts_UniformAbscissa algorithm computes parameter values at uniform arc-length intervals of h along each edge.BRepAdaptor_Curve.D1(), which returns both the point and the tangent.SurfaceSampler2D generates only boundary nodes (is_boundary = True). Interior nodes are generated separately by a dedicated interior sampler and then merged with the boundary cloud by the PointCloudGenerator.
For faces with inner holes (e.g. perforated plates), the OCC topology contains one outer wire and one inner wire for each hole. The arc-length sampler walks all wires, including hole edges. However, in complex geometries, the topological arc of a hole edge may extend geometrically beyond the outer boundary — or an outer-wire segment may pass through a hole — producing nodes that are topologically on a wire but materially invalid.
To remove these spurious nodes, a post-sampling filter filter_boundary_pts_occ() is applied whenever the face has more than one wire (outer + at least one hole). The filter uses the OpenCASCADE BRepClass_FaceClassifier to validate each node by probing the material state on both sides of the stored outward normal:
ShapeAnalysis_Surface.ValueOfUV() and classified with BRepClass_FaceClassifier.TopAbs_IN (inside the material). This is the expected condition for a genuine material-void interface node.TopAbs_OUT, which indicates that the node sits on a wire arc segment that has no material on either side — i.e. a geometrically invalid position.n_max (int or None): Hard cap on total boundary nodes per entity. If set, a uniform random subset is selected. Default: no limit.