A benchmark strain gradient elasticity solution in two-dimensions for verifying computational approaches by means of the finite element method

In elasticity, microstructure-related deviations may be modeled by strain gradient elasticity. For so-called metamaterials, different implementations are possible for solving strain gradient elasticity problems numerically. Analytical solutions of simple problems are used to verify the numerical approach. We demonstrate such a case in a two-dimensional continuum as a benchmark case for computations. As strain gradient enforces higher regularity conditions in displacements, in the finite element method (FEM), the use of standard elements is often seen as inadequate. For such piecewise or elementwise continuous elements, we examine a possible remedy to correctly simulate strain gradient elasticity problems by implementing two techniques. First, we enforce continuity of displacement gradient across elements; second, we employ a mixed finite element method where displacement and its gradient are solved both as unknowns. The results show the pros and cons of each numerical technique. All methods converge monotonically, but the mixed method is more reliable than the other one.


Introduction
Accurate modeling of materials at microscopic length scale is necessary for design and engineering of structures with a detailed and complex substructure. The first-order (first-gradient) continuum mechanics depends on displacement and its first gradient; however, it lacks accuracy at the scales which are close to the length scale of the substructure [1], especially in capturing those phenomena which are dependent on geometric length, known as size effect. A generalization of the first-order elasticity theory is an approach for overcoming this issue. In generalized continuum mechanics, the governing equation depends on displacement, first gradient of displacement, and second gradient of displacement.
The idea of generalized mechanics dates back to the beginning of 20th century, see [2,3] for a history. Modern theories were introduced later starting around six decades ago [4][5][6][7]. Since then, many generalized mechanics theories have been proposed, and they can be considered as specific cases of a unified theory [8].
Including higher gradients of displacement in the equations results in partial differential equations of higher order. A reliable numerical computation of such equations requires suitable techniques and element type selection that ensure the monotonous convergence. For this purpose, different numerical approaches have been proposed for the strain gradient theories such as isogeometric analysis [47][48][49][50], C 1 continuous elements [52,53], and mixed finite element formulation [54][55][56]. It is beneficial to verify the computations by analytical solutions. The analytical solutions for some example problems in the generalized continua are presented, for example, in previous studies [57][58][59][60][61].
In this paper, a two-dimensional problem in the framework of the strain gradient elasticity theory is solved numerically, by means of a finite element method (FEM) implemented using open-source FEniCS libraries. Different techniques are used for the implementation of the numerical code including using mixed finite element formulation, using Lagrange multipliers for imposing the boundary conditions, and enforcing continuity of first gradient across elements. The computations are compared with analytical solutions. Different implementations are compared to each other regarding convergence, computation time, and robustness. This paper is structured in the following way. First, in Section 2, the strain gradient theory is explained, the weak form is generated to be used in the analytical solution, and the constitutive equations are presented. Then, in Section 3, an analytical solution is presented for a plate under simple shear with two different sets of boundary conditions. Next, in Section 4, the numerical implementation and weak form generation of FEM and Mixed FEM are sketched in detail. Finally, the results and error analyses of two implementations of the strain gradient elasticity theory are shown in Section 5.

