Dynamic Mode Decomposition in Adaptive Mesh Refinement and Coarsening Simulations

Dynamic Mode Decomposition (DMD) is a powerful data-driven method used to extract spatio-temporal coherent structures that dictate a given dynamical system. The method consists of stacking collected temporal snapshots into a matrix and mapping the nonlinear dynamics using a linear operator. The standard procedure considers that snapshots possess the same dimensionality for all the observable data. However, this often does not occur in numerical simulations with adaptive mesh refinement/coarsening schemes (AMR/C). This paper proposes a strategy to enable DMD to extract features from observations with different mesh topologies and dimensions, such as those found in AMR/C simulations. For this purpose, the adaptive snapshots are projected onto the same reference function space, enabling the use of snapshot-based methods such as DMD. The present strategy is applied to challenging AMR/C simulations: a continuous diffusion-reaction epidemiological model for COVID-19, a density-driven gravity current simulation, and a bubble rising problem. We also evaluate the DMD efficiency to reconstruct the dynamics and some relevant quantities of interest. In particular, for the SEIRD model and the bubble rising problem, we evaluate DMD's ability to extrapolate in time (short-time future estimates).

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 7

page 14

page 15

page 16

page 17

page 19

page 20

page 24

03/13/2020

Toward fitting structured nonlinear systems by means of dynamic mode decomposition

The dynamic mode decomposition (DMD) is a data-driven method used for id...
09/14/2021

Identification of linear time-invariant systems with Dynamic Mode Decomposition

Dynamic mode decomposition (DMD) is a popular data-driven framework to e...
08/15/2021

Smart Adaptive Mesh Refinement with NEMoSys

Adaptive mesh refinement (AMR) offers a practical solution to reduce the...
09/22/2021

Randomized Projection Learning Method forDynamic Mode Decomposition

A data-driven analysis method known as dynamic mode decomposition (DMD) ...
11/29/2019

Time-adaptive optimization in a parameter identification problem of HIV infection

The paper considers a time-adaptive method for determination of drug eff...
03/18/2019

A Geometrical Method for Low-Dimensional Representations of Simulations

We propose a new data analysis approach for the efficient post-processin...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Data-driven methods are currently revolutionizing the modeling, prediction, and control of complex systems. Increasingly, researchers are considering data-driven approaches for a diverse range of complex systems, such as turbulent flows, climate sciences, epidemiology, finance, robotics, and many other different applications [Brunton2019book]

. Even with the availability of better hardware and advances in techniques and algorithms, numerical simulations of these systems are still resource-demanding: strong nonlinearities, multiple scales, and large dimensionalities are typical examples of complexities found in modern applications. With the assembly of modern mathematical methods, unprecedented data availability, and increasing computational resources, previously complex, challenging problems can now be tackled within the new research field entitled scientific machine learning (SciML).

SciML is a core component of artificial intelligence and computational technology that can be trained, with scientific data, to augment or automate human skills

[osti_1478744]. This emerging research area aims at the opportunities and challenges in the context of complex applications across science and engineering, and other interdisciplinary fields. A wide range of SciML methods can be categorized regarding the type of information available, and their intended use [Brunton2020]. In this study, we focus on Dynamic Mode Decomposition (DMD), an unsupervised SciML method that can extract the most dynamically relevant low-rank structures from large-dimensional data observed in dynamical systems. DMD can be applied to both numerical [Schmid2010] and experimental data [Schmid2011].

The standard DMD procedure for numerical simulations consists of stacking the snapshots (discrete solutions in space for a given time step) in columns to create a matrix and map the dynamics using a linear operator. The DMD procedure assumes that the collected snapshots have spatial dimensionality , where , such that the snapshots matrix has dimension . This occurs when snapshots are obtained from experimental data with sensors in fixed positions or numerical simulations considering a fixed mesh. However, in many situations, this is not always achievable. For numerical simulations using Adaptive Mesh Refinement/Coarsening (AMR/C), for instance, spatial adaptivity leads to solutions computed in meshes that constantly change in time. Adaptive meshes lead to a different number of nodes, nodal coordinates and numbering, and mesh topologies. In the present study, we develop a strategy to project all the snapshots of a given simulation with different dimensionality onto a reference target mesh with minor accuracy loss, enabling the use of any SVD-based data-driven technique such as DMD.

This paper is structured as follows: Section 2 describes the relation between the discretization of PDEs in space and time and a dynamical system. This section introduces Dynamic Mode Decomposition, our method of choice for short-time future estimates and extrapolation. Section 3

describes our strategy to deal with simulations that consider AMR/C in their evolution (e.g., in the case of dimensionality of the output vector, as well as of mesh topology and/or node numbering, varying in time). In Section

4 we describe the numerical applications in this study: the use of DMD on a continuous SEIRD model for COVID-19 and two fluid dynamics problems, a density-driven gravity current, and a bubble rising problem. We show efficiency and accuracy results for the signal reconstruction. Moreover, future time step predictions using DMD are evaluated for the SEIRD model and the bubble rising problem. In Section 5, we draw our final remarks and conclusions.

2 Numerical Methods and Dynamic Mode Decomposition

Solving partial differential equations (PDEs) using fast, accurate, reliable, and robust methods is crucial for many industrial and scientific applications. Several methods (such as finite elements, finite differences, and many others) are responsible for approximating the infinite-dimensional PDEs into finite-dimensional spaces. The discretization of these equations allows the process to be automated. In the present study, we focus on using the finite element method for spatial discretization of the PDEs. That is, consider a generic transient parametric PDE such as

(1)

where is a nonlinear operator, is a vector of parameters (e.g., diffusion, density, viscosity, etc.), is a given function and the solution is a function of spatial coordinates , temporal coordinates , and parameters such that . The equation is equipped with boundary and initial conditions

(2)

where and are the Dirichlet and Neumann boundary conditions, respectively, is the final time, and is the initial condition for . The domain is bounded by Lipschitz continuous boundaries , and is the unit outward normal to . The union of boundaries and domain is represented as . The standard finite element method consists of discretizing into a mesh composed of nodes and elements. Each element has its domain and boundary . The weak form of the system can be obtained by integrating Eq. (1) in its strong form against a weighting function , where is the Sobolev space of the square-integrable functions with an integrable first weak derivative, and applying the divergence theorem. Being the space of polynomials of degree equal or less than over , the function spaces are defined as:

(3)
(4)

Therefore, the semi-discrete finite element formulation for Eq. (1) is: find such that :

(5)

where the inner product over the domain is indicated by . The weak form given by Eq. (5) naturally accommodates several finite element formulations, from Galerkin to Variational Multiscale methods [hughes, rasthofer, ahmed2017, codina2018, bazilevs2013computational]. After the temporal discretization of Eq. (5), the equation can be translated into a discrete-time dynamic system. In this system, the state vector at the time instant can be written such that:

(6)

where represents the discrete-time flow map of the system and incorporates information regarding the parameters , mesh size, solver tolerances, etc. In the present study, we consider that the measurements of the system are the state vectors themselves, that is, . Analyzing the evolution in time of a discretized PDE as a dynamical system is a key concept for introducing Dynamic Mode Decomposition (DMD).

DMD is an equation-free, data-driven method that provides accurate assessments of the dominant structures in a given complex system [Kutz2016book]. Differently from the Proper Orthogonal Decomposition (POD) [Lumley1967, Berkooz1993] that represents data in terms of spatial modes, DMD provides a decomposition of data into spatio-temporal modes that correlate the data across spatial features and also associates them to unique temporal Fourier modes. The main idea of DMD is to efficiently compute the regression of linear/nonlinear terms to a least-square linear dynamics approximation from experimental or numerical observable data. Despite its first appearance in the fluid dynamics context [Rowley2009, Schmid2010], DMD has been used in many other applications such as epidemiology [Proctor2015], biomechanics [Calmet2020], urban mobility [Alla2020], climate [Kutz2016] and aeroelasticity [Fonzi2020], especially in structure extraction from data and control-oriented methods.

