Accelerating the distance-minimizing method for data-driven elasticity with adaptive hyperparameters

Data-driven constitutive modeling in continuum mechanics assumes that abundant material data are available and can effectively replace the constitutive law. To this end, Kirchdoerfer and Ortiz proposed an approach, which is often referred to as the distance-minimizing method. This method contains hyperparameters whose role remains poorly understood to date. Herein, we demonstrate that choosing these hyperparameters equal to the tangent of the constitutive manifold underlying the available material data can substantially reduce the computational cost and improve the accuracy of the distance-minimizing method. As the tangent of the constitutive manifold is typically not known in a data-driven setting, and as it can also change during an iterative solution process, we propose an adaptive strategy that continuously updates the hyperparameters on the basis of an approximate tangent of the hidden constitutive manifold. By several numerical examples we demonstrate that this strategy can substantially reduce the computational cost and at the same time also improve the accuracy of the distance-minimizing method.


Introduction
Data-driven methods have recently arisen as an alternative approach to conventional constitutive modeling. They generally seek to replace analytical constitutive equations by methods that do either not or only to a much smaller extent imply an a priori bias. One branch of data-driven constitutive modeling is relying on machine learning methods such as artificial neural networks [1][2][3][4][5][6][7]. For example, recently constitutive artificial neural networks (CANNs) were introduced [8] as a novel machine learning architecture that enables data-  1 driven constitutive modeling on the basis of only a minimal amount of material data due to the incorporation of powerful (and general) a priori knowledge from continuum mechanics and materials theory.
An alternative to classical machine learning approaches in data-driven constitutive modeling is the local reconstruction of the constitutive manifold underlying the given material data [9][10][11][12]. Interestingly, this perspective opens up ways to interpret problems of data-driven constitutive modeling by way of mixed-integer programming [13].
Another branch of data-driven constitutive modeling that has attracted rapidly increasing attention over the last years are methods that interpret material data (i.e., strain-stress data) as a sort of discrete constitutive law. These methods seek to find a state that satisfies certain essential physical constraints of elasticity theory and yet falls (as closely as possible) into the set of given material data. This approach is often referred to as the distance-minimizing method and was introduced by Kirchdoerfer and Ortiz [14] and extended since then by numerous other works. The method was extended to solve problems of elasticity at finite strains [15], elastodyanmics [16,17], fracture mechanics [18], and plasticity [19]. Besides, also aspects of the implementation have been addressed. For example, efficient data structures were pro-posed in [20] to reduce the computational cost of searching through a material database. Shannon's information entropy and locally convex optimization techniques were applied to deal with noisy databases [11,21]. Moreover, Leygue [22] proposed an algorithm to derive and to build a database of strain-stress pairs that sample mechanical responses of a material in in silico or in situ experiments. The mathematical background of the distance-minimizing method applied to small strain and finite strain elasticity problems has recently been examined in more detail by [23,24]. Since in this datadriven framework there might exist no solution within the given material data set that satisfies at least the major physical constraints (the equilibrium equation and the compatibility condition on the strain field), a notion of relaxation must be introduced to define the data-driven solution of the distanceminimizing method. It is interesting to note that, according to [23], relaxation within the distance-minimizing framework is different from the classical relaxation of energy functions. For example, the relaxation of a bistable material would lead to material data sets that are no longer graphs. Such insights provide some first foundations for the application of the distance-minimizing framework also to non-convex stress-strain data sets. Moreover, a particularly interesting extension of the data-driven perspective towards the realm of stochastics has been proposed in [25].
Generally, in the distance-minimizing paradigm introduced by [14], a data-driven boundary value problem (BVP) is formulated as a double-minimization problem with an associated metric. Such a metric can be defined as a quadratic functional form on the strain-stress phase space [14,17]. To weigh the contributions of the strain and the stress appropriately in the metric, a priori chosen tensor-valued hyperparameters are employed. These were considered to be of only numerical nature in the original work [14]. However, these hyperparameters affect the convergence rate of the distance-minimizing method formulated as a fixed-point iteration method. Moreover, for finite sets of material data, a poor choice of the hyperparameters can lead to low accuracy of data-driven solutions, even in case of noise-free material data. Despite several recent improvements and extensions of the distance-minimizing method, our understanding of the influence of its hyperparameters remains limited to date. In particular it remains poorly understood whether and how they could be chosen to optimize the numerical properties of the distance-minimizing method.
In this paper, we demonstrate that choosing these hyperparameters equal to the tangent of the constitutive manifold underlying the available material data can substantially reduce the computational cost and improve the accuracy of the distance-minimizing method. As the tangent of the constitutive manifold is typically not known in a data-driven setting, and the tangents evaluated at the strain solutions in each iteration change during an iterative solution process, we propose an adaptive strategy that is continuously updating the hyperparameters on the basis of an approximate tangent of the hidden constitutive manifold. We demonstrate the advantages of our novel adaptive strategy by several numerical examples.
2 Data-driven elasticity and distance-minimizing method

Terminology
To explain the distance-minimizing method for computational mechanics as well as its shortcomings, we revisit the classical BVP and then define a corresponding data-driven BVP.
• The primary field is the field on which we can impose the essential boundary conditions. • The gradient field is defined as the gradient of the primary field. • The energetically dual field is energetically conjugate to the gradient field.
The following discussion relies on the context of the small strain theory of continuum mechanics. Specifically, the primary field, the gradient field, and the dual field will be the displacements, the strains and the stresses stored at the material points. For stresses and strains we use Voigt's notation herein, that is, they are not represented by second order tensors but rather by vectors (with 6 components for threedimensional problems). Analogously, material stiffness and compliance are represented by matrices rather than fourth order tensors.

