Online Adaptive Local Multiscale Model Reduction for Heterogeneous Problems in Perforated Domains

# Online Adaptive Local Multiscale Model Reduction for Heterogeneous Problems in Perforated Domains

Eric T. Chung Email: tschung@math.cuhk.edu.hk. Yalchin Efendiev Email: efendiev@math.tamu.edu. Department of Mathematics & Institute for Scientific Computation (ISC), Texas A&M University, College Station, TX 77843-3368, USA. Wing Tat Leung Department of Computational Technologies, Institute of Mathematics and Informatics, North-Eastern Federal University, Yakutsk, 677980, Republic of Sakha (Yakutia), Russia. Maria Vasilyeva Yating Wang Department of Computational Technologies, Institute of Mathematics and Informatics, North-Eastern Federal University, Yakutsk, 677980, Republic of Sakha (Yakutia), Russia.
###### Abstract

In this paper, we develop and analyze an adaptive multiscale approach for heterogeneous problems in perforated domains. We consider commonly used model problems including the Laplace equation, the elasticity equation, and the Stokes system in perforated regions. In many applications, these problems have a multiscale nature arising because of the perforations, their geometries, the sizes of the perforations, and configurations. Typical modeling approaches extract average properties in each coarse region, that encapsulate many perforations, and formulate a coarse-grid problem. In some applications, the coarse-grid problem can have a different form from the fine-scale problem, e.g., the coarse-grid system corresponding to a Stokes system in perforated domains leads to Darcy equations on a coarse grid. In this paper, we present a general offline/online procedure, which can adequately and adaptively represent the local degrees of freedom and derive appropriate coarse-grid equations. Our approaches start with the offline procedure (following [18]), which constructs multiscale basis functions in each coarse region and formulates coarse-grid equations. In [18], we presented the offline simulations without the analysis and adaptive procedures, which are needed for accurate and efficient simulations. The main contributions of this paper are (1) the rigorous analysis of the offline approach (2) the development of the online procedures and their analysis (3) the development of adaptive strategies. We present an online procedure, which allows adaptively incorporating global information and is important for a fast convergence when combined with the adaptivity. We present online adaptive enrichment algorithms for the three model problems mentioned above. Our methodology allows adding and guides constructing new online multiscale basis functions adaptively in appropriate regions. We present the convergence analysis of the online adaptive enrichment algorithm for the Stokes system. In particular, we show that the online procedure has a rapid convergence with a rate related to the number of offline basis functions, and one can obtain fast convergence by a sufficient number of offline basis functions, which are computed in the offline stage. The convergence theory can also be applied to the Laplace equation and the elasticity equation. To illustrate the performance of our method, we present numerical results with both small and large perforations. We see that only a few (1 or 2) online iterations can significantly improve the offline solution.

## 1 Introduction

One important class of multiscale problems consists of problems in perforated domains (see Figure 1 for an illustration). In these problems, differential equations are formulated in perforated domains. These domains can be considered the outside of inclusions or connected bodies of various sizes. Due to the variable sizes and geometries of these perforations, solutions to these problems have multiscale features. One solution approach involves posing the problem in a domain without perforations but with a very high contrast penalty term representing the domain heterogeneities ([31, 43, 28, 32]). However, the void space can be a small portion of the whole domain and, thus, it is computationally expensive to enlarge the domain substantially.

Problems in perforated domains ([42]), as other multiscale problems, require some model reduction techniques to reduce the computational cost. The main computational cost is due to the fine grid, which needs to resolve the space between the perforations. There have been many homogenization results in perforated domains and for biphasic problems, where perforations can have distinctly different properties, e.g., [1, 36, 34, 40, 24, 41, 3, 5, 26, 38, 27, 25]. Homogenization approaches average microscale processes in perforations and outside and provide macroscale equations that differ from microscale equations. In the homogenization procedure, the local cell problems account for the microscale interaction and are solved on a fine grid. Using the solutions of the local problems, the effective properties can be computed. The resulting homogenized equations can be solved on the coarse grid with the mesh size independent of the size of the perforations for different boundary conditions and right hand sides.