We can now apply DMD on the dynamical system described in Eq. (6). Consider a dataset containing the observations in time of the dynamical system for , where is the total number of observations. The dataset

(7)

can be split into two datasets and . DMD consists on finding the best fit approximation of the linear mapping that transforms dataset into dataset , that is,

(8)

The computation of can be done as , where is the Moore-Penrose pseudoinverse of . However, we avoid the computation of the full matrix since is a matrix. Also, the computation of the full Moore-Penrose pseudoinverse is not advisable due to its ill-conditioning. Instead, we can compute the SVD of as

(9)

where and are the left and right singular vectors and

is a diagonal matrix with real, non-negative, and decreasing entries named singular values. The singular values

are hierarchical and can be interpreted in terms of how much the singular vectors influence the original matrix . For the DMD procedure, considering the Eckart-Young Theorem [Eckart1936], the optimal low-rank update approximation matrix , when subjected to a truncation rank , can be written as

(10)

where is a matrix containing the first columns of , contains the first columns of , and is the diagonal matrix containing the first singular values. The pseudoinverse can be approximated as

(11)

and, instead of computing , we can obtain , a projection of as,

(12)

Note that is unitarily similar to . Further mathematical details regarding the optimization problem (the best-fitting matrix ) and the influence of the Eckart-Young Theorem on constraints of the problem can be found in [heas2020lowrank]. Now we can compute the eigendecomposition of :

(13)

where

is a diagonal matrix containing the discrete eigenvalues

and the matrix

contains the eigenvectors

of . The DMD basis can be written as:

(14)

and the signal reconstruction as:

(15)

being the vector containing the projected initial conditions such that , and is a diagonal matrix whose entries are the continuous eigenvalues , where is the time step size between the outputs. In the present study , where , being the time step size used in the temporal integration of the PDEs. For instance, if one chooses to output the solutions once every two time steps, the time step size between the two observations will be two times larger than the time step size used to compute time integration, that is, . It is important to mention that the snapshots sampling frequency affects directly the DMD’s ability to capture the dynamics. For lower dominant frequencies, a larger is more adequate, while smaller values of are required for capturing rapid dynamics [Schmid2010]. The form of (15) can be regarded as a generalization of the Sturm-Liouville expansion for a differential problem:

(16)

where and are the

-th Sturm-Liouville eigenfunctions and eigenvalues for a given differential operator.

DMD can be seen as a dimensionality reduction method due to its inherent ability to extract the most relevant dynamical modes, where is often much smaller than the snapshot matrix rank . However, a strategy to determine the number of relevant modes is not straightforward, and is an active topic in DMD research [Taira2017]. Even though the choice of for DMD may require some trial and error, some techniques can be used to find a good starting point. A hard threshold technique [Kutz2016book] consists of choosing such that:

(17)

where is a tolerance threshold, set, e.g., to . This method implies that more than

of the variance in the data is retained by the approximation. For the case where DMD is used on experimental (or numerical but noisy) data, more sophisticated solutions are presented in the literature

[Gavish2014, Donoho1995].

Another important consideration when using DMD is the SVD algorithm. The SVD can represent a significant part of the computational effort, meaning that improvements in the SVD performance lead to significant CPU time gains. For many SVD-based methods (such as DMD), there is no need to compute the SVD for the whole matrix, since the method aims at extracting the first dominant structures in the matrix. Many algorithms are designed in this direction to make this computation more efficient. One important contribution in this direction is seen in [Sirovich1987], where the method of snapshots was proposed, paving the way to more algorithms and techniques. In this paper, we employ the randomized SVD (rSVD) algorithm [Halko2011, Erichson2019], a non-deterministic algorithm able to compute the near-optimal low-rank approximation of a given large dataset with good efficiency.

3 DMD on Adapted Meshes

Regarding numerical methods to approximate PDEs, the use of finer meshes in finite element discretizations usually leads to more accurate solutions. On the other hand, reducing the number of equations in the nonlinear system is crucial for efficiency, especially considering that the optimal computational complexity of a single physics transient finite element simulation is [Burstedde2010]. The duality between the two statements describes a well-known trade-off between accuracy and efficiency in the finite element context. Despite a considerable research effort in the past decades, strategies to generate tailored meshes to maximize the accuracy while minimizing the computational effort are still an open research topic. Milestones addressing this subject are finite element a posteriori error estimators/indicators [ainsworth2011posteriori]

, techniques such as adaptation, interpolation

[carey1997computational, Lohner1995] and projection [Carey2001, Farrell2011, CodinaIJNME2017], as well as libraries and frameworks containing automated versions of AMR/C techniques [libmesh, AlnaesBlechta2015a].

The general structure of the AMR/C scheme is given in Algorithm 1 and illustrated in Figure 1. Three criteria are fundamental in an AMR/C algorithm: remeshing, flagging, and stopping. The remeshing criterion defines whether the computed solution at a given time step requires remeshing driven by global a posteriori error estimators (or indicators) and/or by calling the refinement/coarsening procedure at every time steps. Next, all mesh elements are visited and flagged for refinement or coarsening. The element flagging criterion is often represented by local a posteriori

error estimators or indicators, i.e. flux-jumps of the solution gradient. In possession of the flagged elements, the remeshing algorithm is invoked. Finally, the previous mesh solution must be projected or interpolated into the target mesh. This is done by the projection/interpolation algorithm. The whole process is repeated until the stopping criterion is achieved. This criterion could be error equidistribution (until a certain threshold), a given element size, the maximum number of elements in the mesh, or the number of refinement levels. Note that the meshes generated in Algorithm 1, guided by the error estimation procedure, have different dimensions (number of degrees of freedom) and different topologies, which poses difficulties for DMD (or, in fact, for any snapshot-based method).

  INPUT: Finite element solution computed at a given time instant .
  OUTPUT: Adapted finite element solution.
  - Definition of a remeshing criterion: global a posteriori error estimator/indicator, remeshing at every time steps, etc.
  for each computed solution do
     if one or more remeshing criteria are met then
        while one or more stopping criteria are not met do
           - Compute local error estimators/indicators (or another strategy) to identify the elements requiring refinement or coarsening and flag them.
           - Call the refinement/coarsening procedure to generate a target mesh for the flagged elements. Different strategies for mesh refinement/coarsening lead to distinct meshes.
           - Project or interpolate the solution computed on instant onto the target mesh
        end while
     end if
  end for
Algorithm 1 Adaptive Mesh Refinement/Coarsening Algorithm
Figure 1: Illustration of a mesh refinement procedure. A local a posteriori error estimator or indicator flags an element for refinement (in green) using the solution computed in the mesh on the left. The mesh is refined (or coarsened) according to the flagged elements, and the process can be restarted until a given criterion is met (error level, element size, maximum number of elements, etc.). Note that the initial and the final mesh differ in the number of degrees of freedom and topology.

