A thermomechanical damage approach to constitutive models for rate-independent dissipative geomaterials