To carry out the homogenization, typical assumptions on periodicity or scale separation are needed to formulate the cell problems. Some generalization to problems with random homogeneous pore-space geometries is introduced in a pioneering work [6], where the authors formulate assumptions, when homogenization can be done using representative volume element concepts. In these approaches, the cell problems in very large domains are formulated and the effective properties are computed using the solutions of the local problems. However, these approaches still assume that the solution space can be approximated by the solutions of directional cell problems (i.e., cell problems in 2D) and the effective equations contain a limited number of effective parameters (e.g., symmetric permeability tensor). These assumptions do not hold for general heterogeneities and the effective properties may be richer (one may need more parameters). To study this, we use Generalized Multiscale Finite Element Method to identify necessary local cell solutions and obtain numerical macroscopic equations.

The main difference in developing multiscale methods for problems in perforated domains is the complexity of the domains and that many portions of the domain are excluded in the computational domain. This poses a challenging task. For typical upscaling and numerical homogenization (e.g., [42, 29]), the macroscopic equations do not contain perforations and one computes the effective properties. In multiscale methods, the macroscopic equations are numerically derived by computing multiscale basis functions [35, 7, 18]. Several multiscale methods have been developed for problems in perforated domains. Our approaches are motivated by recent works [37, 35, 9, 29, 10, 18]. In this regard, we would like to mention recent works by Le Bris and his collaborators [35], where accurate multiscale basis functions are constructed. These approaches differ from numerical homogenization and approaches that use Representative Volume Element (RVE) [20]. However, these approaches do not contain a systematic way of enriching local multiscale spaces to obtain accurate macroscale representations of the underlying fine-scale problem.

Our proposed approaches are based on the Generalized Multiscale Finite Element (GMsFEM) Framewowk[21, 17, 13]. The GMsFEM follows the main concept of MsFEM [23, 33, 12, 2, 4]; however, it systematically constructs multiscale basis functions for each coarse block. The main idea of the GMsFEM is to use local snapshot vectors (borrowed from global model reduction) to represent the solution space and then identify local multiscale spaces by performing appropriate local spectral problem. Using snapshot spaces is essential in problems with perforations, because the snapshots contain necessary geometry information. In the snapshot space, we perform local spectral decomposition to identify multiscale basis functions. These basis functions are derived based on the analysis presented in this paper. The local multiscale basis functions obtained as a result represent the necessary degrees of freedom to represent the microscale effects. This is in contrast to homogenization, where one apriori selects the number of cell problems.

We present the analysis of the proposed method. We focus on analyzing Stokes equations, since similar techniques can be easily extended to the elliptic and the elasticity equations. We note that in [18], we present the offline simulations for heterogeneous problems in perforated domains. In [14], the results for the mixed GMsFEM for the Laplace equation with Neumann boundary conditions are presented. The main contributions of this paper are (1) the rigorous analysis of the offline approach (2) the development of the online procedures and their analysis (3) the development of adaptive strategies. We would like to emphasize that the adaptivity and online basis construction are important for the success of multiscale methods. Indeed, in many regions, one may need only a few basis functions, while some regions may require more degrees of freedom for approximating the solution space. The online basis functions allow a fast convergence and takes into account global effects.

In the GMsFEM, the multiscale basis function construction is local and uses both local snapshot solutions and local spectral problems. In the paper, we discuss the use of randomized snapshots to reduce the offline cost associated with the snapshot space computations. One can use local oversampling techniques [22]; however, the global effects are still not used. One can accelerate the convergence by computing multiscale basis functions using a residual at the online stage [16, 11, 39]. This is done by designing new multiscale basis functions, which solve local problems using the global residual information. Online basis functions are computed adaptively and only added in regions with largest residuals. In this paper, we design online basis functions. It is important that adding online basis function decreases the error substantially and one can reduce the error in one iteration. For this reason, constructing online basis functions must guarantee that the error reduction is independent of small scales and contrast.

Constructing online basis functions follows a rigorous analysis. We show that if a sufficient number of offline multiscale basis functions are chosen, one can substantially reduce the error. This reduction is related to the eigenvalue that the corresponding eigenvector is not included in the coarse space. Thus, one can get an estimate of the error reduction apriori, which is important in practical simulations. Our analysis for the offline procedure starts with the proof of the inf-sup condition, which shows the well-posedness of our scheme. Then, we derive an a-posteriori error bound for our GMsFEM. This bound shows that the error of the solution is bounded by a computable residual and an irreducible error. This irreducible error is a measure of approximating the fine-scale space by the snapshot space. We show that the convergence rate depends on the number of offline basis functions. We note that in [18], we only present the offline simulation results without analysis. Based on the analysis, we have modified some of multiscale basis functions for Stokes’ equations and moreover, introduced adaptive strategies and online basis construction techniques.