Weak form generation
One of the well-known generalizations of the conventional continuum mechanics is the strain gradient elasticity theory. In this theory, the energy density depends not only on strain, e ij , but also on its gradient, e ij, k , where where u i is the displacement field and the comma indicates differentiation in space, X 2 O & IR 3 , in Cartesian coordinates. Therefore, we have In equation (1), the geometric nonlinearities are neglected since the strain measure has to be linear for deriving an analytical solution in the following. We begin with the general formulation based on a scalar mathematical construct called action A. We postulate the action in the time interval T as over the domain, O, with its boundary, ∂O, and the set ∂∂O of the edges of the boundary surface. In a three-dimensional problem, the terms W s and W e are the work done on the boundary surface elements, dA, and line (edge) elements, dL, respectively. Herein, we neglect the term W e for simplicity [62,63]. The values of W s are known, and as this term is applied on the boundary, for the same accuracy in an expansion up to the second order in space derivative, we set W s = W s (u i , u i, j ), i.e., depending only on the displacement and its first gradient but not on the second gradient. In equation (3), L is an existing Lagrangean density describing the underlying system. In the strain gradient elasticity theory for an elastic material, as discussed in Abali [64], we consider the Lagrangean density as where the first three terms indicate the kinetic energy (inertial terms). The term w is the stored (deformation) energy density in J=m 3 . For homogeneous materials, the stored energy density reads The last term in equation (4) denotes the potential energy with the specific body force, f , in N/kg. Based on the principle of least action, for reversible systems, we are looking for solutions such that the variation of the action functional vanishes for any arbitrary test function du The variation of the action, dA, is derived by employing Taylor's expansion with respect to a suitable perturbation parameter, as explained in Abali et al. [65]. By inserting A from equation (3) in equation (6), and neglecting the inertial terms, body forces, and boundary terms acting on edges, according to the least action principle, the integral form for the second-order strain gradient elasticity for a domain O reads After applying the product rule and the divergence (Gauss's) theorem multiple times (for details see since, as already remarked, the inertial terms, body forces, and boundary terms acting on edges are neglected. Here, n is the outward unit normal to the boundary ∂O. We define W s on Neumann boundaries as where t, in N/m 2 (traction), and m, in N m/m 2 (double traction), satisfy the following conditions By inserting equations (10) and (11) in equation (8), the following governing equation is obtained which is solved numerically to calculate the displacement field in the domain O.

Constitutive laws
The stored energy density, w, in equation (12), for centro-symmetric materials is expressed as where C ijkl denotes the rank-4 stiffness tensor (first gradient), and D ijklmn indicates the rank-6 strain gradient stiffness tensor (second gradient) [66][67][68][69][70]. For isotropic materials, we have where c 1 , c 2 are the two Lame constants, and c 3 , c 4 , c 5 , c 6 , c 7 are five additional parameters characterizing the substructure of the material; we refer to Abali et al. [71] for a derivation of this form. After inserting equations (14) and (15) in equation (13), the stored energy becomes w = 1 2 c 1 e ii e jj + c 2 e ij e ij + 2c 3 e ik, i e jj, k + 1 2 c 4 e jj, i e kk, i + 2c 5 e ik, i e jk, j + c 6 e jk, i e jk, i + 2c 7 e jk, i e ji, k , which is equivalent to the potential energy density expressed in Mindlin's work [72, equation (11.3) on page 71]. There is a one-to-one relation between the material parameters used in our formulation (c 1 , c 2 , c 3 , c 4 , c 5 , c 6 , c 7 ) and in Mindlin's formulation (l,m,â 1 ,â 2 ,â 3 ,â 4 ,â 5 ) as follows: The derivative of the stored energy density with respect to the first gradient of displacement is derived using equations (13), (1), and the chain rule as ∂ e kl C klmn e mn + e kl, m D klmnop e no, p À Á ∂e qr by considering the symmetry of the stiffness tensor (C ijkl = C jikl = C klij = C klji ). In the same way, we get the derivative of the stored energy density with respect to the second gradient of displacement as ∂ e lm C lmno e no + e lm, n D lmnopq e op, q À Á ∂e rs, t 1 2 by considering the symmetry of the strain gradient stiffness tensor (D lmnijk = D lmnjik = D ijklmn = D jiklmn ). By inserting equation (14) in equation (18), and equation (15) in equation (19), we have ∂w ∂u i, jk = c 3 d ij e km, m + d jk e mm, i + d ij e nk, n + d ik e mm, j À Á + c 4 d ij e mm, k + c 5 d ik e jn, n + d jk e li, l + d ik e nj, n + d jk e im, m À Á + 2c 6 e ij, k + 2c 7 e ik, j + e kj, i À Á : Finally, by inserting equations (20) and (21) in equation (12), the governing equation is derived in terms of the material parameters and the gradients of strain as c 1 e kk, i + 2c 2 e ij, j À c 3 2e nk, nki + e mm, ikk + e mm, jij À Á À c 4 e mm, kki À 2c 5 e nj, nij + e im, mkk À Á À 2c 6 e ji, kkj À 2c 7 e ik, jkj + e kj, ikj À Á = 0: Equation (22) corresponds to the equation of motion derived in Mindlin's work [72, equation (11.8) on page 72] (with the same one-to-one relation between the material parameters as in equation (17)). Herein, we have neglected the body forces and inertial terms as well.

Analytical solution
In this section, the analytical solution for a plate under simple shear is derived. Two cases of loading and boundary conditions are investigated.
Consider a two-dimensional plate under simple shear as in Figures 1 and 2 with infinite length in xdirection, and with height H in y-direction. The bottom edge is fixed in both directions while the top edge is fixed only in vertical (y) direction, and a displacement or traction is applied on the top edge in xdirection.
Considering the boundary conditions of this problem, only u x and its derivatives along y-direction are non-zero. This so-called semi-analytical ansatz reduces the problem to a one-dimensional continuum. Therefore, the problem is one-dimensional with u y = 0, u x = u x (y) = u. Hence, we have u x, y = u 0 , u x, yy = u 00 , u x, yyy = u 000 , u x, yyyy = u 0000 , and Using equation (22), the governing equation for this problem is formed as which is a fourth-order ordinary differential equation, and its general solution is where r = ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi (c 5 + c 6 + c 7 )=c 2 p and q 1 , q 2 , q 3 , q 4 are four integration constants. Four boundary conditions are necessary for finding q 1 , q 2 , q 3 , q 4 . In the following, two sets of boundary conditions are discussed.

Case 1: displacement prescription
In the first case, as shown in Figure 1, the boundary conditions are considered as where a Dirichlet boundary condition is assumed on the top edge by applying a displacementû. Furthermore, the displacement and double traction, m xy (as defined in equation (11)) are set to zero on the bottom edge. The fourth boundary condition states that the displacement gradient is zero on the top edge. This term activates the strain gradient terms of the theory. In the case of neglecting this boundary condition, the problem of simple shear is obtained as known from the first-order theory. Therefore, this boundary condition is crucial to test the numerical implementation of the strain gradient  (26). The top edge is moving in a rail, therefore its rotation is not allowed. theory. On the application level, a relatively rigid bar is adhered on top of the plate. In this way, rotating along y is prevented, as visible in Figure 1, which leads to u 0 (H) = 0. For the first two boundary conditions in equation (26), we use equation (25), and we obtain The double traction, m xy , has been defined in equation (11) and is calculated in equation (21). For the current problem, the double traction has only one non-zero term as Therefore, for the third boundary condition in equation (26), we have and for the fourth boundary condition, we take the derivative of u in equation (25) with respect to y, and set y = H, By solving equations (27), (28), (30), and (31), as shown in Appendix 2, the four unknowns (q 1 , q 2 , q 3 , q 4 ) are acquired

Case 2: applying traction
In the second case, as shown in Figure 2, the boundary conditions are considered as where a Neumann boundary condition is assumed on the top edge by a given tractiont (as defined in equation (10)). The double traction is set to zero on the top edge. Furthermore, the displacement and displacement gradient are set to zero on the bottom edge. The latter condition is responsible for the strain gradient terms of the theory. Indeed, it models a clamped edge as seen in Figure 2.
For the first boundary condition in equation (33), from equation (25), we obtain The traction, t x with n = (0, 1), has been defined in equation (10), and for the current problem, it is reduced to Therefore, for the second boundary condition in equation (33), we have The third and fourth boundary conditions in equation (33) give respectively. By solving equations (34), (36), (37), and (38), as shown in Appendix 3, the four unknowns (q 1 , q 2 , q 3 , q 4 ) are obtained as where s = c 2 r 2 cosh H r À 1

Numerical implementation
For the numerical implementation of the strain gradient theory, we use the same simple shear problem as in the analytical solution. Two approaches are discussed in the following: (1) FEM and (2) Mixed FEM. The modeling, implementation, and post-processing steps are all carried out using open-source packages. For the FEM analysis, we utilize the FEniCS libraries (73) by following the computational framework as in Abali (74). FEniCS is a package of codes for solving partial differential equations, and it supports symbolic differentiation, which is exploited herein. The FEM code is developed in Python.
The plate under simple shear is modeled as a two-dimensional plate with the height H = 0:5 mm. In the problem description, the length of the plate is assumed to be infinite in the x-direction. In the numerical models, we set a finite value for the length (three times of the height of the plate). Periodic boundary conditions are applied on the lateral edges of the plates; hence, the results will not depend on the value that is chosen for the plate's length. The periodic boundary conditions applied on the left and right edges of the plate impose the following conditions on the domain: (1) the left and right edges of the plate are of course equal in length, (2) the nodes of these two edges have the same vertical coordinates such that there are corresponding nodes on both edges, and (3) the nodal value at the left is restricted to be the same as the corresponding nodal value at the right.
For the material of the plate, we assume Young's modulus, E = 400 MPa and Poisson's ratio, n = 0:49. The choice of Poisson's ratio is crucial for consistency with the semi-analytical ansatz. The simple shear problem is valid under the constant volume assumption that is equivalent to a Poisson's ratio of 0.5, but here it is not possible to use 0.5 value since it makes the first Lame parameter (c 1 ) to be infinite; therefore, we use 0.49 for Poisson's ratio. The constitutive parameters c 1 and c 2 read Moreover, the material parameters for strain gradient elasticity need to be chosen. For this purpose, herein, we utilize the granular micromechanical modeling [75][76][77][78]. Based on the formulation derived in Barchiesi et al. [79], we have where ' is the characteristic length of the granular material of the substructure. We assume three values for ' as f0:1, 0:2, 0:3g mm, which lead to material parameters as compiled in Table 1. The negative values in Table 1 may raise concern about the positive definiteness of the strain energy function. However, the individual values of the material parameters are not of importance. The energy value must be indeed positive in order to have a unique solution. We refer to previous studies [66,70,80] for discussion of positive definiteness in the strain gradient theory. In the problem Case 1, we setû = 0:05 mm and in the problem Case 2, we sett = 1:0 MPa.

FEM
In the classical elasticity theory, we deal with a second-order partial differential equation, while in the strain gradient elasticity theory, we have a governing equation of fourth order [81]. As a result, for satisfying the H 2 regularity in the weak form, unknown fields need to belong to C 1 within the whole domain. One possible approach is to set the minimum regularity requirement for the shape functions to be C 1 [82,83]. Another implementation of the strain gradient theory with C 1 regularity is presented in Glu¨ge [51]. For obtaining the weak form for implementing in the FEM code, we begin with the governing equation of strain gradient elasticity as derived in equation (7). The unknown displacement u i is represented using nodal values discretely in space and form functions for interpolation between nodal values. We circumvent using different notations for analytical functions and their discrete representations, since they never appear in the same equation. We use a discretization using (triangle) Lagrange elements, which generates piecewise continuous polynomials such that they are adequate for approximation in Hilbertian Sobolev space H 1 . This standard FEM elements of order q spans P q on triangles, T , in a two-dimensional continuum. The computational domain, O, is discretized by dividing it in triangles, and this triangulation is denoted by T . Therefore, we use a vector space for displacements The Lagrange elements are C 0 continuous across element boundaries; however, it is necessary to have C 1 continuity everywhere in the domain. Instead of using more advanced elements [84], we add a term to the weak form to enforce the continuity of the first gradient of displacement across the elements. By adding such a term to equation (7), we obtain and we have inserted ∂W s ∂u i = t i and ∂W s ∂u i, j = m ij from equations (10) and (11), respectively. The term Q is the penalty parameter; it is chosen arbitrarily but in connection with the material parameters and in the adequate unit in a way that all the terms in equation (44) have the same unit. Since the formulation involves second gradient in space, we choose q = 2 such that P 2 elements are utilized.
In equation (44), u + i, j and u À i, j are the displacement gradients on the two sides of an interior facet, which is between pairs of adjacent cells of the mesh. Moreover, the integration in dI is done on the set G of the two-sided facet elements while dA is for the one-sided exterior facets of the mesh, i.e., belonging the boundaries of the domain. Figure 3 shows a schematic of a triangular mesh on a domain O, its boundary ∂O, a cell element dV , a one-sided exterior facet element dA, and a two-sided facet (edge) element dI. The formulation holds in two-dimensional or three-dimensional domains; however, for the sake of the visualization, we show the idea on a two-dimensional mesh in Figure 3. In a two-dimensional domain, which is the case herein, the cell element dV is a surface and the facets dA and dI are edge elements.
It is possible to add a displacement prescription in the numerical computations as a Dirichlet boundary condition. However, in the problems that are discussed in the analytical solution (Section 3), there are boundary conditions of ''zero-displacement gradient'' on top (Case 1) and bottom (Case 2) edges of the rectangular domain. It is not possible to add such a boundary condition directly in the numerical computations. Hence, we add the zero-displacement gradient condition into the weak form. We update the weak form of equation (44) as where p = 10 6 is a penalty factor. Here, the last integral of equation (46)

Mixed FEM
The Mixed FEM is developed using the Hu-Washizu principle [85]. In the Mixed FEM, more than one function space is used for approximating the variables. Each function space is dedicated to one of the variables, and all the variables are solved simultaneously. In other words, the additional variables are calculated independently together with the primitive variable. Herein, we define three function spaces in the Mixed FEM formulation, which involves fu i , g ij , M ij g. The first one (Space 1) is a vector space for the primitive variable of the problem, the displacement u i , for which we choose q = 2 and P 2 (quadratic) shape functions. We use a distinct notation for the space derivatives in order to clearly approximate the space derivative of displacement. As the second space in the mixed formulation (Space 2), we introduce g ij = u i, j as a variable to be identified in the computations. We use P 1 (linear) shape functions for the unknown g ij . For the spaces of displacement and displacement gradient, we use standard polynomial FEM elements in FEniCS.
Then, we impose u i, j = g ij in the computations. This condition ensures that the approximated g ij in Space 2 is equal to the gradient of the approximated displacement in Space 1. For enforcing such an identity condition, as we will explain in the following, we define a tensor space of Lagrange multipliers, M ij . We choose L 2 elements for M ij with P 0 such that they are simply constants within elements with a jump across boundaries. We choose the family of discontinuous Galerkin elements in FEniCS which are suitable for this purpose. We set the degree of element to zero as we need constant functions.
At the end, we have the three unknown functions fu i , g ij , M ij g. For our two-dimensional problem, in each node, there are 2 unknowns for the components of u i , 4 unknowns for g ij , and 4 unknowns for M ij , i.e., 10 unknowns in total. These 10 unknowns are all independent in the formulation. In a nutshell, we construct the space for the Mixed FEM formulation as within the domain of the continuum body, O, with its closure, ∂O, where boundary values are given on Dirichlet boundaries, ∂O D .
In the Mixed FEM formulation, we create one single mesh in the domain and each of the function spaces is constructed on the same mesh. Depending on the dimension, degree of shape function, and element type, each space has a different total number of degrees of freedom in the domain. The quadratic vector space of u i has 21,960, the linear tensor space of g ij has 11,160, and the scalar tensor space of M ij has 21,600 degrees of freedom. In total, the mixed space has 54,720 degrees of freedom. The test functions, du i , dg ij , dM ij , are chosen from the same space as the u i , g ij , M ij , respectively.
For generating the weak form for the Mixed FEM approach, we begin with the governing equation of equation (7). From equations (18) and (19), we have ∂w ∂u i, j = C ijkl e kl , ∂w ∂u i, jk = D ijklmn e lm, n : By inserting ∂w ∂u i, j and ∂w ∂u i, jk in equation (7), and also setting ∂W s ∂u i = t i and ∂W s ∂u i, j = m ij from equations (10) and (11), respectively, we obtain ð where we have replaced the du i, jk with dg ij, k since it is the test function related to the second gradient of displacement. For imposing the identity u i, j = g ij (the equality of the approximated g ij in Space 2 and the gradient of the approximated displacement in Space 1), we define a residual as Taking the variation of R gives which should vanish in the domain O as we aim at minimizing the residual R. The complete weak form of the Mixed FEM approach is generated by adding the variation of R from equation (51) to equation (49) as ð O C ijkl e kl du i, j + D ijklmn e lm, n dg ij, k À

Results and discussion
In this section, the results of the computations are presented and verified by comparing them with the analytical solutions. Furthermore, the convergence analyses of the formulations are reported.
As discussed in Section 4, two numerical implementations are used for the computations: FEM and Mixed FEM. Table 2 summarizes the details of the spaces and the meshes of the two implementations. As shown in Table 2, the total degrees of freedom in the two implementations are of the same order since we want to compare their accuracy. Figure 4 shows the deformed state of the plate that has been under prescribed displacement on the top edge from FEM analysis. The effect of the zero-displacement gradient condition on the top edge (u 0 (H) = 0) is visible in this plot. We see that the lateral edges of the plate are fully vertical in the very beginning of their upper part. In order to compare the numerical and analytical results, we consider the displacement of the right edge of the plate. The displacement (u x ) of the right edge calculated by FEM and Mixed FEM is plotted along y in Figures 5 and 6, respectively, for three values of the characteristic length, ', which results in different material parameters, c 3 , c 4 , c 5 , c 6 , and c 7 . Figures 5 and 6 show that both FEM and Mixed FEM formulations are matching in a very satisfactory way with the analytical solution.

Results of Case 1
To see the role of strain gradient terms in systems with different sizes, we simulate the problem of Case 1 for three plates using the Mixed FEM formulation. The height of the three plates are H = f0:2, 2:0, 20:0g mm. We set the characteristic length, ' = 0:1 mm, and prescribed displacement, u = 0:05 mm, for the three simulations. Figure 7 shows the displacement of right edge along y normalized with respect to plate height. We see, in Figure 7, that the H = 20:0 mm case is behaving linearly  compared to the smaller heights. The reason is simply the increased ratio of the characteristic length of the geometry, H, by the characteristic length of the material, '. As expected, for higher H=' values, strain gradient terms are less important. In fact, the strain gradient theory is necessary between H=' larger than 1 and smaller than a certain value which can be estimated using the study presented herein. Convergence analyses are carried out for the FEM and Mixed FEM implementations to ensure the mesh independency of the results. The error is defined as where u comp i is the displacement from the numerical analysis and u ana i is the displacement from the analytical solution. In Figure 8(a) and (b), the monotonously decreasing trend of the error on the log À log plots is seen for FEM and Mixed FEM implementations, respectively.

Results of Case 2
In the problem of Case 2, a traction is applied on the top edge of the plate. Figure 9 depicts the deformation of the plate from Mixed FEM analysis. Here, we see the effect of the zero-displacement gradient condition on the bottom edge (u 0 (0) = 0). As a result, the lateral edges of the plate are vertical in the very lower part. For Case 2, the FEM formulation does not produce reliable results and it is not verified by  the analytical solution. On the contrary, the Mixed FEM formulation yields highly matching results with the analytical solutions. Figure 10 shows the displacement (u x ) of the right edge calculated by Mixed FEM for three values of the characteristic length, ', which results in different values for the material parameters, c 3 , c 4 , c 5 , c 6 , and c 7 .

Conclusion
Two implementations of the strain gradient elasticity theory based on the FEM are verified. The governing equation of the strain gradient elasticity is modeled using FEM and Mixed FEM, in which three distinct function spaces for the different variables are introduced, allowing the simultaneous  determination of the different unknowns on the three distinct spaces. For a simple shear problem, the computations are verified with an analytical solution. The Mixed FEM proved to be reliable in the considered boundary conditions (applying traction and displacement) while the FEM approach succeeds in predicting the displacement only in one of the cases of boundary conditions. In the FEM implementation approach, in every node, there exist 2 degrees of freedom, while in the Mixed FEM, the number of degrees of freedom is 10 per node; however, for FEM computations, a finer mesh is necessary to give acceptable results. In a nutshell, the Mixed FEM formulation proves to be more robust and reliable for solving problems in the framework of the strain gradient elasticity theory. The codes used for the computations are developed under the GNU Public license [86] made publicly available in Abali [87] for encouraging a transparent scientific exchange.