(re)added cg-method and file output

worked for very small examples but wrong solution
error probably in applyDirichlet