A monolithic algorithm for the simulation of cardiac electromechanics in the human left ventricle

: In this paper, we propose a monolithic algorithm for the numerical solution of the electromechanics model of the left ventricle in the human heart. Our coupled model integrates the monodomain equation with the Bueno-Orovio minimal model for electrophysiology and the Holzapfel-Ogden constitutive law for the passive mechanics of the myocardium; a distinguishing feature of our electromechanics model is the use of the active strain formulation for muscle contraction, which we exploit – for the ﬁrst time in this context – by means of a transmurally variable active strain formulation. We use the Finite Element method for space discretization and Backward Di ﬀ erentiation Formulas for time discretization, which we consider for both implicit and semi-implicit schemes. We compare and discuss the two schemes in terms of computational e ﬃ ciency as the semi-implicit scheme poses signiﬁcant restrictions on the timestep size due to stability considerations, while the implicit scheme yields instead a nonlinear problem, which we solve by means of the Newton method. Emphasis is laid on preconditioning strategy of the linear solver, which we perform by factorizing a block Gauss-Seidel preconditioner in combination with combination with parallel preconditioners for each of the single core models composing the integrated electromechanics model. We carry out several numerical simulations in the High Performance Computing framework for both idealized and patient-speciﬁc left ventricle geometries and meshes, which we obtain by segmenting medical MRI images. We produce personalized pressure-volume loops by means of the computational procedure, which we use to synthetically interpret and analyze the outputs of the electromechanics model.


Introduction
The heart plays the crucial role of pumping blood into the circulatory system by providing all sort of vital substances to the cells. Moreover, cardiovascular related diseases represent the leading causes of death in the whole world [60]. While advancements in medical practice are continuously improving patients conditions and diseases outcomes, recent progresses in mathematical modeling and computational mechanics allow to perform realistic cardiovascular numerical simulations [38,65,76,77,84,97,105,107], thus potentially providing medical doctors and clinicians with valuable diagnostic and predictive tools. Moreover, clinical data and the application of image segmentation techniques to Magnetic Resonance Imaging (MRI) and Computed Tomography (CT) scans feed, as inputs, the mathematical models, thus allowing numerical simulations in subject-and patient-specific frameworks [23,55]; in addition, uncertainty quantification techniques allow to estimate the models parameters and data, and to cope with their variability [30,59].
The mathematical modeling of the heart involves several challenges intrinsically related to the complexity of its function [17,20,33]. A satisfactory model must be able to describe a wide range of different processes, such as the evolution of the transmembrane potential in the myocardium, the deformation caused by the muscles contraction, and the dynamics of the blood in the heart chambers and through the valves [31,71,76,77,96,98,99]. All these processes feature different temporal and spatial scales, yielding the so-called tyranny of scales [8]. A satisfactory knowledge of the models for isolated processes -the electrophysiology, the active and the passive mechanics -which we refer to as "single core models", is nowadays quite established; however, further theoretical and numerical studies are still necessary to better understand their mutual interactions [18,22,30,82]. In this work, we use state-of-the-art models in passive myocardial tissue modeling -the Holzapfel-Ogden model [46] -together with the active strain formulation [2,3] in combination with a recently proposed model for the transmurally heterogeneous thickening of the myocardium [7]; the latter is for the first time used in this paper for the integrated electromechanics modeling of the left ventricle (LV). The link between electrophysiology and mechanics is finally established through a model describing the shortening of the myocardial fibers [88], which is in turn triggered by a change in the ionic concentrations in the cardiac cells.
From the numerical viewpoint, we discretize in space the continuous single core models by means of the Finite Element Method (FEM) with both linear and quadratic elements, while the time discretization is carried on using Backward Differentiation Formulas (BDFs) of orders 1 and 2 [78]. BDFs are used both within implicit and semi-implicit schemes, the latter consisting in equal-order extrapolation of the unknowns in the nonlinear terms [16,37]; however, the semi-implicit scheme poses strong limitations on the choice of the timestep size with respect to the implicit scheme, even if the latter yields a nonlinear problem, which we approximate by means of the Newton method. Integrating the discrete single core models leads to the formulation of a monolithic algebraic coupled problem. Numerical coupling of cardiac electromechanics is however typically performed by means of segregated or staggered approaches, for which the electrophysiology and mechanics solvers are not applied simultaneously [4,5,18,38,54,84,107]. It is however known that partitioned schemes (segregated or staggered) do not generally guarantee unconditional stability [15], an issue not concerning instead the monolithic scheme.
Monolithic schemes for cardiac electromechanics of the heart were firstly proposed and analyzed in [24,25], where only the contraction phase was simulated and the blood pressure at the endocardium (the LV inner wall) was neglected. More recently, a monolithic scheme including a 0D model for the vascular system, heart valve, and atrial chamber model was proposed in [44]. However, other than being less explored, monolithic schemes have been used so far only for cardiac electromechanics within the framework of the active stress formulation and only for idealized or simplified LV geometries. Instead, in this paper we propose and successfully use a monolithic algorithm for the numerical simulation of cardiac electromechanics in the framework of the active strain formulation; in addition, we simulate full cardiac cycles (one heartbeat) for both idealized and patient-specific geometries. Essential components of our framework are: modeling FSI at the LV endocardium wall by means of 0D models for the pressure variable along the heartbeat ( [30,84,107]) and the prestress technique, which we apply to the patient-specific LVs to estimate the internal stresses of the myocardium at the initial time of the simulation [47,100]. We solve the large, sparse block linear system stemming from the monolithic strategy by means of the GMRES method and, in order to speed-up the convergence of the linear solver, we employ a novel (right) preconditioner [89]. Our preconditioning strategy extends the one proposed in [27] for FSI problems and is based on the factorization of a block Gauss-Seidel preconditioner which exposes the multiphysics nature of the integrated problem, thus allowing to adapt its action on each single factor of the preconditioner. This strategy can be easily extended to a wide range of integrated multiphysics problems: the factors are indeed independently preconditioned by using algebraic multigrid [11] or domain decomposition [14,104] preconditioners tailored by exploiting physics-specific information (such as the number of equations) for each block; this local information would be instead lost by using a global monolithic preconditioner.
We use our monolithic electromechanics solver to perform numerical simulations in the High Performance Computing framework of the whole cardiac cycle, both for idealized and patient-specific LV geometries, and we analyze the numerical results in terms of clinically relevant indicators; specifically, we produce the so-called pressure-volume loops in order to assess the LV function and its properties.
The paper is organized as follows: in Sec. 2 we introduce the mathematical models for the electrophysiology, the mechanics and the activation of the myocardium; we then integrate them thus obtaining a continuous integrated model. In Sec. 3 we carry on the space and time numerical approximations of the single core models; in Sec. 4 we introduce the preconditioner used to solve the monolithic linear system arising after the time and space discretizations. In Sec. 5 we report and discuss the numerical results obtained with the proposed methods, and we finally draw our conclusions in Sec. 6.

