<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 8, 2015 at 11:02 PM, Adrian Croucher <span dir="ltr"><<a href="mailto:a.croucher@auckland.ac.nz" target="_blank">a.croucher@auckland.ac.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I apologize for taking so long. I got caught up in the SIAM Meeting. I have<br>
pushed<br>
<br>
PetscErrorCode DMPlexGetPointGlobalField(DM dm, PetscInt point, PetscInt<br>
field, PetscInt *start, PetscInt *end)<br>
<br>
to next. This corresponds with the public interface naming scheme Jed<br>
started.<br>
</blockquote>
<br>
Thanks Matt.<br>
<br>
I'm not sure if I understand how to use this correctly, because so far I have just got segfaults.<br>
<br>
To test it out I tried using the C version in a copy of src/dm/impls/plex/examples/<u></u>tutorials/ex1.c. After the call to DMSetDefaultSection(dm, section), I inserted the lines:<br>
<br>
ierr = DMPlexGetPointGlobalField(dm, 0, 1, &istart, &iend); CHKERRQ(ierr);<br>
printf("start: %d end: %d", istart, iend);<br>
<br>
I figured this would give me the start and end locations of the field 1 ("v") at point 0 (the first cell?), which should be ok because v is defined on cells. So for dim = 2 I'd expect istart = 0 and iend = 2- is that right?<br>
<br>
Instead I get:<br></blockquote><div><br></div><div>Is it possible that you have not created the global section yet? I do not use the normal interface here, which creates it</div><div>automatically, to speed things up. You can just call DMPlexGetDefaultGlobalSection() before the call.</div><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">
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range<br>
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger<br>
[0]PETSC ERROR: or see <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind" target="_blank">http://www.mcs.anl.gov/petsc/<u></u>documentation/faq.html#<u></u>valgrind</a><br>
[0]PETSC ERROR: or try <a href="http://valgrind.org" target="_blank">http://valgrind.org</a> on GNU/linux and Apple Mac OS X to find memory corruption errors<br>
[0]PETSC ERROR: likely location of problem given in stack below<br>
[0]PETSC ERROR: --------------------- Stack Frames ------------------------------<u></u>------<br>
[0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,<br>
[0]PETSC ERROR: INSTEAD the line number of the start of the function<br>
[0]PETSC ERROR: is given.<br>
[0]PETSC ERROR: [0] PetscSectionGetOffset line 1205 /home/acro018/software/PETSc/<u></u>code/src/vec/is/utils/<u></u>vsectionis.c<br>
[0]PETSC ERROR: [0] DMPlexGetGlobalFieldOffset_<u></u>Private line 408 /home/acro018/software/PETSc/<u></u>code/include/petsc-private/<u></u>dmplexi<br>
mpl.h<br>
[0]PETSC ERROR: [0] DMPlexGetPointGlobalField line 367 /home/acro018/software/PETSc/<u></u>code/src/dm/impls/plex/<u></u>plexpoint.c<br>
<br>
Cheers, Adrian<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Dr Adrian Croucher<br>
Senior Research Fellow<br>
Department of Engineering Science<br>
University of Auckland, New Zealand<br>
email: <a href="mailto:a.croucher@auckland.ac.nz" target="_blank">a.croucher@auckland.ac.nz</a><br>
tel: +64 (0)9 923 84611<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">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></div>