In our numerical examples, we consider two different geometries, where one case includes only a few perforations and the other case includes many perforations. We considered elliptic, elasticity, and Stokes equations and only report the results for elasticity and Stokes equations. Our results for the offline consist of adding multiscale basis functions where we observe that the error decreases as we increase the number of basis functions. However, the errors (especially those involving solution gradients) can still be large. For this reason, online basis functions are added, which can rapidly reduce the error. We summarize some of our quantitative results below.

• For elasticity equations without adaptivity, we observe that, with using offline basis functions per coarse neighborhood, we can achieve % error in norm, while the error is % in norm. The results for the offline computations are similar for two different geometries.

• For Stokes equations without adaptivity, we observe that, with using offline basis functions per coarse block, we can achieve % error in norm, while the error is % in norm. All errors are for the velocity field. The results for the offline computations are better for the case with many inclusions.

• For online simulations, we observe that the error decreases rapidly as we add one online basis functions. The error keeps decreasing fast as we increase the number of online basis functions; however, we are mostly interested in error decay when one basis function is added. We observe that the error decrease much faster if we have more than initial offline basis function. For example, the error decreases only times if one basis function is chosen, while the error decreases more than times if initial basis functions are selected (see Table 5 and 6 for the Stokes case and second geometry).

• We observe that one can effectively use adaptivity to reduce the computational cost in the online simulations. Our adaptive results show that we can achieve better accuracy for the same number of online basis functions.

The paper is organized as follows. In Section 2, we present a general setting for perforated problems, the coarse and fine grid definitions, and a general idea of the GMsFEM. In Section 3, we discuss constructing offline and online basis functions. Section 4 is devoted to numerical results. In Section 5, we present the convergence analysis for the offline and online GMsFEM. The conclusions are presented in Section 6.

## 2 Preliminaries

### 2.1 Problem setting

In this section, we present the underlying problem as stated in [18, 14] and the corresponding fine-scale and coarse-scale discretization. Let () be a bounded domain covered by inactive cells (for Stokes flow and Darcy flow) or active cells (for elasticity problem) . In the paper, we will consider case, though our results can be extended to . We use the superscript to denote quantities related to perforated domains. The active cells are where the underlying problem is solved, while inactive cells are the rest of the region. Suppose the distance between inactive cells (or active cells) is of order . Define , assume it is polygonally bounded. See Figure 1 for an illustration of the perforated domain. We consider the following problem defined in a perforated domain

 Lϵ(w)=f,inΩϵ, (1) w=0 or ∂w∂n=0, on ∂Ωϵ∩∂Bϵ, (2) w=g, on ∂Ω∩∂Ωϵ, (3)

where denotes a linear differential operator, is the unit outward normal to the boundary, and denote given functions with sufficient regularity.

Denote by the appropriate solution space, and

 V0(Ωϵ)={v∈V(Ωϵ),v=0 on ∂Ωϵ}.

The variational formulation of Problem (1)-(3) is to find such that

 ⟨Lϵ(w),v⟩Ωϵ=(f,v)Ωϵfor all v∈V0(Ωϵ),

where denotes a specific for the application inner product over for either scalar functions or vector functions, and and is the inner product. Some specific examples for the above abstract notations are given below.

Laplace: For the Laplace operator with homogeneous Dirichlet boundary conditions on , we have

 Lϵ(u)=−Δu, (4)

and , .

Elasticity: For the elasticity operator with a homogeneous Dirichlet boundary condition on , we assume the medium is isotropic. Let be the displacement field. The strain tensor is defined by

 ε(u)=12(∇u+∇uT).

Thus, the stress tensor relates to the strain tensor such that

 σ(u)=2με+ξ∇⋅uI,

where and are the Lamé coefficients. We have

 Lϵ(u)=−∇⋅σ, (5)

where and .

