CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums

tmp - stands for 'true macro pain'?

Register Blogs Community New Posts Updated Threads Search

Rate this Entry

tmp - stands for 'true macro pain'?

Posted December 5, 2016 at 12:50 by kindle
Updated February 23, 2017 at 04:03 by kindle

use when ready

Quote:
Originally Posted by hjasak View Post
Well, put on your 1970-s hat (or a shirt with huge collars!) and let's talk about memory peaks. For simpleFoam, the memory peak is at the point of creation of the pressure equation, because, unlike PISO, I am allowed to delete the momentum matrix before the creation of the pressure matrix. Therefore, I make the momentum matrix a tmp and call UEqn.clear(); at an opportune place in the code and drop the peak memory requirement by one complete assymetric matrix!

Guess what clear() does: it will delete the pointer to the actual momentum matrix (before reaching the destructor) and free up a lot of memory to be re-used for the pressure matrix.

This is how FOAM beats eg Fluent and STAR in memory usage per cell, but in the 21st century (and especially when you are writing new discretisation capability) you don't care that much. In PISO-based solvers you don't have this option, since you will call UEqn.H() later on in the algorithm, and this requires access to momentum matrix coefficients. Therefore, there's no need for the tmp<matrix> gymnastics...

Clear?

Hrv
Posted in programming
Views 733 Comments 0 Edit Tags Email Blog Entry
« Prev     Main     Next »
Total Comments 0

Comments

 

All times are GMT -4. The time now is 03:28.