The structure of the exact DMD algorithm relies on the fact that the measurements of the state vectors, i.e., have the same dimensionality. This structure could be exemplified in numerical experiments as fixed discretizations in space, i.e., fixed meshes or static sensors in experimental data. However, finite element simulations equipped with AMR/C strategies provide solutions in different function spaces, depending on the mesh used to compute the solution on a given time step. Spatial adaptivity on transient finite element simulations leads to meshes with a different number of nodes, numbering, and nodal coordinates. It can also lead to different mesh topologies and structures. For that reasons, snapshots obtained by AMR/C simulations cannot be stacked in columns to construct the snapshot matrix. Even if one considers an AMR/C strategy that restricts the adaptive meshes to preserve the dimensionality of the snapshots, the difference between the nodal coordinates of the various meshes will lead to misleading dynamics captured by DMD. In the present study, we circumvent this issue by considering the projection [CodinaIJNME2017] of the numerical simulation results for different meshes into a reference target mesh. Recent work on reducing these projection costs for related reduced-order modeling techniques (though not DMD) may be found in [HALE2021113723]

. The projection or interpolation of numerical solutions between finite element meshes is a well-known computational mechanics subject. Many issues regarding boundary conditions, data visualization, or coupling arise from this kind of problem. The choice of a proper method to successfully project functions in different finite element spaces is not a trivial task since conservation may not be satisfied

[Carey2001, Farrell2011, CodinaIJNME2017]. This issue is not addressed in the present study since the mesh projection occurs as a post-processing phase after computing the AMR/C solutions. Therefore it cannot lead to cumulative errors. Furthermore, we are also careful to choose reference target meshes with characteristic length equivalent with the existent in the AMR/C meshes to avoid any major accuracy losses. For the sake of generality, we consider the projection as our method of choice, and it can be defined as follows [Thompson2015]. Assuming that the solution on the donor mesh to be projected onto the target mesh must satisfy the orthogonality condition,

(18)

where is a finite-dimensional subspace of defined by the target mesh and the interpolant is the optimal interpolant in the norm for . The orthogonal projection can be defined in terms of the following linear system

(19)

where is the mass matrix and is the projection matrix. The mass matrix is usual in finite element computations. The matrix, however, can present technical difficulties (see Appendix).

Therefore, our strategy consists of applying the projection onto a tailored reference target mesh capable of representing the many scales in time and space of all the snapshots. This routine is inserted in the code and invoked after the adaptive procedure in Algorithm 1 at every output time step . This tailored reference mesh is described in this work as target reference mesh and should not be confused with the target mesh generated during the AMR/C procedure. The new solution (computed on the adaptive donor mesh) is projected onto the reference target mesh and exported as a simulation output. In this work, we export as output files for visualization purposes, although there is no restriction on stacking the snapshots on the snapshot matrix during the simulation runtime or dumping only on disk. We considered Gmsh[Geuzaine2009]

, an open-source robust mesh generator, as our software of choice for defining and creating the target meshes for this study. The output for each time step is the snapshot with constant dimensionality

such that all nodes in space are correctly mapped and capturing the dynamics existent in the system. The procedure is summarized in Algorithm 2. This strategy is relatively simple since the projection consists of solving a linear system where the generated matrix is a mass matrix and requires no extra outputs for storing the projected solutions since the projection can be applied right after the AMR/C code. The mass matrix is generated in the finite element context by a self-adjoint operator, enabling more efficient solvers. In terms of versatility, the projection method is flexible because a solution obtained for a given mesh can be naturally projected onto reference target meshes with different topologies and dimensionalities. Also, since the mesh projection is a vital part of AMR/C algorithms, finite element algorithms frequently present efficient implementations of interpolation or projection techniques. Figure 2 shows an example where a solution obtained by an adaptive mesh simulation is projected onto two meshes with different topologies.

(a) Adaptive mesh (left) and solution (right), .
(b) Structured mesh (left) and projected solution (right), .
(c) Unstructured mesh (left) and projected solution (right), .
Figure 2: Comparison of different projection examples on structured and unstructured meshes.

For this example, we consider the square domain and the function defined in such that

(20)

This function is approximated on a structured finite element mesh discretized into cells where each cell is divided into two triangular elements. An AMR/C procedure is invoked to refine three times the transition between and , creating a new mesh containing elements and nodes. Figure 2(a) shows the new mesh generated after the AMR/C procedure and the function approximated by the resulting function space. Two meshes - one structured and another unstructured - are considered for projection. The structured mesh contains cells, resulting in triangular elements and nodes. The element sizes of the structured mesh are similar to the smallest elements in the adaptive mesh. The unstructured mesh presents a smaller characteristic length than the structured mesh and contains elements and nodes. Figures 2(b) and 2(c) show the proposed meshes and the projections of the solution onto the new finite element spaces. Note that the projected solutions are fairly accurate since their infinity norm is in good agreement with the adaptive mesh solution’s infinity norm.

  INPUT: Finite element solutions considering AMR/C
  OUTPUT: Projected solutions onto a prescribed reference target mesh.
  for each observation time step  do
     1: Apply the projection of the adaptive solution onto the function space of the reference target mesh.
     2: Stack the resulting snapshot into the snapshot matrix or output the projected solutions to disk.
  end for
Algorithm 2 Snapshot projection

Remark: In this study, the projection is carried out inside the finite element simulation since the projection computational cost is practically negligible in comparison with the overall time required for solving nonlinear systems of a complex numerical simulation. However, if one does not have access to the finite element simulation codes used, the reconstruction of the solution of each time step can still be done off-line. Output files of various formats contain information regarding the mesh used (such as nodal coordinates and connectivities) for visualization purposes. By properly reading these files, the solutions can be reconstructed under a finite element framework (such as FEniCS [fenics] or libMesh [libmesh]) or on a code developed by the user. However, this totally non-intrusive approach can significantly increase the computational cost due to several I/O operations that are often extremely low compared to computational intensive operations. Since the mesh constantly varies in an AMR/C finite element simulation, each solution obtained in the simulation has to be imported, reconstructed under its original mesh, and projected. After the projection, the user can choose to dump the solution in the disk or stack the snapshots on the snapshot matrix. For the first case, another I/O operation would be invoked. This non-intrusive strategy is especially suitable (and restricted) to be used with DMD, which is also a non-intrusive algorithm. For intrusive snapshot-based methods such as Proper Orthogonal Decomposition (POD), one needs to project finite element matrices onto the computed basis and, therefore, requires access to the code [ullmann2016pod].

4 Numerical Experiments

