Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

how to free memory for direct solver

More
4 years 6 months ago #1912 by Guosheng Fu
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
More
4 years 6 months ago #1913 by hvwahl
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
More
4 years 6 months ago #1916 by Guosheng Fu
Thanks, Henry. It works.
Time to create page: 0.146 seconds