Miguel,

    Thanks for reporting this, you have found a bug in our code. When we 
changed the adapt type we did not zero out the function pointers for the old 
basic adaptor hence they were improperly called when the object was finally 
destroyed at the end.

   I've attached a patch. Once you apply this simply run

    make gnumake

   in the PETSc root directory, recompile your code and run it again and it 
should successfully end.

  Barry

Attachment: ts-adapt.patch
Description: Binary data

> On Dec 11, 2014, at 4:06 PM, Miguel Angel Salazar de Troya 
> <[email protected]> wrote:
> 
> Hi 
> 
> I'm trying to use the same TS twice, the first time using the basic 
> TSAdaptType, then I change it to none like this:
> 
> TSAdapt adapt;
> TSGetAdapt(ts,&adapt);
> TSAdaptSetType(adapt,"none");
> 
> However, when I destroy the TS, I get this error:
> 
> 0x00007ffff605c4f2 in VecDestroy (v=0x28) at 
> /home/miguel/petsc/src/vec/vec/interface/vector.c:423
> 423     if (!*v) PetscFunctionReturn(0);
> (gdb) backtrace
> #0  0x00007ffff605c4f2 in VecDestroy (v=0x28) at 
> /home/miguel/petsc/src/vec/vec/interface/vector.c:423
> #1  0x00007ffff6f330a5 in TSAdaptDestroy_Basic (adapt=0xfdacd0) at 
> /home/miguel/petsc/src/ts/adapt/impls/basic/adaptbasic.c:66
> #2  0x00007ffff6f2c433 in TSAdaptDestroy (adapt=0xfccbc8) at 
> /home/miguel/petsc/src/ts/adapt/interface/tsadapt.c:238
> #3  0x00007ffff6f03093 in TSDestroy (ts=0x7fffffffdd80) at 
> /home/miguel/petsc/src/ts/interface/ts.c:1906
> 
> 
> It's trying to destroy the TSAdaptDestroy_Basic, but I think it was already 
> destroyed when I changed the TSAdaptType to none, is this true? How can I 
> effectively change the TSAdaptType without having this error?
> 
> Thanks
> Miguel
> 
> -- 
> Miguel Angel Salazar de Troya
> Graduate Research Assistant
> Department of Mechanical Science and Engineering
> University of Illinois at Urbana-Champaign
> (217) 550-2360
> [email protected]
> 

Reply via email to