Mathematical models
The myocardium is a complex tissue composed of cardiomyocytes, organized in fibers and laminar collagen sheets [94], characterising the LV orthotropic internal structure. Therefore, the material properties of the LV are strongly dependent on the direction of fibers and sheets. First, the electrical conductivity of the cardiomyocytes is much larger in the longitudinal direction than transversally [52,75]; hence, at the macroscopic level, the transmembrane electric potential travels faster along the fibers. Secondly, it has been experimentally observed in [46] that the response of internal stresses to an external load significantly varies when measured among different directions since the myocardium is stiffer along the fibers. Finally, the contraction of the LV is made possible thanks to an active force acting on the cardiomyocytes lined up along the fibers direction [86]. In order to mathematically define fibers and sheets, we identify a local frame of reference by defining the mutually orthonormal vector fields f 0 (fibers), s 0 (sheets) and n 0 (aka normals), where n 0 is such that n 0 , f 0 , and n 0 are mutually orthogonal, as depicted in Figure 1. The fiber orientation f 0 varies transmurally, while the sheets direction s 0 (which is oriented as the normal to the collagene sheets) is orthogonal to the LV walls. The n 0 direction is orthogonal to both f 0 and s 0 .

Electrophysiology
Electrophysiology models take into account the electrochemical reactions occuring in the myocardium [21] triggered by an electric impulse originated at the sino-atrial node and then conveyed through the Purkinje fibers [20]. Such signal causes a quick depolarization of the LV cardiomyocytes, meaning that the transmembrane potential (i.e. the difference in electric potential between the interior and the exterior of a cell) changes sign in few microseconds. The potential drives a change in the concentration of different ionic species flowing through the so-called ionic gates located on the cellular membrane; the concentration of these ionic species, in turn, influences the potential thus slowly repolarizing the cells. The continuous interaction between the ions concentration and the potential causes a cascade effect for which a fast traveling wave known as action potential propagates in the whole myocardium [57].
In this work, we consider the monodomain equation for the description of the evolution of the cellular transmembrane potential V, a nonlinear diffusion-reaction equation obtained by homogenization of the bidomain equations [20,48,75,92]. The latter is indeed a richer, but more complicated model than the monodomain equation which is required for pathological conditions. In physiological conditions, the monodomain model is adequate and reads: Here, Ω 0 is the reference computational domain, a smooth and bounded subset of R 3 represented e.g. by the configuration of the LV at the end of the diastolic phase, and T > 0 is the final time. The parameters χ and C m ∈ R + are the ratio of membrane surface with respect to the volume and the membrane capacitance, respectively. In order to take into account the anisotropic electrical conductance [90], we define the diffusion tensor -a second order tensor in where σ t , σ l ∈ R + are the electric conductivities in the directions transversal and longitudinal with respect to the fibers, respectively. The current geometry displacement d = X − x, with d : Ω 0 −→ R 3 , also influences the diffusive term since the second order strain tensor F = I + ∂d ∂X and J = det(F), where X and x are the reference and deformed coordinates, respectively; for J > 0, the second order tensor JF −1 D m F −T has uniform elliptic properties. The function I app (t) represents an externally applied current, which stands for the electric stimulus injected at the endocardium by the terminal fibers of the Purkinje network; for our purposes, we consider it as a source term which triggers the electrophysiological activity. The nonlinear term I ion (V, w) in Eq. 2.1 depends on the ionic variable w and is peculiar of the ionic model at hand. In the Hodgkin-Huxley formalism [45], a ionic model takes the form: where the unknowns w i ∈ [0, 1] represent the ions concentration and/or the fraction of open ionic channels on the cellular membrane. Among the manychoices proposed in literature -see e.g. [1,57,58,64, 102] -we use the Bueno-Orovio minimal model [12] for its simplicity (for which N I = 3); nonetheless, this model is capable of capturing the main features of the electrophysiology in healthy myocardial tissues. The system of differential equations modeling the electrophysiology hence reads: since χ = C m = 1 as prescribed in [12], where the monodomain equation is presented in dimensionless form; moreover, I ion (V, w) = q∈{ f i,so,si} I q (V, w). Albeit a system of ODEs, the ionic model is defined in Ω 0 × (0, T ) since the dependence on V indirectly introduces a dependence on the space independent variable. The terms of the ionic model are: Here H a (z) is the Heaviside function centered in a ∈ R and its smooth approximation is H ε a (z) = 1 + tanh( (z − a)) 2 , with ∈ R + .