In this section, for the sake of generality, we apply our method in several applications, with different systems of equations, numerical formulations, mesh topologies, spatial dimensions, refinement criteria, and finite element libraries. We compare the results between the AMR/C solution, the fixed mesh solution, and the DMD results for all cases. First, we test the DMD short-time future prediction capabilities on a continuous SEIRD model for COVID-19, a nonlinear system of diffusion-reaction equations. The equations are considered using a Galerkin finite element discretization and are solved using libMesh [libmesh], a high-performance C++ finite element library. The error estimators, refinement/coarsening strategies built-in on libMesh can be seen on [Viguerie2021, grave2020adaptive]. Also, the -projection algorithm is embedded in libMesh. We explore the results in one and two spatial dimensions, where the 1D case is a hypothetical example, and the 2D case describes the COVID-19 evolution in the Lombardy region in Italy [viguerie2020diffusion, Viguerie2021, grave2020adaptive]. The simulation obtains the results for and days for the 1D and 2D cases, respectively. Since we want to predict days in the future, we only feed DMD with snapshot matrices containing the first and days in the 1D and 2D cases, respectively, such that the predicted results can be compared with the results obtained in the simulations. To apply DMD to the SEIRD data obtained on an AMR/C simulation, we project the adaptive solution onto a mesh with characteristic length compatible with the obtained simulation results. The discretization of the reference mesh used for the projection is as fine as the final refinement level on the adaptive meshes. Next, we consider two fluid dynamics applications where the governing equations for both cases are advection-dominated. To circumvent the LBB condition and spurious oscillations regarding dominant advection, these equations consider the residual-based variational multiscale (RBVMS) formulation [hughes, rasthofer, ahmed2017, codina2018, bazilevs2013computational, Guerra2013] on a finite element discretization. We consider the use of DMD on a 2D density-driven gravity flow and a 3D bubble rising simulation. The density-driven gravity current is modeled by the coupling of the incompressible Navier-Stokes equation and the advection-diffusion equation. We consider a lock-exchange problem, where a tank is filled with two fluids of different densities, separated by a lock. The simulation starts when the lock is removed, and the difference in the densities of the fluids generates the driving forces responsible for the motion of the fluids. Unlike the other examples in this work, the implementation of this numerical test is made on the FEniCS v.2019.1 framework [fenics], a high-performance Python/C++ finite element library. The refinement/coarsening algorithm and projection algorithm for this example are part of the framework. We consider an interface-tracking error indicator for the AMR/C simulations, and the mesh is refined following the bisection method [Rivara1984]. DMD is considered to reconstruct the solution, and the results are compared to the fixed mesh results and the results obtained by AMR/C simulations. Finally, we extend our analysis to a 3D bubble rising case [grave2020new], a two-phase incompressible flow problem where the interface is captured by the convected level-set method. This model is implemented on libMesh, taking advantage of the same refinement/coarsening strategies as well as the projection algorithm used in the SEIRD numerical tests. In this example, we test the projection of the adaptive solutions onto three different meshes containing the different scales existent on the AMR/C simulation and evaluate the results. We consider DMD to predict the bubble geometry and dynamics for a short time in the future.

For all the numerical tests proposed, we evaluate the results in terms of efficiency and accuracy. For efficiency purposes, we compute the ratio between the computational time required to run the finite element simulations and the time required to run DMD separately. We refer to this quotient as speedup. The finite element code is responsible for computing the snapshots and projecting the results onto the reference target meshes proposed, while the DMD code imports the output files, extract the snapshots, computes the approximation, and outputs the results. Also, we provide a table describing how the projection routine affects the overall computational time required for the simulations for all examples. In terms of accuracy, we evaluate the results in terms of overall relative error where is the snapshots matrix, is a matrix comprising the approximations obtained by DMD and denotes the Frobenius norm. A more detailed analysis is also done in terms of relative error in time . For that, we plot the curves of the relative errors (in terms of -norm) of each snapshot. We compute for snapshots, where denotes the -norm. Also, to avoid unphysical results, some quantities of interest are evaluated and compared using both simulation and approximation results. For the SEIRD model, we plot the results regarding the total population. This quantity should be constant in time according to the hypothesis of the model. For the lock-exchange simulation, we compute the mass during the simulation and the front position. Since the simulation is considered on a closed tank, the mass must be kept constant during the simulation. For the 3D bubble rising problem, we plot the quantities of interest related to the geometry (volume and sphericity) and dynamics (center of mass and rise velocity) of the bubble. In this case, we test meshes with different minimum characteristic lengths. The results are shown and discussed below.

4.1 Continuous SEIRD model for COVID-19

The outbreak of COVID-19 in 2020 has led to a surge in interest in the mathematical modeling of infectious diseases. This new virus is responsible for infecting millions of people worldwide and impacting the economy in an unprecedented way. Therefore, numerical simulation of the virus’ dynamics may help provide short-term prediction models for forecasting the number of future cases. In this perspective, it is possible to develop strategic planning in the public health system to avoid deaths and manage patients.

Disease transmission may be modeled as compartmental models, in which the population under study is divided into compartments and has assumptions about the nature and time rate of transfer from one compartment to another [brauer2019mathematical]. Here, we work with a spatio-temporal SEIRD model, presented in [viguerie2020diffusion, Viguerie2021, grave2020adaptive], and given by,

(21)
(22)
(23)
(24)
(25)

where , , , , and denote the densities of the susceptible, exposed, infected, recovered, and deceased populations, respectively. The sum of all the compartments with the exception of is represented by which is the total living population. characterizes the Allee effect (persons), that takes into account the tendency of outbreaks to cluster around large populations, and denote the transmission rates between symptomatic and susceptible individuals and asymptomatic and susceptible individuals, respectively (units days), denotes the incubation period (units days), corresponds to the asymptomatic recovery rate (units days), the symptomatic recovery rate (units days), represents the mortality rate (units days), and , , , are the diffusion parameters of the different population groups as denoted by the sub-scripted letters (units km persons days). Note that all these parameters can be considered time and space-dependent. We also compute the compartment , the cumulative field of the compartment.

For the numerical solution of (21)-(25), we discretize in space using a Galerkin finite element variational formulation. The resulting systems of equations are stiff, leading us to employ implicit methods for time integration. We apply the Backward Differentiation Formula (BDF2), which offers second-order accuracy while remaining unconditionally stable. We implement the whole model in libMesh [libmesh]. We additionally make use of AMR/C, allowing us to resolve multiple scales. One may find more details about the methods in [Viguerie2021, grave2020adaptive].

4.1.1 Reproducing a 1D model

First, we use a simple 1D continuous SEIRD model for COVID-19 with adaptive mesh refinement to validate the projection and DMD. This example was introduced in [Viguerie2021] and reproduced in [grave2020adaptive]. Basically, we consider a 1D region with initial conditions that represents a large population centered around with no exposed persons and a small population centered around with some exposed individuals, as shown in Figure 3. Thus, we set and as follows,

(26)
(27)

We further set , , and . We also enforce homogeneous Neumann boundary conditions at and a zero-population Dirichlet boundary condition at for all model compartments. The latter represents a non-populated area at .

Figure 3: Initial conditions for the 1D model.

Following [Viguerie2021, grave2020adaptive] we set days, dayspersons, days, days and days, , , , and kmpersonsdays. The time step size is defined as days and we consider the mesh projection and outputs at every time step, that is, .

We use an adapted mesh with initially 125 elements, and after the refinement, the smallest element has a size 0.002. At the beginning of the simulation, we refine uniformly the whole domain into two levels and, after that, we apply the adaptive mesh refinement every 4 time steps. The idea is that the AMR/C strategy will keep this spatial resolution on more dynamically relevant regions while coarsening other regions in the domain. As a target reference mesh, we consider the uniformly refined mesh, such that all the domain contains the minimal spatial resolution obtained by the AMR/C simulation.

The results of this simulation are validated against the results from [Viguerie2021] and [grave2020adaptive]. Figure 4 show the solution of the 1D SEIRD example at days for the fixed mesh simulation, the adaptive mesh simulation, and the projection of the adaptive solution onto the target reference mesh used in the fixed mesh simulation. We observe a good agreement between the solutions. This agreement is a positive indicator that the DMD can be used on the projected meshes with little to no error compared to the DMD on a fixed mesh simulation. In terms of efficiency, Table 1 shows the computational effort required for the reference mesh projection embedded on the adaptive finite element code in comparison with the time used for the simulation code itself (AMR/C FEM).

Figure 4: Solution at days for the fixed mesh solution, AMR solution and the respective projection onto a reference mesh for the 1D SEIRD example. The reference mesh was built with characteristic length similar to the smaller elements in the adaptive mesh.
Code Part Absolute Time (s) Relative Time ()
AMR/C FEM
Mesh Projection
Table 1: Absolute and relative time required for the projection routine in comparison with the adaptive finite element simulation code (AMR/C FEM) for the SEIRD model in the 1D case.

