Implementation direct solver to allow for better preconditioners in iterative solver