In the wide literature devoted to the cardiac structural mechanics, the strain energy proposed by Holzapfel and Ogden exhibits a number of interesting features: it has suitable mathematical properties and it is based on few material parameters that can, in principle, be identified by standard laboratory tests. In this work we illustrate the implementation of a numerical solver based on such a model for both the passive and active mechanics of the heart. Moreover we discuss its performance on a few tests that can be regarded as preliminary to the adoption of the Holzapfel-Ogden model for a real cardiac simulation. While the passive behavior of the cardiac muscle is modeled as an orthotropic hyperelastic material, the active contraction is here accounted for a multiplicative decomposition of the deformation gradient, yielding the so-called "active strain" approach, a formulation that automatically preserves the ellipticity of the stress tensor and introduces just one extra parameter in the model. We adopt the usual volumetric-isochoric decomposition of the stress tensor to obtain a mathematically consistent quasi-incompressible version of the material, then the numerical approximation applies to a classical Hu-Washizu three fields formulation. After introduction of the tangent problem, we select suitable finite element spaces for the representation of the physical fields. Boundary conditions are prescribed by introduction of a Lagrange multiplier. The robustness and performance of the numerical solver are tested versus a novel benchmark test, for which an exact solution is provided. The curvature data obtained from the free contraction of muscular thin films are used to fit the active contraction parameter. (C) 2014 Elsevier Masson SAS. All rights reserved.