<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div> In PCSetUp_MG() it is creating needed vectors for each level. In order to create the vectors it needs to have a "template" of the vectors. It tries<div class="">several ways to get such a template. </div><div class=""><br class=""></div><div class="">If you have provided an vector for each level with PCMGSetRhs() it uses VecDuplicate for the needed vectors.</div><div class=""><br class=""></div><div class="">If you provided a matrix for each level with PCMGSetOperators() it uses the MatCreateVectors() using that matrix</div><div class=""><br class=""></div><div class="">If you have not provided either of those it tries DMCreateGlobalVector() for the DM associated with that level, if there is no DM it defaults to DMShell and then errors.</div><div class=""><br class=""></div><div class="">Since it errors this seems to indicate you did not provide an operator for each level, nor a right hand side vector. </div><div class=""><br class=""></div><div class="">Please find attached a patch that may resolve the issue for.</div><div class=""><br class=""></div><div class="">In the petsc directory do</div><div class="">patch -p1 < mg.patch</div><div class="">make libs</div><div class=""><br class=""></div><div class="">then rerun your example. Please let us know if it resolves the problem and if not send the complete error message</div><div class=""><br class=""></div><div class="">Barry</div><div class=""></div></body></html>