Solving the Nonstationary Richards Equation With Adaptive hp-FEM

Pavel Solin1,2, Ondrej Certik1,3, Michal Kuraz4 1Department of Mathematics and Statistics, University of Nevada, Reno, USA 2Institute of Themomechanics, Prague, Czech Republic 3Institute of Physics, Academy of Sciences of the Czech Republic, Czech Republic 4Department of Water Resources and Environmental Modeling, Czech University of Life Sciences, Prague, Czech Republic

Abstract This paper introduces briefly the adaptive hp-FEM method and examines its potential for the numerical solution of time-dependent variably saturated groundwater flow problems described by the Richards equation. For this purpose we use a benchmark for the nonstationary Richards equation that has a known exact solution given in terms of Fourier series, and an example of groundwater seepage into a dry lysimeter box with time-dependent boundary conditions. In the second part of the paper we discuss in more detail several advanced approximation techniques related to adaptive hp-FEM and introduce the open source adaptive hp-FEM library HERMES. Keywords: Richards equation, Adaptive hp-FEM

1. Introduction oscillation [9]. It should be noted that these oscillations are an attempt of the numerical method to preserve mass The problem of predicting flow in an unsatu- within large elements where the solution is not captured rated/saturated zone is important in many fields rang- with sufficient accuracy. ing from agriculture and hydrology to technical appli- One of the goals of this paper is to show that to cer- cations such as contaminant transport, disposal of dan- tain extent, these problems can be avoided by resolving gerous waste in deep rock formations, and others. areas with steep solution gradients with adaptive finite The Richards equation is obtained by combining the element methods, so that the underlying reason for the Darcy-Buckingham’s law with the law of conservation nonphysical oscillations ceases to exist. In particular, of mass. Its numerical solution is the subject of an we focus on the application of adaptive hp-FEM, a mod- intense research since the early 1970s, beginning with ern version of the finite element method that is capable Neuman’s finite element solution of unsteady dam seep- of extremely fast, exponential convergence [36]. age [20], Celia’s mass conservative modified Picard it- The outline of the paper is as follows: To make the eration [2] method in the early 1990s, and the recent paper self-contained and to establish notation, in Sec- Kees’s work with focus on stabilized finite element ap- tion 2 we introduce the Richards equation and relevant proximations [16, 18, 5]. Numerical methods for the constitutive relations. In Section 3 we introduce briefly Richards equation can be tested on several simplified adaptive hp-FEM and demonstrate its potential on a examples with known exact solutions such as [38, 39]. simple elliptic benchmark problem with known exact It is well known that a straightforward application solution. In Section 4, an analogous comparison with of the Galerkin approximation to the Richards equation low-order finite element methods is done for the time- yields poor results. In certain types of media, wetting dependent Richards equation, in the context of a bench- fronts generate steep gradients with a dominant con- mark problem with known exact solution. Section 5 is vective term [16]. Classical finite element approxima- dedicated to solving with adaptive hp-FEM a nonsta- tions are therefore often modified using low-order mass- tionary groundwater seepage into a dry lysimeter box, lumping and upwinding schemes to prevent nonphysical with time-dependent boundary conditions. In the sec-

Preprint submitted to Advanced Water Resources August 2, 2010 ond part of the paper we describe in more detail some pressure, and n and m [-] are a pore-size distribution particular aspects on adaptive hp-FEM that are relevant parameters affecting the slope of the retention function. for computations performed in this paper, and we intro- The relation between the hydraulic conductivity and duce the open source project HERMES [12]. the negative pressure head, an unsaturated conductivity function, might be defined by the Mualem’s model [19]:

