Writting fields separately
At the end of my calculation i create several (let's say 50 additional) volVectorFields from my solution and write them to the hard drive.
Right now I create a prtList<volVectorField> foo
and put all my vectorFields in there.
Well this works but it's very costly in terms of RAM. So is there a way to force the writing?
0. compute field i
1. create field
2. write field
3. delete field
4. goto 0 and repeat
What I'm looking for ist a method "write this field now to time N".
Anyone got any idea?
Thanks and best regards
If I understand your question you could take the writing responsibilities from the runTime.write() call and take it into your own hands.
You could set the fields to be NO_WRITE instead of AUTO_WRITE when declaring the IOobject.
Then you can write on demand (and only when you demand) with:
Is that what you were looking for?
Adding to this, if you create the volFields inside the if(runTime.write()) block you can keep your RAM free until write time at which the Fields are created, written then deleted (automatically go out of scope).
thank you, that was what I was looking for. I just didn't find the write() method of the IOobject, although it's obvious.
|All times are GMT -4. The time now is 11:05.|