I'm sitting over this problem quite a while now, but im not sure about the answer. Given is the following mixed boundary value problem: \begin{align*} -\nabla \cdot(A(x)\nabla u) &= f \qquad \ \ x \in \Omega, \\ u &= g_D \qquad x \in \Gamma_D, \\ \frac{\partial u}{\partial \nu} &= g_N \qquad x \in \Gamma_N, \end{align*} I want to use the Deep Ritz Method (arXiv:1710.00211). What does the variational fomulation for numerical minimization look like? My best guess is: \begin{align*} I(u) = & \int\limits_{\Omega} \frac{1}{2}A\nabla u \cdot \nabla u -fu \ dx + \underbrace{\frac{\beta}{2} \int\limits_{\Gamma_D}{} (g_D - u)^2 \ d \sigma(x)}_{\text{just a penalty term}} + \int\limits_{\Gamma_N}{} g_N u \ d \sigma(x). \end{align*}
The similar questions didn't help me :/