After some initial experiments, we set for all compartments. In this example, the finite element simulation computes the results for days, that is, time steps. However, we only consider the first days in the snapshot matrix for reconstruction. DMD is set to approximate the results for a further days so the results can be compared with the days results obtained in the finite element simulation. In other words, we want to evaluate the DMD ability to predict the COVID-19 scenario two weeks in the future given the data of the last days. For numerical reasons, we considered an initial days shift in the snapshots since some compartments are initialized with zeros, affecting how DMD captures the dynamics. The th day solution for the adaptive simulation and the th day prediction considering DMD are seen in Figure 5. We observe good agreement between predictions and the numerical solutions of the simulations for most compartments. The speedup and overall relative error between the DMD approximation and the snapshots are seen in Table 2.

Compartments Relative Error Speedup
Table 2: Relative error between reconstructed (and predicted) data and the projected snapshots.
Figure 5: Solution at days for the AMR simulation solution and the days projection using DMD for the 1D SEIRD example.

4.1.2 The Lombardy region

We extend our analysis by solving the continuous SEIRD model and applying DMD to a 2D real world domain that is the Lombardy region in Italy. The spread of the COVID-19 has been studied in this region using the continuous SEIRD model with accurate results [Viguerie2021, viguerie2020diffusion]. Here, we reproduce this simulation with the solver developed in [grave2020adaptive] which invokes adaptive mesh refinement every 4 time steps. We use the same parameters as shown in [Viguerie2021, viguerie2020diffusion]. It is important to point that, in this simulation, the transmission rates and diffusion parameters vary with time in order to reproduce the effects of restrictions during the simulated period.

Figure 6: Number of mesh nodes in time for the adaptive solution and the proposed reference mesh for the 2D SEIRD example.

For this simulation, an unstructured mesh is considered due to the complex geometry imposed by the domain. The mesh is generated using Gmsh and is uniformly refined as the simulation starts. After refining the whole mesh in one level, the mesh presents a minimum spatial resolution of approximately 1 kilometer. This procedure allows the solver to coarsen the regions where no significant dynamics are observed while preserving the scales of the regions of interest. Figure 6 shows the variation of the number of nodes in time for the AMR/C strategy. The coarsening approach improves the simulation performance significantly since the average number of nodes (and respectively, the number of equations ) used in the adaptive simulation is approximately half with respect to the case of a fixed mesh with the same spatial resolution considered for the entire domain. In this example, the reference target mesh is the uniformly refined unstructured mesh considered in the early stages of the simulation, presenting nodes and elements. The simulation considers a time step size of days for the numerical integration and days for the observations. Initial conditions for the Lombardy domain are the same presented on [Viguerie2021, viguerie2020diffusion] and are seen in Figure 7, while compartments and are initialized to zero.

Figure 7: Initial conditions for the SEIRD model in the Lombardy case.

We then proceed to run both adaptive and fixed mesh simulations and, to apply DMD in the adaptive mesh results, we consider the proposed projection scheme. Figure 8 shows the compartment solution at days for both simulations and the projected adaptive solution onto the reference mesh, revealing that the results are in good agreement. In terms of efficiency, Table 3 shows results for the computational time required for the projection compared to the finite element code. That said, the adaptive snapshots can now be assembled into a snapshot matrix for the DMD reconstruction and prediction.

(a) Fixed mesh solution
(b) Adaptive solution
(c) Projection onto reference mesh
Figure 8: Solution for the susceptible compartment at days obtained using an adaptive mesh and its respective projection onto a fixed reference mesh.
Code Part Absolute Time (s) Relative Time ()
AMR/C FEM
Mesh Projection
Table 3: Absolute and relative time required for the projection routine in comparison with the adaptive finite element simulation code (AMR/C FEM) for the SEIRD model in the Lombardy case.

The DMD analysis is made in the same way as presented in the 1D case: the simulation outputs the projected snapshots for the first days ( snapshots). The snapshot matrix assembles the information regarding days of simulations, while DMD approximates the results for days. The idea is to predict two weeks in the future, given the data observed in the past days. For this example, we consider the SVD truncation at for all compartments. Again, an initial days shift in the data is considered to avoid issues with the compartments initialized to zero. Results for the th day comparing the computed numerical solutions and the DMD predictions are seen in Figures 9 and 10. We present the projected solutions, the DMD prediction, and the relative error in space between the two results from left to right. We can note that most compartments show results in agreement with the simulations, while the exposed compartment reveals more pronounced differences than the other compartments.

Figure 9: Comparison between computed and predicted solutions at days for the susceptible, exposed, and infected compartments.
Figure 10: Comparison between computed and predicted solutions at days for the recovered, deceased, and cumulative infected compartments.

Figure 11 shows the relative error in time between the DMD results and the projected snapshots. The first thing we notice is that the curves are different for each compartment. This discrepancy occurs due to the different parameters for each equation in the SEIRD model, which largely affects the dynamics of the system. The dynamics for each compartment are different since each compartment presents different coupling, diffusion, and reaction parameters. Also, regarding this issue, since the parameters are time and space-dependent, sudden changes in their values can affect the dynamics of the system as well as DMD’s dynamics mapping ability. Some sudden changes in the and compartments related to stricter public policies considered to reduce the transmission rates (parameters and ) are incorporated into the model. Since the variation in the parameters is not introduced smoothly, DMD’s ability to map sudden changes in the dynamics of the system is reflected by the existence of some spikes on the curves of the relative errors in time. Comparing the reconstruction and prediction stages, we observe that the errors tend to grow as soon as the prediction stage starts (dashed line). The exposed compartment, which yielded most of the oscillations due to parameter changing on the reconstruction stage, presented the same behavior on the prediction phase around day . We also note that the exposed compartment yields a larger relative error for the th day in comparison with the other compartments. Table 4 shows the overall relative error and the speedups for the six compartments approximations. Comparing these results with the results presented in Figures 9, 10, and 11, we can conclude that the predictions are reasonably accurate in comparison with the numerical solutions, specially when considering the time required for calculation.

Figure 11: Relative error for all compartments between numerical simulation snapshots and DMD reconstruction and prediction. The dashed line represents the beginning of the DMD prediction stage.
Compartments Relative Error () Speedup
Table 4: Relative error between reconstructed (and predicted) data and the computed snapshots and speedup between DMD and the numerical simulation.

Another important analysis to be done is the conservation property of the continuous SEIRD model. As mentioned before, the standard projection does not guarantee conservation among the projections. Figure 12 shows the total population during the simulation, normalized by the total population modeled in the initial conditions. The total population is computed as the sum of the integral of the compartments (excluding ) divided by the sum of the integral of the elements of the mesh. Since the SEIRD model does not consider any population growth, the value must be theoretically constant for all the simulations. From the figure, we observe that the population is kept constant during all the adaptive simulation, and this was preserved by the projected solutions and the DMD reconstruction stage. That is, we can note that the projection does not yield conservation issues in this example. For the prediction phase, DMD preserves the total population for several days in the future. However, it presents a slight increase (around ) for predictions over days, which does not affect the results significantly. This increase can be explained by the relative errors behavior, observed in Figure 11, as DMD computes future estimates.

Figure 12: Population conservation for both adaptive and projected results.

4.2 Fluid dynamics

This section evaluates the DMD use on two cases involving AMR/C in computational fluid dynamics: the reconstruction of a 2D density-driven gravity current simulation and the temporal prediction on a 3D rising bubble. Different from the previous cases, the test cases presented in this section are advection-dominant. To approximate the governing equations, we use a finite element RBVMS formulation [hughes, rasthofer, ahmed2017, codina2018, Guerra2013]. In the first case, we reconstruct the solution and evaluate important quantities of interest regarding density-driven gravity flows. On the bubble rising simulation, we show how our strategy works on a 3D mesh, and we evaluate the DMD ability to predict the quantities of interest of the rising bubble in time.

