what is the definition of hardness in science