Tissue passive mechanics
An adequate mechanical model for the description of the myocardium's displacement must account for the tissue's complex behavior. Firstly, the internal stresses induced by a prescribed deformation are highly anisotropic [41] and in our formulation depend on the directions f 0 , s 0 , and n 0 . We model the compressibility of the tissue through a nearly-incompressible formulation by weakly penalizing large volumetric variations [95] since with this approach small volumetric changes are allowed. Finally, the contraction of the muscle due to the electrophysiological activity must be taken into account: with this aim, we introduce the auxiliary dimensionless variable γ f , which represents the relative stretching (or elongation) of the fibers. The model that we use to describe the evolution of γ f will be detailed in Sec. 2.3 as it constitutes the link between the electrophysiology and the mechanics.
We recall the momentum conservation equation in the reference configuration Ω 0 , endowed with boundary and initial conditions, in the unknown displacement variable d [66]: Here Γ η 0 , with η = {epi, base}, represents the subsets of the boundary corresponding to the epicardium and the base of the myocardium as depicted in Figure 2.
We denote by , a vector in R 3 , the zero-th order term of the Robin boundary condition and by K η ⊥ , K η , C η ⊥ , C η ∈ R + its parameters: the symbols ⊥ and identify either a parameter relative to the normal or the tangential direction at the corresponding boundary subset γ η 0 , respectively. p endo (t) is the external load applied by the fluid at the endocardium wall which, at this stage of the model description only, we assume to be prescribed. N is the outward directed unit vector normal to the boundary; d 0 andḋ 0 are the initial data. The information related to the mechanical behaviour is embedded in the nonlinear Piola-Kirchhoff strain tensor P = P(d, γ f ) -a second order tensor in R 3 -which also must incorporate the active properties of the muscle. In order to characterize P, we first define the right Cauchy-Green tensor as C = F T F, where F = I + ∇ 0 d is the strain tensor, and we introduce the strain energy function W(C) : R 3×3 −→ R which relates the strain energy of the material to the strain tensor. The tissue mechanical properties are taken into account through the strain energy function: under the hyperelasticity assumption, the latter is differentiated with respect to the deformation tensor in order to obtain the Piola-Kirchhoff strain tensor, i.e.: A very popular model for the myocardial tissue is the Holzapfel-Ogden [46] one. This is obtained by considering different contributions and by taking into account the anisotropic nature of the muscle: where I 1 = tr C, I 4 f = C : f 0 ⊗ f 0 = f · f, I 4s = C : s 0 ⊗ s 0 = s · s, and I 8 f s = C : f 0 ⊗ s 0 = f · s are the invariants of the tensor C; the parameters a k , b k are fitted from experimental data [46]. The function y = y H 0 (y) indicates the positive part of y and its role consists in switching off the contributions of the fibers and sheets to W when the material is under compression along these directions. The mechanical model should also account for the volumetric change to which the myocardium undergoes during the cardiac cycle. It has been observed in [19,113] that albeit this change is moderate, still it significantly ranges from 2% to 15%.
For these reasons we use a nearly-incompressible formulation, which allows for small volume variations [28].
We multiplicatively decompose the deformation gradient F into the isochoric and the volumetric parts as: where J = det(F v ) = det(F), being det(F) = 1, and we weakly enforce the incompressibility constraint by adding to the strain energy function W a convex term W vol (J) such that J = 1 is its global minimum; in this manner, large variations in volume are penalized. We choose: such that the larger is the bulk modulus B ∈ R + , the "stronger" is the enforcement of the incompressibility constraint. Following [93], we evaluate the isotropic term W 1 in . The energy function hence reads: We now proceed by modeling the active behavior of the myocardium driven by the stretching of the representing the active part of the deformation between the reference domain Ω 0 and the deformed one Ω (see Figure 3), is introduced. The domain Ω is reached from Ω 0 by applying a prescribed active transformation (which we will specify later) represented by the tensor F A . On the other hand, the material's elastic response to the prescribed active transformation is embedded in the tensor F E and finally transforms Ω into Ω. Mathematically, this approach requires a decomposition in the form where we also take into account the factorization (2.5) for the term F E . Finally, we define P in Ω 0 with respect to the total displacement d of the tissue by applying a pull-back to the stress computed in the intermediate state Ω, i.e.: In Sec. 2.3, we will provide the explicit form of the tensor F A under the requirement of symmetry and identity of its determinant. Under these assumptions, the final form of the tensor P reads:

Mechanical activation
The activation model of the myocardium represents the link between the electrophysiology and the tissue (passive) mechanics. Instead of cellular models describing the complex dynamic taking place inside the sarcomeres [81], we exploit a phenomenological model for the local shortening of the fibers γ f at the macroscopic level. This model has been proposed in [88] and further developed in [84], and assumes that the evolution of γ f is due to the concentration of calcium ions [Ca 2+ ] and by a feedback from the mechanics (through the variable d): With respect to the formulation [84] we added the diffusive term ε∆γ f in (2.8) to yield a model in the form of a PDE. While this is not strictly motivated by physical considerations, it can be interpreted as the upscaling of the microscopic activation at the macroscopic continuum level of the tissue. Moreover, this choice yields a more regular solution γ f in terms of the space variable X, from which the numerical approximation will also benefit.
The contraction of the tissue is triggered by the calcium concentration exceeding a threshold value c 0 . The parameters α and µ A represent quantities to be properly tuned for the case under consideration, while R FL is the sarcomere force-length relationship [39] of cardiac cells which we represent as truncated Fourier series d n sin(nl 0 z 1/2 ) + e n cos(nl 0 z 1/2 ) χ [S L min ,S L max ] (z 1/2 ). The calcium concentration is not explicitly represented in the set of variables w in the Bueno-Orovio model; however, the variable w 3 acts as a generic ion concentration, for which it can be interpreted as c = [Ca 2+ ]; this choice has been already made in literature e.g. in [84,85]. Being γ f the solution of (2.8), we choose the following orthotropic form for the tensor F A [3,6,73,84,85]: which is symmetric and we set γ n = γ n (γ f ), γ s = γ s (γ f , γ n ). In analogy with γ f , these functions represent the local shortening (or elongation) of the tissue in the directions s 0 and n 0 , respectively. Following [7], we define γ n such that, according to experimental observations [67], the thickening of the ventricle's walls is transversely non-homogeneous: Indeed, the latter depends on an independent variable λ which represents the transmural coordinate, taking the value λ endo at the endocardium and the value λ epi at the epicardium. As detailed in [7] where the results of numerical simulations are compared and validated against experimental data for strains in the canine LV provided in [67] -this model is able to capture the transmural heterogeneity of the thickening of the LV. The function k (λ) is defined as:

