2.2.2. Offline Spaces

The offline space *V<sup>ω</sup><sup>i</sup> off* is derived from the snapshot space and is used for computing the solution of the problem. We need to solve for a spetral problem and this can be summarized as finding *λ* and *v* ∈ *V<sup>ω</sup><sup>i</sup> snap* such that:

$$a\_{\omega\_i}(\upsilon, w) = \lambda s\_{\omega\_i}(\upsilon, w), \forall w \in V\_{\text{snap}}^{\omega\_i} \tag{6}$$

where *<sup>a</sup>ωi* is symmetric non-negative definite bilinear form and *<sup>s</sup>ωi* is symmetric positive definite bilinear form. By convergence analysis, they are given by

$$a\_{\omega\_i}(v, w) = \int\_{\omega\_i} \kappa \nabla v \cdot \nabla w,\tag{7}$$

$$s\_{\omega\_i}(v, w) = \int\_{\omega\_i} \mathbb{k}v \cdot w. \tag{8}$$

In the above definition of *<sup>s</sup>ωi* , the function *κ*˜ = *κ* ∑ |∇*<sup>χ</sup>j*|<sup>2</sup> where {*<sup>χ</sup>j*} is a set of partition of unity functions corresponding to the coarse grid partition of the domain *D* and the summation is taken over all the functions in this set. The offline space is then constructed by choosing the

smallest *Li* eigenvalues and we can form the space by the linear combination of snapshot basis using corresponding eigenvectors:

$$
\phi\_k^{\omega\_i} = \sum\_{j=1}^{L\_i} \Psi\_{kj}^{\omega\_i} \psi\_j^{\omega\_i} \,\tag{9}
$$

where Ψ*<sup>ω</sup><sup>i</sup> kj* is the *j*th element of *kth* eigenvector and *Li* is the number of snapshot basis. *Voff* is then defined as the collection of all local offline basis functions. Finally we are trying to find *uoff* ∈ *Voff* such that

$$a(u\_{off}, v) = \int\_{D} f v\_{\prime} \,\forall v \in V\_{off} \tag{10}$$

where *<sup>a</sup>*(*<sup>u</sup>*, *v*) = '*Dκ*∇*u* · ∇*<sup>v</sup>*. For more details, we refer the readers to the references [8–10].

## *2.3. The Idea of the Proposed Method*

We present the general methodology in this section. The target is to save the time in computing the GMsFEM basis *φ<sup>ω</sup><sup>i</sup> k* for all *ωi* and for all uncertain space parameters. We propose the clustering algorithm to coarsen the uncertain space in each local neighborhood. The key to the success of the clustering is that: the cluster should inherit the property of the solution, that is, the local heterogeneous fields *<sup>κ</sup>*(*<sup>x</sup>*,*<sup>s</sup>*) clustered into the same group should have similar solution properties. When the cluster is learned by the some learning algorithm, the only computation involved is to fit the local neighborhood of the given testing heterogeneous field into some cluster. This is a feed forward process including several convolution operations and matrix multiplications and compared to the direct computing, we save a lot of time in computing the spectral problem in Equation (6) and the inverse of a matrix Equation (10). The detailed process is illustrated in the following chart (Figure 3):


It should be noted that we perform clustering using the heterogeneous fields; however, the cluster should inherit the property of the solution corresponding to the heterogeneous fields. This makes the clustering challenging. The performance of the standard K-means algorithm relies on the initialization and the distance metric. We may initialize the algorithm based on the clustering of the heterogeneous fields but we need to design a good metric. In the next section, we are going to introduce a learning algorithm which uses an auto-encoder structure and multiple losses to achieve the required clustering task.

**Figure 3.** Work flow of the proposed method.
