<div><font class="Apple-style-span" face="'courier new', monospace">  ierr = DMDAGetInfo(dac,&dimc,&Mc,&Nc,&Pc,&mc,&nc,&pc,&dofc,&sc,&wrapc,&stc);CHKERRQ(ierr);</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">  ierr = DMDAGetInfo(daf,&dimf,&Mf,&Nf,&Pf,&mf,&nf,&pf,&doff,&sf,&wrapf,&stf);CHKERRQ(ierr);</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">  if (dimc != dimf) SETERRQ2(((PetscObject)daf)->comm,PETSC_ERR_ARG_INCOMP,"Dimensions of DMDA do not match %D %D",dimc,dimf);CHKERRQ(ierr);</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">  if (dofc != doff) SETERRQ2(((PetscObject)daf)->comm,PETSC_ERR_ARG_INCOMP,"DOF of DMDA do not match %D %D",dofc,doff);CHKERRQ(ierr);</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">  if (sc != sf) SETERRQ2(((PetscObject)daf)->comm,PETSC_ERR_ARG_INCOMP,"Stencil width of DMDA do not match %D %D",sc,sf);CHKERRQ(ierr);</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">  if (wrapc != wrapf) SETERRQ(((PetscObject)daf)->comm,PETSC_ERR_ARG_INCOMP,"Periodic type different in two DMDAs");CHKERRQ(ierr);</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">  if (stc != stf) SETERRQ(((PetscObject)daf)->comm,PETSC_ERR_ARG_INCOMP,"Stencil type different in two DMDAs");CHKERRQ(ierr);</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">  if (Mc < 2) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Coarse grid requires at least 2 points in x direction");</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">  if (dimc > 1 && Nc < 2) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Coarse grid requires at least 2 points in y direction");</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">  if (dimc > 2 && Pc < 2) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Coarse grid requires at least 2 points in z direction");</font></div>
<div><br></div><div>Several of these are not necessary. DMGetInjection_DA_3D:</div><div><br></div><div><div><font class="Apple-style-span" face="'courier new', monospace">  ierr = DMDAGetInfo(dac,0,&Mx,&My,&Mz,0,0,0,0,0,&pt,0);CHKERRQ(ierr);</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">  ierr = DMDAGetInfo(daf,0,&mx,&my,&mz,0,0,0,&dof,0,0,0);CHKERRQ(ierr)</font>;</div></div><div><br></div><div>Seems silly to fail when not necessary. I'm inclined to move the guards into the specific implementation so that only the necessary amount of consistency needs to be checked. How about getting rid of DMGetInjection_DA entirely and just set the appropriate ops slot?</div>