Many tectonic problems require to treat the lithosphere as a compressible elastic material, which can also flow viscously or break in a brittle fashion depending on the stress level applied and the temperature conditions. We present a flexible methodology to address the resulting complex material response, which imposes severe challenges on the discretization and rheological models used. This robust, adaptive, two-dimensional, finite element method solves the momentum balance and the heat equation in Lagrangian form using unstructured meshes. An implementation of this methodology is released to the public with the publication of this paper and is named DynEarthSol2D (available at http://bitbucket.org/tan2/dynearthsol2). The solver uses contingent mesh adaptivity in places where shear strain is focused (localization) and a conservative mapping assisted by marker particles to preserve phase and facies boundaries during remeshing. We detail the solver and verify it in a number of benchmark problems against analytic and numerical solutions from the literature. These results allow us to verify and validate our software framework and show its improved performance by an order of magnitude compared against an earlier implementation of the Fast Lagrangian Analysis of Continua algorithm.