Thanks John. I had not realized this was the issue, your explanation was quite instructive.
There was indeed a bug on my code, fixed now. Best regards, Renato Em ter., 10 de ago. de 2021 10:17, John Peterson <jwpeter...@gmail.com> escreveu: > According to frame #6, we are trying to cast a nullptr (oldvar): > > #6 0x00007ffff598d1bf in libMesh::cast_ptr<libMesh::PetscMatrix<double>*, > libMesh::SparseMatrix<double> > (oldvar=0x0) at > ./include/libmesh/libmesh_common.h:582 > > In libMesh::cast_ptr, we throw an error if the result of the cast is a > nullptr (which is what happens when the incoming pointer is nullptr). The > error message you are actually seeing on line 582 is caused when we > dereference the input nullptr in order to try and print a better error > message. So, we should probably try to avoid doing that, but the bigger > question is how/why you would are calling solve() with a nullptr > preconditioner matrix... this could be due to some other bug in your user > code perhaps. > > -- > John > > > On Mon, Aug 9, 2021 at 7:39 PM Renato Poli <rebp...@gmail.com> wrote: > >> Hi, >> >> I see this issue: >> >> Failed to convert N7libMesh12SparseMatrixIdEE pointer to >> PN7libMesh11PetscMatrixIdEE >> The N7libMesh12SparseMatrixIdEE appears to be a >> Thread 1 "sim" hit Breakpoint 1, 0x00007ffff1d58d60 in PMPI_Abort () from >> /usr/lib/x86_64-linux-gnu/libmpi.so.40 >> (gdb) bt >> #0 0x00007ffff1d58d60 in PMPI_Abort () from >> /usr/lib/x86_64-linux-gnu/libmpi.so.40 >> #1 0x00007ffff4ff6658 in libMesh::libmesh_terminate_handler () at >> ../src/base/libmesh.C:321 >> #2 0x00007ffff1b7f38c in ?? () from >> /usr/lib/x86_64-linux-gnu/libstdc++.so.6 >> #3 0x00007ffff1b7f3f7 in std::terminate() () from >> /usr/lib/x86_64-linux-gnu/libstdc++.so.6 >> #4 0x00007ffff1b7f6a9 in __cxa_throw () from >> /usr/lib/x86_64-linux-gnu/libstdc++.so.6 >> #5 0x00007ffff1b733b1 in __cxa_bad_typeid () from >> /usr/lib/x86_64-linux-gnu/libstdc++.so.6 >> #6 0x00007ffff598d1bf in libMesh::cast_ptr<libMesh::PetscMatrix<double>*, >> libMesh::SparseMatrix<double> > (oldvar=0x0) at >> ./include/libmesh/libmesh_common.h:582 >> #7 0x00007ffff5bbf9a5 in libMesh::PetscNonlinearSolver<double>::solve >> (this=0x555555a1e4a0, pre_in=..., x_in=..., r_in=...) at >> ../src/solvers/petsc_nonlinear_solver.C:794 >> #8 0x00007ffff5c52062 in libMesh::NonlinearImplicitSystem::solve >> (this=0x5555559d0390) at ../src/systems/nonlinear_implicit_system.C:189 >> #9 0x000055555568695f in Poroelastic::solve (this=0x555555a1ece0) at >> /home/renato/dev/chimas3d/src/Poroelastic.cpp:253 >> #10 0x000055555562f8b7 in TimeLoop::main_loop (this=0x7fffffffda50) at >> /home/renato/dev/chimas3d/src/TimeLoop.cpp:86 >> #11 0x000055555562f1be in TimeLoop::TimeLoop (this=0x7fffffffda50, ci=..., >> m=...) at /home/renato/dev/chimas3d/src/TimeLoop.cpp:23 >> #12 0x000055555561c57c in main (argc=1, argv=0x7fffffffddc8) at >> /home/renato/dev/chimas3d/src/main.cpp:17 >> >> I am using libmesh master branch and petsc 3.15.3. >> >> Any idea of what might be wrong? >> >> Thanks, >> Renato >> >> _______________________________________________ >> Libmesh-users mailing list >> Libmesh-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/libmesh-users >> > > > -- > John > _______________________________________________ Libmesh-users mailing list Libmesh-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmesh-users