Classical versus data-driven boundary value problem
A standard boundary value problem consists of three ingredients besides boundary conditions: (A) Compatibility conditions, (B) conservation laws and (C) a constitutive law or a material law. In the following, we assume that the mechanical continuum on which the boundary value problem is defined has already been discretized, using, for example, the finite element method [26]. That is, we assume that the displacement field is represented by a displacement vector . Each of its components u i relates to a specific discrete point in the continuum (e.g., a node of a finite element discretization) and a certain coordinate direction. N DOF is the number of degrees of freedom of the discretization.

Compatibility conditions
Let the matrix B e relate the displacement vector to the strain e at a discrete material point e where the constitutive relation has to be evaluated (e.g., a Gauss point in a finite element discretization). If there are in total M such points, we have For example, if the continuum is discretized using N elem twodimensional linear quadrilateral finite elements with four Gauss points each, M = 4N elem [17]. For a quadrature point e in a specific finite element, most components of B e are zero and the non-zero components are computed from the gradient of the shape functions of the specific finite element (see also [26]). If the displacement field is sought as the solution and the strain is derived from this field, the compatibility conditions are automatically fulfilled in the discrete setting by applying (1).

Conservation laws
The conservation law for the deformation of a continuum body in quasi-static analysis is given in the strong form by where is the spatial domain the body occupies, σ the Cauchy stress tensor, and f the external volume force exerted on the body. The continuum body has a prescribed displacement on the part D ⊂ ∂ of the boundary and is subject to the external traction σ • n = t on the part N ⊂ ∂ of the boundary, where n is the outer unit normal vector to the boundary ∂ and t is the prescribed traction. We assume that ∂ = D ∪ N and D ∩ N = ∅. This strong form together with the prescribed boundary conditions is first converted to a weak form, which is subsequently discretized by the standard finite element method yielding the discrete equilibrium equation Here, the external nodal force vector F captures the effect of external loading on each finite element node and is energetically conjugate to the nodal displacement vector u. The right-hand side in (3) can be understood as an internal force vector that summarizes for each degree of freedom of the discretized continuum the overall effect of the elastic stresses in the continuum. The coefficients {w e } M e=1 are weight factors of the different material points where the stress is evaluated (e.g., of the Gauss points in a finite element scheme), see also [17] for detail discussion of these coefficients. The matrix B T e captures numerical effects of the chosen discretization (e.g., of the chosen shape functions)

Material laws
To arrive at a closed system of equations, the strain and stress must be related to each other. In a classical boundary value problem, one defines to this end a function that assigns to any strain a stress value. In the data-driven boundary value problem, a material law like (4) does not exist. Instead, there are abundant material data points collected in a material data set which specifies for a number of N data discrete strain states j the associated stress states σ j . In a classical boundary value problem, we seek the solution to (3) that preserves both the compatibility condition (1) and a given material law (4). By contrast, in a data-driven framework for constitutive modeling, we seek the data points in D that minimize the violation of (1) and (3). In other words, we seek the solution to (3) that is closest to the data set D. In the next section, these ideas will be formulated mathematically.

Distance-minimizing method
In this section, we introduce the data-driven boundary problem in the sense of the distance-minimizing method following the ideas and concepts of [14,17].

Phase space
The phase space Z is defined as the set of all possible strain-stress states at all the material points of the system. Mathematically, the phase space Z and an element z ∈ Z can be written as where q is the dimension of and σ and depends on the problem setting [17]. Each element z of the phase space consists of multiple strain-stress pairs, each of which corresponds to one material point. The addition of two elements and the multiplication of one element in Z by a real scalar are defined in a component-wise manner. The set of possible strain-stress states ( e , σ e ) specifically at the e-th material point is referred to in the following as local phase space Z e .
The strain-stress states at all the material points are collected in one global strain-stress state and denoted by ( , σ ) = {( e , σ e )} M e=1 . Therefore, the strain-stress pair without the subscript e will refer to the global state.

Material data space, constitutive manifold and physical-constraint space
The material data space D is the subset of Z that results if we admit only strain-stress pairs from the material data set D.
The material data D can be imagined to result from a combination of some hidden constitutive law σ = σ ( ) following (4) and some additional noise. The hidden constitutive law can be represented in the local phase space Z e by a so-called constitutive manifold and the material data are located in a close corridor around M, whose width is determined by the magnitude of the noise (Fig. 1). The physical-constraint space C ⊂ Z comprises of elements c = {( e , σ e )} M e=1 satisfying both the compatibility conditions and the conservation law. C is also referred to as physical-constraint manifold. The material data D is typically located in the close neighborhood of some (in general unknown) constitutive manifold M. The difference between the material data and the constitutive manifold is caused by the noise incorporated in the material data

Metric
With the above notions, we can equip the phase space Z with a metric [14,17] Herein, we use Voigt notation so that C e and S e are matrices and the central dot denotes a scalar product between two vectors. The matrices C e and S e are of numerical nature and must be defined a priori. They are the hyperparameters in the distance-minimizing method described below. and σ denote energy-like terms whose definition will turn out convenient for the development below. The scalars w e are weights of the contribution of each material point.
Similarly to (7), also the local phase space Z e can be equipped with a metric so that the global metric (7) is determined as a weighted sum of the local metric (8), namely ( , σ ) = M e=1 w e ( e , σ e ) e .

