Hard-constrained Physics-informed Neural Networks for Interface Problems
Physics-informed neural networks (PINNs) have emerged as a flexible framework for solving partial differential equations, but interface problems remain challenging because continuity and flux conditions are typically imposed through soft penalty terms, leading to imperfect interface enforcement and degraded accuracy near interfaces. We introduce two ansatz-based hard-constrained PINN formulations for interface problems that embed the interface physics into the solution representation, decoupling interface enforcement from PDE residual minimization. The windowing approach constructs the trial space from compactly supported windowed subnetworks so that interface continuity and flux balance are satisfied by design. The buffer approach discretely hard-constrains subnetworks with additive buffer functions that enforce boundary and interface constraints at sampled points through a lightweight correction. We study both formulations on one- and two-dimensional elliptic interface benchmarks against soft-constrained baselines. A statistical study in one dimension shows that the windowing approach occasionally attains very high accuracy (as low as $O(10^{-9})$) on simple structured cases, but its rigid ansatz makes training stiff, so its median errors are often worse than the baselines. In contrast, the buffer approach achieves the smallest median error (as low as $O(10^{-5})$) across a wider range of source terms and interface configurations. In two dimensions, the buffer formulation is more robust for general geometries, while the windowing construction is more sensitive to overlap and corner effects and over-constrains the problem. These results position the buffer method as a straightforward and promising approach for interface problems, with the search for an optimal buffer function form left for future work.