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

porousZone.C writeDict()

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 15, 2011, 09:21
Default porousZone.C writeDict()
  #1
Senior Member
 
Hisham's Avatar
 
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 16
Hisham is on a distinguished road
Dear Foamers,

Can you help me understand which purpose this function serves?

http://foam.sourceforge.net/docs/cpp...ce.html#l00394

Code:
00394 void Foam::porousZone::writeDict(Ostream& os, bool subDict) const
00395 {
00396     if (subDict)
00397     {
00398         os  << indent << token::BEGIN_BLOCK << incrIndent << nl;
00399         os.writeKeyword("name")
00400             << zoneName() << token::END_STATEMENT << nl;
00401     }
00402     else
00403     {
00404         os  << indent << zoneName() << nl
00405             << indent << token::BEGIN_BLOCK << incrIndent << nl;
00406     }
00407 
00408     if (dict_.found("note"))
00409     {
00410         os.writeKeyword("note")
00411             << string(dict_.lookup("note")) << token::END_STATEMENT << nl;
00412     }
00413 
00414     coordSys_.writeDict(os, true);
00415 
00416     if (dict_.found("porosity"))
00417     {
00418         os.writeKeyword("porosity")
00419             << porosity() << token::END_STATEMENT << nl;
00420     }
00421 
00422     if (dict_.found("intensity"))
00423     {
00424         os.writeKeyword("intensity")
00425             << intensity() << token::END_STATEMENT << nl;
00426     }
00427 
00428     if (dict_.found("mixingLength"))
00429     {
00430         os.writeKeyword("mixingLength")
00431             << mixingLength() << token::END_STATEMENT << nl;
00432     }
00433 
00434     // powerLaw coefficients
00435     if (const dictionary* dictPtr = dict_.subDictPtr("powerLaw"))
00436     {
00437         os  << indent << "powerLaw";
00438         dictPtr->write(os);
00439     }
00440 
00441     // Darcy-Forchheimer coefficients
00442     if (const dictionary* dictPtr = dict_.subDictPtr("Darcy"))
00443     {
00444         os  << indent << "Darcy";
00445         dictPtr->write(os);
00446     }
00447 
00448     // thermalModel
00449     if (const dictionary* dictPtr = dict_.subDictPtr("thermalModel"))
00450     {
00451         os  << indent << "thermalModel";
00452         dictPtr->write(os);
00453     }
00454 
00455     os  << decrIndent << indent << token::END_BLOCK << endl;
00456 }
00457
Best regards,
Hisham
Hisham is offline   Reply With Quote

Old   November 16, 2011, 05:33
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,679
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by Hisham View Post
Dear Foamers,

Can you help me understand which purpose this function serves?

http://foam.sourceforge.net/docs/cpp...ce.html#l00394

...
Quite simply actually. You can use it to output the dictionary settings associated with the porous zone.
olesen is offline   Reply With Quote

Old   November 16, 2011, 05:42
Default
  #3
Senior Member
 
Hisham's Avatar
 
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 16
Hisham is on a distinguished road
Just that ...... Is it not then needed by any other class?????

I mean it is not called by OF for any reason than if the developer (i.e. I) calls it ??
Hisham is offline   Reply With Quote

Old   November 16, 2011, 05:46
Default
  #4
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,679
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by Hisham View Post
Just that ...... Is it not then needed by any other class?????

I mean it is not called by OF for any reason than if the developer (i.e. I) calls it ??
AFAIK it is just part of the IO for the class. The only place it might be used indirectly is if you need a SHA1 of the input dictionary.
olesen is offline   Reply With Quote

Old   November 16, 2011, 05:59
Default
  #5
Senior Member
 
Hisham's Avatar
 
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 16
Hisham is on a distinguished road
Thanks a lot Olesen. The issue is that I'm developing a class based on the porousZone class and was wondering if I should invest time modifying this function .....

I guess I will save my time for now and leave it as is, until I have more concrete info or a related error!

Best regards,
Hisham
Hisham is offline   Reply With Quote

Reply

Tags
porouszone, writedict

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



All times are GMT -4. The time now is 08:04.