Distance-minimizing method
We define the data-driven boundary value problem in the sense of the distance-minimizing method as an optimization problem (see That is, we seek among all possible strain-stress states the state d * in the material data space that is as close as possible to the physical-constraint space as well as the state c * in the physical-constraint space that is as close as possible to the material data space. The actual data-driven solution can either be defined as z = c * or as z = d * . In the first case, we strictly demand a strain-stress state of which it is sure that is possible (because it forms part of the given material data space D) but allow an-as small as possible-violation of fundamental physical laws. By contrast, in the second case, we strictly demand that all fundamental physical laws are exactly satisfied and allow to this end also strain-stress states of which we do not know for sure that they are possible but which are at least as close as possible to strain-stress states of which we know that they are possible. Both approaches are in principle possible and it is up to the user which of them to define as the solution to the datadriven BVP. It is worth mentioning that the minimization steps in (9) are interchangeable. The conceptualization of this minimization problem is visualized in Fig. 2.
At this point, it is instructive to distinguish between the setting of and the solution method for a boundary value problem (BVP). Whereas a classical BVP is associated with a constitutive law (4), a data-driven BVP comes along with a material data set replacing the constitutive law. The classical BVP can be solved both by a direct method or by the distance-minimizing method described in this section.
In the first case, we express the equilibrium equations in terms of the displacement field by eliminating the stress field from the system with the aid of the material law. Subsequently, we search a solution within the space of admissible displacement fields. By contrast, in the second case the solution to the classical BVP is simply found as the solution to (9). In this case c * = d * because in a classical BVP there exists a state in the phase space that both satisfies all the physical constraints and the given constitutive equation (4) at the same time. While the classical BVP can be solved either by a classical, direct method or by the distance-minimizing method, the data-driven BVP cannot be solved by classical, direct methods but rather the distance-minimizing (or a similar) method is required.

Numerical implementation of the distance-minimizing method
In this section, we summarize the staggered scheme described in [14,17] for solving the double-minimization problem (9). This problem is decomposed into a series of single minimization problems. We randomly pick an initial value d [0] ∈ D and then solve iteratively for k = 0, 1, 2, . . . the problems until a converged solution is achieved. Here, both the superscripts (k) and [k] refer the iteration step k and c (k) and d [k] on the right-hand sides are known from the previous iteration step, respectively. Herein, the parentheses ( ) imply that the associated quantities belong to the physical-constraint space C and the square brackets [ ] that they belong to the material data space D. Equivalently, we could also start with a random c (0) ∈ C for the initialization and then repeat the two steps Rambausek, Marc-André Keip, Variational framework for distance-minimizing method in datadriven computational mechanics, with permission from Elsevier [17] in (10) in reversed order. The described solution scheme is demonstrated in Fig. 2.
In general, we do not have a strain-stress pair ( , σ ) satisfying the compatibility and equilibrium equations at initialization. Therefore, starting with a properly chosen c (0) is typically not trivial. By contrast, it is easy to pick some d ∈ D. Hence, a numerical solution with the initialization in D is more favorable. Nevertheless, the final solution in C has the favorable property of respecting the physical laws.
The numerical scheme to solve (10) can be rewritten in a fixed-point formulation as The iteration scheme stops when there is no further effective change in the data selection process. The value of c from the last iteration with (10) 1 automatically yields c * for (9). Section 2.5 discusses how to define stopping criteria for (11).

Data-driven solver for linear elasticity problem
In the following, we briefly summarize the single steps to the solution in the distance-minimizing method for linear elasticity problems, following [14,17].

Projection on the physical-constraint space
The strain-stress state stored in the mechanical system in one particular step k (k = 0 for the initialization step) is given by d [k] = ( [k] , σ [k] ). To solve (10) 1 , we need to find c (k) = ( (k) , σ (k) ) that minimizes the norm (12) and satisfies the physical constraints (1) and (3). The solution can be obtained by using the method of Lagrange multipliers with a Lagrangian function Here we used (1) in the norm, which allows us to satisfy always the compatibility conditions. Then the only remaining constraint is the balance law, which is enforced by the (vectorial) Lagrange multiplier η (k) . The stationary point of L is the solution to the following system where the stress σ (k) e has been resolved according to We will call the right-hand side of the second equation residual vector as the equilibrium state corresponds to this vector being close to zero. This result can be derived in a variational framework proposed in [17]. Finally, the solution ( (k) , σ (k) ) is obtained by solving system (14) and computing the strains and stresses according to (1) and (15). Following (14), it appears reasonable to choose S e = C −1 e because this way the left-hand side of the two equations of (14) can be computed by one single assembly process. Thus, in the following we will strictly use S e = C −1 e with C −1 e being the inverse of S e in the sense C e • S e = I, where I is the identity matrix.

Projection on the material data space
Solving the minimization problem (10) 2 means pulling the solution c (k) = ( (k) , σ (k) ) back to the material data space D. For each material point in the continuum body, we seek (16) This is simply a discrete optimization problem (without additional constraints). It can be solved by going through all the material data points in D and then selecting the one minimizing the above function. The combination of all the optimal local solutions of (16) at the individual material points constitutes the global solution , σ [k+1] ) to the global problem as shown in [17].

