On 11/09/2017 07:22 PM, Matthew Knepley wrote:
On Thu, Nov 9, 2017 at 1:20 PM, Yann Jobic <[email protected] <mailto:[email protected]>> wrote:

    Hello,
    I'm trying to access to the values of a p4est forest.
    I know how to do that by converting my forest to a DMPlex, and
    then use DMPlexVecGetClosure over the converted DM.
    However, i want to assign a label and access to the values of the
    forest directly.


What do you mean by "directly". p4est only has topology. We use a Section to map points to values, just like Plex.
I feel stupid, but i don't know how to use a section to map points to values. In my code i use (from ex11.c and DMComputeL2GradientDiff_Plex) :
  ierr = DMGetDefaultSection(forest, &section);CHKERRQ(ierr);
  ierr = DMForestGetCellChart(forest,&cStart,&cEnd);CHKERRQ(ierr);
  ierr = DMGetLocalVector(forest, &localX);CHKERRQ(ierr);
  ierr = DMGlobalToLocalBegin(forest, u, INSERT_VALUES, localX);CHKERRQ(ierr);   ierr = DMGlobalToLocalEnd  (forest, u, INSERT_VALUES, localX);CHKERRQ(ierr);

  for (c = cStart; c < cEnd; c++) {

     DMPlexVecGetClosure(forest, section, localX, c, NULL, &x);

[...]

And i would like to get "x" for a DM forest.

I looked at dm/impls/forest/p4est/pforest.c, but it looks like quite difficult to import. I also search in vec/is/utils/vsectionis.c in order to find the correct section function, but i didn't catch how to use the right one.

It looks so simple to use DMPlexVecGetClosure for DM Plex, getting into the code of DMPlexVecGetClosure is also kind of difficult, at my level i mean.

Where can i find the correct way to do it ? Is there an example for what i want to do ?

Thanks,

Yann


 Thanks,

    Matt

    Is it possible ?
    Thanks,
    Yann


    ---
    L'absence de virus dans ce courrier électronique a été vérifiée
    par le logiciel antivirus Avast.
    https://www.avast.com/antivirus <https://www.avast.com/antivirus>




--
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.caam.rice.edu/%7Emk51/>


--
___________________________

Yann JOBIC
HPC engineer
Polytech Marseille DME
IUSTI-CNRS UMR 6595
Technopôle de Château Gombert
5 rue Enrico Fermi
13453 Marseille cedex 13
Tel : (33) 4 91 10 69 39
  ou  (33) 4 91 10 69 43
Fax : (33) 4 91 10 69 69

Reply via email to