The coupled model: electromechanics
Writing together Eqs.(2.3), (2.4), and (2.8), the coupled electromechanics problem finally reads: (2.10) We remark that at this stage the pressure p endo (t) is still prescribed: however, later in Sec. 4.1, we will consider p endo (t) as an additional unknown of the coupled problem, being the solution of 0D fluid problems for each of the phases of the cardiac cycle.

Prestress
A common problem which has to be considered in biological modeling involving a fluid-structure interface is that the reference geometry Ω 0 , acquired from medical images at the telediastole (the phase immediately before the systole), does not necessarily correspond to a stress-free configuration. This because the blood exerts a pressure on the endocardium walls p endo (t) which, at each time instant of the heartbeat, is larger than zero, taking values ranging approximately from a minimum of 5 mmHg to a maximum of 120 mmHg in healthy individuals. In turn, this implies that solving problem (2.4) with a physiological endocardial pressure p endo > 0 would give rise to non-physiological displacements as the internal stresses are not in equilibrium with the intraventricular blood's pressure of LV. This issue is particularly evident in the case of patient-specific settings since, unlike the case of idealized geometries, the actual computational geometry is obtained from medical images and hence the reference domain Ω 0 cannot be arbitrarily chosen. Typically, the LV geometry is acquired at the so-called telediastole and the electromechanics (or mechanics) model initiated at this stage. The corresponding pressure is indicated with p endo and the stressed LV configuration is determined in these conditions. To our knowledge, two strategies have been proposed in literature to address this issue.
Pressure preload ( [30,84,101,103]): the reference geometry Ω 0 is loaded with the prescribed pressure p endo . This is done by solving the steady variant of the mechanics problem (2.4) while gradually increasing the pressure until the desired value p endo . The displacement field so obtained is then used as an initial datum d 0 for the unsteady problem.
Pressure prestress ( [47,100]): we compute internal stresses distribution such that the reference geometry is in equilibrium with the blood pressure p endo . An additive decomposition of the stress tensor P = P(d) + P 0 is operated, where the prestress tensor P 0 is determined to ensure a null displacement d 0 in correspondance of the assigned pressure p endo .
We adopt the pressure prestress approach since in the preload one the procedure returns a configuration which might be significantly different with respect to the initial geometry as shown in [47]. Indeed, we already know the loaded configuration from medical images. In order to compute P 0 according to this approach, we proceed by adapting the method proposed in [47] to our model by first defining the following mechanical problem: Eq. (2.11) is the steady, passive version of problem (2.4) with the additive decomposition of the strain tensor. Moreover, we set: where S ∈ N is the number of steps of the continuation method that we exploit to gradually increase the pressure value. Then, the fixed point Algorithm 1 is applied to compute P 0 . First, we compute the approximation P 0 = Prestress(100, 10 −2 , p endo , 0) and finally we set P 0 = Prestress(1, 10 −5 , p endo , P 0 ). The additional step is performed to require a smaller tolerance when the pressure has already reached a closer value of the tensor P 0 to the target. We observe that, while does not converge to 0 but to a vector which we denote by d. However, we observe that the quantity d ∞ is negligible with respect to the endocardial walls thickness, and that this initial displacement ensures that the prestress is in equilibrium with the pressure at the epicardium. Therefore, we decide to set d 0 = d in (2.10). 1: function Prestress(S , tol, p, P 0,0 ) 2:

Numerical discretization
In this section we describe the numerical approximation of the electromechanics problem (2.10). The FEM [78] is used for the space discretization of the PDEs, while BDF [78] are used for the time discretization.

Space discretization
We consider a mesh composed of tetrahedrons T h , with h representing the maximum size of the elements K ∈ T h , such that ∪ K∈T h K = Ω 0 ; the mesh elements are pairwise disjoint and their union Ω 0 ⊂ R 3 is the region of the space identified by the myocardium in the telediastolic phase of the heartbeat. In this work, we consider two LV geometries, that is an idealized prolate ellipsoid (as is often done in literature [30,40,84]) and a patient-specific geometry extracted through a segmentation procedure from 3D MRI images * , as we will describe in Sec. 5.1. We will approximate each of the single core models in the computational domain with a space discretization based on the FEM. We will denote by N dof V , N dof w , N dof d , and N dof γ f the number of Degrees of Freedom (DoF) (i.e. the size of the discretized single core model) for the potential, ionic variables, displacement, and fiber shortening, respectively. The underlying number of nodes determined by the mesh T h and the degree r is indicated as N h . Hence, we have that, for scalar PDEs as the electrophysiology, N dof V = N h .