Convergence criteria for the distance-minimizing method
The distance-minimizing method as expressed in (11) can be implemented by a fixed-point iteration scheme [14,17] where can be used as a stopping criterion. Note that the metric used in this condition depends on the hyperparameters C e and S e . An alternative criterion is an inequality operating on the material data space in the form This criterion works equivalently to the criterion (17) as the projections of elements z ∈ Z onto the data function space D and onto the physical-constraint space C are continuous and linear operators. Moreover, for this reason a sequence {z (k) } ∞ k=0 obtained by applying consecutively the above projections between physical-constraint and material data space will finally converge to the classical solution for a classical BVP. A proof of this statement for a simple system will be presented in Sect. 5.1.2. All of the numerical examples shown below use (18) with δ = 10 −10 .
As mentioned above, the distance-minimizing method can be used to solve both classical and data-driven BVPs. In classical BVPs, the constitutive manifold D and the material data set are continuous domains so that one has to choose some small positive tolerance δ. By contrast, since in data-driven BVPs the material data set is discrete with |D| < ∞, also δ = 0 can be used both in (17) and (18).
find estimates for the hyperparameters of which one can hope that they accelerate the convergence of these iterations.
The distance-minimizing method consists of a series of projections of type (10) 1 , where a projection from the material data space to the physical-constraint space is performed, and of type (10) 2 , where a projection from the physicalconstraint space to the material data space is performed. During both projections a step z e = ( e , σ e ) is performed at each material point in the local phase space Z e . To perform this step, for both projections a cost function has to be minimized. For projection steps of type (10) 1 the cost function is (16) and for projection steps of type (10) 2 the cost function is (12). Both cost functions consist of summands of the type The magnitudes of the strain-related contributions ( e , C e ) and the stress-related contributions σ ( σ e , C −1 e ) depend on the hyperparameters C e , respectively. If both types of contributions are substantially different in magnitude, one will dominate the other during the solution of the minimization problem. In such cases, the iteration steps will be performed either in a way that focuses on strain and largely neglects the role of stress or vice versa. This implies little progress during the single iteration steps for the respectively neglected quantity. At the same time, however, the initial state at the beginning of the iterations differs from the sought solution typically both in stress and strain considerably. So, if the hyperparameters are chosen such that changes of one of these two quantities remain small during the single iteration steps, necessarily a large number of iteration steps will be required to obtain a solution that is optimal with respect to both. In other words, if the magnitudes of ( e , C e ) and σ ( σ e , C −1 e ) are substantially different, we have to expect in general slow convergence of the distance-minimizing method at least with respect to either stress or strain.
The key question is now under which conditions we can expect that ( e , C e ) and σ ( σ e , C −1 e ) are of comparable or, by contrast, starkly different order of magnitude. To understand this, we focus for simplicity on the later stage of the iterative solution procedure required by the distance-minimizing. Moreover, we assume a situation where abundant material data of high quality is available so that the strain-stress pairs computed by the projection steps (10) 1 the cost function is (16) and (10) 2 the cost function is (12) are-in the later stage of the iterative solution procedureclose to the (hidden) constitutive manifold σ = σ ( ) of the material. It is important to note that this situation is indeed representative for many practically relevant application sce-narios because there one will often seek to obtain a large amount of material data of good quality. Moreover, iterative solution procedures tend to spend most of their iterations in a relatively small neighborhood around the final solution to achieve the elevated accuracy that is numerically desired. As in that neighborhood strain-stress pairs are close to the (hidden) constitutive manifold, we can assume that stress increments between two subsequent steps in the iterative solution of the distance-minimizing problem are related to their associated strain increments by with the tangent of the hidden constitutive manifold C e = ∂ σ /∂ ( e ) computed at the strain-stress state (at the beginning or end) of the respective iteration step. Using this approximation, and thus Now we assume C e = γ C e , which allows us to discuss in a rule-of-thumb manner cases where the hyperparmaeters are either of comparable magnitude as the tangent stiffness of the hidden constitutive manifold (γ = 1) or much larger (γ 1) or much smaller (γ 1). From (22) we derive That is, we expect the strain-related contributions ( e , C e ) and the stress-related contributions σ ( σ e , C −1 e ) in the objective functions of the minimization problems solved in each step of the distance-minimizing method to be of similar order of magnitude if the hyperparameters are of similar magnitude as the tangent stiffness of the (hidden) constitutive manifold. By contrast, if this is not the case and the hyperparameters are chosen much larger or much smaller, we expect that in these minimization problems either the contributions of the type ( e , C e ) or σ ( σ e , C −1 e ) will dominate the respective other. And for the reasons above, we then expect slow convergence.

Hyperparameters based on linear regressions
From the above sections it is clear that for an efficient and effective implementation of the distance-minimizing method it is essential to choose its hyperparameters comparable to the tangent of the hidden constitutive manifold. As the latter is not known, it is important to estimate it. Here we will discuss how this is possible on the basis of linear regression techniques, which are computationally cheap and simple.
To estimate the tangent of the hidden constitutive manifold in the neighborhood of a specific z e = ( e , σ e ) ∈ Z e at a material point e, we first have to identify the material data given in its neighborhood. We may do so by defining these data as with the Euclidean norm . E . Note that here we cannot use the above usually used phase space norm because its computation requires exactly the hyperparameters whose determination is the objective of the procedure described in this section. Therefore, we have to use a Euclidean (or alternatively other standard) norm here and can thus compare only either the stress or the strain components of a state in the local phase space to quantify proximity in some sense.
Here we decide to focus on the strain components so that we can use N (z e , r ) and N ( e , r ) equivalently. By the denoting k = |N (z e , r )|, we can define N (z e , k) := N (z e , r ) as a set of k material data points in D that are closest to z e , that is, as the set of its k nearest neighbors. Based on the neighborhood data from (24) we can perform a linear regression [27]. To this end, we determine in the parameters C a (z e ) and σ 0 (z e ) such that they best fit the material data in N (z e , r ). Then C a (z e ) forms an estimate of the tangent C of the hidden constitutive law as introduced in (25). For practical purposes, r should be chosen small enough so that the hidden constitutive law can be approximated reasonably by a linear relation in its range. At the same time, r should be chosen large enough to suppress noise in the material data by averaging across a sufficient amount of data.
We make some minor remarks on a possibility of encountering the constitutive tangent tensor that can be not positive definite. Physically, such a tangent stiffness tensor is associated with an unstable material. As unstable materials have hardly had any applications in engineering (with possibly a few very special cases), we decided not to discuss such cases n depth in our paper. When focusing on practically relevant materials, we expect that issues with positive definiteness of the tangent stiffness could only arise as numerical artifacts of our regression techniques. Such problems could, however, be handled simply by eliminating any hyperparameters that are not positive definite in our set of pre-defined hyperparameters established by our divide and conquer strategy. This can be expected to affect the overall outcome in no significant way. Another way of ensuring positive definiteness of the hyperparameters, which we used in this work, is choosing the radii of neighborhoods appropriately.

