Physics-informed neural networks (PINNs) that embed the information of partial differential equation (PDE) into the loss function are being increasingly applied and developed in the field of numerical methods for differential equations. Compared to PINNs, gradient-enhanced physics-informed neural networks (gPINNs) further utilize gradient information of the PDE residual and exhibit higher accuracy. In this paper, we present an adaptive gPINN model based on hard constraints for achieving more accurate solutions to PDEs. This model utilizes residual information for sampling points and allows for the placement of more points in sharp areas of the solution to enhance the model's effectiveness. The process of adaptive sampling points is implemented over several iterations. During each iteration, the computational domain is divided into several subdomains, and then a number of points are selected to be added to the training points from the subdomain with the largest mean value of the absolute PDE residuals. Obviously, the new training set has more data points than the original training set, and the distribution of training points characterizes the features of the problem. From this viewpoint, the new training set is better suited to enhance the predictive accuracy of neural networks. Finally, we test the Poisson equation, Burgers' equation, and Allen–Cahn equation. The results indicate that the proposed adaptive gPINNs achieve higher predictive accuracy compared to the standard gPINNs.
Chen et al. (Wed,) studied this question.