2. Richards Equation  2  Rθ    1 dθ   q   h(θ)   θ  θr  The mathematical model of unsaturated flow was  Ks    θs  RθS    1  originally published in [25]. This formula, usually iden- K(h) =  h(θ) dθ  (5)  θ tified as the mixed form of the Richards equation, states  r  ∀θ ∈ (θr, θS ) ⇒ h ∈ (−∞, 0); that   Ks ∀θ = θS ⇒ h ∈ h0, +∞). ∂θ ∂K(θ) − ∇ · (K(θ)∇h) − = 0. (1) ∂t ∂z Here θr is the so called residual water content [-] – a bot- tom limit of water content for Darcian flow to occur, Ks Here θ is the water content of a porous material [-], h is is the saturated hydraulic conductivity (the maximum the pressure head [L], K(θ) is the unsaturated hydraulic value). − conductivity function [L.T 1], z denotes the vertical di- Due to the great complexity of the van Genuchten’s mension [L], assumed positive upwards, and the porous relations (4) and (5), an older exponential Gardner’s medium is assumed to be isotropic. Appropriate con- model [10] is sometimes used in works treating analyti- stitutive relationships among θ and h, K and h, are also cal aspects such as, e.g., [38, 39]. The Gardner’s model assumed. has the form This PDE can be generalized as a quasilinear elliptic- ( θ + (θ − θ )eαh. ∀ h ∈ (−∞, 0), parabolic differential equation and as a degenerate θ(h) = r s r (6) convection-diffusion problem. A proof of the existence θS , ∀ h ∈ h0, +∞), of a solution is given in [1]. This model is applicable to unsteady unsaturated and flow, thus for h ∈ (−∞, 0i. An extension into saturated ( αh Kse , ∀ h ∈ (−∞, 0), zone can be obtained by modifying the time derivation K(h) = (7) Ks, ∀ h ∈ h0, +∞). term as considered in Neumann’s and Huyakorn’s works (see, e.g., [20, 21, 22, 13, 14]). The modification has the form 3. Adaptive hp-FEM ∂θ θ ∂h ∂K(θ) + S − ∇ · (K(θ)∇h) − = 0, (2) The finite element method (FEM) is the most widely ∂t θS ∂t ∂z used numerical technique to solve partial differential equations (PDE). By adaptive hp-FEM we mean a mod- where θS is the saturated water content [-] and S the specific storativity [L−1]. Such an approach is suitable, ern version fo FEM that combines adaptively finite ele- h e.g., for modeling an unsteady dam seepage. Equation ments of different spatial diameters ( ) and polynomial p (2) can also be assumed in the standard h-based form, degrees ( ) in order to maximize the convergence rate. For theory and technical details of higher-order FEM ! θ ∂h ∂K(h) and automatic hp-adaptivity we refer, e.g., to [36] and C(h) + S −∇·(K(h)∇h)− = 0. (3) θS ∂t ∂z many references therein. In the following let us present a simple example that illustrates the huge computational 2.1. Constitutive Relations potential of the method. A relation between the water content and the pressure We consider the Poisson equation −∆u = f with head is called retention curve. Its most commonly used zero Dirichlet boundary conditions, in a square domain 2 analytical formula is the van Genuchten’s equation [40]: Ω = (0, π) . Exact solution to this problem is chosen to be u(x, y) = sin(x) sin(y) and the right-hand side func- ( − θs θr + θ , ∀ h ∈ (−∞, 0) tion f is calculated accordingly. Note that having the θ(h) = (1+(−α|h|)n)m r (4) θS , ∀ h ∈ h0, +∞). exact solution means that we are able to calculate the approximation error exactly, and thus compare fairly the Here α [L−1] is an empirical parameter whose inverse performance of different methods. The exact solution u is often referred to as the air entry value or bubbling is shown in Fig. 1. 2 Figure 1: Exact solution.

The problem is solved using adaptive hp-FEM, adap- tive h-FEM with quadratic elements, and adaptive h- FEM with linear elements. To solve the problem we have implemented a simple C++ program that uses the open source adaptive hp-FEM library HERMES that is Figure 2: Convergence in terms of DOF. described in more detail in Section 7. Each computation starts from a one-element mesh and it is stopped when the number of unknowns in the discrete problem (DOF) exceeds 40000, or when the ap- proximation error drops below 10−5%. Due to these lim- itations, each method stops with a different number of DOF and accuracy, as shown in Table 1:

Method DOF error [%] h-FEM (p = 1) 27469 0.3917379 h-FEM (p = 2) 39185 0.0022127 hp-FEM 49 0.0000427

Table 1: Performance comparison of the three methods.

The table shows that adaptive hp-FEM attained an er- ror below 10−4% with 49 DOF, which is an accuracy that neither of the two remaining methods was able to Figure 3: Convergence in terms of CPU time. attain with much larger numbers of DOF. Fig. 2 presents a more complete convergence com- Final meshes for all three computations are shown in parison of the three methods, and it also shows that each Figs. 4 – 6. Note that the hp-FEM mesh (Fig. 6) only method attained its theoreticaly predicted asymptotic contains one element of polynomial degree 8. convergence rate – h-FEM with linear and quadratic ele- ments have on a log-log convergence graph slopes −1/2 and −1, respectively, and the convergence of hp-FEM is exponential. The reader can extrapolate the linear log-log con- vergence graphs of the adaptive h-FEM with linear and quadratic elements to see that in order to attain an error level of 10−4, they would need approximately 1,000,000,000,000 and 1,000,000 DOF, respectively. A CPU-time convergence comparison of the three methods presented in Fig. 3 shows that similar con- Figure 4: Final mesh for h-FEM with linear elements (27469 DOF, clusion also holds for the comparison of the CPU time error level 0.3917379%). requirements of the methods. 3 on the top edge Γ3 the value of h is given by the relation 1    πx h(x, 0, t) = log eαhr + 1 − eαhr sin (8) α a where α = 0.001. The initial condition is

h(x, z, 0) = hr for all (x, z) ∈ Ω. (9) The situation is depicted in Fig. 7.

Figure 5: Final mesh for h-FEM with quadratic elements (39185 DOF, error level 0.0022127%).

Figure 7: Geometry and boundary conditions.

Figure 6: Final mesh for hp-FEM (49 DOF, error level 0.0000427%). Since the treatment of the initial condition (9) is non- trivial in the finite element context, let us discuss it very Note that besides adaptive hp-FEM, also high-order briefly here. At time t = 0 the exact solution (9) is con- spectral element methods (SEM) are capable of expo- stant and it does not satisfy the Dirichlet boundary con- nential convergence on problems whose solution is very dition on the top edge. Therefore, as an initial step of smooth like this one. However, only adaptive hp-FEM each computation we run automatic adaptivity and cre- maintains exponential convergence when the solutions ate an initial mesh and a continuous approximate ini- lose their regularity (i.e., when they are not continu- tial condition h0(x, y) satisfying (8), that approximates ously differentiable, contain singularities, steep gradi- h(x, z, 0) with a given relative error TOL in the H1- ents, boundary or internal layers, etc.). norm. The spatial accuracy for all subsequent computa- In the vicinity of singularities or boundary/internal tions is set to TOL = 1%. The function h0 is shown in layers, adaptive hp-FEM acts similarly to adaptive low- Fig. 8. order FEM, and thus in practice the convergence gains over adaptive low-order FEM may be less astonishing than in this particular example.

4. A Benchmark for the Richards Equation

In this section we also compare the performance of adaptive hp-FEM and adaptive FEM with linear and quadratic elements, but now in the context of the time- dependent Richards equation. For this purpose we con- sider a benchmark problem with known exact solution from [38]. Figure 8: Initial condition. The computational domain Ω is a square (0, 100) × (−100, 0) cm2. Boundary conditions for the pressure head are Dirichlet h(x, z, t) = hr with hr = −1000 cm The initial meshes for all three methods are shown in on the bottom edge Γ1 and vertical edges Γ2 and Γ4, and Figs. 9 – 11. 4 Figure 9: Initial mesh for hp-FEM (97 DOF). Figure 12: Steady-state solution.

Figs. 13 and 14 show the convergence history of the three methods in terms of degrees of freedom (DOF) and CPU time. The horizontal axis represents the phys- ical time. Fig. 13 shows how the number of DOF evolved during the computation. Adaptive hp-FEM started with 97 DOF and finished with 28 DOF. Adap- tive h-FEM with quadratic elements started with 535 DOF and finished with 203 DOF, and adaptive h-FEM with linear elements started with 24843 DOF and fin- ished with 17367 DOF. Fig. 14 shows that the adaptive hp-FEM took approx. 103 seconds, adaptive h-FEM with quadratic elements Figure 10: Initial mesh for h-FEM with quadratic elements (535 approx. 104 seconds (one order of magnitude more than DOF). hp-FEM, similar to the DOF graph), and adaptive h- FEM with linear elements approx. 106 seconds (two orders of magnitude more than h-FEM with quadratic elements, also similar to the DOF graph).

Figure 11: Initial mesh for h-FEM with linear elements (24843 DOF).

In Figs. 9 - 11 different colors are used to distin- guish between different polynomial degrees of finite el- ements. All elements in these computations are quadri- laterals. Notice in Fig. 9 that adaptive hp-FEM employs anisotropic (i.e., directionally different) polynomial de- Figure 13: Number of degrees of freedom as a function of physical grees in finite elements – this is when an element in the time. mesh contains two different colors. The steady-state so- lution is shown in Fig. 12. Final meshes that were obtained adaptively to ap- 5 Figure 17: Final mesh for h-FEM with linear elements (17367 DOF).

5. Groundwater Seepage into a Dry Lysimeter Box Figure 14: CPU time as a function of physical time. This example is motivated by Kees’ recent publica- tion [16]. The problem is concerned with an unsteady proximate the steady-state solution with the tolerance seepage of groundwater into an initially dry lysime- TOL = 1% in the H1-norm are shown in Figs. 15 - 17. ter with a side bottom orifice. In the initial state, the groundwater table is three meters under the lysimeter bottom and the domain is in a steady state without any consideration of root uptakes and evapotranspiration. The groundwater table rises up linearly up to the level 2.2 m above the lysimeter bottom during the first half an hour of simulation time. Initially, unsaturated and later saturated flow through the orifice occurs together with the groundwater lift. Root uptake represented by recharge is considered as well, during the first hour of the simulation time.

5.1. Initial and Boundary Conditions The domain of interest is a rectangle (8.0, 0)×(0, 6.5) Figure 15: Final mesh for hp-FEM (28 DOF). 2 m bounded by Γ1...6 as shown in Fig. 18. At the begin- ning, the system is at steady state pressure head distri- bution without any inflow or outflow,

h(x, z, 0) = −3 − z m for all (x, z) ∈ Ω. (10)

The boundary conditions are stated as follows:

• Γ1 is a no-flow boundary. The Darcy-Buckingham law

∂h q = − − µ (11) ∂n K(h) 3

yields that this is a non-homogeneous Neumann boundary with Figure 16: Final mesh for h-FEM with quadratic elements (203 DOF). ∂h = −1 ∂n

(recall that µ3 is the vertical component of the outer normal vector to the boundary). 6 • Γ2 is a no-flow boundary with µ3 = 0 and thus a homogeneous Neumann boundary.

• Γ3 represents a side bottom orifice. Initially, this condition fulfills the initial state (10). The ground- water rises linearly and it is assumed that pressure head distribution out of the lysimeter box keeps its typical steady state distribution. Then this bound- ary reads

( t −3 − z + 5.2 if t < tstartup, h(Γ ) = tstartup (12) 4 2.2 − z if t ≥ t , startup Figure 19: Initial condition (10).

where tstartup is 30 minutes.

• Γ4 is a no-flow boundary, and since µ3 = −1, (11) ∂h implies that ∂n = 1.

• The condition on Γ5 is the same as on Γ2.

• Γ6 is a time dependent recharge boundary. Initially the recharge is zero, and during 30 minutes it rises −1 linearly to qmax = 0.07 m.d . The exact form of the corresponding nonhomogeneous boundary condition follows from (11). Figure 20: Initial mesh (33 DOF). 5.2. Material Properties The domain consists of two 50 cm thick surface lay- ers and a low-permeable clay block. The unsaturated material properties were obtained from [17] and the sat- urated material properties (storativity) [23]. The first layer is a silt loam, and the second is a silty clay loam. Layer three is sandy clay loam and layer four silty clay again. For details on the material parameters see Fig. 18 and Table 5.2. For the corresponding constitutive rela- tions we use the van Genuchten’s law (4) and Mualem’s law (5). This is a variably-saturated problem. The domain is partly under the groundwater table and the process of Figure 21: Solution after 7.5 minutes. the groundwater seepage through Γ3 is unsteady. There- fore, equation (1) is used with the groundwater modifi- cation (2).

5.3. Numerical Results Based on results of Section 3, we only use adaptive hp-FEM for the computation. The relative spatial error tolerance in the H1-norm is set to 0.5%. For the time-discretization we have chosen the second-order accurate and unconditionally stable Crank-Nicolson method with a time step of 1.5 minutes. A few snapshots of the solution and meshes are shown in Figs. 19 and 26. Figure 22: Mesh after 7.5 minutes (213 DOF).

7 Figure 18: Domain geometry for the groundwater seepage problem.

Table 2: Material properties. −1 −1 −1 type KS [m.d ] θs [-] θr [-] α [m ] n [-] m [-] S[m ] 1 0.108 0.4670 0.1201 0.15 1.8 0.8 0.01330 2 0.0168 0.3205 0.1012 0.23 1.85 0.589 0.01262 3 0.0048 0.15 0.064 0.185 1.56 0.756 0.011955 4 1.061 0.3250 0.08590 1.85 2.0 0.055 0.012577

8 Figure 23: Solution after 15 minutes. Figure 26: Mesh corresponding to stationary solution (478 DOF).

Figure 24: Mesh after 15 minutes (413 DOF).

Figure 27: Number of degrees of freedom in the groundwater seepage problem as a function of physical time.

low-order finite element methods. Compared to tradi- tional methods such as finite differences or low-order finite elements, adaptive hp-FEM is very young, but it has already been applied successfully to problems in civil engineering, mechanical engineering, electrical en- gineering, nuclear engineering, quantum chemistry and other fields. To our best knowledge, it has not been used Figure 25: Stationary solution. for variably saturated groundwater flow problems yet. Fig. 27 shows how the discrete problem size evolved As a matter of fact, adaptive hp-FEM is not so easy with physical time (in days). to handle as finite differences or low-order finite ele- The reader can experiment with this example on ments. It requires a deeper understanding of the under- his/her own, it is available in the HERMES Git reposi- lying mathematics and also its computer implementa- tory at [12] as example ”richards-seepage-adapt”. tion is more demanding. In the following we present a brief survey of details where the hp-FEM differs from 6. Overview of Adaptive hp-FEM standard low-order FEM. After that, in Section 7 we in- troduce the open source hp-FEM finite element library The reader has seen in Sections 3 and 4 that adaptive HERMES that lets the user enjoy the benefits of adap- hp-FEM can be much more efficient than conventional tive hp-FEM without having to learn tedious details. 9 6.1. Higher-Order Basis Functions In addition to the standard piecewise-linear vertex functions used in low-order FEM (see Fig. 28), in higher-order FEM one employs the so-called edge func- tions, face functions (in 3D only) and bubble functions.

Figure 30: A cubic edge function.

calculated using transfinite interpolation combined with projection-based interpolation. All these aspects of the higher-order finite element discretization technology are described in great detail Figure 28: A vertex function. in [36]. Edge functions are higher-order polynomials that are 6.2. Higher-Order Numerical Integration associated with mesh edges. On such an edge, the edge function has a nonzero trace, and it is nonzero within Numerical quadrature, which is not an issue in low- the elements that share the edge (see Fig. 29). order finite element methods, requires a substantial amount of attention in the hp-FEM. In one spatial dimension, Gauss integration points and weights are known and tabulated up to practi- cally unlimited orders of accuracy. One way to obtain them effortlessly is through the p roots() command in Scipy [26]. On product geometries (such as squares or hexahedra), Gauss points and weights are products of one-dimensional points and weights. On simplices (tri- angles, tetrahedra), however, Gauss points and weights have to be calculated ”from scratch” by solving large systems of nonlinear algebraic equations. For high polynomial degrees, these systems have hundreds and even thousands of solutions with more Figure 29: A cubic edge function. points than required, with points lying outside of the domain of integration, or with negative weights. Due Bubble functions are higher-order polynomials that to these technical limitations, the current knowledge of are associated with element interiors and they vanish on Gauss integration rules for simplices is rather limited. element boundaries (see Fig. 30). The state of the art as of 2003 was summarized in [36], In practice, all vertex, edge and bubble shape func- and for more recent updates we recommend to use the tions are first defined on a suitable reference do- Encyclopaedia of Cubature Formulas by Ronald Cools main which often is the square (−1, 1) × (−1, 1) for at the Katholieke Universiteit Leuven [3]. quadrilateral elements, and a triangle with the ver- From the point of view of higher-order finite ele- tices [−1, −1], [1, −1], [−1, 1] for triangular elements. ment discretization, the added difficulty lies in the fact A shape function is transformed from the reference el- that one has to integrate products of basis functions ement into a physical mesh element using a reference with very different polynomial degrees. For example, map. Reference maps are constructed using the shape when integrating the product of two linear functions, functions themselves, combined with geometrical de- one needs a quadrature rule of degree two. However, grees of freedom. Geometrical degrees of freedom are a quadrature rule of degree 20 is needed to integrate 10 the product of two tenth-degree polynomials. The order 4,2 5,2 6,3 of numerical integration needs to be much higher when 4,4 etc. one integrates on distorted quadrilateral or hexahedral 4,2 4,3 5,4 elements, on curvilinear elements, or when complicated material parameters are used. Figure 32: Sample combinations of directional polynomial degrees in The computational cost of high-order numerical subelements. quadrature is so large that it is not possible to just use a very high-order integration rule for everything. On the reader can see that there are hundreds of hp-refinement contrary, one needs to be as economical as possible and candidates per element. take great care to integrate each product with the mini- In contrast to this, in standard low-order FEM one mum required number of integration points. This aspect typically only has one or very few ways an element can alone makes an hp-FEM code very different from a low- be refined, and therefore element-wise constant error order FEM code. estimates are sufficient to guide adaptive mesh refine- ments in standard low-order FEM. The large number of 6.3. Error Estimation and Automatic Adaptivity element refinement options in the hp-FEM means that one needs a much better information about the error With the growing importance of Validation and Veri- than in standard FEM. In other words, a constant er- fication (V&V) in Computational Engineering and Sci- ror estimate in an element does not help us to select the ence (CSE), error estimation and automatic adaptiv- optimal hp-refinement among the hundreds of options. ity have become standard components of finite element In order to make this possible, we use a technique analysis. In both error estimation and automatic adap- that has been used in ODE solvers for decades [11]: In tivity the hp-FEM differs substantially from standard each adaptivity step we calculate two approximations low-order finite element methods. Let us illustrate this with different orders of accuracy, and use the difference on quadrilateral elements. between them as an a-posteriori error estimate. This ap- As the polynomial space on these elements is formed proach, although seemingly computationally expensive, by the product of one-dimensional spaces, these ele- can be optimized significantly [30] and it is practically ments can have generally different directional polyno- useful. The key idea is to maintain an approximation mial degrees. In adaptivity, one is no longer limited by pair during the adaptive process by evolving the two spatial subdivision of an elements with maintaining the approximations simultaneously rather than to construct same polynomial degrees on the subelements. On the a new higher-order approximation from the lower-order contrary – in the so-called p-refinement, the element is one in each adaptivity step. The most significant advan- not split in space att all, just one or both of its directional tages of this approach over analytical error estimators polynomial degrees are altered. If one allows alteration are that by up to two, this yields eight refinement candidates (not counting the original element.) The element can • It estimates the shape of error, not only its magni- also be split in space in three different ways – isotropi- tude, and thus it is suitable to guide hp-adaptivity. cally into four subelements, or halved anisotropically in • It is PDE-independent in the sense that it does not two ways (see Fig. 31). use any information of technique that would limit its applicability to a narrow class of problems such as elliptic equations.

The robustness of this computational a-posteriori error estimator makes adaptive hp-FEM naturally applicable Figure 31: Isotropic and anisotropic divisions of a quadrilateral ele- ment. to a large variety of multiphysics PDE problems, such as [33, 34, 35]. On each of these spatial divisions, one can vary the directional polynomial degrees as in p-refinement (see 6.4. Hanging Nodes Fig. 32). Recall that a finite element mesh is called regular if When the selection of a suitable spatial division is any two mesh elements can either be disjoint, or share combined with the selection of optimal polynomial de- a common vertex, or share a common edge, or share a grees in subelements, we talk about hp-adaptivity. The common face (in 3D). A finite element mesh which does 11 not satisfy this condition is called irregular. Even in an 35. The corresponding finite element mesh with three- irregular mesh though, a vertex of an element cannot level hanging nodes, obtained with adaptive hp-FEM, is lie in the interior of another element. Element vertices shown in Fig. 36. that lie inside an edge or face of another element, or an edge that lies inside a face of another element (3D only) are called hanging nodes. By level of a hanging node we mean the difference of refinement levels of the adjacent elements. For illustration, a simple example of an irregular mesh with one and two levels of hanging nodes is shown in Fig 33.

Figure 33: Irregular meshes with one-level hanging nodes (left) and two-level hanging nodes (right).

While regular meshes are favored by theoretical nu- merical analysts, meshes with hanging nodes yield bet- Figure 35: Solution with an internal layer. ter convergence rates. To illustrate this, let us consider a mesh consisting of four triangular elements (Fig. 34 left), and assume that the element on the left needs to be refined.

Figure 34: Adaptivity with regular meshes.

If the finite element code cannot handle one-level hanging nodes, then after splitting the element the mesh needs to be regularized. This is done by introducing ad- ditional forced refinements (the four thin triangular ele- ments in Fig. 34 middle). If the next element to be re- fined is the gray element in Fig. Fig. 34 (middle), then Figure 36: Corresponding finite element mesh with three-level hang- the effect of mesh regularization becomes even worse. ing nodes. Recall that long thin elements in the mesh cause the con- dition number of the stiffness matrix to be unnecessar- This example (benchmark ”layer”) is described in ily high, and moreover the forced refinements are con- great detail in the tutorial to HERMES at [12]. The user tributing unnecessary degrees of freedom which slow can experiment with it by himself/herself after fetching down the convergence rate of the method. the HERMES Git repository from the above web site. In order to avoid mesh regularization completely, one needs to resort to arbitrary-level hanging nodes. This 6.5. Multimesh Assembling technique was proposed in [31] and extended to vector- It is well known that in order to capture well individ- valued finite elements in [32]. Higher-level hanging ual behaviors of various solution components in mul- nodes typically do not appear in isotropic parts of the tiphysics coupled problems, one needs to approximate solution (such as point singularities) but they are needed them on individual meshes. Traditionally this has been to resolve efficiently anisotropic features such as bound- done by decomposing the multiphysics problem into a ary or internal layers. Such a solution is shown in Fig. series of single-physics equations via operator splitting, 12 and employing an outer fixed-point iteration. Solution data in this type of methods is usually transferred be- tween different meshes using various interpolation or projection techniques. These methods, however, are well know to suffer from loss of accuracy and even sta- Master mesh bility due to the interpolation or projection errors [15]. As an alternative to these methods, a multimesh dis- cretization technique that does not transfer solution data between meshes was introduced recently in [33, 34, 35]. It was shown in [4] that the multimesh discretization technique compares favorably to methods based on in- Mesh for solution component 1 Mesh for solution component 2 termesh data transfer. Although the main focus of this paper is not on mul- tiphysics problems, the multimesh assembling is ex- tremely useful for the design of adaptive finite element methods that employ dynamically changing meshes, and therefore we find it useful to describe at least the main idea here. Union mesh. Assume that we have a two-equation PDE system where the two solution components behave very dif- Figure 37: Example of a master mesh (top), locally refined meshes ferently. Ideally, the meshes for these two functions for two different solution components (middle), and the corresponding union mesh (bottom). should be completely independent. However, for algo- rithmic reasons, we introduce a simplifying assumption that each of them is defined starting from a common culate integral products for the corresponding block in coarse master mesh. and using a finite sequence of ele- the global stiffness matrix. mentary refinement operations. The master mesh is very coarse and it may not be even used for discretization 6.6. Adaptivity for Time-Dependent Problems purposes. It serves as the top of a tree-like structure of In this Subsection we explain a feasible way to ob- meshes which is used by the multimesh assembling pro- tain adaptive finite element methods with dynamically cedure. The situation is illustrated in Fig.37 where the changing meshes, based on a combination of the mul- master mesh is shown on top, and two different meshes timesh assembling described above and the so-called for the solution component are in the middle. Bottom of Rother’s method. Fig.37 shows the union mesh, a geometrical union of all The Rothe’s method is a natural counterpart of the meshes in the system. widely used Method of Lines (MOL). Recall that the The union mesh is never created physically in the MOL performs discretization in space while keeping the computer memory, but its virtual elements guide the time variable continuous, which leads to a system of multimesh assembling algorithm. The algorithm visits ODEs in time. The Rothe’s method, on the contrary, all virtual elements of the union mesh, determines the preserves the continuity of the spatial variable while polynomial orders for all solution components, trans- discretizing time. In every time step, an evolutionary forms the integration points, evaluates the correspond- PDE is approximated by means of one or more time- ing contributions of the bilinear and linear forms, and independent ones. The number of the time-independent distributes the values into the stiffness matrix and right- equations per time step is proportional to the order of hand side in a standard way. accuracy of the time discretization method. For exam- It is worth mentioning that automatic adaptivity in ple, when employing the implicit Euler method, one has multimesh hp-FEM is done in such a way that all el- to solve one time-independent PDE per time step. The ements of all meshes in the system are sorted according Rothe’s method is fully equivalent to the MOL if no to their error estimates, and thus the system of multiple adaptivity in space or time takes place, but it provides meshes is handled as if it was just one mesh. The bene- a better setting for the application of spatially adaptive fit of this approach is that if some solution component is algorithms. The spatial discretization error can be con- resolved with sufficient accuracy, or it does not evolve trolled by solving the time-independent equations adap- in time significantly, all elements of the corresponding tively, and the size of the time step can be adjusted using mesh are skipped, and thus one does not have to recal- standard ODE techniques [11]. 13 For the sake of clarity, let us first use the implicit Eu- are defined on different meshes τn and τn+1,m which ler discretization with a constant time step ∆t > 0. This were obtained from the coarse mesh τ0 through finite se- is done by approximating the temporal derivative using quences of mutually independent local refinements. In a backward finite difference, order to perform assembling in this situation, we em- ploy the multimesh hp-FEM that was described in Sub- ∂h hn+1 − hn ≈ . (13) section 6.5. ∂t ∆t Adaptive time integration is typically carried out us- Generalizations to more sophisticated time stepping ing a pair of methods that provide at the end of each time methods are straightforward as long as the temporal par- step two approximations with different orders of accu- tial derivative ∂h/∂t can be approximated with some fi- racy. In every time step, the difference between the pair nite difference scheme as in (13). In particular, gener- of results provides an estimate of the local truncation er- alization to the second-order Crank-Nicolson scheme is ror that is used to adapt the time step. These methods very simple as it is just an arithmetic average of the im- may be either embedded Runge-Kutta methods, back- plicit and explicit Euler methods. ward difference methods, or others [11]. Using the backward finite difference (13), equation (3) becomes 7. Open Source Project HERMES

! All computations that have been presented in this pa- θ hn+1 − hn C(hn+1) + S − ∇ · (K(hn+1)∇hn+1) per so far were performed using HERMES [12], an open θS ∆t source C++ library for rapid development of space- and space-time adaptive hp-FEM solvers, developed by the ∂K(hn+1) − = 0. (14) hp-FEM group at the University of Nevada, Reno. ∂z The software utilizes a number of novel mathematical Here h0 enters through the initial condition methods and algorithms including finite elements based on generalized eigenfunctions of PDE operators [28, h(x, z, 0) = h0(x, z), (15) 29], PDE-independent hp-adaptivity algorithms [30], hp-FEM approximations with arbitrary-level hanging hn is known from the previous time step, and hn+1 needs nodes [31, 32], adaptive multimesh hp-FEM for mono- to be computed. The weak formulation of (14) is de- lithic discretization of multiphysics problems [33], and rived in a standard way. The discrete problems are space-time adaptive hp-FEM with dynamical meshes systems of nonlinear algebraic equations and we solve for time-dependent PDE problems [34, 35]. them using the standard Newton’s method. For this, in The library can be employed to solve various PDE addition to C(h), K(h) and ∂K(h)/∂h we also need to problems ranging from stationary linear equations to know ∂C(h)/∂h and ∂2K(h)/∂h2. complex time-dependent nonlinear multiphysics PDE By τ0 let us denote a uniform coarse mesh covering systems. The Git repository accessible on the project the computational domain Ω. This mesh is used as the home page contains many examples from various engi- initial mesh for automatic adaptivity in every time step. neering and scientific areas including civil, mechanical, 1 The first approximation h (x) ≈ h(x, z, ∆t1) is computed electrical and nuclear engineering, computational fluid adaptively in k1 steps, starting from the mesh τ0 and dynamics, quantum chemistry, and hydrology. using intermediate approximations h1,1, h1,2, ..., h1,k1 = 1 7.1. User Documentation h on meshes τ1,1, τ1,2, ..., τ1,k1 = τ1. The number k1 depends on a user-defined tolerance TOLs for the spatial The User Documentation written in Sphinx [37] is ac- error. cessible on the project home page. It begins with an In- At the beginning of the (n + 1)st time step, the ap- troduction that explains the philosophy of the library, its n proximation h is defined on a locally refined mesh τn mathematical background, and installation on various that was constructed adaptively in the nth step. (The hardware platforms including , Windows Cygwin, only exception is h0 which is defined on the coarse mesh Windows MSVC, and MAC OS. n+1 τ0.) The unknown h is computed adaptively in kn+1 The second section is introducing the user to Git. It steps starting from the mesh τ0 and using intermedi- explains how to clone the HERMES Git repository, cus- ate approximations hn+1,1, hn+1,2, ..., hn+1,kn+1 = hn+1 tomize Git via the .gitconfig file, create a local branches, on meshes τn+1,1, τn+1,2, ..., τn+1,kn+1 = τn+1. Note that make and commit changes, create and send patches, and in the mth adaptivity step, the functions hn and hn+1,m use Github for sharing code. 14 The next part of the User Documentation is the Tuto- • Jacobian forms in nonlinear problems. rial that is split into six sections: Vector forms are used to define 1. Linear Problems. • 2. Automatic Adaptivity. linear forms in linear problems, 3. Nonlinear Problems. • residuals for nonlinear problems. 4. Adaptivity for Time-Dependent Problems. 5. Miscellaneous Techniques. The example in Section 3 solves the Poisson equation − 6. Using . ∆u = f with homogeneous Dirichlet boundary condi- tions, and thus the corresponding matrix form is The last two sections of the User Documentation con- Z tain a detailed description of about twenty benchmark ∇u · ∇v dxdy. problems with known analytical solutions including Ω convergence studies, and about twenty advanced exam- This is translated into the code as follows: ples. // Matrix form. 7.2. An Example template Scalar bilinear_form(int n, double *wt, The user has to write a C++ application in order to Func *u_ext[], utilize the library’s functionality. For typical problems, Func *u, Func *v, Geom *e, this applications are extremely simple. Let us demon- ExtData *ext) strate this on the adaptive example that was used in { Section 3. The following code snippets are part of the return int_grad_u_grad_v(n, wt, u, v); main.cpp file from benchmark ”smooth-iso” that can be } retrieved from the Git repository. Here, int grad u grad v is a predefined macro that One begins with specifying for each boundary marker performs the numerical integration in this widely used whether the corresponding boundary condition is natu- case. Without the macro, the code would read ral or essential. In this particular case, the entire bound- ary is Dirichlet and thus essential: // Matrix form. template // Boundary condition types. Scalar bilinear_form(int n, double *wt, BCType bc_types(int marker) Func *u_ext[], { Func *u, Func *v, return BC_ESSENTIAL; Geom *e, } ExtData *ext) { In the next step, one defines boundary values for all es- Scalar val = 0; for (int i = 0; i < n, i++) { sential boundary conditions. These may depend on the val += wt[i] * (u->dx[i] * v->dx[i] spatial position, possibly on time (via a global variable, + u->dy[i] * v->dy[i]); and for the example in Section 3 they are zero: } scalar essential_bc_values(int ess_bdy_marker, return val; double x, double y) } { return 0; Here n is the number of integration points in the mesh } element and wt is an array of the corresponding inte- gration weights. Physical coordinates of the integra- In the next step the user enters the variational fomula- tion points can be accessed through the Geom structure tion of the PDE. The weak forms can be real or complex along with other geometrical information such as nor- valued, and there are two types of them – matrix forms mal or tangential vectors on edges, etc. The variable and vector forms. u ext contains the solution values and first and second Matrix forms can be used to represent partial derivatives at all integration points, and it is rel- • bilinear forms in linear problems, evant for nonlinear problems only. The variables u and v contain the same information for the basis function u • bilinear forms in generalized eigenproblems, and test function v. The struct ExtData is used in more 15 advanced application to provided additional data for the As a second step, one performs initial mesh refine- weak formulation. ments. This step is not relevant for the example in Sec- The right-hand side of the weak formulation has the tion 3, but in general this functionality is very useful. form Z The user can call the following functions of the Mesh f v dxdy. class whose names are self-explanatory: Ω Mesh::refine_element(int id, int refinement = 0); The function f is defined via Mesh::convert_quads_to_triangles(); Mesh::convert_triangles_to_quads(); // Right-hand side function. Mesh::refine_by_criterion(int (*criterion)(Element* e), template int depth); Real rhs(Real x, Real y) Mesh::refine_towards_vertex(int vertex_id, int depth); { Mesh::regularize(int n); return 2*sin(x)*sin(y); Mesh::unrefine_element(int id); } Mesh::unrefine_all_elements(); and the linear form using Next, one creates a finite element space: // Vector form. // Create an H1 space with default shapeset. template H1Space space(&mesh, bc_types, essential_bc_values, Scalar linear_form(int n, double *wt, P_INIT); Func *u_ext[], Func *v, Geom *e, Here, P INIT is an initial polynomial degree of mesh ExtData *ext) { elements which currently can be an integer between return int_F_v(n, wt, rhs, v, e); one and ten. Other admissible spaces in addition to } H1Space are HcurlSpace, HdivSpace and L2Space. In vector-valued PDE problems, each solution compo- Again the function int F v is a shortcut and the full nent can have a different space. version of this function would be After defining spaces for all solution components, // Vector form. one needs to register the weak forms in the WeakForm template class: Scalar linear_form(int n, double *wt, Func *u_ext[], // Initialize the weak formulation. Func *v, Geom *e, WeakForm wf; ExtData *ext) wf.add_matrix_form(callback(bilinear_form), H2D_SYM); { wf.add_vector_form(callback(linear_form)); Scalar val = 0; for (int i = 0l i < n; i++) { The number of weak forms that are added here can be val += wt[i] * rhs(e->x[i], e->y[i]) * v->val[i]; } arbitrary. In typical non-adaptive computations one just needs return val; to call the function solve linear(): } // Solve the linear problem. Here the user can see how the physical coordinates of Solution sln; integration points are accessed via the Geom structure, solve_linear(&space, &wf, &sln, matrix_solver); and how one uses function values of the test function v at integration points. Through the variable matrix solver the user tells After entering the weak formulation, the problem can his preference for the matrix solver. The options cur- be solved. This is done using a standard sequence of rently available include UMFPACK, PETSc, MUMPS, steps. First, the mesh is loaded: Trilinos and a variety of Python solvers available through an interface to Scipy [26]. After the call to // Load the mesh. solve linear() is finished, the variable sln contains Mesh mesh; a solution that can be either saved to a file or visualized H2DReader mloader; mloader.load("square_quad.mesh", &mesh); in HERMES directly using one of the ScalarView, or VectorView classes. Other visualization classes in- The H2DReader expects the mesh in a generic HER- cluding MeshView, BaseView, etc. are available. MES format that allows variable parameters. Other For adaptive computations, one needs to specify a re- readers/formats are available. finement selector that manages the selection of element 16 refinement candidates during adaptivity, as it was de- are determining the behavior of the adaptivity algorithm scribed in Subsection 6.3. In the example in Section 3 and their meaning can be found in the User Documen- we use an H1ProjBasedSelector: tation. MESH REGULARITY determines the maximum level of hanging nodes in the mesh. Regular meshes // Initialize refinement selector. are not supported in HERMES due to their notoriously H1ProjBasedSelector selector(CAND_LIST, CONV_EXP, H2DRS_DEFAULT_ORDER); bad performance. By specifying MESH REGULARITY = -1, one allows arbitrary-level hanging nodes (cf. Sub- Here, CAND LIST defines a set of element refinement section 6.4). candidates. There are eight options: For a typical linear or nonlinear problem the last step is to call the function call solve linear adapt(): • P ISO: Only p-refinements allowed. Different di- rectional polynomial degrees on quadrilateral ele- // Adaptivity loop. Solution *sln = new Solution(); ments not allowed. Solution *ref_sln = new Solution(); ExactSolution exact(&mesh, exact_sol); • P ANISO: Only p-refinements allowed. Different WinGeom* swg = new WinGeom(0, 0, 440, 350); directional polynomial degrees on quadrilateral el- WinGeom* mwg = new WinGeom(450, 0, 400, 350); ements are allowed. bool verbose = true; solve_linear_adapt(&space, &wf, H2D_H1_NORM, sln, • H ISO: Only h-refinements allowed. Anisotropic matrix_solver, ref_sln, &selector, &apt, swg, mwg, refinements of quadrilateral elements not allowed. verbose, &exact_sol);

• H ANISO: Only h-refinements allowed. Here, sln and ref sln are the solution pair on the Anisotropic refinements of quadrilateral ele- coarse and globally refined meshes, cf. Subsection 6.3. ments are allowed. ExactSolution is an optional parameter to be used if the exact solution to the problem is know (as it is • HP ISO: hp-refinements are allowed. They can be known for the problem in Section 3). The parame- isotropic both in h and p. ter H2D H1 NORM specifies that the adaptivity algorithm • HP ANISO P: hp-refinements are allowed. They will be projecting the fine mesh solution on the coarse can be anisotropic in p and isotropic in h. mesh using the H1-norm. Other possible norms are H2D HCURL NORM, H2D HDIV NORM and H2D L2 NORM. • HP ANISO H: hp-refinements are allowed. They By setting the Boolean variable verbose to either true can be isotropic in p and anisotropic in h. or false, the user specifies whether he is interested in the output of adaptivity data, such as error estimates, • HP ANISO: hp-refinements are allowed. They can numbers of degrees of freedom in the coarse and fine be anisotropic in p and anisotropic in h. mesh solutions, etc. The variables swg and mwg de- Note that the last option, HP ANISO is the most general fine geometries of visualization windows. By setting hp-adaptivity scheme in HERMES with the most refine- them to NULL, the user disables visualization inside the ment candidates per element. Accordingly, the selection solve linear adapt() function. The last optional process takes most time. Therefore, this option should parameter exact sol contains the exact solution (if only be used in problems with genuinely anisotropic so- available). If this parameter is provided, then HERMES lutions. will also measure error wrt. exact solution in addition Other parameters for automatic adaptivity are entered to its error estimate. through the structure AdaptivityParamType: For vector-valued problems, the user can replace sin- gle variables such as the space, projection norm, solu- // Initialize adaptivity parameters. tion, reference solution, or views with Tuples. AdaptivityParamType apt(ERR_STOP, NDOF_STOP, THRESHOLD, STRATEGY, Users who have more advanced applications can MESH_REGULARITY); copy and edit the source code of the function solve linear adapt() according to their needs. For The user-defined constant ERR STOP defines the level more details we refer to the Sphinx tutorial to HERMES of relative error estimate in percent when the computa- that is available on the project home page [12]. The tu- tiona will stop. NDOF STOP is the threshold for the num- torial also covers more advanced examples such as the ber of degrees of freedom when the adaptivity will stop. solution of multiphysics coupled problems using adap- The other two parameters, THRESHOLD and STRATEGY tive hp-FEM on dynamical meshes. 17 7.3. Interactive Web Accessibility Acknowledgment HERMES can be used remotely within the FEMhub The first author gratefully acknowledges the finan- Online Numerical Methods Laboratory [7] where any- cial support of the Grant Agency of the Academy one can create a free account and compute remotely of Sciences of the Czech Republic under Grant No. through the web browser window. FEMhub [6] is an IAA100760702. The second author’s research was sup- open source distribution of finite element codes with a ported by the LC06040 research center project. The unified Python interface. Besides HERMES it contains third author was supported with a Grant of the Czech several other open source finite element and finite vol- Ministry of Agriculture No. QH 91247. ume codes such FiPy [8], Phaml [24], and SfePy [27]. It contains a large number of additional scientific com- puting and visualization tools such Numpy, Pysparse, References Sympy, Mayavi. Matplotlib and others. The Online [1] H. W. Alt, S. Luckhaus: Quasilinear Elliptic-Parabolic Differen- Numerical Methods Laboratory is based on ExtJS and tial Equations, Mathematische Zeitschrift 183 (1983) 311-341. powered by UNR high-performance computing facili- [2] M. A. Celia, E. T. Bouloutas, R. L. Zarba: A General Mass- Conservative Numerical Solution for the Unsaturated Flow ties. The user can also connect it to his/her own com- Equation, Water Resources Research 26 (1990) 1483-1496. puting servers. [3] R. Cools: Encyclopaedia of Cubature Formulas, http://nines.cs.kuleuven.be//research/ecf/. [4] L. Dubcova, P. Solin, G. Hansen, H. Park: Comparison of Multi- 8. Open Source Project AGROS mesh hp-FEM to Interpolation and Projection Methods for Spa- tial Coupling of Reactor Thermal and Neutron Diffusion Calcu- AGROS (http://hpfem.org/agros2d) is a multiplat- lations, submitted to J. Comput. Phys. [5] M. W. Farthing, C. E. Kees, T. S. Coffey, C. T. Kelley, C. T. form C++ application for the solution of single and Miller: Efficient Steady-State Solution Techniques for Variably multiphysics PDE problems based on the HERMES li- Saturated Groundwater Flow, Advances in Water Resources 26 brary. AGROS provides an advanced graphical user in- (2003) 833-849. [6] FEMhub, an Open Source Distribution of Free Scien- terface (GUI), interactive geometry modeling and CAD tific Computing Codes with a Unified Python Interface, import, automatic meshing, and a number of advanced http://femhub.org/. visualization and postprocessing features. The code is [7] FEMhub Online Numerical Methods Laboratory, being developed by an engineering research group at the http://lab.femhub.org/. [8] FiPy, A Finite Volume PDE Solver Using Python, University of West Bohemia in Pilsen, Czech Republic. http://www.ctcms.nist.gov/fipy/. AGROS is distributed under the GNU General Public [9] P. Forsyth, M. Kropinksi: Monotonicity Considerations for Sat- License. Currently, it supports the finite element anal- urated Unsaturated Subsurface Flow, SIAM J. Sci. Comput. 18 ysis of electrostatic fields, electric current fields, mag- (5) (1997) 1328-1354. [10] W. R. Gardner: Some Steady State Solutions of the Unsaturated netic fields (steady state, harmonic and transient anal- Moisture Flow Equation with Application to Evaporation from ysis), heat transfer (steady state and transient analy- a Water Table, Soil Science 85 (1958) 228-232. sis), basic fluid mechanics and linear elasticity (in de- [11] E. Hairer, G, Wanner: Solving Ordinary Differential Equa- velopment). A Richards module for variably saturated tions II: Stiff and Differential-Algebraic Problems, 2nd Edition, Springer Series in Mathematics, 1996. groundwater flow is also currently in development. [12] HERMES, a C++ Library for Rapid Development of Space- and Space-Time Adaptive hp-FEM Solvers, http://hpfem.org/. [13] P. S. Huyakorn, S. D. Thomas, B. M. Thompson: Techniques for Making Finite Elements Competitive in Modeling Flow in Vari- ably Saturated Porous Media, Water Resources Research 20(8) (1984) 1099-1115. [14] P. S. Huyakorn, E. P. Springer, V. Guvanasen, T. D. Wadsworth: A Three Dimensional Finite Element Model for Simulating Wa- ter Flow in Variably Saturated Porous Media, Water Resources Research 22(13) (1986) 1790-1808. [15] X. Jiao and M. T. Heath: Common-Refinement-Based Data Transfer Between Non-Matching Meshes in Multiphysics Sim- ulations. Internat. J. Numer. Methods Engrg., 61(14):24022427, 2004. [16] C.E. Kees, M.W. Farthing, C.N. Dawson. Locally Conservative, Stabilized Finite Element Methods for Variably Saturated Flow. Comput. Methods Appl. Mech. Engrg. 197 (2008) 4610-4625. [17] V. Kuraz: Soil Properties and Water Regime of Reclaimed Sur- Figure 38: Sample snapshot of AGROS on Mac OS X. face Dumps in the North Bohemia Brown-coal Region – a Field Study, Waste Management 21 (2001) 147-151. 18 [18] C.T. Miller, M.W. Farthing, C.E. Kees, C.T. Kelley: Higher the Hydraulic Conductivity of Unsaturated Soils, Journal of Soil Order, Locally Conservative Temporal Integration Methods for Science, 44(5) (1980) 892-898. Modeling Multiphase Flow in Porous Media, Developments in Water Science 47 (2002) 249-256. [19] Y. Mualem: A New Model for Predicting the Hydraulic Conduc- tivity of Unsaturated Porous Media, Water Resources Research 12 (1976) 513-522. [20] S. P. Neuman, P. A. Witherspoon: An- alyzing Steady Seepage with a Free Surface, Water Resources Research 6(3) (1970) 889-897. [21] S. P. Neuman, P. A. Witherspoon: Analysis of Nonsteady Flow with a Free Surface Using the Finite Element Method, Water Resources Research 7(3) (1971) 611-623. [22] S. P. Neuman: Saturated-Unsaturated Seepage by Finite Ele- ments, Journal of the Hydraulics Division 12 (1973) 2233-2250. [23] P. Pech: Determination of Skin Factor by Means of the Intersec- tion Time from the Early-portion of Pumping Test, Journal of Environmental Hydrology 11 (2003) 1-9. [24] Phaml, a Fortran 90 code using adaptive refinement, multi- grid and parallel computing to solve 2-D linear elliptic PDEs, http://math.nist.gov/phaml/. [25] L.A. Richards, Physics 1 - DOI:10.1063/1.1745010 (1931) 318- 333. - Show quoted text - [26] Scipy: Open Source Library of Scientific Tools, http://www.scipy.org/. [27] SfePy: Simple Finite Elements in Python, http://code.google.com/p/sfepy/. [28] P. Solin, T. Vejchodsky: Higher-Order Finite Elements Based on Generalized Eigenfunctions of the Laplacian, Int. J. Numer. Methods Engrg 73 (2007), 1374 - 1394. [29] P. Solin, K. Segeth: Hierarchic Higher-Order Hermite Ele- ments on Hybrid Triangular/Quadrilateral Meshes, Math. Com- put. Simul. (76) 2007, pp. 198 - 204. [30] P. Solin, D. Andrs, J. Cerveny, M. Simko: PDE-Independent Adaptive hp-FEM Based on Hierarchic Extension of Finite Ele- ment Spaces, J. Comput. Appl. Math. 233 (2010) 3086-3094 [31] P. Solin, J. Cerveny, I. Dolezel: Arbitrary-Level Hanging Nodes and Automatic Adaptivity in the hp-FEM, Math. Com- put. Simul. 77 (2008), 117 - 132. [32] P. Solin, L. Dubcova, J. Cerveny, I. Dolezel: Adaptive hp-FEM with Arbitrary-Level Hanging Nodes for Maxwell’s Equations, Advances in Applied Mathematics and Mechanics, Vol. 2, No. 4, 2010, pp. 518 - 532. [33] P. Solin, J. Cerveny, L. Dubcova, D. Andrs. Monolithic Dis- cretization of Linear Thermoelasticity Problems via Adaptive Multimesh hp-FEM, J. Comput. Appl. Math 234 (2010) 2350 - 2357. [34] P. Solin, L. Dubcova, J. Kruis: Adaptive hp-FEM with Dynami- cal Meshes for Transient Heat and Moisture Transfer Problems, J. Comput. Appl. Math. 233 (2010) 3103-3112. [35] P. Solin, L. Dubcova, J. Kruis: Adaptive hp-FEM with Dynami- cal Meshes for Transient Heat and Moisture Transfer Problems, J. Comput. Appl. Math. 233 (2010) 3103-3112. [36] P. Solin, K. Segeth, I Dolezel. Higher-Order Finite Element Methods, CHapman & Hall / CRC Press, 2003. [37] Sphinx, a Free Open-Source SQL Full-Text Search Engine, http://www.sphinxsearch.com/. [38] F. T. Tracy: Clean Two- and Three-Dimensional Analytical So- lutions of Richards Equation for Testing Numerical Solvers, Wa- ter Resources Research 42(8) ( 2006). [39] F. T. Tracy: Three-Dimensional Analytical Solutions of Richards Equation for a Box-Shaped Soil Sample with Piecewise-Constant Head Boundary Conditions on the Top, Journal of Hydrology 336(3-4) (2007) 391-400. [40] M. T. H. van Genuchten: A Closed-form Equation for Predicting

19