Monodomain equation
We use the FEM for the spatial approximation of the monodomain equation (2.1). We first introduce the finite dimensional space X r h = v ∈ C 0 (Ω 0 ) : v| K ∈ P r (K) ∀K ∈ T h , where P r (K) is the set of polynomials of degree smaller than or equal to r in the element K. Moreover, we denote by as V h (t) = N dof V j=1 V j (t)ψ j and the weak semidiscrete formulation of the problem reads: given w h (t) and d h (t), find, for all t ∈ (0, T ), V h (t) ∈ X r h such that , we rewrite Eq. (3.1) as a system of nonlinear ODEs: We will discuss in Sec. 3.1.3 two different strategies for the approximation of the nonlinear term I ion (V h , w h ). Moreover, we will use a lumped mass matrix M L in place of M in Eq. (3.2) in order to avoid numerical instabilities, a known numerical issue that may occur in the case of problems with "traveling waves" due to the dominance of zero order terms over the second order ones [13].

Ionic model
The ionic model (2.2) is a system of ODEs that indirectly depends on the space variable through the transmembrane potential V. By denoting with x j N dof w j=1 the set of the degrees of freedom, we write the equations of the model evaluated at each of these points and we denote the value of the l-th ionic variable in x j by w l j (t). Similarly, we write V j (t) = V h (x j , t), and finally rearrange the unknowns in the vector w h (t) in the following fashion: The problem thus obtained reads: given V h (t), find, for all t ∈ (0, T ), w h (t) such thaṫ with w l j (0) = w l 0 , for l = 1, . . . , N I , j = 1, . . . , N dof w . Following Eq. (3.4), system (3.5) can be conveniently rewritten in algebraic form as where the block matrix U and the block vector Q are defined as (U the quadrature nodes and the corresponding weights in a generic mesh element K ∈ T h , we consider two approaches which are investigated, for instance, in [53,68,69,70]. State Variable Interpolation (SVI): the variables V h and w h in Eq. (3.3) are evaluated at the quadrature nodes This approach corresponds to the standard FEM approximation.
Ionic Currents Interpolation (ICI): for each element, I q is evaluated at the degrees of freedom of V and its value at the quadrature nodes is obtained by interpolation through the same Lagrangian polynomial basis of degree r used for the FE space.
The two approaches are equivalent if I q is linear in V h and w h . Both the approaches tend to overestimate the conduction velocities if the computational mesh is not "sufficiently" fine [62], but yield convergent results under h-refinement. The SVI approach corresponds to a standard FE approximation, while the ICI one yields a faster assembly of the ionic currents term [53,68,84] but introduces an error in the evaluation of I ion (V h , w h ). In our case, as we will describe in Sec. 5, the overall time required for the assembly of the terms of the system arising from the ful discretization of Eq. (2.10) is mostly determined by the construction of the mechanics terms, while the assembly of the ionic currents term does not represent a computational bottleneck; we hence use the SVI method since the advantage of using ICI here is negligible.

Active and passive mechanics
As previously done for the monodomain equation, we use the FEM to approximate the momentum equation (2.4 We rewrite it in algebraic form as: Finally, we once again use FEM to discretize in space the equation for the unknown γ f : given c h (t) and d h (t), find, for all t ∈ (0, T ), γ f,h (t) ∈ X h such that We highlight that, with respect to Eq. (2.8), we divided each term by g(c h ). Thus, we obtain the following system of ODEs:

Time discretization
After having applied the space discretization to the single core models, we obtain the semi-discretized formulation of problem (2.10) in the form of a nonlinear system of ODEs. We denote by z = (z w , z V , z γ f , z d ) T the block vector containing the unknowns of each semi-discrete single core problem, where the ordering of the unknowns will be motivated in Sec. 3.2.2, and we write: , d 2 dt 2 is a differential operator which applies a first order time derivative to the ionic variables, the transmembrane potential and the fibers shortening (motivating the division by g(c h ) of the corresponding equation), while a second order time derivative to the displacement. In order to obtain a fully discretized formulation, we use the BDF for the time approximation of Eq. (3.6). Hence, we write:ż where ∆t = T N T is the timestep, N T being the number of timesteps, while the parameters ϑ (I) k , ϑ (II) k , k = 0, . . . , σ depend on the order σ of the BDF scheme. We will in particular use BDF of order σ = 1 and 2, and will consider two schemes for the time discretization of the monolithic problem: a fully implicit and a semi-implicit one.
In the implicit case, we obtain the following nonlinear system: with z k assigned for k = 0, . . . , σ and we set for simplicityḋ 0,h = 0. Problem (3.7) is solved by exploiting the Newton method [78] at each timestep.
In the semi-implicit case, on the other hand, we extrapolate the variables in the nonlinear term A(z n+1 ) by means of the Newton-Gregory backward polynomials [16] -as is done, e.g., for the Navier-Stokes equations in [37] -thus yielding a linear system at each timestep. The extrapolated variables are evaluated as a linear combination of the variables at previous timesteps, with an approximation of the same order σ of the BDF scheme: We then avoid the nonlinear terms by partially evaluating A in the extrapolated variable z * , i.e. we approximate the nonlinear term as A(z n+1 ) ≈ A(z * )z n+1 + g n+1 for n = σ, . . . , N T − 1.

The implicit scheme
By applying the Newton method [78] to (3.7), we iteratively solve for n = σ, . . . , N T − 1 the linear problem for k = 0, . . . , until some convergence criterion is met. J n+1 k is the Jacobian matrix of A evaluated in the z n+1 k and is endowed with the following block structure: while the residual is defined as r n+1

The semi-implicit scheme
In this case, the block structure of the matrix associated to linear system (3.8) to be solved is sparser with respect to the implicit one, as A is a block lower triangular matrix endowed with only one extra diagonal block for each n = σ, . . . , N T − 1: (3.10) The matrix (3.10) is block lower triangular thanks to the ordering of the variables in the electrophysiology model (3.6): indeed, by swapping the ionic and the electric blocks we would have obtained a block upper triangular matrix. The semi-implicit scheme has the clear advantage of avoiding, at each timestep, the solution of a nonlinear problem. Moreover, both the assembly of the system matrix A(z * ) and the solution of the linear system (3.8) require smaller computational time than in the implicit case.
On the other hand, semi-implicit schemes may impose strong limitations on the timestep size ∆t to ensure stability. This is indeed what we observe from our numerical tests: the maximum timestep size that we used in order to ensure stability for the semi-implicit scheme is at least one order of magnitude smaller than the one that used for the implicit one, for which accuracy is the main factor driving the choice of ∆t. This, in turn, makes the computational cost of the semi-implicit scheme much larger than the implicit one, especially when considering the simulation of a full heartbeat. By analyzing the behavior of the linear solver (which we will detail in Sec. 4) and the residual of the system (3.8), we observe that numerical instabilities are driven by the mechanics block: we conclude that the strong nonlinearity of the Piola-Kirchhoff tensor (2.7) and the presence of the exponential terms in particular yield evaluations of the stress tensor P(d * h , γ * f,h ) in the extrapolated variables that are not "sufficiently" close to P(d n+1 h , γ n+1 f,h ), unless the timestep is significantly "small". Indeed, instability does not appear in numerical simulations of the isolated electrophysiology problem, even using a larger timestep with respect to the one used for the monolithic problem, thusconfirming that the bottleneck in the choice of ∆t is due to the mechanics core model.
We will further investigate this issue in the future; however, for the next numerical simulations of this paper we will consider only the implicit scheme.

Linear solver: the preconditioning strategy
We rewrite, for the sake of simplicity, the linear system associated to a single Newton iteration for the implicit scheme (3.9) in the following form: We use the GMRES method [89] for the solution of the linear problem (4.1) as J is non-symmetric and the distribution of the eigenvalues of its spectrum is not known a priori. The choice of the preconditioner is critical in order to ensure the convergence of the linear solver; while this is true in general, it is even more relevant in the case of monolithic multiphysics problems [51]. Indeed, using a black-box algebraic preconditioner for problem (4.1) the information related to each differential problem associated to a single core model would be neglected; we instead consider a strategy exploiting such information at the block level, that is we create a preconditioner that exploits the "physics" of the coupled problem at the level of the block structure. Following [26,27,35] for FSI problems, we propose a block Gauss-Seidel preconditioner P obtained by dropping the upper triangular blocks of matrix J, i.e. the off-diagonal blocks, thus obtaining: P can then be factorized into four model-specific nonsingular matrices, namely P ion , P pot , P act , and P mec corresponding to the ionic, the potential, the activation, and the mechanics single core models, respectively: This decomposition can also be interpreted as an inexact factorization of matrix J. The preconditioned version of problem (4.1) then reads: Since each diagonal block J ii appears in a distinct factor P i , for i = 1, . . . , 4, then physics-specific adhoc preconditioners can be efficiently used to approximate its inverse. Indeed, we define the symbolic operation δz = P −1 y in (4.2) as the application of the following sequential steps the solution of each linear system in (4.3) is carried out by using again the GMRES method and by exploiting Algebraic Multigrid (AMG) preconditioners [11]. This new preconditioner P can be regarded as a generalization of the FaCSI preconditioner for FSI problems proposed in [27] (see also [26,35]).

Cardiac cycle
For our simulations we will consider a full heartbeat, by taking the conventional duration of T = 0.8 s. With this aim, we take into account for the interaction of the endocardium with the blood by modeling the pressure p endo as in Eq. (2.10). Before introducing the models used to describe such pressure, we first recall that the heartbeat is conventionally split into four phases (see Figure 4): (1) an isovolumic contraction phase in which the endocardial pressure p endo (t) increases from the End Diastolic Pressure (EDP) to the value measured in the aorta (about 95 mmHg). This increment is driven by the early stages of the LV contraction; (2) an ejection phase characterized by a decrement in the ventricular volume V endo (t) due to the contraction of the LV forcing the blood to flow through the aortic valve; (3) an isovolumic relaxation phase during which p endo (t) decreases as a consequence of the LV early relaxation; (4) a filling phase starting with the opening of the mitral valve causing an increment of V endo (t) until p endo (t) reaches the EDP value.
When necessary, we compute the volume V endo (t) at time n by exploiting the formula V endo,n = Γ endo 0 J(d n h )ξ · F −T (d n h )N dΓ 0 , which is rigorously derived in [84] and where ξ is a vector directed as the centerline of the LV.
We then model the endocardial pressure p endo (t) with different 0D models, following [30,84,107], for each of the aforementioned phases (in the following, we drop the "endo" superscript for simplicity): 1) Isovolumic phase I: At each timestep, we iteratively solve problem (2.10) by updating at each subiteration the pressure in the following manner: < ε is satisfied. The parameter C p < 0 has to be "sufficiently" large in order for the fixed point algorithm to converge. This phase ends when the pressure p n+1 k+1 reaches the value p = 95 mmHg. 2) Ejection phase: A two-element Windkessel model [110] of the form: is solved in the pressure variable with a BDF scheme of order σ = 1 while the term dV dt is approximated at time n + 1 as V n −V n−1 ∆t , for simplicity. T and T are the initial and final time of this phase, respectively, while the parameters C, R > 0 represent the capacitance and resistance of the equivalent electric circuit. This phase ends when the (initially negative) term dV dt changes sign. 3) Isovolumic phase II: Modeled as the first isovolumic phase. This phase ends when the pressure reaches the minimal value of p = 5 mmHg.

