Create mass_matrix_function