An algorithm for prescribed mean curvature using isogeometric methods