C routines for fem applications