[petsc-users] PETSCFE_CLASSID/PETSCVF_CLASSID

Matthew Knepley knepley at gmail.com
Sun Dec 13 08:54:14 CST 2020


On Sat, Dec 12, 2020 at 6:07 AM Nicolas Barral <
nicolas.barral at math.u-bordeaux.fr> wrote:

> Thanks Matt and Jacob,
>
> There's still something not working yet, but I'm trying to build a MFE
> before asking.
>
> Matt, what you say is consistent with plex/tutorials/ex8.c, but not with
> DMAdaptorAdapt_Sequence_Private. Does that mean that the latter is broken ?
>

Yes, that may be broken. The pitfall of having untested interface. I will
try and look at it.

  Thanks,

     Matt


> Thanks
>
> --
> Nicolas
>
> On 11/12/2020 18:39, Matthew Knepley wrote:
> > On Fri, Dec 11, 2020 at 12:02 PM Nicolas Barral
> > <nicolas.barral at math.u-bordeaux.fr
> > <mailto:nicolas.barral at math.u-bordeaux.fr>> wrote:
> >
> >     Hi all (and probably more specifically Matt ?)
> >
> >     I am trying to understand how the class IDs of a DM field are set,
> and
> >     can't find it in the documentation.
> >
> >     A little background, I am mimicking
> >     SNES/utils/dmadapt.c/DMAdaptorAdapt_Sequence_Private for a specific
> >     case
> >     (I'm trying to build the same kind of metric from a single sensor
> >     field,
> >     without all the SNES layer).
> >
> >     I need to compute the gradient of the sensor field, using
> >     DMPlexComputeGradientClementInterpolant, for which I create a DM, to
> >     which I associate a PetscFE, a DS, like in existing code:
> >
> >     PetscFE  feGrad
> >     PetscDS  probGrad
> >
> >     ierr = PetscFECreateDefault(PetscObjectComm((PetscObject) dmGrad),
> dim,
> >     coordDim, PETSC_TRUE, NULL, -1, &feGrad);CHKERRQ(ierr);
> >     ierr = PetscDSSetDiscretization(probGrad, f, (PetscObject)
> >     feGrad);CHKERRQ(ierr);
> >
> >
> > Jacobi is correct, so let me give the history. Originally, you were to
> > call PetscDSSetDiscretization() as you have done.
> > However, now it is possible to have different discretization within the
> > same domain, So now we want you to call
> > DMAddField(dm, feGrad), and then DMCreateDS(), which will
> > call PetscDSSetDiscretization() for you. I changed the
> > examples, but I did not have another place to document this.
> >
> >    Thanks,
> >
> >       Matt
> >
> >     ierr = PetscFEDestroy(&feGrad);CHKERRQ(ierr);
> >
> >     Yet, when I call DMPlexComputeGradientClementInterpolant, I get the
> >     following error:
> >     [0]PETSC ERROR: Unknown discretization type for field 0
> >
> >     I don't fully understand what all these objects are (FE, DS and
> Field),
> >     and how they are related, where would that be documented ?
> >     And what else do I need to do to make my example work ?
> >
> >     Thanks
> >
> >     --
> >     Nicolas
> >
> >
> >
> > --
> > What most experimenters take for granted before they begin their
> > experiments is infinitely more interesting than any results to which
> > their experiments lead.
> > -- Norbert Wiener
> >
> > https://www.cse.buffalo.edu/~knepley/ <
> http://www.cse.buffalo.edu/~knepley/>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20201213/1852efa4/attachment-0001.html>


More information about the petsc-users mailing list