Stokes: For Stokes equations, we have

 Lϵ(u,p)=(∇p−Δu∇⋅u), (6)

where is the viscosity, is the fluid pressure, represents the velocity, , and

 ⟨Lϵ(u,p),(v,q)⟩Ωϵ=((∇u,∇v)Ωϵ−(∇⋅v,p)Ωϵ(∇⋅u,q)Ωϵ0).

We recall that contains functions in with zero average in .

In this paper, we will show the results for elasticity and Stokes equations. The results for Laplace have similar convergence analysis and computational results as those for elasticity equations, so we will omit them here.

### 2.2 Coarse and fine grid notations

For the numerical approximation of the above problems, we first introduce the notations of fine and coarse grids. Let be a coarse-grid partition of the domain with mesh size . Here, we assume that the perforations will not split the coarse triangular element, as in this case, the coarse block will have two disconnected regions. In general, the proposed concept can be applied to this disconnected case; however, for simplicity, we avoid it and assume that every coarse-grid block is path-connected (i.e., any two points can be connected within the coarse block). Notice that, the edges of the coarse elements do not necessarily have straight edges because of the perforations (see Figure 2). By conducting a conforming refinement of the coarse mesh , we can obtain a fine mesh of with mesh size . Typically, we assume that , and that the fine-scale mesh is sufficiently fine to fully resolve the small-scale information of the domain, and is a coarse mesh containing many fine-scale features. Let and be the number of nodes and edges in coarse grid respectively. We denote by the set of coarse nodes, and the set of coarse edges.

For all the three model problems, we define a coarse neighborhood for each coarse node by

 ωϵi=∪{Kϵj∈TH;  xi∈¯Kϵj}, (7)

which is the union of all coarse elements having the node . For the Stokes problem, additionally, we define a coarse neighborhood for each coarse edge by

 ωϵm=∪{Kϵj∈TH;  Em∈¯Kϵj}, (8)

which is the union of all coarse elements having the edge . See Figure 2 for an illustration of the coarse neighborhoods.

On the triangulation , we introduce the following finite element spaces

 Vh :={v∈V(Ωϵ):v|K∈(Pk(K))l for all K∈Th},

where, denotes the polynomial of degree ( ), and ( ) indicates either a scalar or a vector. Note that for the Laplace and elasticity operators, we choose , i.e., piecewise linear function space as our fine-scale approximation space; for Stokes problem, we use for fine-scale velocity approximation and for fine-scale pressure approximation. We use to denote the space for pressure.

We will then obtain the fine-scale solution by solving the following variational problem

 ⟨Lϵ(u),v⟩Ωϵ=(f,v)Ωϵ,for all v∈Vh (9)

for Laplace and elasticity, and obtain the fine-scale solution by solving the following variational problem

 ⟨Lϵ(u,p),(v,q)⟩Ωϵ=((f,0),(v,q))Ωϵ,for all (v,q)∈Vh×Qh (10)

for the Stokes system. These solutions are used as reference solutions to test the performance of our schemes.

### 2.3 General idea of GMsFEM

Now, we present the general idea of GMsFEM [21, 30, 16]. We divide the computations into offline and online stages.

Offline stage. The construction of offline space usually contains two steps:

• Construction of a snapshot space that will be used to compute an offline space.

• Construction of a small dimensional offline space by performing a dimension reduction in the snapshot space.

From the above process, we will get a set of basis functions such that each is supported in some coarse neighborhood . Also, the basis functions satisfy a partition of unity property.

Once the bases are constructed, we define the coarse function space as

 Voff:=span{Ψoffi}Mi=1,

where is the number of coarse basis functions.

In the offline stage of GMsFEM, we seek an approximation in , which satisfies the coarse-scale offline formulation,

 ⟨Lϵ(ums),v⟩Ωϵ=(f,v)Ωϵ,for all v∈Voff. (11)

Here, the bilinear forms are as defined before, and is the inner product.

Online stage. Now, we will turn our attention to the online computation. At the enrichment level , denote by and the corresponding GMsFEM space and solution, respectively. The online basis functions are constructed based on the residuals of the current multiscale solution . To be specific, one can compute the local residual in each coarse neighborhood . For the coarse neighborhoods where the residuals are large, we can add one or more basis functions by solving

 Lϵ(ϕoni)=Ri.

