[petsc-dev] More on FV overlap cells and Fortran

Adrian Croucher a.croucher at auckland.ac.nz
Wed Apr 8 23:02:44 CDT 2015


> I apologize for taking so long. I got caught up in the SIAM Meeting. I have
> pushed
>
>    PetscErrorCode DMPlexGetPointGlobalField(DM dm, PetscInt point, PetscInt
> field, PetscInt *start, PetscInt *end)
>
> to next. This corresponds with the public interface naming scheme Jed
> started.

Thanks Matt.

I'm not sure if I understand how to use this correctly, because so far I 
have just got segfaults.

To test it out I tried using the C version in a copy of 
src/dm/impls/plex/examples/tutorials/ex1.c. After the call to 
DMSetDefaultSection(dm, section), I inserted the lines:

   ierr = DMPlexGetPointGlobalField(dm, 0, 1, &istart, &iend); 
CHKERRQ(ierr);
   printf("start: %d end: %d", istart, iend);

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?

Instead I get:

[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, 
probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see 
http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS 
X to find memory corruption errors
[0]PETSC ERROR: likely location of problem given in stack below
[0]PETSC ERROR: ---------------------  Stack Frames 
------------------------------------
[0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,
[0]PETSC ERROR:       INSTEAD the line number of the start of the function
[0]PETSC ERROR:       is given.
[0]PETSC ERROR: [0] PetscSectionGetOffset line 1205 
/home/acro018/software/PETSc/code/src/vec/is/utils/vsectionis.c
[0]PETSC ERROR: [0] DMPlexGetGlobalFieldOffset_Private line 408 
/home/acro018/software/PETSc/code/include/petsc-private/dmplexi
mpl.h
[0]PETSC ERROR: [0] DMPlexGetPointGlobalField line 367 
/home/acro018/software/PETSc/code/src/dm/impls/plex/plexpoint.c

Cheers, Adrian

-- 
Dr Adrian Croucher
Senior Research Fellow
Department of Engineering Science
University of Auckland, New Zealand
email: a.croucher at auckland.ac.nz
tel: +64 (0)9 923 84611




More information about the petsc-dev mailing list