2017-02-15 6:53 GMT-05:00 Sebastian.Gonzalez-Pintor <segon...@gmail.com>: > I have been thinking, and the problem is that I do not know when to do the > `dof.clear()`. In my case `dof` belongs to an instance (state) that still > exists when python try to remove the instance containing the `triangulation` > (geo). The only way I can think the problem can be solved would be by > explicitly mentioning the order to delete the objects. I will try to ask > more people around to see if I can find other solution, and then I will post > it here. You want to add dof.clear() in the destructor of the object that owns the triangulation that way you can clear the DoFHandler before the Triangulation is destroyed. So you will have to change your interface... Another thing you could try is something like this:
def run(inp,geo): state = pystate.State1D(inp, geo); equation = pyeqfactory.EqFactory1D.New(state) eigenprob = pyeigenprobfactory.EigenProbFactory1D.New(state, equation) solver = pyeigensolver.EigenSolver1D(state, eigenprob) inp = pyinput.Input("heter1d/1d1g_heter") geo = pygeom.ProbGeom1D(inp) run(inp,geo) when you exit run, all the object should (hopefully) be destroyed, then you can safely destroy geo. 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.