Should something like std::vector<Function> u; u.push_back(Function(mesh, 0.0)); work? I'm getting all sorts of memory errors. Garth