<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 12, 2018 at 9:07 AM, Smith, Barry F. <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> On Mar 11, 2018, at 6:49 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br>
><br>
> On Mon, Mar 12, 2018 at 8:33 AM, Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
> Please implement things properly with subclasses (subtypes) and get this crap out of the public interface files<br>
><br>
> See below.<br>
<br>
I don't understand See Below. why are there not functions in the function table for these operations so the functions can be implemented back in the impls directory where they belong. Why do DMPlex calls appear directly in this function which should not know about particular implementations.<br></blockquote><div><br></div><div>It needs to be done, it just has not been done yet.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
><br>
> Matt<br>
><br>
> dm/interfaces should be able to be compiled and linked even if dm/impls stuff did not exist. This mixing of particular subclass implementations and public interface functions is disgusting. Ideally we'd have nightly tests that flags this broken stuff.<br>
><br>
><br>
><br>
> Barry<br>
><br>
> #include <petscdmplex.h><br>
><br>
> {<br>
> PetscBool isplex;<br>
><br>
> ierr = PetscObjectTypeCompare((<wbr>PetscObject) cdm, DMPLEX, &isplex);CHKERRQ(ierr);<br>
> if (isplex) {<br>
> ierr = DMPlexGetHeightStratum(cdm, 0, &cStart, &cEnd);CHKERRQ(ierr);<br>
> } else SETERRQ(PetscObjectComm((<wbr>PetscObject) cdm), PETSC_ERR_ARG_WRONG, "Coordinate localization requires a DMPLEX coordinate DM");<br>
><br>
> PetscBool isplex;<br>
><br>
> ierr = PetscObjectTypeCompare((<wbr>PetscObject) cdm, DMPLEX, &isplex);CHKERRQ(ierr);<br>
> if (isplex) {<br>
> ierr = DMPlexGetDepthStratum(cdm, 0, &vStart, &vEnd);CHKERRQ(ierr);<br>
> ierr = DMPlexGetMaxProjectionHeight(<wbr>cdm,&maxHeight);CHKERRQ(ierr);<br>
> ierr = DMGetWorkArray(dm,2*(maxHeight + 1),MPIU_INT,&pStart);CHKERRQ(<wbr>ierr);<br>
> pEnd = &pStart[maxHeight + 1];<br>
> newStart = vStart;<br>
> newEnd = vEnd;<br>
> for (h = 0; h <= maxHeight; h++) {<br>
> ierr = DMPlexGetHeightStratum(cdm, h, &pStart[h], &pEnd[h]);CHKERRQ(ierr);<br>
> newStart = PetscMin(newStart,pStart[h]);<br>
> newEnd = PetscMax(newEnd,pEnd[h]);<br>
><br>
><br>
><br>
> > On Mar 11, 2018, at 4:21 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br>
> ><br>
> > This stuff is in DM because two concepts need to be promoted to DM. They are<br>
> > already both in DA and Plex:<br>
> ><br>
> > 1) GlobalToNatural, which is in dmi.c<br>
> ><br>
> > 2) Coordinates, in particular periodic coordinates, which is in dm.c<br>
> ><br>
> > Removing these means adding 1 or 2 functions to dmimpl<br>
> ><br>
> > Matt<br>
> ><br>
> ><br>
> > On Mon, Mar 12, 2018 at 3:06 AM, Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
> ><br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
> > -- Norbert Wiener<br>
> ><br>
> > <a href="https://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~<wbr>knepley/</a><br>
><br>
><br>
><br>
<span class="HOEnZb"><font color="#888888">><br>
> --<br>
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
> -- Norbert Wiener<br>
><br>
> <a href="https://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~<wbr>knepley/</a><br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div>
</div></div>