[petsc-users] Cell numbering in DMPlex

Pierre Seize pierre.seize at onera.fr
Tue Sep 29 12:19:45 CDT 2020


Thank you for the answer.

As I said, DMPlexGetGhostCellStratum gives me the bounds of the domain 
boundaries (actual domain boundaries), that's what I called cStartGhost 
in my first message. What I want is the bounds of the actual cells, or 
the bounds of the overlapping cells.

Maybe this will help clarify my question: if I have a 1D mesh with two 
cells I have this numbering on two procs with overlap = 1:

[0] 2-|-0-|-1-|
[1]   |-1-|-0-|-2

The first proc have one "real" cell (0), one "overlap" cell (1) and one 
boundary cell (2).
Here, DMPlexGetGhostCellStratum would give me cEndInterior = 2, where I 
want 1.

Pierre

Le 2020-09-29 17:58, Mark Adams a écrit :

> I believe it is:
> 
> ierr = DMPlexGetHeightStratum(dm, 0, &cStart, &cEnd);CHKERRQ(ierr);
> ierr = DMPlexGetGhostCellStratum(dm, &cEndInterior, 
> NULL);CHKERRQ(ierr);
> 
> On Tue, Sep 29, 2020 at 11:34 AM Pierre Seize <Pierre.Seize at onera.fr> 
> wrote:
> 
>> Hello!
>> 
>> I have a parallel DMPlex, and I would like to loop on every "real" 
>> cell.
>> It seems that the indexing is as such:
>> 
>> [cStart (always 0 I think), XXX [ -> actual cell
>> 
>> [XXX, cStartGhost [ -> parallel cells, as I have overlap = 1
>> 
>> [cStartGhost, cEndGhost= cEnd[ -> my finite volume boundaries cells.
>> 
>> I can get cStart and cEnd with DMPlexGetHeightStratum, and cStartGhost
>> and cEndGhost with DMPlexGetGhostCellStratum.
>> 
>> What I want is the bound XXX. Right now, I do loop from cStart to 
>> cEnd,
>> and when I find a cell that gives me DMGetLabelValue(dm, "ghost", c,
>> &value) with a positive value I break my loop and take the current 
>> cell
>> number as the wanted bound. I am not unsatisfied with this but I 
>> wonder
>> if there is a more straightforward way to get what I want.
>> 
>> Thank you.
>> 
>> Pierre


-- 
Pierre Seize


More information about the petsc-users mailing list