Adaptive hyperparameters based on the constitutive manifold
The previous section discusses how to compute the hyperparameters so that they approximate the tangent of the hidden constitutive manifold. This tangent, however, may in general change from iteration step to iteration step and material point to material point in the general case of a nonlinear hidden constitutive law. Therefore, an adaptive procedure is required in practice. Such a procedure can be defined for the distanceminimizing method as follows: we start with some initial guess. Based on this initial guess we use at each material point linear regression to estimate the tangent of the hidden constitutive manifold, which yields us the hyperparameters for the next iteration step. With these hyperparameters, we can solve the minimization problem giving us the next intermediate configuration of our iterative solution process. From this intermediate configuration we again estimate the hyperparameters by linear regression, perform the next iteration step and so on. This adaptive hyperparameter strategy preserves the fixed-point property of the scheme (11) in the sense that still converges to a specific solution. As will be seen from the numerical examples in Sect. 5, the adaptive hyperparameter strategy described here indeed dramatically decreases the number of iteration steps required to this end. At the same time, however, also the computational cost per iteration step increases. The reason is that for constant hyperparameters the left-hand side of (14) has to be evaluated only once. By contrast, when using adaptive hyperparameters it has to be reevaluated in every iteration step, which means the computational cost of the assembly of an additional stiffness matrix in each iteration step. The computational effort is dominated by the process of recomputing hyperparameters at all the material points. Therefore, a simple adaptation of the hyperparameters in each iteration step does in practice often not lead to the desired substantial reduction of computational cost. In the next subsection we will discuss a strategy to overcome this caveat.

Divide and conquer technique for a finite set of representative hyperparameters
The key idea for a computationally efficient adaptation of the hyperparameters of the distance-minimizing method is to allow variations of the hyperparameters only within a finite set of predefined values. As will be seen below, this simple strategy can decrease the computational cost of hyperparameter adaptation substantially while still exploiting most of its benefits, noting that for a reduction of the number of iteration steps it is sufficient if the hyperparameters reasonably approximate the tangent of the hidden constitutive law whereas an accurate adjustment of them is not required. For an efficient adaptation of the hyperparameters, we proceed as follows: let be the domain of all possible strain states that are of interest. In practice, may often be chosen, for example, as the convex hull of the strain states in the material data set, potentially extended by some boundary layer to allow also a certain extrapolation beyond the available material data. We can divide into a set of non-overlapping subdomains i . To each such strain subdomain, we assign an approximation C a i of the average tangent of the hidden constitutive manifold in this domain. This approximation may, for example, be computed as a weighted average of all the approximations gained from linear regression for all the states z e ∈ D in the material data set whose strain components e are located in i that is, The weights α(z e ) may be chosen equal to the (normalized) size of the part of i for which e is representative. This size may, for example, be set equal to the size of an associated Voronoi cell if a Voronoi tesselation of i is performed based on the strain values in the material data set which fall into i . Having subdivided the strain space into i and computed the associated C a i once in the beginning, our strategy for hyperparameter adaptation is as follows: at a specific material point in a specific iteration step, one first determines the associated subdomain i and then uses for the next iteration step C a i as hyperparameter C e at this material point.

Examples
The following examples not only demonstrate the advantages of the proposed strategy of adaptive hyperparameters but also support the underlying theoretical considerations, which is of particular importance since they could so far not yet be based on a rigorous mathematical proof. First, we present a set of examples where classical BVP is solved using the distance-minimizing method with various fixed hyperparameters. The effect of the choice of hyperparameters is discussed and numerically illustrated. Then, we show that the proposed method with adaptive hyperparameters outperforms the standard approach with constant hyperparameters especially when the noise in the material data increases. Finally, we show that the hyperparameter-adaptive solver leads to a better convergence rate with respect to the amount of available material data than that of the one with fixed hyperparameters.

Problem setting
In Sect. 5.1 we study the three-member truss system illustrated in Fig. 3. As stresses and strains are constant within the three trusses, respectively, the state of the system is characterized by three strain-stress pairs ( e , σ e ), e = 1, 2, 3 denoting strain and stress in the e-th truss respectively. We assume a linear constitutive law