4.2.1 Density-driven gravity flow

In this section, we consider a long numerical simulation that consists of a lock-exchange between two fluids, the heavy fluid, A, and the lighter fluid, B, based on the numerical example in [Necker2002]. The difference between their densities is such that the Boussinesq hypothesis is considered valid. Moreover, particles in the heavy fluid have negligible inertia and are much smaller than the smallest length scales of the buoyancy-induced fluid motion. Thus, the dimensionless governing equations are,

(28)

where is the fluid velocity, is the concentration field, is the pressure, is the vector pointing in the direction of gravity, is the Schmidt number and is the Grashof number, two dimensionless numbers that relate viscous effects with diffusion and buoyancy effects, respectively. A Grashof number of this magnitude indicates a turbulent flow. The field is the concentration and is responsible for mapping the evolution of fluid interactions. The time step size considered for this simulation consists on s for a total simulation time of s with an output frequency of s. We consider a tank, that is, a rectangular domain with length m, height m. The boundary conditions for this case are no-slip for the velocity and no-flux for the transport equation, and the initial conditions are such that the heavy fluid is represented as a column with dimensions m m located at the left border of the tank and the light fluid fills the rest of the domain. Figure 13 illustrates the domain and the initial conditions.

Figure 13: Scheme illustrating the initial conditions for the density-driven gravity flow example.

To solve the governing equations, we implement the RBVMS formulation [Guerra2013] for Eq. (28) using the FEniCS 2019.1 [AlnaesBlechta2015a] framework to generate the snapshots for this example. The adaptive mesh refinement procedure returns the solution for and . For this example, we only consider the snapshots of for our calculations, that is, an overall data reduction of . Details of the formulation of the problem can be found in [Guerra2013, Barros2020]. We consider a fixed mesh simulation with nodes and cells, where each cell is divided into two linear triangles. We consider an interface-tracking adaptive mesh error indicator that flags and refines the mesh where the two fluids interact for the adaptive mesh simulation. The error indicator for the mesh refinement is being larger than a given tolerance. For this purpose, a mesh containing cells is considered, the interfaces are refined considering two levels of refinement, and the mesh refinement is invoked at every time step. Figure 14 shows the results at s for both fixed and adaptive mesh simulations and the projection of the adaptive solution onto the same mesh used in the fixed mesh simulation.

(a) Adaptive solution
(b) Adaptive mesh
(c) Projected solution in the structured mesh
(d) Fixed structured mesh solution
Figure 14: Results and mesh for the first 8 meters of the domain at s.

AMR/C in this problem is advisable since the dynamics are predominant on the interface between the fluids. Most of the domain is not affected in the early stages of the simulation, and the use of fine meshes outside these regions may represent unnecessary computational effort. Figure 15 shows the number of nodes in the mesh during the simulation time for the adaptive mesh compared with the fixed nodes mesh.

Figure 15: Number of mesh nodes in time for the adaptive solution and the proposed reference mesh for the density-driven gravity current example.

We observe that the number of nodes in the adaptive simulation is smaller than the fixed mesh for all the simulation time. Table 5 shows the time required for the simulation to run in comparison with the time spent on projecting the solutions onto the reference target mesh.

Code Part Absolute Time (s) Relative Time ()
AMR/C FEM
Mesh Projection
Table 5: Absolute and relative time required for the projection routine in comparison with the adaptive finite element simulation code (AMR/C FEM) for the lock-exchange example.

Now we proceed applying DMD to the projected solution and reconstructing the solutions. Figure 16 shows the relative error for the reconstruction using different values of the rank . The results are also confirmed in Table 6, where the relative error between the reconstructed and projected snapshot matrices is shown and the speedup computed for each case. We observe that, for increasing values of , the relative error decreases for all steps and affects the overall relative error of the matrices. That is, inserting more structures in the DMD basis yields better accuracy in terms of overall relative error. As for the speedup, we notice that it decreases for increasing values of . Such a decrease occurs because larger values of directly affect the rSVD algorithm performance [Barros2020, Erichson2019] and increase the dimensions of the matrices for the computation of the DMD basis.

Figure 16: Relative error for the reconstruction considering different values of the rank .
Rank Relative Error () Speedup
Table 6: Relative error between reconstructed data and the snapshots and speedup between DMD and the numerical simulation.

Most importantly, we can evaluate the quantities of interest common to density-driven gravity currents. Figure 17 shows the front position and mass conservation for both simulations and the respective reconstructions. We note that, for these quantities all reconstructions are in extremely good agreement with those computed with the fixed and adaptive meshes, approaching them, as expected, for higher values .

(a) Front position
(b) Mass conservation
Figure 17: Front position and mass conservation for the fixed mesh and adaptive mesh simulations and reconstructions with the target mesh.

4.2.2 Bubble rising problem

We now study a bubble rising 3D benchmark, whose task is to track the evolution of a three-dimensional bubble rising in a liquid column. The initial configuration is described in Figure 18.

Figure 18: Initial configuration and boundary conditions for the bubble rising problem.

For this problem, we couple the Navier-Stokes equations with an interface capturing method called convected level-set [coupez2007convection, ville2011, grave2020new]. The convected level-set is a method used to represent the interface between two phases and, by a convection equation, to move the interface as the flow evolves. A force that has an important role in bubble problems is the surface tension , which is applied using the Continuum Surface Model (CSF) [brackbill1992continuum].

We write the governing equations in their dimensional form as

(29)

where is the density, is the dynamic viscosity, is the acceleration of gravity vector, is the level-set function, is a penalty constant, , and a function related to the level-set signed distance function.

For the temporal integration, we apply the Backward-Euler method to the Navier-Stokes equations, while for the convected level-set, we use the BDF2 method. One may find more details about the governing equations and methods in [grave2020new].

The initial configuration consists of a spherical bubble of radius m centered at m in a m domain. The no-slip boundary condition is applied to all boundaries. Table 7 lists the parameters used for this simulation.

Computational domain (m)
Grid sizes to (m)
Number of time steps (-)
Time step s
Bubble radius m
Initial bubble position m
Liquid density kg/
Liquid viscosity kg/(ms)
Gas density kg/
Gas viscosity kg/(ms)
Surface tension N/m
Gravity m/
Table 7: Rising bubble data.

We use an adapted mesh, initially with cells, with each cell divided into linear tetrahedra. We refine the initial region where the bubble is located into two levels and, after the refinement, the smallest element has a size of m. The adaptive mesh refinement is based on the flux jump of the level-set function error, in which . We apply the adaptive mesh refinement every four time steps. The interface is modeled with , and the time step size is defined as s. We output the projected solutions at every time steps such that s. In this example, we consider three tetrahedral meshes for our projection strategy, presented in Figure 19. The three meshes named coarse, intermediate and fine, present characteristic lengths similar to the three scales existent in the refinement levels of the adaptive mesh simulation. The coarse mesh represents the initial mesh on the adaptive simulation, with 12000 elements and 2541 nodes. The intermediate mesh presents smaller elements equivalent to the generated elements after the first refinement level on the AMR/C simulation, totalizing 96000 elements and 18081 nodes and the fine mesh contains the smallest scales presented on the adaptive numerical solution with 768000 elements and 136161 nodes. The figures show the level-set solution on half of the domain and at s for the adaptive mesh solution and the respective projections. We also present on Table 8 the time required for the projection of the solutions of on the three meshes in terms of absolute and relative time. We can see that the projection time is very small.