Adding the online basis in the solution space, we will get a new coarse function space . The new solution will be found in this approximation space. This iterative process is stopped when some error tolerance is achieved. The accuracy of the GMsFEM relies on the coarse basis functions. We shall present the construction of suitable basis functions in both offline and online stages for the differential operators defined above.

## 3 The construction of offline and online basis functions

In this section, we describe the construction of offline and online basis for elasticity problem and Stokes problem.

In the offline computation, we first construct a snapshot space for each coarse neighborhood . Construction of the snapshot space involves solving the local problems for various choices of input parameters. The offline space is then constructed via a dimension reduction in the snapshot space using an auxiliary spectral decomposition. The main objective is to seek a subspace of the snapshot space such that it can approximate any element of the snapshot space in an appropriate sense defined via auxiliary bilinear forms. Based on the residual of the current solution, we enrich the solution space by adding some online functions to enhance the accuracy of the solution. The precise construction of offline and online basis will be presented for different applications.

### 3.1 Elasticity Problem

In this section, we will consider the elasticity problem (5) with a homogeneous Dirichlet boundary condition.

#### 3.1.1 Snapshot Space

The snapshot space for elasticity problem consists of extensions of the fine-grid functions in . Here at the fine node , at other fine nodes , and in . Let be the restriction of the fine grid space in and be the set of functions that vanish on . We will find with by solving the following problems on a fine grid

 ∫ωϵi(2με(uik):ε(v)+ξ∇⋅uik∇⋅v)dx=0,∀v∈Vih,0, (12)

with boundary conditions

 uik=0  on  ∂ωϵi∩∂Bϵ,    uik=(δij,0)  or  (0,δij)  on  ∂ωϵi.

We will collect the solutions of the above local problems to generate the snapshot space. Let and define the snapshot space by

 Vsnap=span{ψi,snapk:  1≤k≤Ji,1≤i≤Nv},

where is the number of snapshot basis in , and is the number of nodes. To simplify notations, let and write

 Vsnap=span{ψsnapi:  1≤i≤M% snap}.

#### 3.1.2 Offline space

This section is devoted to the construction of the offline space via a spectral decomposition. We will consider the following eigenvalue problems in the space of snapshots:

 Ai,offΨi,offk=λi,offkSi,% offΨi,offk, (13)

where

 Ai,off=ai(ψi,snapm,ψi,snapn)=∫ωϵi(2με(ψi,snapm):ε(ψi,snapn)+ξ∇⋅ψi,snapm∇⋅ψi,snapn),Si,off=si(ψi,snapm,ψi,snapn)=∫ωϵi(ξ+2μ)ψi,snapm⋅ψi,snapn. (14)

We assume that the eigenvalues are arranged in the increasing order. To simplify notations, we write .

To generate the offline space, we choose the smallest eigenvalues from Equation (13) and form the corresponding eigenfunctions in the respective snapshot spaces by setting , for , where are the coordinates of the vector . The offline space is defined as the span of , namely,

 Voff=span{χiΦi,offl:  1≤l≤li,1≤i≤Nv},

where is the number of snapshot basis in , and is a set of partition of unity functions for the coarse grid. One can take as the standard hat functions or standard multiscale basis functions. To simplify notations further, let and write

 Voff=span{χiΦoffi:  1≤i≤M}.

#### 3.1.3 Online adaptive method

By the offline computation, we construct multiscale basis functions that can be used for any input parameters to solve the problem on the coarse grid. In the earlier works [15, 16], the online method for the diffusion equation with heterogeneous coefficients has been proposed. In this section, we consider the construction of the online basis functions for elasticity problem in perforated domains and present an adaptive enrichment algorithm. We use the index to represent the enrichment level. The online basis functions are computed based on some local residuals for the current multiscale solution , where we use to denote the corresponding space that can contain both offline and online basis functions.

Let be the new approximate space that constructed by adding online basis on the -th coarse neighborhood . For each coarse grid neighborhood , we define the residual as a linear functional on such that

 Ri(v)=∫ωϵifvdx−∫ωϵi(2με(umms):ε(v)+ξ∇⋅umms∇⋅v)dx,∀v∈Vih,0.

