<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Nov 10, 2017 at 5:13 AM, Yann JOBIC <span dir="ltr"><<a href="mailto:yann.jobic@univ-amu.fr" target="_blank">yann.jobic@univ-amu.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div class="m_5708745352849182298moz-cite-prefix">On 11/09/2017 07:22 PM, Matthew Knepley
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Thu, Nov 9, 2017 at 1:20 PM, Yann
Jobic <span dir="ltr"><<a href="mailto:yann.jobic@univ-amu.fr" target="_blank">yann.jobic@univ-amu.fr</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
I'm trying to access to the values of a p4est forest.<br>
I know how to do that by converting my forest to a DMPlex,
and then use DMPlexVecGetClosure over the converted DM.<br>
However, i want to assign a label and access to the values
of the forest directly.<br>
</blockquote>
<div><br>
</div>
<div>What do you mean by "directly". p4est only has
topology. We use a Section to map points to values, just
like Plex.</div>
</div>
</div>
</div>
</blockquote>
I feel stupid, but i don't know how to use a section to map points
to values.</div></blockquote><div><br></div><div>There is a manual section on it, however it is quite simple. Everything in the mesh is numbered consecutively, so each point</div><div>(cell, face, edge, vertex) has a number. The Section maps this number p to a pair (dof, off)</div><div><br></div><div> p --> (dof, off)</div><div><br></div><div>where dof is a number of degrees of freedom, and off is an offset into the Vec holding these values.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"> In my code i use (from ex11.c and
DMComputeL2GradientDiff_Plex) :<br>
ierr = DMGetDefaultSection(forest, §ion);CHKERRQ(ierr);<br></div></blockquote><div><br></div><div>This default section is the Section for the solution field.</div><div><br></div><div>Before here just call</div><div><br></div><div> ierr = DMConvert(forest, DMPLEX, &plex);CHKERRQ(ierr);</div><div><br></div><div>and use that in all the subsequent calls.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
ierr =
DMForestGetCellChart(forest,&<wbr>cStart,&cEnd);CHKERRQ(ierr);<br>
ierr = DMGetLocalVector(forest, &localX);CHKERRQ(ierr);<br>
ierr = DMGlobalToLocalBegin(forest, u, INSERT_VALUES,
localX);CHKERRQ(ierr);<br>
ierr = DMGlobalToLocalEnd (forest, u, INSERT_VALUES,
localX);CHKERRQ(ierr);<br>
<br>
for (c = cStart; c < cEnd; c++) {<br>
<br>
DMPlexVecGetClosure(forest, section, localX, c, NULL, &x);<br>
<br>
[...]<br>
<br>
And i would like to get "x" for a DM forest.<br>
<br>
I looked at dm/impls/forest/p4est/pforest.<wbr>c, but it looks like quite
difficult to import.<br>
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.<br>
<br>
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.<br>
<br>
Where can i find the correct way to do it ? Is there an example for
what i want to do ?<br>
<br>
Thanks,<br>
<br>
Yann<br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div><br>
</div>
<div> Thanks,</div>
<div><br>
</div>
<div> Matt</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is it
possible ?<br>
Thanks,<br>
Yann<br>
<br>
<br>
---<br>
L'absence de virus dans ce courrier électronique a été
vérifiée par le logiciel antivirus Avast.<br>
<a href="https://www.avast.com/antivirus" rel="noreferrer" target="_blank">https://www.avast.com/antiviru<wbr>s</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="m_5708745352849182298gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>What most experimenters take for granted before
they begin their experiments is infinitely more
interesting than any results to which their
experiments lead.<br>
-- Norbert Wiener</div>
<div><br>
</div>
<div><a href="http://www.caam.rice.edu/%7Emk51/" target="_blank">https://www.cse.buffalo.edu/~<wbr>knepley/</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p><br>
</p>
<pre class="m_5708745352849182298moz-signature" cols="72">--
___________________________
Yann JOBIC
HPC engineer
Polytech Marseille DME
IUSTI-CNRS UMR 6595
Technopôle de Château Gombert
<a href="https://maps.google.com/?q=5+rue+Enrico+Fermi&entry=gmail&source=g">5 rue Enrico Fermi</a>
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
</pre>
</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div>
</div></div>