(a) Adaptive mesh solution
(b) Coarse mesh projection
(c) Intermediate mesh projection
(d) Fine mesh projection
Figure 19: Level-set solution detail at s and projection to the coarse, medium and fine meshes.
Target Mesh Code Part Absolute Time (s) Relative Time ()
Coarse AMR/C FEM
Mesh Projection
Intermediate AMR/C FEM
Mesh Projection
Fine AMR/C FEM
Mesh Projection
Table 8: Absolute and relative time required for the projection routine in comparison with the adaptive finite element simulation code (AMR/C FEM) for the bubble rising example.

To verify if the bubble geometry and dynamics are being preserved during the mesh projections, we evaluate the quantities of interest such as the bubble volume, sphericity, center of mass, and rise velocity. Bubble volume and sphericity are related to the bubble geometry, while the position of the bubble center of mass and rise velocity regard the bubble dynamics. The results are compared for the AMR/C simulation output and the projections on Figure 20. The quantities of interest are computed using the adaptive snapshots as well as the projected snapshots and compared with each other. Regarding the geometry quantities of interest, we observe that the coarse mesh projection solution affects the bubble’s geometry, leading to bad results regarding the bubble volume and sphericity compared with the AMR/C simulation. For the intermediate and the fine meshes, the bubble’s geometry is not largely affected, and the results are compatible with the AMR/C results. As for the quantities of interest related to the bubble dynamics, no significant difference is observed on the projection of the three meshes. We observe that the center of mass is not affected by the projections compared with the simulation results. As for the rise velocity, we observe some minor differences in all projection cases.

(a) Volume.
(b) Sphericity.
(c) Center of mass.
(d) Rise velocity.
Figure 20: Comparison between the simulation and projection of the 3D rising bubble quantities of interest.

The simulation proceeds until s, yielding a dataset containing snapshots regarding the solution of for each target mesh from the projections. We do not consider the use of velocities and pressure in the DMD analysis, reducing the required data in . We consider the results for the first s to construct the basis and predict the last seconds. We compare the DMD results in terms of relative error between the snapshot matrix and the obtained solutions for each case. The DMD solution for the coarse mesh is compared to the projected adaptive solution onto the coarse mesh and so forth. Results are evaluated for multiple values of , such that . The results regarding accuracy and performance for multiples values of and the three meshes are presented in Table 9.

Rank Mesh Rel. Error () Speedup
5 Coarse
Intermediate
Fine
10 Coarse
Intermediate
Fine
15 Coarse
Intermediate
Fine
30 Coarse
Intermediate
Fine
45 Coarse
Intermediate
Fine
60 Coarse
Intermediate
Fine
Table 9: Relative error between reconstructed data and the projected snapshots and speedup between DMD and the numerical simulation. Results presented for multiple values of .

The results for are shown in Figure 21. We observe that the errors are stable for the reconstruction case, that is, the DMD solution before s. From that point, shown as a dashed line on the figure, the errors begin to grow exponentially for each predicted time step, while still remaining below 1% until around 2.9 seconds. We observe that the errors in the reconstruction case are different regarding the mesh used. That is, the errors are larger with respect to the minimum characteristic length of the projection meshes. However, we observe that the errors grow at the same rate on the prediction phase independently of spatial discretization.

Figure 21: Relative error for the rising bubble example for the coarse, intermediate, and fine mesh solutions. The dashed line defines the start of the prediction phase.

We also show the results considering for reconstruction at s and prediction at s in Figure 22. We compare the DMD results for the three projected meshes, the adaptive mesh solution, and a fixed mesh solution. The fixed mesh solution is obtained by running the simulation with a mesh of elements and nodes, as the fine mesh used in the projection.We observe initially that the bubble geometry is better defined on the reconstruction than on the prediction figure. This better definition is directly related to the errors observed in Figure 21. We observe that the coarse mesh results do not capture the bubble geometry with the same accuracy as the intermediate and fine meshes for the reconstruction results. As for the intermediate and fine meshes, they present similar results in comparison with the projected solutions. However, when we observe the prediction figure, we observe that instabilities inherent to DMD arise on the bubble contour, affecting the bubble geometry for the intermediate and fine mesh.

(a) s.
(b) s.
Figure 22: Bubble contour at the vertical mid plane for the signal reconstruction (s) and prediction (s) last steps.

We now proceed comparing the results in terms of quantities of interest for the DMD results. Figure 23 shows the bubble volume, sphericity, center of mass, and rise velocity for the DMD results compared to the adaptive solution results. The same issue regarding sphericity on the coarse mesh projection is observed on the coarse mesh DMD results. However, for the intermediate and fine meshes, the values match the results observed for the projection. We observe results in conformity for the center of mass and rise velocity as well. In terms of prediction, we observe that DMD accurately predicts the volume and the center of mass evolution. As for the other quantities of interest, the increasing exponential errors in the DMD prediction structure affect the quantities of interest for long time future predictions.

(a) Volume.
(b) Sphericity.
(c) Center of mass.
(d) Rise velocity.
Figure 23: Comparison between the simulation and DMD signal plus prediction of the 3D rising bubble quantities of interest. The dashed line marks the beginning of the prediction regime for the DMD.

5 Conclusions

In this work, we propose a strategy to enable data-driven snapshot-based methods on finite element solutions obtained by AMR/C simulations. The use of AMR/C algorithms in finite element approximations of PDEs is known to reduce memory usage and to increase the efficiency of the simulations without compromising the accuracy. The simulation adapts the mesh with the evolution of the solution, refining regions of interest and coarsening regions that are not of interest. The adaptation process leads to different meshes during the simulations, and the solutions have different dimensions and topologies (or different connectivities and nodal coordinates) whenever the AMR/C algorithm is invoked. Snapshots with different dimensions prevent the use of snapshot-based algorithms such as DMD, where the snapshot matrix is built by stacking the solutions for each observation in columns. In this study, we considered a strategy to project the adaptive solutions on reference meshes such that all snapshots present the same dimensions and nodal indices, enabling the construction of snapshot matrices. The method employed to project the solutions onto the target reference mesh is the projection, a simple, fast and versatile approach. The projection is a common strategy present in several finite element libraries and frameworks and consists basically of solving a linear system, where the matrix is obtained by a self-adjoint operator enabling the use of efficient solvers. Despite presenting drawbacks, especially regarding properties’ conservation, we investigate the use of the projection as a postprocessing tool without any relevant issues. By postprocessing, we mean that the projection algorithm is invoked only to insert the solutions on a reference function space for each time step and output the files. This strategy does not yield significant additional computational effort as we observe that the projection routine required around of the computational time required for the adaptive finite element code to run in most cases and in the worst case. When the source code is not available to invoke the projection, one can construct the solutions from the output files and project them onto the target reference mesh in a complete non-intrusive workflow.