4) Filling phase:
The pressure is linearly increased at each timestep so that it reaches the EDP value at the final time T . We are aware that this is not fully coherent with the real behavior of the diastolic phase, but a model for the muscle and the function of the left atrium are not taken into account in this work. Future work should better address this points to represent the full heartbeat in a detailed fashion.
Even if (4.5) is strongly coupled with (2.10) during the ejection phase, for simplicity we solve the two problems in a segregated fashion.

Numerical simulations
We now describe the geometries used for the numerical simulation of the integrated electromechanics problem. As anticipated in Sec. 3, we use both an idealized prolate geometry and a patient-specific geometry segmented from MRI images as detailed in Sec. 5.1. Moreover, in Sec. 5.2, we outline the procedure that is exploited to define the fibers and the sheets fields on the different meshes. We conclude this section by showing and analyzing the results of the simulations.

Patient-specific geometry segmentation
Image segmentation is the process of locating regions of interest (ROI) in the form of a subset of pixels [42]. In biomedical applications, this accounts to assign different flags to regions containing different types of tissues and/or fluids. This result, depending on the properties of the biological Figure 5. The patient-specific mesh and its projection on three slices of the 3D MRI image from which it was segmented.
material which is to be segmented, can often be achieved through semi-automatic or automatic procedures (see e.g. [32,49,106] for arteries and blood vessels and [10,109] for the Purkinje network), exploiting a large set of different techniques. However, since the development of algorithms for the segmentation of the chambers of the heart [72,114,115] is beyond the scope of this work, we used a manual procedure based on the brightness of the pixels of the aforementioned 3D MRI images. We first apply a threshold filter to select the smallest set of pixels containing the whole myocardium; then, we manually remove artifacts and features that we decide to neglect such as the papillary muscles and the upper part of the LV. Finally, a Gaussian smoothing procedure [111] was performed to improve the quality of the mesh. See Figure 5.
The image was taken at the end of the diastolic phase, that is when the LV reaches its maximum enlargement. The internal volume of the patient-specific myocardium at this stage of the heartbeat measures approximately 95 ml.

