<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jul 25, 2020 at 9:08 AM Mark Adams <<a href="mailto:mfadams@lbl.gov">mfadams@lbl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Yea, I did not get all the code you need. Here is an example of making crddm. I'm not sure if this is all best practices (Matt?)<div><br></div><div>  /* create coordinate DM */<br>  ierr = DMClone(dm, &crddm);CHKERRV(ierr);<br></div></div></blockquote><div>PetscFE       fe; </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>  ierr = PetscFECreateDefault(PETSC_COMM_SELF, dim, dim, PETSC_FALSE, "", PETSC_DECIDE, &fe);CHKERRV(ierr);<br>  // ierr = PetscFECreateLagrange(PETSC_COMM_SELF, dim, dim, PETSC_FALSE, "", PETSC_DECIDE, &fe);CHKERRQ(ierr);<br>  ierr = PetscFESetFromOptions(fe);CHKERRV(ierr);<br></div></div></blockquote><div><br></div><div> And you need to take care to construct 'fe' in the same way that you construct the PetscFE in 'dm'. (is there a better way to clone a PetscFE?)</div></div></div>