<div dir="ltr"><div>Dear Barry,</div><div><br></div>1) Do we still need this? It is totally untested, from the docs it seems it may be redundant<div><br clear="all"><div>$ git grep DMCreateAggregates<br>include/petscdm.h:PETSC_EXTERN PetscErrorCode DMCreateAggregates(DM,DM,Mat*);<br>src/dm/impls/da/dacreate.c:extern PetscErrorCode  DMCreateAggregates_DA(DM,DM,Mat*);<br>src/dm/impls/da/dacreate.c:  da->ops->getaggregates               = DMCreateAggregates_DA;<br>src/dm/impls/da/dainterp.c:PetscErrorCode  DMCreateAggregates_DA(DM dac,DM daf,Mat *rest)<br>src/dm/interface/dm.c:   DMCreateAggregates - Gets the aggregates that map between<br>src/dm/interface/dm.c:PetscErrorCode  DMCreateAggregates(DM dmc, DM dmf, Mat *rest)<br></div><div><br></div><div>2) Why don't we implement DMHasCreateInjection_Default() this way?</div><div><br></div><div>static PetscErrorCode DMHasCreateInjection_Default(DM dm, PetscBool *flg)<br>{<br>  PetscFunctionBegin;<br>  PetscValidHeaderSpecific(dm,DM_CLASSID,1);<br>  PetscValidPointer(flg,2);<br>  *flg = dm->ops->getinjection ? PETSC_TRUE : PETSC_FALSE;<br>  PetscFunctionReturn(0);<br>}<br></div><div><br></div><div>This way we can keep the one in DMDA, perhaps the one in SNESVI, and remove all the other type specific implementations.</div><div><br></div><div>Or maybe even better, we should get rid of DMHasCreateInjection_Default(), and do things this simple and obvious way:</div><div><br></div><div>PetscErrorCode  DMHasCreateInjection(DM dm,PetscBool  *flg)<br>{<br>  PetscErrorCode ierr;<br>  PetscFunctionBegin;<br>  if (dm->ops->hascreateinjection) {<br>    ierr = (*dm->ops->hascreateinjection)(dm,flg);CHKERRQ(ierr);<br>  } else {<br>    *flg = dm->ops->getinjection ? PETSC_TRUE : PETSC_FALSE;<br>  }<br>  PetscFunctionReturn(0);<br>}<br></div><div><br></div><div>and of course rename m->ops->getinjection to dm->ops->createinjection, because the inconsistency offends my little mind.</div><div> </div><div>Am I missing something about this one?</div><div><br></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Lisandro Dalcin<br>============<br>Research Scientist<br>Extreme Computing Research Center (ECRC)<br>King Abdullah University of Science and Technology (KAUST)<br><a href="http://ecrc.kaust.edu.sa/" target="_blank">http://ecrc.kaust.edu.sa/</a><br></div></div></div></div></div>