[petsc-users] Local and Global numberings after DMPlexDistribute

Matthew Knepley knepley at gmail.com
Tue Nov 12 18:10:21 CST 2013


On Tue, Nov 12, 2013 at 5:32 PM, Anthony Vergottis <a.vergottis at ucl.ac.uk>wrote:

> I would like to calculate the area of all the elements in my unstructured
> mesh. This is the process that I have envisaged:
>
> 1) Partition the mesh with DMPlexDistribute.
>
> 2) Obtain which cell/vertices are owned by each process.
>
> 3) Have each process calculate the area of the cells it own, as I would
> like to do this in parallel.
>
> I hope this explains things a bit better.
>

ierr = DMPlexGetHeightStratum(dm, 0, &cStart, &cEnd);CHKERRQ(ierr);
for (c = cStart; c < cEnd; ++c) {
  PetscReal vol;
  ierr = DMPlexComputeCellGeometryFVM(dm, c, &vol, NULL,
NULL);CHKERRQ(ierr);
  <do crap with the cell volume>
}

   Matt


> Thanks.
>
> Regards,
> Anthony
>
>
>
> On 12 November 2013 23:25, Matthew Knepley <knepley at gmail.com> wrote:
>
>> On Tue, Nov 12, 2013 at 4:10 PM, Anthony Vergottis <a.vergottis at ucl.ac.uk
>> > wrote:
>>
>>> Dear All,
>>>
>>> How does one get the local and global numbers of nodes/elements on each
>>> process after the DMPlexDistribute function has been used to partition the
>>> mesh (DM object)?
>>>
>>
>> Can you be more explicit? Vertices and cells are renumbered after
>> distribution to be contiguous on
>> each process:
>>
>>   cell: [0, numCells)
>>   vertices: [numCells, numCells+numVertices)
>>
>>    Matt
>>
>>
>>> Are there any built in PETSc  functions that offer such functionality?
>>>
>>> Thanks in advance.
>>>
>>> Regards,
>>> Anthony
>>>
>>
>>
>>
>> --
>> 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
>>
>
>


-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131112/69663f47/attachment-0001.html>


More information about the petsc-users mailing list