1. A system for generating a set of locally adapted hierarchical basis functions for preconditioning a finite element analysis of a set of input data, comprising using a computing device to perform steps for: receiving an input matrix, having two or more dimensions, which represents a set of input data; identifying a set of unwanted matrix elements from the input matrix; evaluating the input matrix to identify original connection strengths between the unwanted matrix elements and each unwanted matrix element's immediately neighboring matrix elements; for each unwanted matrix element, forming a grid comprising one of the unwanted matrix elements and its immediately neighboring matrix elements; for each grid, eliminating each unwanted matrix element and forming new connections between each remaining element in the grid, each new connection having a new connection strength determined as a function of the original connection strengths; for each grid, for each new connection between matrix elements that connects matrix elements that are not immediately adjacent neighbors, eliminating those new connections and redistributing the strength of those eliminated new connections to the remaining new connections between the matrix elements that are immediately adjacent neighbors to construct a first level coarse matrix having new connection strengths; and outputting the first level coarse matrix and the new connection strengths as a first hierarchical basis function for preconditioning the input matrix.