The norm of is defined as

 ||Ri||(Vih)∗=supv∈Vih,0|Ri(v)|ai(v,v)12,

where .

For the computation of this norm, according to the Riesz representation theorem, we can first compute as the solution of following problem

 ∫ωϵi(2με(ϕon):ε(v)+ξ∇⋅ϕon% ∇⋅v)dx=∫ωϵifvdx−∫ωϵi(2με(umms):ε(v)+ξ∇⋅umms∇⋅v)dx,∀v∈Vih,0 (15)

and take .

For the construction of the adaptive online basis functions, we use the following error indicators to access the quality of the solution. In those non-overlapping coarse grid neighborhoods with large residuals, we enrich the space by finding online basis using equation (15).

• Indicator 1. The error indicator based on local residual

 ηi=||Ri||2(Vih)∗ (16)
• Indicator 2. The error indicator based on local residual and eigenvalue

 ηi=(λωili+1)−1||Ri||2(Vih)∗ (17)

Now we present the adaptive online algorithm. We start with enrichment iteration number and choose . Suppose the initial number of offline basis functions is () for each coarse grid neighborhood , and the multiscale space is (). For

• Step 1. Find in such that

 ∫ωϵi(2με(umms):ε% (v)+ξ∇⋅umms∇⋅v)dx=∫ωϵifv,∀v∈Vmms.
• Step 2. Compute error indicators () for every coarse grid neighborhoods and sort them in decreasing order .

• Step 3. Select coarse grid neighborhoods , where enrichment is needed. We take smallest such that

 θNv∑i=1ηi≤k∑i=1ηi.
• Step 4. Enrich the space by adding online basis functions. For each , where , we find by solving (15). The resulting space is denoted by .

We repeat the above procedure until the global error indicator is small or we have certain number of basis functions.

### 3.2 Stokes problem

In the above section, we presented the online procedure for the elasticity equations. In this section, we present the constructions of snapshot, offline and online basis functions for the Stokes problem.

#### 3.2.1 Snapshot space

Snapshot space is a space which contains an extensive set of basis functions that are solutions of local problems with all possible boundary conditions up to fine-grid resolution. To get snapshot functions, we solve the following problem on the coarse neighborhood : find (on a fine grid) such that

 ∫ωϵi∇uil:∇vdx−∫ωϵipildiv(v)dx=0,∀v∈Vih,0,∫ωϵiqdiv(uil)dx=∫ωϵicqdx,∀q∈Qih, (18)

with boundary conditions

 uil=(0,0), on ∂Bϵ,uil=(δil,0) or (0,δil), on ∂ωϵi∖∂Bϵ,

where function is a piecewise constant function such that it has value on and value on other fine-grid edges. Notice that , where are the fine-grid edges and is the number of these fine grid edges on . In (18), we define and as the restrictions of the fine grid space in and be functions that vanish on . Notice that and are supported in . We remark that the constant in (18) is chosen by compatibility condition, . We emphasize that, for the Stokes problem, we will solve (18) in both node-based coarse neighborhoods (7) and edge-based coarse neighborhoods (8).

The collection of the solutions of above local problems generates the snapshot space, in :

 Vsnap={ψi,snapl:1≤l≤2Si,1≤i≤(Ne+Nv)},

where we recall that is the number of coarse-grid edges and is the number of coarse-grid nodes.

#### 3.2.2 Offline Space

We perform a space reduction in the snapshot space through the use of a local spectral problem in . The purpose of this is to determine the dominant modes in the snapshot space and to obtain a small dimension space for the approximation the solution.

We consider the following local eigenvalue problem in the snapshot space

 Ai,offΨk=λi,offkSi,offΨi,offk, (19)

where

 Ai,off=ai(ψi,snapm,ψi,snapn)
 Si,off=si(ψi,snapm,ψi,snapn)

and

 ai(u,v)=∫ωϵi∇u:∇vdx, and si(u,v)=∫ωϵi|∇χi|2u⋅vdx

and will be specified later. Note that the above spectral problem is solved in the local snapshot space corresponding to the neighborhood domain . We arrange the eigenvalues in the increasing order, and choose the first eigenvalues and take the corresponding eigenvectors , for , to form the basis functions, i.e., , where are the coordinates of the vector . We define

 ˜Vioff=span{˜Φi,offk,  k=1,2,...,2Si}.

