"Fine" is a stretch here. You are currently getting away with accessing an item in a size zero vector so you are definitely in the land of undefined behavior. If you move to a different machine, it may very well crash. libMesh does bounds checking on many container access methods to look for this type of error. You just found one.
I'm sorry I'm not of more help as to exactly what you are doing wrong, but something is definitely wrong here. Cody On Wed, Nov 23, 2016 at 9:31 AM Michael Povolotskyi <[email protected]> wrote: > Dear libmesh users/developers, > > I see a strange situation: one assertion fails if libmesh is built in > opt mode, but the code runs fine if libmesh is built in dbg mode. > > What I'm doing is as follows: I'm solving a nonlinear system with > changing the sparsity pattern by hand using > system->get_dof_map().attach_extra_sparsity_object(...); > > The message is as follows: > > Assertion `local_index < _local_size' failed. > local_index = 0 > _local_size = 0 > > > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib64/libthread_db.so.1". > 0x00007fe4b2bb7dba in waitpid () from /lib64/libc.so.6 > #0 0x00007fe4b2bb7dba in waitpid () from /lib64/libc.so.6 > #1 0x00007fe4b2b36a3b in do_system () from /lib64/libc.so.6 > #2 0x00007fe4aec0ed72 in libMesh::print_trace(std::ostream&) () from > /home/mpovolot/NEMO5/NEMO/libs/libmesh/libmesh/.libs/libmesh_opt.so.0 > #3 0x00007fe4aec0d3ea in libMesh::MacroFunctions::report_error(char > const*, int, char const*, char const*) () from > /home/mpovolot/NEMO5/NEMO/libs/libmesh/libmesh/.libs/libmesh_opt.so.0 > #4 0x00007fe4b576839e in libMesh::PetscVector<double>::operator() > (this=0x4259bb0, i=0) at > > /home/mpovolot/NEMO5/NEMO/libs/libmesh/libmesh/include/libmesh/petsc_vector.h:1229 > #5 0x00007fe4af23a95b in libMesh::System::reinit() () from > /home/mpovolot/NEMO5/NEMO/libs/libmesh/libmesh/.libs/libmesh_opt.so.0 > #6 0x00007fe4af22b8aa in libMesh::ImplicitSystem::reinit() () from > /home/mpovolot/NEMO5/NEMO/libs/libmesh/libmesh/.libs/libmesh_opt.so.0 > > thank you for help, > > Michael. > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Libmesh-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/libmesh-users > ------------------------------------------------------------------------------ _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