Fibers and sheets distribution
Unlike the geometry, the fibers and sheets field distribution in the myocardium may not be extracted from medical images such as MRIs unless special procedures are applied [80]. For this reason, several mathematically rule-based definition of the fields have been used in literature [38,56,61,86], which try to approximate their orientation. At the epicardium and at the endocardium, the fiber direction is tangential to the boundary, while the sheet direction belongs to the plane identified by the normal and the ventricle centerline. Then, in the most general case, angles α endo , α epi , β endo , and β epi , representing the inclination of the fibers and the sheets with respect to the base plane, are assigned. Finally, the direction of fibers and sheets inside the myocardium is determined by a transmurally linear mapping. A first study of the influence of the angles on both the conductivity and the deformation was carried out in [30]. Since this kind of analysis goes beyond the scope of this work, we will consider for both the idealized and the patient-specific geometries the algorithm proposed in [112] and further developed in [84], thereforse setting α endo = −60 • , α epi = +60 • , β endo = β epi = 0 • . In Figure 6, we show the fields obtained by applying the algorithm to a set of subsequently refined ideal meshes, while in Figure 7 the same is done for the patient-specific mesh.

Numerical results
We setup a total of five numerical simulations, each for a single heartbeat, using the four meshes shown in Figures 6-7. The monodomain, the activation, and the mechanics equations are approximated with P r elements; the ionic model equations, on the other hand, are solved in the degrees of freedom determined by the discretization of the monodomain equations (e.g. the vertices of the tetrahedrons if r = 1). We set r = 1 for each mesh in order to limit the size of the monolithic system and, additionally, r = 2 for the coarse mesh only. This yields a linear system of size M = 8 × N h . A second order BDF scheme (σ = 2) is considered for the time discretization in all cases to ensure A-stability while maximizing the convergence order [78]. The information on the meshes and on the numerical simulations is summarized in Tables 1 and 2, respectively. We use LifeV † , an open-source finite element library for the solution of problems described by PDEs in a High Performance Computing framework, to implement the numerical methods. All the computations were carried out using Piz Daint, a Cray XC50/XC40 supercomputer installed at the Swiss National Supercomputing Center (CSCS) ‡ .
As detailed in Sec. 4 we exploit the Newton method for the solution of the nonlinear system (3.7) by setting a maximum number of 5 iterations per timestep. Moreover we use the relative residual as stopping criterion, with a tolerance equal to 10 −7 . At each Newton iteration (3.9), as detailed in Sec. 4, we use the GMRES method for the inversion of the blocks J ii , i = 1, . . . , 4 together with AMG preconditioners by taking into account the number of underlying PDEs of each block; we exploit the ML package [36] of the Trilinos library [43] by performing three sweeps of the Gauss-Seidel algorithm for pre-and post-smoothing, while the solution on the coarsest level is obtained through an LU factorization. We consider the relative residual as stopping criterion for the GMRES method, with a tolerance equal to 10 −8 . For simplicity, we initiate the electric signal propagation by applying at the same time 2-milliseconds long stimuli at three distinct points on the endocardium; we remark that, even if this pacing strategy is not fully realistic since the electrical signal delivered by the Purkinje network activates asynchronously hundreds of cells [83,108], it provides physically meaningful results. The other parameters used for the simulations are reported in Table 3.
We compare in Figure 8 the transmembrane potential obtained using r = 1 elements on the three idealized meshes at different times. As expected, the conduction velocities are overestimated when the mesh size is not sufficiently fine [9,29]. The same conclusion can be drawn by observing the plots in Figure 9, where the transmembrane potential sampled at the apex is represented against time: the delay of the action potential (the quick depolarization of the tissue followed by a slow repolarization [21]) in the finer meshes is due to the longer time needed for the wave to reach the apex. We display in Figure 10 the transmembrane potential for the patient-specific case at the same instants.
We observe from Figure 9 a difference of several milliseconds in the complete activation of the myocardium, which is significant in the electrophysiology characteristic time scales. However, because of the multiscale nature of the integrated problem, the mechanics is not affected by such delay as can be observed in Figure 11. Here, the only remarkable difference between the three results is the underestimation of the displacement magnitude in the simulation with the coarsest mesh (a). In this case, the number of degrees of freedom is not sufficient to either fullfill the nearly-incompressible constraint nor to represent the large deformations observable in the other two cases. The deformation of the patient-specific mesh (d) at the same times is shown in Figure 12.       In both the idealized and the patient-specific cases, a significant thickening of the myocardium walls takes place, which is in accordance with experimental observations [79]. The model, with the set of parameters in Table 3, produces however a significant rotation of the LV: a recent work [74] suggests that this behavior is related to the choice of the incompressibility constraint, the bulk modulus B magnitude, and the boundary conditions. As a first step towards the investigation of this aspect, we report in Figure 13 the muscle obtained with different values of the bulk modulus B, while all the other parameters are kept unchanged with respect to Table 3 Larger values of B correspond to a larger torsion, more accentuated and uniform along the ventricle's walls; moreover, the thickening of the myocardium is larger when the bulk modulus is smaller as expected, since the incompressibility condition becomes weaker. However, the imposition of a stronger volumetric constraint through B negatively affects the conditioning of the system matrix J in (4.1), and forces the linear solver to perform more iterations in order to reach convergence. We will further focus on this issue in future works.
In order to better evaluate the ability to describe the LV activity of the integrated numerical model for a full cardiac cycle, pressure-volume (pV) loops are also represented. A comparison with in-vivo measurements would be pointless in the case of the ideal geometry, however we stress the fact that the pV-loops reported in Figure 14 are in both qualitative and quantitative agreement with those observed experimentally as e.g. in [87]; moreover, the maximal endocardial pressure, which is reached during the ejection phase, is approximately 110 mmHg and hence lays well within the physiological range of average individuals [91]. The difference between the four cases in Figure 14 accounts to a maximum variation of about 2 % in the minimal ventricle volume during the second isochoric phase.
The pV-loop for the patient-specific case is reported in Figure 15. Experimental measurements of the pressure and of the volume for the patient under study were not available, therefore we did not carry on a quantitative comparison of our results against patient-specific data. However, we once again observe that the values of the pV-loop are in line with real data [87].
We then report in Table 4, the timestep used for each simulation, the average number of Newton   Table 4 clearly shows that finer meshes require larger computational resources for a full heartbeat simulation (T tot ), and this is mostly due to the longer time required for the solution of a single linear system. On the other hand, we notice that the proposed preconditioner ensures that the convergence of the GMRES method is obtained with a relatively small number of iterations N G even with large linear system sizes. Finally, we test the strong scalability of the proposed monolithic solver for cardiac electromechanics. With this aim, we further refine the ideal mesh of Figure 6, thus obtaining a finer one featuring 4'629'817 vertices and 26'624'000 tetrahedra, which is more adequate for the strong scalability test. We then set ∆t = 2 × 10 −4 s and solve the electromechanics problem with the implicit scheme up to the final time T = 10 −2 s. As preconditioner for the GMRES linear solver, we use the block Gauss-Seidel one P outlined in Sec. 4. However, for this test we use an Additive Schwarz preconditioner for preconditioning of the mechanics core block as, in our experience, it shows better scalability properties that the Algebraic Multigrid one [34]. For our test, we use 800, 1'600, and 3'200 CPUs. Since with this mesh the total number of unknowns of the monolithic discrete problem (3.9) amounts to 37'038'536, the number of unknowns attributed to each CPU is about 46'298, 23'149, and 11'574, respectively § . We remark however that our preconditioning strategy applies sequentially to each core model according to Eq. (4.3); hence, the true number of unknowns per CPU is smaller and amounts, e.g., to about 5'787, 2'894, and 1'447 for the monodomain model, respectively. We report in Fig. 16 the mean number of Newton N N and N G GMRES iterations, the average time T P spent in assembling and applying the preconditioner, and the total wall time T W of the simulation. We observe that, while N N and N G are kept almost constant with the number of CPUs, the total wall time T W first decreases but then increases when the largest number of unknowns per CPU is achieved. This is due to the fact that communications among CPUs becomes dominating, the application of the preconditioner being the main responsible as highlighted by T P . § Performing the strong scalability test with a number of CPUs smaller than 800 was not feasible with this mesh; indeed, memory limitations occurred due the excessive number of unknowns per single CPU.