For construction of conforming offline space, we need to multiply the functions by a partition of unity function . We remark that the partition of unity functions are defined with respect to the coarse nodes and the mid-points of coarse edges. One can choose as the standard multiscale finite element basis. However, upon multiplying by partition of unity functions, the resulting basis functions do not have constant divergence any more, which affects the stability of the scheme. To resolve this problem, we solve two local optimization problems in every coarse element :

 min∥∥∇Φi,offx1,k∥∥L2(Kij)~{}~{}such that~{}~{}div(Φi,% offx1,k)=1|Kij|∫∂Kij(χi˜Φi,offx1,k,0)⋅nids,in Kij (20)

with , and

 min∥∥∇Φi,offx2,k∥∥L2(Kij)~{}~{}such that~{}~{}div(Φi,% offx2,k)=1|Kij|∫∂Kij(0,χi˜Φi,offx2,k)⋅nidsin Kij, (21)

with . We write that and , where is the Stokes extension of the function .

Combining them, we obtain the global offline space:

 Voff=span{Φi,offx1,k and Φi,offx2,k:1≤i≤(Ne+Nv) and 1≤k≤Mi}.

Using a single index notation, we can write

 Voff=span{Φoffi}Nui=1,

where . This space will be used as the approximation space for the velocity. For coarse approximation of pressure, we will take to be the space of piecewise constant functions on the coarse mesh.

#### 3.2.3 Online Adaptive Method

Similar to Section 3.1.3, we will define the online velocity basis for Stokes problem. For each coarse grid neighborhood , we define the residual as a linear functional on such that

 Ri(v)=∫ωϵif⋅vdx−∫ωϵi∇umms:∇vdx+∫ωϵipm% msdiv(v)dx,∀v∈Vi (22)

where is the multiscale solution at the enrichment level , and . The norm of is defined as

 ||Ri||(Vi)∗=supv∈Vi|Ri(v)|∥v∥H1(ωϵi). (23)

We will then use indicators (16) and (17) for our adaptive enrichment method. For the computation of online basis , we solve the following problem

 ∫ωϵi∇ϕon% i:∇vdx−∫ωϵipondiv(v)dx=Ri(v),∀v∈Vih,0,∫ωϵidiv(ϕoni)qdx=0,∀q∈Qoff. (24)

The adaptivity procedure follows the one presented in Section 3.1.3.

### 3.3 Randomized snapshots

In the above construction, the local problems are solved for every bounday node. This procedure is expensive and may not be practical. However, one can use the idea of randomized snapshots (as in [8]) and reduce the cost substantially. In randomized snapshots, one computes a few more snapshots compared to the required number of multiscale basis functions. E.g., we compute snapshots for multiscale basis functions.

To be more specific, we first generate inexpensive snapshots using random boundary conditions. Instead of solving the local problem (12) and (18) for each fine boundary degree of freedom, we solve a small number of local problems with boundary conditions:

 u+,ik =(ril,0)or(0,ril)on∂ω+,ϵi∖∂Bϵ, u+,ik =(0,0)on∂Bϵ.

Here are independent identically distributed (i.i.d.) standard Gaussian random vectors defined on the fine degree freedom of the boundary. Notice that we will solve for in a larger domain, the oversampling domian . The oversampling technique is used avoid the effects of randomized boundaries. After removing dependence, we finally get our snapshot basis by taking the restriction of in , i.e, .

In Section 4, we will take the Stokes problem as an example and show the numerical results for randomized sanpshots.

## 4 Numerical results

In this section, we show simulation results using the framework of online adaptive GMsFEM presented in Section 2.3 for elasticity equations and Stokes equations. We set and use two types of perforated domains as illustrated in Figure 3, where the perforated regions are circular. We have also used perforated regions of other shapes instead and obtained similar results. The computational domain is discretized coarsely using uniform triangulation, where the coarse mesh size for elasticity problem and for Stokes problem. Furthermore, nonuniform triangulation is used inside each coarse triangular element to obtain a finer discretization. Examples of this triangulation are displayed also in Figure 3.

