1D/2D finite element solver code