Theoretical analysis
Now we discuss the solution of the classical BVP from Sect. 5.1.1 using the distance-minimizing method. For this specific problem, we can compute the sequence of iteration steps performed by the distance-minimizing method analytically because the underlying minimization problems can be solved analytically in each iteration step. Doing so allows us to study thoroughly the dependence of the convergence rate of the data-driven solver on the hyperpararmeters. If we solve (10) analytically and set all the three hyperparameters C e equal to a single constant C, we obtain is, the better the convergence rate. Using this theorem, we can prove that the iteration scheme (28) guarantees a convergent solution identical to the solution presented already at the end of Sect. 5.1.1. To this end, we first note that if there exists a fixed-point of (28), it must be the solution to the system (M − I) + R = 0. Solving this linear equation system immediately yields the solution presented above. Now there only remains the question whether there always exists a fixed point of (28). To examine this, we first compute the spectral radius ρ(M) as It is clear that 1/2 ≤ ρ(M) < 1 for all C = 0 and thus a fixed-point is guaranteed. The scheme achieves the best convergence rate at C = E, where the spectral radius attains the smallest value ρ(M) = q 1 = q 2 = 1/2. This is in excellent agreement with our above theoretical discussion where we argued that generally hyperparameters of the distanceminimizing method comparable to the tangent of the (in general hidden) constitutive manifold-which is here Ecan be expected to yield the best convergence rate.

Numerical results
After having established by theoretical analysis that C = E can be expected to be numerically optimal, we additionally tested different values for the hyperparameter C by solving the problem iteratively. As initial values, we used The stopping criterion for the iterations was defined by (17) with δ = 10 −10 . The results are shown in Fig. 4.
In Fig. 4, we see that for C = 10 3 = E, the strains (and also the stresses) converge to the analytical solution solution around 60 times faster than for C = 10 2 or C = 10 4 . These results strongly support our theoretical considerations and conclusions in Sect. 3. In particular, they illustrate the high importance of a proper choice of the hyperparameters in practical applications, where a difference in computation time by a factor of 60 is in many cases the difference between feasibility on the one hand and prohibitively high computational cost on the other hand.
To better understand the mechanism resulting in this substantial dependence of the number of iterations on the choice of the hyperparameters, it is instructive to examine the residual error R [k] σ for the balance of linear momentum and the residual error R [k] for the compatibility condition. These are with In Sect. 3 we discussed that hyperparameter much larger or much smaller than the tangent stiffness would lead to a situation where either stress or strain is largely neglected during the minimization process so that it would take many iterations to reach a point where both is satisfactory. In (30) and Fig. 5 we see the underlying mechanism. If C E, stress dominates the metric in (19). Therefore, the numerical scheme can quickly reduce error in stress, that is, the residual error R [k] σ in the equilibrium equation. However, as strain is numerically neglected, our solution scheme is unsuccessful in reducing also the residual error R [k] of the compatibility equation, which does not depend on stress but only strain. By contrast, C E yields exactly the opposite situation.

Data-driven solution obtained by using various hyperparameters
We have proven that for the problem defined in Sect. 5.1.1 the distance-minimizing method converges to the correct solution. This is consistent with the theoretical analysis in [23] because a continuous constitutive law mimics the limit case where the number of material data points approaches infinity, thereby fully characterizing the constitutive law. However, it is important to note that convergence to the exact solution cannot necessarily be expected from the distance-minimizing method in case of a finite material data set. In this subsection we will demonstrate that if the hyperparameter C is chosen very different from the tangent of the (hidden) constitutive manifold, not only the convergence of the data-driven solution is slow (as shown in the previous sections) but that one requires also many more data to ensure that the limit of the convergence is close to the physically correct solution. Assume that we have N data material data points such that D = {( i , σ i )} N i=1 samples the linear constitutive manifold (27) in the strain range = (−5%, 5%) with N data ∈ {10 j + 1, j = 2, 3, 4, 5} data points. The data points always included the point ( , σ ) = (0, 0) to capture rigid body deformations, while the remaining data points uniformly sampled . For these four different material data sets, we applied the data-driven solver with the three different hyperparameters C ∈ {20, 1000, 20000}. To measure convergence, we examined the error norm Fig. 6 we see that even with 10 4 + 1 data points, the data-driven solutions obtained with C ∈ {20, 20000} are still worse than the ones obtained with C = 1000 for 10 2 +1 data points. Additionally, for C = 1000 one can observe linear convergence with respect to the data size, while the convergence rate for C ∈ {20, 20000} is clearly sub-linear. This demonstrates that a proper choice of the hyperparameters appears to accelerate-if the distance-minimizing method is applied-not only the numerical solution but to improve also its quality in case of a finite data set (which is in practice always the case).

Noisy data
In this subsection we test the effect of the hyperparameter adaptation introduced in Sect. 4. To this end, we slightly modify the three-truss problem introduced in Sect. 5.1.1 replacing the linear constitutive law (27) by a nonlinear constitutive law σ = 50 tanh(50 ).
The applied load is changed to f x = 45, f y = −45 and the exact solution can be shown to be ref 1 = 0 and ref 2,3 = ± ln(19)/100. Moreover, to mimic a more realistic situation, we generate material data with noise. To this end, we first generate a noisefree material data set D = ( j , σ j ) N i=1 from the (hidden) constitutive law (32). Then we create from D a noisy material data set D = ( j , σ j ) N i=1 , which we actually use for our computations and which is defined by with random numbers r j drawn from a uniform distribution in the interval (−a, a). In Fig. 7 the results for three sets of material data with a = 0, 2%, 3% are shown. To make a comparison with the original approach from [14], we first solved the problem with the same material data sets used there and with the fixed hyperparameter C = 1150 = 1