First we will choose a fixed number of offline basis (initial basis) for every coarse neighborhood, and obtain corresponding offline space , which is also denoted by . Then, we perform the online iterations on non-overlapping coarse neighborhoods to obtain enriched space , . We will add online basis both with adaptivity and without adaptivity and compare the results. All the errors are in percentage. We note that our approaches are designed to explore the sparsity and the adaptivity in the solution space and our main emphasis is on the construction of coarse spaces. Our numerical results will show the approximation of the fine-scale solution for different dimensional coarse spaces.

### 4.1 Elasticity equations in perforated domain

We consider the elasticity operator (5). We use zero displacements on the inclusions, on the left boundary, on the bottom boundary and on the right and top boundaries. Here, and . The source term is defined by , the elastic modulus is given by , Poisson’s ratio is , where

 μ=E2(1+ν),ξ=Eν(1+ν)(1−2ν).

We use the following error quantities to measure the performance of the online adaptive GMsFEM

 ||e||L2=∥eu∥L2(Ωϵ)=∥∥(ξ+2μ)(u−ums)∥∥L2(Ωϵ)∥(ξ+2μ)u∥L2(Ωϵ),||e||H1=∥eu∥H1(Ωϵ)= ⎷⟨Lϵ(u−ums),u−ums⟩Ωϵ⟨Lϵ(u),u⟩Ωϵ,

where and are the fine and coarse solutions, respectively, and . Note that the reference solution needs a full fine scale computation. The fine grid DOF is 13262 for the domain with small perforations(left in Figure 3) and 21986 for the domain with big perforations (right in Figure 3).

The fine-scale solution and coarse-scale solution corresponding to the two different perforated domains in Figure 3 are presented in Figures 4 and 5. Fine solutions are shown on the left of the figure, coarse offline solutions are in the middle and online solutions are on the right. In Tables 1 and 2, we present the convergence history when the problem is solved in two different perforated domain with one, two and four initial bases in the left, middle and right column, respectively. Each column shows the error behavior when the online method is applied without adaptivity, with adaptivity using Indicator 1 (see (16)) and with adaptivity using Indicator 2 (see (17)).

Numerical results for the first perforated domain are displayed in Figure 4. We observe that the offline solution is close to the fine-scale solution; however, there are some missing features in the offline solution. For example, the low values of the solution for a connected regions around circular inclusions, while this is not the case for the fine-scale solution. Also, we observe that the offline solution does not capture the low values of the solution near the inclusions. On the other hand, the solution using the online procedure with approximately the same number of degrees of freedom as the offline solution has very good accuracy. From Table 1, we observe that when using one initial basis, the and energy error reduce to % and % respectively after one online iteration in the case without adaptivity. However, if we select two initial bases, the the and energy error can be reduced to % and % respectively after one online iteration, which is almost half of the errors for one initial basis situation. When the number of basis is fixed, it shows that adding online basis can reduce the error more effectively than adding offline basis. For example, when we use two offline basis and two online basis, the energy error is %; while when we select four offline basis, the energy error is %. Comparison of the error behavior between solving with and without adaptivity in this table shows that, error is smaller under the similar DOF when adaptive online method is applied. For example, if we start with one initial basis, the energy error is 5.482% with DOF 500 when online method is applied without adaptivity, but the energy error becomes 2.589% with DOF 536 when online adaptive method is applied. When we solve with the adaptivity, we observe that the first indicator (see (16)) is more effective when one initial basis is selected. However, if we start with two or four initial bases, the second indicator (see (17)) gives us slightly better results. The smallest eigenvalues are when one, two and four initial basis are used.

In Figure 5, we test with a different perforated domain where the circular inclusions are larger compared to the domain in Figure 4 and extremely small inclusions are set around some big ones. Comparing the offline and fine solution, we notice that some features of solution in the interior of the domain are missing, and the errors around the boundary are large. However, the online solution fix these problems well and show much better accuracy. Looking at Table 2, we observe that as we select more initial basis, the error decreases faster after one online iteration. For example, when one online iteration is applied without adaptivity, the error reduces times if we use one initial basis, yet it reduces around times if we use two initial basis. Considering the convergence behavior of online method with adaptivity against the online method without adaptivity, we see that the adaptivity is important. For instance, in a similar DOF of in the case of four initial basis used, the error without adaptivity, while it is only with adaptivity.