Does word "grate" have the same meaning in the following two sentences?

Grate one's teeth in anger.

To grate a window.
different meanings