how to free memory for direct solver

Hello,

I have limited ram in my computer and encountered a memory problem for time dependent simulation.
Basically, I am reassembling a time dependent linear system and apply direct solver in each time step.
Now, for a particular size problem, a single matrix factorization eat up most of my memory (80%).
As I am reassembling the matrix and recomputing the matrix factorization, the old one still occupies that 80% memory, and the direct solver fails to proceed.
Is there a simple trick to clear the memory of the old matrix factorization?
In matlab, I can simply do clear(inva)… I was wondering about the analog in python…

Best,
Guosheng

Hi Guosheng,

I think that pythons “del” command should work, i.e., if inv = a.mat.Inverse(X.FreeDofs()) call “del inv” and whatever else you want to get rid of at then end of each time step.

Best wishes,
Henry

Thanks, Henry. It works.