  In this work, we develop an efficient solver based on neural networks for
second-order elliptic equations with variable coefficients and singular
sources. This class of problems covers general point sources, line sources and
the combination of point-line sources, and has a broad range of practical
applications. The proposed approach is based on decomposing the true solution
into a singular part that is known analytically using the fundamental solution
of the Laplace equation and a regular part that satisfies a suitable modified
elliptic PDE with a smoother source, and then solving for the regular part
using the deep Ritz method. A path-following strategy is suggested to select
the penalty parameter for enforcing the Dirichlet boundary condition. Extensive
numerical experiments in two- and multi-dimensional spaces with point sources,
line sources or their combinations are presented to illustrate the efficiency
of the proposed approach, and a comparative study with several existing
approaches based on neural networks is also given, which shows clearly its
competitiveness for the specific class of problems. In addition, we briefly
discuss the error analysis of the approach.