Conclusion
In this work we proposed a novel monolithic solver for the simulation of the integrated electromechanics problem for the LV of the human heart. We coupled the monodomain equation, the ionic minimal model, the activation model for the fibers contraction, and the myocardial mechanics in the active strain framework with a transmurally variable activation. The interaction of the myocardium with the blood inside the ventricle was taken into account by prestressing and by solving additional 0D problems for the fluid.
We considered both implicit and semi-implicit BDF schemes for our monolithic solver together with a preconditioning strategy based on block Gauss-Seidel preconditioner which exploits the multiphysics structure of the coupled problem. The strong limitations on the timestep size in the semi-implicit case are such that the implicit scheme is by far the most efficient for numerical simulations lasting for one or multiple heartbeats. We solve the coupled problem in the High Performance Computing framework and we performed a scalability analysis for a benchmark test involving more than 37'000'000 unknowns.
The results obtained by simulating a complete heartbeat with both ideal and patient-specific geometries are qualitatively in agreement with physiological values measured in healthy patients. Moreover, the comparison of the simulations on the idealized geometry with different mesh sizes shows that the proposed numerical model is able to capture the physical solution with satisfactory accuracy even in the case of relatively coarse meshes. From our simulations we observe that choosing a mesh with maximum size h of about 2 mm is sufficient to correctly reproduce the contraction of the LV, while negligible differences to the corresponding pV-loops are observable when using finer meshes.