# Meshfree Variational-Physics-Informed Neural Networks (MF-VPINN): An Adaptive Training Strategy
## 3 Numerical Results
### Adaptive Training Strategies  
Let us consider the Poisson problem:  
\[ \begin{cases}-\Delta u=f&\text{in}\;\;\Omega,\\ u=g&\text{on}\;\;\Gamma,\end{cases}  \tag{28}\]  
defined on the unit square \(\Omega=(0,1)^{2}\). The forcing term \(f\) and the boundary condition \(g\) are chosen such that the exact solution is, in polar coordinates,  
\[u(r,\theta)=r^{\frac{2}{3}}\sin\biggl{(}\frac{2}{3}\Bigl{(}\theta+\frac{\pi}{ 2}\Bigr{)}\biggr{)}. \tag{29}\]  
We use this function, represented in Figure 2, because the solution \(u\) is such that \(u\in H^{5/3-\varepsilon}(\Omega)\) but \(u\in C^{\infty}(\Omega)\backslash\mathcal{N}_{0})\), where we denote by \(\mathcal{N}_{0}\) a neighborhood of the origin. Therefore, we know that an efficient distribution of patches has to be characterized by a high density only near the origin. Below, we propose, in order of complexity, three alternatives to construct the new patches after having marked the ones with the higher error indicator. The first strategy is the most simple and intuitive, and the new patches are randomly generated with centers inside the marked patches, whereas the second strategy and third one place the new centers on a small local cartesian grid to ensure a more regular distribution. The difference between the second and the third strategies is that the marked patches are removed to increase the efficiency and we add a constraint to the marking procedure to ensure more regular distributions of the new patches. _Strategy #1: Random patch centers with uniform distribution_  
To solve Problem (28), as a first strategy, we consider the reference patch \(\hat{P}=(0,1)^{2}\) and generate a sequence of sets of patches. During the first training iteration, we use \(\mathcal{P}_{0}=\{\hat{P}\}\) since this is already a cover of \(\Omega\). During the second iteration, we enrich the set of patches as \(\mathcal{P}_{1}=\mathcal{P}_{0}\cup\{P_{1},P_{2},P_{3},P_{4}\}\) where \(P_{1},P_{2},P_{3}\) and \(P_{4}\) are squared patches with edge \(h_{i}=0.6\), \(i=1,\ldots,4\) and centers  
\[c_{\mathbf{P_{1}}} =(0.3,0.3), c_{\mathbf{P_{2}}} =(0.7,0.3),\] \[c_{\mathbf{P_{3}}} =(0.3,0.7), c_{\mathbf{P_{4}}} =(0.7,0.7).\]  
This allows us to start from a homogeneous distribution of patches before utilizing the error indicator to choose the location of the new patches. Then, to decide how many patches have to be added to \(\mathcal{P}_{m-1}\) to generate \(\mathcal{P}_{m}\), we choose \(\widetilde{\tau}_{m}\) such that  
\[\widetilde{\tau}_{m}=\dim\biggl{(}\left\{\widetilde{\tau}\in\{1,\ldots,\dim( \mathcal{P}_{m-1}):\frac{\sum_{i=1}^{\widetilde{\tau}}\eta_{i_{i}}^{\gamma}} {\sum_{i=1}^{\dim(\mathcal{P}_{m-1})}\eta_{i}^{\gamma}}<0.75\}\right\}\biggr{)} +1 \tag{30}\]  
and fix  
\[\tau_{m}=\min(\lceil 0.3\cdot\dim(\mathcal{P}_{m-1})\rceil,\widetilde{\tau}_{m}). \tag{31}\]  
Note that (30) allows us to consider the smallest set of patches such that the corresponding error indicators contribute at least 75% of the global error indicator \(ES_{m-1}\), whereas (31) is considered to limit the maximum number of patches that can be added for efficiency reasons. Then, to generate the generic set of patches \(\mathcal{P}_{m}\), we fix a multiplication factor \(C_{M}\) to decide how many new patches have to be inserted inside each patch \(P_{i}\) such that \(\eta_{i}^{\gamma}\in\overline{\eta}_{m-1}\). Inside each chosen patch \(P_{i}\), \(C_{M}\) centers \(\widetilde{c}_{P_{i}}^{\kappa}\ =\ (\widetilde{x}_{i}^{k},\widetilde{y}_{i}^{k})\), \(k=1,\ldots,C_{M}\), are randomly generated with a uniform distribution and the new patches' edges' lengths are chosen as \(h_{i}^{k}=\lambda\frac{A_{\text{ratio}}}{\sqrt{C_{M}}}h_{i}\). Here, \(\lambda\) is a random real value from the uniform distribution \(U\Bigl{(}\left[ \begin{smallmatrix}9&10\\ 10&9\end{smallmatrix} \right]\Bigr{)}\), and the scaling coefficient \(\frac{A_{\text{ratio}}}{\sqrt{C_{M}}}\) is chosen such that the sum of the areas of the new patches is \(A_{\text{ratio}}\) times the area of the original patch \(P_{i}\).