Hi! I added a destructor than "talk" in the python code and #!/usr/bin/python import pyinput import pygeom import pystate import pyeqfactory import pyeigenprobfactory import pyeigensolver import pypostprocessing
def deltalk(self): print type(self).__name__ ," die" pyinput.Input.__del__ = deltalk pygeom.ProbGeom1D.__del__ = deltalk pystate.State1D.__del__ = deltalk pyeqfactory.EqFactory1D.__del__ = deltalk pyeigenprobfactory.EigenProbFactory1D.__del__ = deltalk pyeigensolver.EigenSolver1D.__del__ = deltalk pypostprocessing.PostProcessing1D.__del__ = deltalk inp = pyinput.Input("heter1d/1d1g_heter") geo = pygeom.ProbGeom1D(inp) state = pystate.State1D(inp, geo); equation = pyeqfactory.EqFactory1D.New(state) eigenprob = pyeigenprobfactory.EigenProbFactory1D.New(state, equation) solver = pyeigensolver.EigenSolver1D(state, eigenprob) and the python code try to delete the object in a wrong order. $ python test2_forest.py EigenSolver1D die ProbGeom1D die -------------------------------------------------------- An error occurred in line <114> of file </home/segonpin/lib/dealii/source/base/subscriptor.cc> in function virtual dealii::Subscriptor::~Subscriptor() The violated condition was: counter == 0 The name and call sequence of the exception was: ExcInUse (counter, object_info->name(), infostring) Additional Information: Object of class N6dealii13TriangulationILi1ELi1EEE is still used by 1 other objects. (Additional information: <none>) See the entry in the Frequently Asked Questions of deal.II (linked to from http://www.dealii.org/) for a lot more information on what this error means and how to fix programs in which it happens. Stacktrace: ----------- #0 /home/segonpin/lib/dealii-8.4.bin/lib/libdeal_II.g.so.8.4.2: dealii::Subscriptor::~Subscriptor() #1 /home/segonpin/lib/dealii-8.4.bin/lib/libdeal_II.g.so.8.4.2: dealii::Triangulation<1, 1>::~Triangulation() #2 /home/segonpin/codessebas/dealii-neutron-transport/python/_pygeom.so: Forest::ProbGeom<1>::~ProbGeom() #3 /home/segonpin/codessebas/dealii-neutron-transport/python/_pygeom.so: #4 python: PyObject_Call #5 python: PyObject_CallFunctionObjArgs #6 /home/segonpin/codessebas/dealii-neutron-transport/python/_pygeom.so: #7 python: ) [0x4fd4e6] #8 python: PyDict_SetItem #9 python: _PyModule_Clear #10 python: PyImport_Cleanup #11 python: Py_Finalize #12 python: Py_Main #13 /lib/x86_64-linux-gnu/libc.so.6: __libc_start_main #14 python: _start -------------------------------------------------------- So this was obviously the problem. I will see if I can change the title of the question so someone having the same problem can find the answer easily. Thanks. El martes, 14 de febrero de 2017, 16:21:00 (UTC+1), Bruno Turcksin escribió: > > 2017-02-14 10:13 GMT-05:00 Sebastian.Gonzalez-Pintor <sego...@gmail.com > <javascript:>>: > > I am doing some reading about this now. I do not have explicit > destructors > > neither in c++ nor in python, so I want to be carefull that I can define > the > > destructors to add the cout without changing the what the destructor > would > > do the work. Thanks for the hint. > You should be fine just adding destructors with cout (at least in > c++). The behavior won't change. > > Best, > > Bruno > -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.