[petsc-dev] PetscFV

Matthew Knepley knepley at gmail.com
Wed May 15 07:00:37 CDT 2019


On Wed, May 15, 2019 at 1:48 AM Adrian Croucher via petsc-dev <
petsc-dev at mcs.anl.gov> wrote:

> Further to this, I think I'm a bit confused about using PetscFV to set
> up the data layout (as seems to be done in the TS ex11 example), vs.
> doing it by creating a section using DMPlexCreateSection() and then
> DMSetSection().
>
> If you do it using PetscFV, as in TS ex11, there seems to be no need to
> create a section explicitly.
>

Yes, it is done automatically by the DM, which holds the PetscFV object.


> If you do it using by creating a section, is there still any need to set
> up the PetscFV? I seem to recall trying taking the PetscFV stuff out of
> my code and finding that it didn't work properly without it.


You should be able to take it out if you make a Section by hand, unless you
are using some other functionality.


> It seems
> PetscFV does some other things besides setting up a data layout, but if
> so I am unclear as to what they are.
>

I guess now that things are more clear, I should write something about how
this is intended to go together.

PetscSection: There is a little in the manual on this. It is a
generalization of PetscLayout for Vec, in that
instead of a map {process -> #dof} that we use to layout a parallel vector,
it is

  {point -> #dof}

that we can use to specify any data layout, depending on what we call
"points". We can get PetscLayout
if points denote processes, or finite element/volume layouts if points
denote pieces of the mesh (Plex),
or matrix layouts if points denote dofs, etc.

PetscSection is the algebraic interface to the solvers which gets setup by
stuff managing assembly. It
can indicate field divisions, blocking, constrained unknowns, etc.

A DM is supposed to build a Section to talk to the solvers about data
layout. I built two supporting classes,
PetscFE and PetscFV, to help the DM build a Section for common
discretizations.

In addition, if you have a Plex, the discretization information can also be
used to integrate residuals and
Jacobians, apply boundary conditions, and interpolate to different meshes.
However, there is no requirement
to do so.

  Thanks,

     Matt


> - Adrian
>
> On 15/05/19 2:37 PM, Adrian Croucher wrote:
> > hi
> >
> > I just tried upgrading from PETSc 3.10 to 3.11 and working my way
> > through all the changes that have broken things in my code.
> >
> > I think I have most of them working again, except for the changes to
> > PetscFV. Following the TS ex11 example I am now using DMAddField() and
> > DMCreateDS().
> >
> > It looks like I am now supposed to use PetscFVSetComponentName() to
> > set field component names. Unfortunately there does not appear to be a
> > Fortran interface for this function yet?
> >
> > - Adrian
> >
> --
> Dr Adrian Croucher
> Senior Research Fellow
> Department of Engineering Science
> University of Auckland, New Zealand
> email: a.croucher at auckland.ac.nz
> tel: +64 (0)9 923 4611
>
>

-- 
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-dev/attachments/20190515/2378846c/attachment-0001.html>


More information about the petsc-dev mailing list