ArashMehraban / petsc-fem-elasticity

Petsc FEM code based on Brown Model
1 stars 0 forks source link

DMGetApplicationContext errors #1

Open ArashMehraban opened 7 years ago

ArashMehraban commented 7 years ago

https://github.com/ArashMehraban/petsc-fem-elasticity/blob/4524287308a132c53ba4621b9f9bd88ebf9c58d3/main.c#L43

@jedbrown I am not sure what I am missing from dmMeshSetup function in user.c that the fe (FE type) and user (AppCtx type) do not get set to the dm, so when I call ierr = DMGetApplicationContext(dm, &fe);CHKERRQ(ierr); ierr = PetscPrintf(PETSC_COMM_SELF,"fe->polydegree: %d\n", fe->polydegree);CHKERRQ(ierr); in main.c

valgrind errors as an invalid read ==8310== Invalid read of size 4 ==8310== at 0x402B24: main (main.c:43) ==8310== Address 0xffeffe7f4 is on thread 1's stack ==8310== 364 bytes below stack pointer

valgrind --track-origins=yes --leak-check=full ./main -f cube8.exo -ne 4 -dof 3 -polydegree 2

jedbrown commented 7 years ago

Your call to DMSetApplicationContext has a different type.