Fig. 7
Convergence of the data-driven solution on noisy data with adaptive hyperparameters (circles) or constant hyperparameters (triangles).
In the latter case, the hyperparameters were either fixed to C = 1150 (top) or C = 100 (bottom). In all cases the same set with N data = 1024 material data points was used ters, which we initialized one time as C = 1150 and another time as C = 100. The adaptive hyperparameters were chosen among a finite set of 100 potential hyperparameters based on a division of the strain domain (−5%, 5%) into 100 subdomains. The results of all these computations are illustrated in Figs. 7 and 8. Generally, the distance-minimizing method with adaptive hyperparameters performs never worse than with fixed hyperparameters. However, in case that the fixed hyperparameters are chosen close to the tangent of the hidden constitutive law in the state of the exact solution (top row in Fig. 7), the difference between adaptive hyperparameters and fixed hyperparameters is only small. Nevertheless, one has to keep in mind that in reality typically no such information about the tangent of the constitutive law is explicitly available. Therefore, in case of a nonlinear problem, fixed hyperparameters will typically be chosen far from the tangent of the constitutive law in the state of the final solution. This more realistic situation is illustrated in the second row of Fig. 7. There one indeed observes that the error obtained with our novel adaptive hyperparameter scheme is around one order of magnitude smaller than the one obtained with fixed hyperparameters. It is important to note that this holds even if we initialize the adaptive hyperparameter scheme with exactly the same value we use for the fixed hyperparameter scheme. The big advantage of the adaptive hyperparameter scheme is that an improper initialization is quickly resolved by the adaptation scheme as illustrated also in Fig. 8.

Problem setting
In this section, we deal with a planar multi-truss system consisting of N elem = 43 truss elements and N node = 21 nodes, as shown in Fig. 9. The trusses have unit length L = 1. The top nodes are subject to a vertical load F = 40 each. The constitutive law for all trusses is given by (32).

Strategy of data enrichment and reference solution
Using this planar truss structure, we study the convergence of the data-driven solution as the amount of material data increases. To this end, we define a series of material data sets D n such that D n ⊂ D n+1 and the material data are uniformly sampled in the strain domain (−5%, 5%) by (32). A strategy of creating such data sets is illustrated in Fig. 10a and will be explained here. Assume that we currently have the data set D n with the material data points given by and N n is an even number. Then, the data set D n+1 is constructed by adding one additional strain in the center between each pair of neighboring strains in D n , see Fig. 10a. Subse- quently, the corresponding stresses are computed using (32). Thus, (n+1) = (n) /2, and N n+1 = 2N n . No noise is considered in this section.
To obtain a reference solution for the distance-minimizing method, we first solved the above system in the classical fashion using the nonlinear finite element method where at each material point the nonlinear constitutive equation (32) was evaluated in an exact manner and the numerical solution was computed by Newton-Raphson iterations with a very low numerical tolerance to obtain a nearly exact solution.
The data-driven solution is obtained by the adaptive solver using a data set described as in (33). Figure 10b demonstrates that the data-driven solution agrees very well with the one obtained in the classical fashion already for a dataset of 257 data points.

Convergence of the data-driven solution with respect to the data size
In the following, the classically computed solution C = { C e } N elem e=1 is used as a reference solution in a convergence study of the data-driven solution D = { D e } N elem e=1 . The distance between both is measured by the Euclidean norm The convergence of the data-driven solution with an increasing amount of material data is shown in Fig. 11a. We see that the adaptive hyperparameters give the linear convergence rate of the strain solution while the constant hyperparameters give sub-linear convergence rate. Figure 11b compares   the performance of the distance-minimizing method with adaptive hyperparameters versus constant hyperparameters (C = 2500) in terms of the number of iterations. Apparently, the adaptive hyperparameters provide for the same amount of material data a much higher quality of the solution. Moreover, the number of iterations increases with an increasing number of material data points rapidly for constant hyperparameters but only very slowly for adaptive hyperparameters. This is a highly important feature for the practical application of the distance-minimizing method to ensure a feasible computational cost.

Comparison of computational time
To demonstrate the benefits of the adaptive hyperparameter strategy, we measured the computation time of the datadriven solution with three different strategies: (i) constant hyperparameters, (ii) hyperparameters updated continuously with linear regression, (iii) hyperparameters computed using divide-and-conquer technique. The comparison of computational time is shown in Fig. 12. It is obvious that for all the three algorithms the computation time increases with the data size. However, the computation time for the solver using the strategy (i) is much lower than that of the strategy (ii). This is because the computational efforts for updating the hyperparameters by performing k-nearest-neighbor search and then linear regression are very large as compared to those for computing one entire iteration step in using the constant hyperparameters. By contrast, the computation time for strategy (iii) is much lower than for the other two strategies. The computational overhead for computing pre-defined hyperparameters is insignificant. This becomes especially clear when the number of finite elements, and hence the number of material points, increases as compared to the number of partitions of the strain domain . In the divide-and-conquer strategy, the pre-defined hyperparameters are computed only once. Additionally, these hyperparameters are independent of the finite element mesh because it is only relevant how we partition the strain domain . In contrast, if we do not apply the divide-and-conquer strategy, we must compute hyperparameters at every material point and in every fixed-point iteration. Henceforth, it is important to emphasize the necessity of the divide-and-conquer strategy as explained in Sect. 4.3.

