CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Memory consumption of an IOobject

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By hk318i

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 24, 2016, 02:04
Default Memory consumption of an IOobject
  #1
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
Hi guys,

I have a confusion, for example, I have 100 same volScalarField, T1, T2, ... T100.

I can create them by:

Code:
volScalarField T1
    (
        IOobject
        (
            "T1",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::NO_WRITE
        ),
        mesh,
        dimensionedScalar("zero", dimensionSet(0, 0, 1, 0, 0), 0.0)
    );
Also I can create them by:
Code:
volScalarField T2(T1);

volScalarField T3(T1);

...
Is there any difference on this? from the memory consumption and computational speed?

Best,


/*******************************************/

Okay, I got it, even with the second method, T2 is also registered from objectRegistry implicitly.
__________________
My OpenFOAM algorithm website: http://dyfluid.com
By far the largest Chinese CFD-based forum: http://www.cfd-china.com/category/6/openfoam
We provide lots of clusters to Chinese customers, and we are considering to do business overseas: http://dyfluid.com/DMCmodel.html
sharonyue is offline   Reply With Quote

Old   February 24, 2016, 10:08
Default
  #2
Senior Member
 
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 17
hk318i is on a distinguished road
You conclusion is right.
You are creating the same type using two different constructors. First one is more explicit and the second one is a typical copy constructor. Therefore all the copied instances are registered to the same mesh and have the same field size.
sharonyue likes this.
hk318i is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
viewfactors memory consumption derekm OpenFOAM Pre-Processing 0 April 26, 2015 17:53
Run-time memory allocation error akalopsis CFX 0 November 17, 2014 17:17
Lenovo C30 memory configuration and discussions with Lenovo matthewe Hardware 3 October 17, 2013 10:23
reconstructParMesh not working with an axisymetric case francesco OpenFOAM Bugs 4 May 8, 2009 05:49
CFX CPU time & real time Nick Strantzias CFX 8 July 23, 2006 17:50


All times are GMT -4. The time now is 01:39.