|
[Sponsors] |
January 25, 2013, 05:43 |
Writting fields separately
|
#1 |
Member
Jim Knopf
Join Date: Dec 2010
Posts: 60
Rep Power: 15 |
Hello there!
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. Code:
forAll(foo, fooI) { /* writte data to U field*/ foo.set ( fooI, new volVectorField ( IOobject ( "bar"+Foam::name(fooI), mesh.time().timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), U ) ); } Well this works but it's very costly in terms of RAM. So is there a way to force the writing? Like 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 Jim |
|
January 25, 2013, 18:32 |
|
#2 |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17 |
Hi Jim,
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: Code:
if(runTime.write()) { fooI.write(); } Is that what you were looking for? |
|
January 26, 2013, 07:50 |
|
#3 | |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 16 |
Quote:
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). Hisham |
||
January 28, 2013, 04:19 |
|
#4 |
Member
Jim Knopf
Join Date: Dec 2010
Posts: 60
Rep Power: 15 |
Hi,
thank you, that was what I was looking for. I just didn't find the write() method of the IOobject, although it's obvious. Greets Jim |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Time averaged fields on a defined time range | Yann | OpenFOAM Post-Processing | 8 | August 7, 2019 05:46 |
The mysterious _0 fields | stevenvanharen | OpenFOAM Running, Solving & CFD | 2 | January 4, 2011 08:24 |
Missing fields in reconstructPar | flowris | OpenFOAM | 1 | July 9, 2010 03:48 |
domainIntegrate, dieselFoam and Lagrangian Fields | mturcios777 | OpenFOAM | 0 | May 14, 2010 16:16 |
PostChannel | maka | OpenFOAM Post-Processing | 5 | July 22, 2009 10:15 |