Plane strain problem
In this section, we extend our scope from truss systems to problems of general continuum mechanics and demonstrate that the ideas and concepts introduced in this paper hold also there. To this end, we consider the two-dimensional continuum in plane strain condition that is illustrated together with its loading conditions in Fig. 13 (left). To solve this problem, the triangular mesh shown in Fig. 13 (right) was used with one quadrature point per element. It consists of N element = 1441 triangular elements and 841 nodes. The mesh exhibits small elements around the circular holes to capture high stress concentration about the circular boundaries.
To generate the material data for this example, we employed the constitutive law suggested by [17]. This law is constructed by combining a Neo-Hookean with a Saint-Venant material model [29], truncating strain terms of more than quadratic order. Its strain energy density is [17] ψ( ) = μ trace( ) − log 1 + trace( ) + trace( 2 ) are the Lame parameters defined in terms of Young's modulus E and Poisson's ratio ν. We assumed E = 200 and ν = 0.34. We created four different data sets with increasing data size. To this end, the problem was first solved in a classical fashion with the analytical constitutive equation (35). Next, the maximum and minimum values of all the three strain components across all the quadrature points in the whole domain were identified. Finally, we generated a material data set sampling for each of these strain components the interval between the respective maximal and minimal strain value by N 1D data = 15 × 2 q uniformly distributed data points, with q = 0, 1, 2, 3. After that, also the reference solution ( ref , σ ref ) at each quadrature point was added to the data set to enable the solver to find in principle at each point an exact solution. Altogether, this yielded a material data set of the size N q data = (15 × 2 q ) 3 + N element . To examine role of the hyperparameters, we defined the hyperparameters for the data-driven solution as That is, for γ = 1, the hyperparameters are equal to the tangent stiffness of the constitutive manifold in the stress-free condition. In addition to γ = 1, we also tested γ = 0.2, γ = 5, and finally also the case where the hyperparameters were determined in each iteration step according to the adaptive scheme introduced in this paper. The results are shown in Fig. 14. Apparently, also in this two-dimensional problem the best numerical efficiency is reached for hyperparameters comparable to the tangent stiffness; see Fig. 14 (left). If the hyperparameters are much larger or much smaller, this increases the computational cost especially for a large material data set. As this example focuses on small strain elasticity, the tangent stiffness of the material in the unloaded configu-ration is a good approximation for the tangent stiffness in the loaded configuration. Therefore, it is not surprising that the number of iterations obtained with γ = 1 is similarly low as the one obtained with adaptive hyperparameters. Fig. 15 Symmetric system of two trusses with equal cross section, which are aligned at an angle α relative to the horizontal direction ingly, in terms of the strain error norm the solution obtained with adaptive hyperparameters does not only outperform the one obtained with poorly chosen hyperparameters (γ = 0.2 or γ = 5) but also-though to a much lesser extent-the one obtained with reasonably chosen (γ = 1) but constant hyperparameters. As already seen from the comparison of computation time shown in Fig. 12 for the 2D truss system, it is reasonable to expect that the solver with adaptive hyperparameters (using the divide-and-conquer strategy) is more efficient than that with constant hyperparameters. However, the strategy of updating hyperparameters continuously with k-nearest-neighbor search and linear regressions should be avoided in general due to its excessive computational cost.

Conclusion
This work revisits the distance-minimizing method proposed by Kirchdoerfer and Ortiz [14] for data-driven boundary value problems in elasticity. Relying on the notion of the phase space of strain-stress states and its associated metric, the distance-minimizing method is formulated as a fixedpoint iteration scheme. The distance-minimizing method was introduced in its original form with constant hyperparameters influencing the final data-driven solution. Herein, we demonstrated that setting these hyperparameters equal to the tangent of the hidden constitutive manifold can not only reduce the computational cost substantially but also improve the accuracy of the solution finally obtained. As the tangent of the hidden constitutive manifold is a priori not known in most cases, we proposed a computational approach in which the hyperparameters are updated after each iteration in the fixed-point scheme. To ensure computational efficiency, the hyperparameters are allowed to vary only within a finite set constructed by combining linear regressions and a divide-and-conquer strategy. In the process of adapting hyperparameters based on estimating the constitutive tangents of the hidden constitutive manifold, we have subtly based our data-driven framework on a sort of de-facto constitutive model, although one that is particularly robust against noise in the material data.
Using several examples, we demonstrated the favorable numerical properties of this adaptive hyperparameter scheme, which can substantially reduce computational cost and improve accuracy compared to classical approaches with fixed hyperparameters. While we have presented above ample numerical evidence for our concept, we have not yet succeeded in supporting it by a rigorous mathematical proof for general cases. In Sect. 5.1.2 we presented such a proof for our ideas for a specific application example. This proof relied on the concept of the spectral radius. Unfortunately, we found in lengthy analyses that this type of proof can most likely not be extended in a way that captures also the most general case. Indeed, when working on such an extension, we found that there exist degenerate cases such as the one illustrated in Fig. 15 where the spectral radius does not become minimal if the hyperparameters are equal to the tangent of the hidden constitutive manifold but rather for zero hyperparameters. Interestingly, all such degenerate cases that we could construct also had the property that their special structure implied that the data-driven solution could be obtained in a single iteration step regardless of the hyperparameters. Therefore, although in these cases zero hyperparameters yielded the smallest spectral radius, they did in the end not lead to a faster convergence or more accurate solution than hyperparameters equal to the tangent of the constitutive manifold. Hence, these (rare and very special) cases are by no means in contradiction to the general ideas we presented in this paper. However, they yet reveal that developing a general mathematical proof for these ideas may require mathematically more advanced concepts than the one of the spectral radius. The identification and development of such concepts may form an interesting avenue of future research.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecomm ons.org/licenses/by/4.0/.