[petsc-users] DMPlexDistributeField

Adrian Croucher a.croucher at auckland.ac.nz
Thu Jun 20 23:49:05 CDT 2019


I have been trying to get this FVM geometry data re-distribution to work 
using DMPlexDistributeField().

It seems to be working OK for the cell geometry data (cell volumes and 
centroids). But it is making a mess of the face geometry data (face 
normals and centroids).

Should I even expect DMPlexDistributeField() to work for redistributing 
a vector of data defined on mesh faces? Or is there some reason I 
haven't thought of, which means that will never work?

The only example I could find anywhere of DMPlexDistributeField() being 
used is in DMPlexDistributeCoordinates() so I've been basing what I'm 
doing on that.

(I think I have answered my own questions below by experiment- 1) local 
vectors should work (they do in DMPlexDistributeCoordinates); 2) 
probably doesn't matter; 3) yes.)

- Adrian

On 6/06/19 1:42 PM, Adrian Croucher wrote:
> hi
>
> I have some questions about using the DMPlexDistributeField() 
> function. I have finite volume mesh geometry data stored in two local 
> vectors created using DMPlexComputeGeometryFVM(), and I need to 
> redistribute these after calling DMPlexDistribute() to redistribute my 
> mesh. (I need the geometry data before redistribution, so I can't just 
> wait until after redistribution to create them.)
>
> So I figured DMPlexDistributeField() looks like the thing to use for 
> that, using the SF that comes out of DMPlexDistribute().
>
> 1) Does DMPlexDistributeField() work on local vectors or do they have 
> to be global ones?
>
> 2) It takes a 'dm' parameter and the documentation says this is "The 
> DMPlex object", but is that the original DM (before redistribution) or 
> the redistributed one, or does it not matter? It looks like it only 
> uses the DM to get the vector type.
>
> 3) It looks like you need to manually create the newSection and newVec 
> output parameters before passing them in to this routine, is that 
> correct?
>
> - 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



More information about the petsc-users mailing list