writing H2meshfunction