Hierarchical approximate factorization methods for the solution of sparse linear systems with application in geoscience