<div dir="ltr"><div dir="ltr">On Sat, Dec 12, 2020 at 6:07 AM Nicolas Barral <<a href="mailto:nicolas.barral@math.u-bordeaux.fr">nicolas.barral@math.u-bordeaux.fr</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thanks Matt and Jacob,<br>
<br>
There's still something not working yet, but I'm trying to build a MFE <br>
before asking.<br>
<br>
Matt, what you say is consistent with plex/tutorials/ex8.c, but not with <br>
DMAdaptorAdapt_Sequence_Private. Does that mean that the latter is broken ?<br></blockquote><div><br></div><div>Yes, that may be broken. The pitfall of having untested interface. I will try and look at it.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Thanks<br>
<br>
-- <br>
Nicolas<br>
<br>
On 11/12/2020 18:39, Matthew Knepley wrote:<br>
> On Fri, Dec 11, 2020 at 12:02 PM Nicolas Barral <br>
> <<a href="mailto:nicolas.barral@math.u-bordeaux.fr" target="_blank">nicolas.barral@math.u-bordeaux.fr</a> <br>
> <mailto:<a href="mailto:nicolas.barral@math.u-bordeaux.fr" target="_blank">nicolas.barral@math.u-bordeaux.fr</a>>> wrote:<br>
> <br>
>     Hi all (and probably more specifically Matt ?)<br>
> <br>
>     I am trying to understand how the class IDs of a DM field are set, and<br>
>     can't find it in the documentation.<br>
> <br>
>     A little background, I am mimicking<br>
>     SNES/utils/dmadapt.c/DMAdaptorAdapt_Sequence_Private for a specific<br>
>     case<br>
>     (I'm trying to build the same kind of metric from a single sensor<br>
>     field,<br>
>     without all the SNES layer).<br>
> <br>
>     I need to compute the gradient of the sensor field, using<br>
>     DMPlexComputeGradientClementInterpolant, for which I create a DM, to<br>
>     which I associate a PetscFE, a DS, like in existing code:<br>
> <br>
>     PetscFE  feGrad<br>
>     PetscDS  probGrad<br>
> <br>
>     ierr = PetscFECreateDefault(PetscObjectComm((PetscObject) dmGrad), dim,<br>
>     coordDim, PETSC_TRUE, NULL, -1, &feGrad);CHKERRQ(ierr);<br>
>     ierr = PetscDSSetDiscretization(probGrad, f, (PetscObject)<br>
>     feGrad);CHKERRQ(ierr);<br>
> <br>
> <br>
> Jacobi is correct, so let me give the history. Originally, you were to <br>
> call PetscDSSetDiscretization() as you have done.<br>
> However, now it is possible to have different discretization within the <br>
> same domain, So now we want you to call<br>
> DMAddField(dm, feGrad), and then DMCreateDS(), which will <br>
> call PetscDSSetDiscretization() for you. I changed the<br>
> examples, but I did not have another place to document this.<br>
> <br>
>    Thanks,<br>
> <br>
>       Matt<br>
> <br>
>     ierr = PetscFEDestroy(&feGrad);CHKERRQ(ierr);<br>
> <br>
>     Yet, when I call DMPlexComputeGradientClementInterpolant, I get the<br>
>     following error:<br>
>     [0]PETSC ERROR: Unknown discretization type for field 0<br>
> <br>
>     I don't fully understand what all these objects are (FE, DS and Field),<br>
>     and how they are related, where would that be documented ?<br>
>     And what else do I need to do to make my example work ?<br>
> <br>
>     Thanks<br>
> <br>
>     -- <br>
>     Nicolas<br>
> <br>
> <br>
> <br>
> -- <br>
> What most experimenters take for granted before they begin their <br>
> experiments is infinitely more interesting than any results to which <br>
> 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/~knepley/</a> <<a href="http://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">http://www.cse.buffalo.edu/~knepley/</a>><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><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.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>