We test the algorithm on several models presenting different dynamics and underlying physics. First, we present the results for DMD on a continuous SEIRD model for COVID-19 for fictional data in 1D and real data for Lombardy, Italy, in 2D. The idea of considering short-time future estimates on COVID-19 models could improve the decision-making of public policies to avoid further contamination, and the use of AMR/C in the simulations, coupled with the presented projection scheme and DMD, can lead to fast and reliable predictions. The simulations are implemented using the libMesh library using its refinement built-in functions. We compare the solution, its projection in the reference mesh, and the adaptive solution and notice that no relevant errors are found for the projection strategy. In this example, the -projection consists of and of the total time required for the code to run for the 1D and 2D cases, respectively. As for the use of short-time future estimates, we consider DMD for predicting two weeks in the future given a set of snapshots. For the 1D case, we feed DMD with snapshots covering days, while for the 2D case, the snapshot matrix comprises days of simulation results. The DMD results are presented in terms of efficiency and accuracy compared to the projected solutions, and we observe that the predictions are mostly in good agreement except for the exposed compartment. To test the approach’s agnosticism regarding the dynamics of the systems, we consider two different fluid dynamics problems: a 2D density-driven gravity current and a 3D bubble rising problem. We use a -snapshot simulation to generate a basis containing the spatio-temporal coherent structures for the density-driven gravity flow. The lock-exchange simulation is solved using the FEniCS framework. The computational effort regarding the projection, in this case, corresponds to of the overall computational time. As for the DMD analysis, we evaluate the results for different values of the rank and observe that, as we increase it, in this case, the overall relative errors decrease significantly. However, when evaluating the quantities of interest such as mass conservation and front position, even the worst case yields good approximations. For the 3D example, we use the libMesh library, testing three different reference meshes considering the three element sizes existent in the adaptive simulation. We investigate the occurrence of projecting the adaptive solution onto meshes that do not necessarily guarantee that all the scales obtained in the solution are preserved in terms of quantities of interest related to the bubble geometry and dynamics. We observe that the use of -projection on coarser meshes leads to issues regarding the shape of the bubble, affecting quantities of interest such as bubble volume and sphericity. When considering the projection on meshes with approximately the same spatial resolution as the finest scale in the adaptive meshes, these effects are mitigated. As for the bubble dynamics, even coarser meshes reveal similar results for the bubble center of mass and rise velocity in comparison with finer mesh projections and the adaptive solution itself. In terms of computational effort, the projection corresponds to , and of the total simulation time for the coarse, intermediate, and fine meshes, respectively. Proceeding to the DMD analysis, we present the results for a time step reconstructions and a time step prediction for the bubble rising problem. We test the approximations for multiple values of being our best approximations. The results computed by DMD are presented in terms of efficiency and accuracy compared to the projected solutions. We also reevaluate the quantities of interest, now with the DMD approximation. For the reconstruction, results are practically identical to those observed for the projection, while for the prediction, the center of mass and bubble volume yield good results while sphericity and rise velocity are not in agreement with those obtained in the simulation.

Summarizing our findings, we highlight that the present approach, despite its simplicity:

  • is versatile since every finite element library that presents AMR/C is often equipped with efficient projection algorithms;

  • is fast in the sense that the projection only requires solving a sparse, well-conditioned linear system where is the mass matrix, obtained by a self-adjoint operator, enabling the use of efficient solvers;

  • is framework-agnostic, as noted in the results of our simulations implemented on libMesh and FEniCS, requiring only the standard procedures already in place in both libraries;

  • is problem-agnostic, as observed on meshes with different spatial dimensions (1D, 2D, and 3D), topologies (structured and unstructured), and equations (convection-dominated and reaction-diffusion systems);

  • preserves the dynamics computed on the adaptive snapshots for all the tested examples.

The results observed in this study reveal that the use of mesh projections for adaptive solutions preserves the dynamics inherent to the finite element solutions. However, this approach on large problems could be inefficient or prohibitive since the mesh projection on a sufficiently fine target reference mesh can lead to unfeasible DMD storage and computation times. As a future work, aiming to circumvent this issue, we plan to explore the use of data compression on DMD, once used for streaming purposes [Erichson2019], in the mesh projection context.

Acknowledgements

This research was financed in part by the Coordenação de Aperfeiçoamento de Pessoal de Nível Superior - Brasil (CAPES) - Finance Code 001. This research has also received funding from CNPq and FAPERJ. Computer time in Lobo Carneiro supercomputer was provided by the High Performance Computer Center at COPPE/Federal University of Rio de Janeiro, Brazil. A. Reali was partially supported by the Italian Ministry of University and Research (MIUR) through the PRIN project XFAST-SIMS (No. 20173C478N).

Conflict of interest

The authors declare that they have no conflict of interest.

Appendix

In this appendix we provide a more detailed discussion of several points raised in section 3 regarding the use of DMD on adapted meshes. As discussed in the main text, given the way DMD works by acting on the snapshot matrix, it is therefore essential for its proper application that all snapshots are of equal dimension; if the original dataset has been produced using different meshes, this may not be the case. Thus, it is crucial in such a case to use some sort of post-processing technique to provide a uniform snapshot size across the time series.

For practical purposes, however, ensuring simply that all snapshots of uniform dimension is a necessary but not sufficient condition to usefully apply DMD. As illustrated in Figure 24, we show an example of two meshes (labelled as 1 and 2) that both an have equal number of nodes. Assuming the same order of finite element approximation is used on each mesh, the resulting vectors and will have the same dimension. However, while the number of degrees of freedom is the same on each mesh, they are topologically distinct. Hence, to properly perform DMD in this instance, we must have a third mesh, which we call a reference mesh (labeled as mesh 3), on which we project both and . We note that this mesh is refined everywhere, compared to the locally-refined mesh 1 and mesh 2. In this way, we guarantee that the fine-scale frequencies captured by all the different mesh levels are properly represented by the DMD modes.

Figure 24: Depiction demonstrating the need for projection. Even though Mesh 1 and Mesh 2 have the same number of degrees of freedom, the different topologies require that, for a proper application of DMD, we must project both meshes onto a reference mesh 3 (Mesh 3). As shown, this reference mesh should be sufficiently fine to resolve all necessary in all areas of the domain.

In the current work, we have performed this by using -projection of all snapshots onto a reference (or projected) mesh. Let denote the finite element solution on the original mesh. Then we define the -projection onto the reference mesh as:

(30)

for all in . One may quickly verify that this satisfies the Galerkin orthogonality property on the reference mesh, i.e., for all in , the relation:

is satisfied. At the algebraic level, the problem (30) may be expressed as:

(31)

where is the mass matrix on the FEM space and is a rectangular matrix consisting of the projection from onto . Letting correspond to the shape functions of and to , the matrices have the following definitions:

(32)

We then may view as:

(33)

Consider now DMD on Mesh 1:

(34)

Similarly, DMD defined on the reference mesh reads:

(35)

Similarly,

(36)

From (35), (36):

(37)

where denotes the left-sided pseudoinverse of (see e.g. [golub2013matrix]). Thus, rank() = dim(), DMD may properly represent all relevant dynamics on the reference (projected) mesh.
Theorem. If every degree of freedom of the original mesh is also a degree of freedom of the reference mesh, then the matrix is full-rank.
Proof. By assumption, for every , the corresponding (assumed to be more fine and hence greater in number) is defined such that:

This idea may be alternatively expressed as:

where the different are finite element spaces corresponding to the different adapted meshes. Such a condition was also used in [ullmann2016pod]. We therefore have that:

(38)

where for all is a volumetric constant relating the measures of and . By (38), the matrix , defined such that:

which has the same rank (that is, dim()) as by construction. We then observe that, for :

Thus we can express as:

Assume now for the sake of contradiction that is not full-rank. This implies that there exists a such that Then:

(39)

implying that , contradicting the full-rank of . Hence we can conclude is full-rank.

The above theorem requires an assumption that, while often the case in practice, is not strictly necessary in our experience to obtain acceptable results using DMD. As mentioned, a similar condition was required for the related POD method in [ullmann2016pod], in which a common finite element space was implicitly constructed from the different spaces from each adapted mesh. Issues regarding projection between meshes were also studied in [maddison2017optimal, dickopf2011study, bolten2015generalized], in which the interested reader may find more theoretical results regarding projection between meshes.

References